mraa: rename from maa to mraa
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
@@ -23,16 +23,16 @@
|
||||
*/
|
||||
|
||||
//! [Interesting]
|
||||
#include "maa.hpp"
|
||||
#include "mraa.hpp"
|
||||
|
||||
int main ()
|
||||
{
|
||||
uint16_t adc_value;
|
||||
maa::Aio* a0;
|
||||
mraa::Aio* a0;
|
||||
|
||||
a0 = new maa::Aio(0);
|
||||
a0 = new mraa::Aio(0);
|
||||
if (a0 == NULL) {
|
||||
return MAA_ERROR_UNSPECIFIED;
|
||||
return MRAA_ERROR_UNSPECIFIED;
|
||||
}
|
||||
|
||||
for(;;) {
|
||||
@@ -40,6 +40,6 @@ int main ()
|
||||
fprintf(stdout, "ADC A0 read %X - %d\n", adc_value, adc_value);
|
||||
}
|
||||
|
||||
return MAA_SUCCESS;
|
||||
return MRAA_SUCCESS;
|
||||
}
|
||||
//! [Interesting]
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "maa.hpp"
|
||||
#include "mraa.hpp"
|
||||
#define DEFAULT_IOPIN 8
|
||||
|
||||
static int iopin;
|
||||
@@ -55,13 +55,13 @@ int main (int argc, char **argv)
|
||||
signal(SIGINT, sig_handler);
|
||||
|
||||
//! [Interesting]
|
||||
maa::Gpio* gpio = new maa::Gpio(iopin);
|
||||
mraa::Gpio* gpio = new mraa::Gpio(iopin);
|
||||
if (gpio == NULL) {
|
||||
return MAA_ERROR_UNSPECIFIED;
|
||||
return MRAA_ERROR_UNSPECIFIED;
|
||||
}
|
||||
int response = gpio->dir(maa::DIR_OUT);
|
||||
if (response != MAA_SUCCESS)
|
||||
maa_result_print((maa_result_t) MAA_SUCCESS);
|
||||
int response = gpio->dir(mraa::DIR_OUT);
|
||||
if (response != MRAA_SUCCESS)
|
||||
mraa_result_print((mraa_result_t) MRAA_SUCCESS);
|
||||
|
||||
while (running == 0) {
|
||||
response = gpio->write(1);
|
||||
|
||||
@@ -6,8 +6,8 @@ add_executable (Spi-pot Spi-pot.cpp)
|
||||
|
||||
include_directories(${PROJECT_SOURCE_DIR}/api)
|
||||
|
||||
target_link_libraries (AioA0 maa stdc++)
|
||||
target_link_libraries (blink-io-cpp maa stdc++)
|
||||
target_link_libraries (Pwm3-cycle maa stdc++)
|
||||
target_link_libraries (I2c-compass maa stdc++ m)
|
||||
target_link_libraries (Spi-pot maa stdc++)
|
||||
target_link_libraries (AioA0 mraa stdc++)
|
||||
target_link_libraries (blink-io-cpp mraa stdc++)
|
||||
target_link_libraries (Pwm3-cycle mraa stdc++)
|
||||
target_link_libraries (I2c-compass mraa stdc++ m)
|
||||
target_link_libraries (Spi-pot mraa stdc++)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "maa.hpp"
|
||||
#include "mraa.hpp"
|
||||
#include "math.h"
|
||||
|
||||
#define MAX_BUFFER_LENGTH 6
|
||||
@@ -98,8 +98,8 @@ int main ()
|
||||
uint8_t rx_tx_buf[MAX_BUFFER_LENGTH];
|
||||
|
||||
//! [Interesting]
|
||||
maa::I2c* i2c;
|
||||
i2c = new maa::I2c(0);
|
||||
mraa::I2c* i2c;
|
||||
i2c = new mraa::I2c(0);
|
||||
|
||||
i2c->address(HMC5883L_I2C_ADDR);
|
||||
rx_tx_buf[0] = HMC5883L_CONF_REG_B;
|
||||
@@ -138,5 +138,5 @@ int main ()
|
||||
}
|
||||
delete i2c;
|
||||
|
||||
return MAA_SUCCESS;
|
||||
return MRAA_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "maa.hpp"
|
||||
#include "mraa.hpp"
|
||||
|
||||
int running = 0;
|
||||
|
||||
@@ -42,11 +42,11 @@ int main ()
|
||||
{
|
||||
signal(SIGINT, sig_handler);
|
||||
//! [Interesting]
|
||||
maa::Pwm* pwm;
|
||||
mraa::Pwm* pwm;
|
||||
|
||||
pwm = new maa::Pwm(3);
|
||||
pwm = new mraa::Pwm(3);
|
||||
if (pwm == NULL) {
|
||||
return MAA_ERROR_UNSPECIFIED;
|
||||
return MRAA_ERROR_UNSPECIFIED;
|
||||
}
|
||||
fprintf(stdout, "Cycling PWM on IO3 (pwm3) \n");
|
||||
|
||||
@@ -62,5 +62,5 @@ int main ()
|
||||
delete pwm;
|
||||
//! [Interesting]
|
||||
|
||||
return MAA_SUCCESS;
|
||||
return MRAA_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <signal.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "maa.hpp"
|
||||
#include "mraa.hpp"
|
||||
|
||||
int running = 0;
|
||||
|
||||
@@ -44,9 +44,9 @@ int main ()
|
||||
signal(SIGINT, sig_handler);
|
||||
|
||||
//! [Interesting]
|
||||
maa::Spi* spi;
|
||||
mraa::Spi* spi;
|
||||
|
||||
spi = new maa::Spi(0);
|
||||
spi = new mraa::Spi(0);
|
||||
|
||||
uint8_t data[] = {0x00, 100};
|
||||
uint8_t *recv;
|
||||
@@ -71,5 +71,5 @@ int main ()
|
||||
delete spi;
|
||||
//! [Interesting]
|
||||
|
||||
return MAA_SUCCESS;
|
||||
return MRAA_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user