155 if (pn) ret_val = pn;
170 if (pv) ret_val = pv;
233 if (pn) ret_val = pn;
250 std::ostringstream oss;
251 oss <<
"Gpio name " << pin_name <<
" is not valid";
252 throw std::invalid_argument(oss.str());
271 std::ostringstream oss;
272 oss <<
"i2c name " << i2c_name <<
" is not valid";
273 throw std::invalid_argument(oss.str());
292 std::ostringstream oss;
293 oss <<
"Spi name " << spi_name <<
" is not valid";
294 throw std::invalid_argument(oss.str());
313 std::ostringstream oss;
314 oss <<
"PWM name " << pwm_name <<
" is not valid";
315 throw std::invalid_argument(oss.str());
334 std::ostringstream oss;
335 oss <<
"UART name " << uart_name <<
" is not valid";
336 throw std::invalid_argument(oss.str());
Result
Definition: types.hpp:204
std::string getPlatformVersion(int platform_offset=MRAA_MAIN_PLATFORM_OFFSET)
Definition: common.hpp:166
int mraa_spi_lookup(const char *spi_name)
Result setLogLevel(int level)
Definition: common.hpp:350
int mraa_i2c_lookup(const char *i2c_name)
mraa_result_t mraa_remove_subplatform(mraa_platform_t subplatformtype)
int mraa_gpio_lookup(const char *pin_name)
const char * mraa_get_version()
Result initJsonPlatform(std::string path)
Definition: common.hpp:471
Result init()
Definition: common.hpp:56
std::string getVersion()
Definition: common.hpp:67
Platform getPlatformType()
Definition: common.hpp:94
int getPwmLookup(std::string pwm_name)
Definition: common.hpp:308
Result addSubplatform(Platform subplatformtype, std::string dev)
Definition: common.hpp:426
const char * mraa_get_platform_name()
mraa_platform_t
Definition: types.h:39
mraa_platform_t mraa_get_platform_type()
void printError(Result result)
Definition: common.hpp:105
int getI2cBusCount()
Definition: common.hpp:204
int getUartCount()
Definition: common.hpp:192
mraa_boolean_t mraa_pin_mode_test(int pin, mraa_pinmodes_t mode)
int getI2cLookup(std::string i2c_name)
Definition: common.hpp:266
int mraa_get_sub_platform_index(int pin_or_bus_id)
unsigned int mraa_adc_supported_bits()
int getI2cBusId(int i2c_bus)
Definition: common.hpp:216
bool isSubPlatformId(int pin_or_bus_id)
Definition: common.hpp:374
int mraa_get_i2c_bus_count()
int getDefaultI2cBus(int platform_offset=MRAA_MAIN_PLATFORM_OFFSET)
Definition: common.hpp:412
int mraa_get_i2c_bus_id(int i2c_bus)
mraa_boolean_t mraa_is_sub_platform_id(int pin_or_bus_id)
T * initIo(std::string desc)
Definition: common.hpp:457
unsigned int adcSupportedBits()
Definition: common.hpp:140
int mraa_set_priority(const int priority)
int getSpiLookup(std::string spi_name)
Definition: common.hpp:287
char * mraa_get_pin_name(int pin)
int mraa_get_uart_count()
unsigned int getPinCount()
Definition: common.hpp:180
Platform
Definition: types.hpp:40
mraa_result_t mraa_init_json_platform(const char *path)
mraa_result_t mraa_init() __attribute__((constructor))
int getGpioLookup(std::string pin_name)
Definition: common.hpp:245
int mraa_uart_lookup(const char *uart_name)
std::string getPlatformName()
Definition: common.hpp:151
mraa_result_t mraa_add_subplatform(mraa_platform_t subplatformtype, const char *dev)
int mraa_pwm_lookup(const char *pwm_name)
bool pinModeTest(int pin, Pinmodes mode)
Definition: common.hpp:118
bool hasSubPlatform()
Definition: common.hpp:361
int mraa_get_sub_platform_id(int pin_or_bus_index)
unsigned int mraa_adc_raw_bits()
Result removeSubplatform(Platform subplatformtype)
Definition: common.hpp:439
mraa_result_t
Definition: types.h:209
void * mraa_init_io(const char *desc)
int setPriority(const int priority)
Definition: common.hpp:83
mraa_pinmodes_t
Definition: types.h:232
std::string getPinName(int pin)
Definition: common.hpp:229
#define MRAA_MAIN_PLATFORM_OFFSET
Definition: common.h:41
const char * mraa_get_platform_version(int platform_offset)
mraa_boolean_t mraa_has_sub_platform()
unsigned int adcRawBits()
Definition: common.hpp:129
Pinmodes
Definition: types.hpp:227
int getUartLookup(std::string uart_name)
Definition: common.hpp:329
void mraa_result_print(mraa_result_t result)
int getSubPlatformId(int pin_or_bus_index)
Definition: common.hpp:387
mraa_result_t mraa_set_log_level(int level)
int mraa_get_default_i2c_bus(uint8_t platform_offset)
int getSubPlatformIndex(int pin_or_bus_id)
Definition: common.hpp:400
unsigned int mraa_get_pin_count()