36 #if !defined(PERIPHERALMAN) 43 #include "uart_ow.hpp" 53 MraaIo(
const std::string& initStr) : descs()
56 throw std::runtime_error(
"mraa_io_init error");
59 aios.reserve(descs->n_aio);
60 for (
int i = 0; i < descs->n_aio; ++i) {
61 aios.emplace_back(descs->aios[i]);
64 gpios.reserve(descs->n_gpio);
65 for (
int i = 0; i < descs->n_gpio; ++i) {
66 gpios.emplace_back(descs->gpios[i]);
69 i2cs.reserve(descs->n_i2c);
70 for (
int i = 0; i < descs->n_i2c; ++i) {
71 i2cs.emplace_back(descs->i2cs[i]);
74 #if !defined(PERIPHERALMAN) 75 iios.reserve(descs->n_iio);
76 for (
int i = 0; i < descs->n_iio; ++i) {
77 iios.emplace_back(descs->iios[i]);
81 pwms.reserve(descs->n_pwm);
82 for (
int i = 0; i < descs->n_pwm; ++i) {
83 pwms.emplace_back(descs->pwms[i]);
86 spis.reserve(descs->n_spi);
87 for (
int i = 0; i < descs->n_spi; ++i) {
88 spis.emplace_back(descs->spis[i]);
91 uarts.reserve(descs->n_uart);
92 for (
int i = 0; i < descs->n_uart; ++i) {
93 uarts.emplace_back(descs->uarts[i]);
96 uart_ows.reserve(descs->n_uart_ow);
97 for (
int i = 0; i < descs->n_uart_ow; ++i) {
98 uart_ows.emplace_back(descs->uart_ows[i]);
101 if (descs->leftover_str) {
102 leftoverStr = std::string(descs->leftover_str);
104 leftoverStr = std::string(
"");
112 if (descs->leftover_str) {
113 free(descs->leftover_str);
125 #if !defined(PERIPHERALMAN) 139 if (descs->n_uart_ow) {
140 free(descs->uart_ows);
148 std::vector<Aio> aios;
149 std::vector<Gpio> gpios;
150 std::vector<I2c> i2cs;
151 #if !defined(PERIPHERALMAN) 152 std::vector<Iio> iios;
154 std::vector<Pwm> pwms;
155 std::vector<Spi> spis;
156 std::vector<Uart> uarts;
157 std::vector<UartOW> uart_ows;
161 std::string leftoverStr;
Definition: initio.hpp:47
mraa_result_t mraa_io_init(const char *strdesc, mraa_io_descriptor **desc)