Lines Matching refs:plat
49 mraa_board_t* plat = NULL; variable
84 if (plat != NULL) { in mraa_init()
119 if (plat != NULL) { in mraa_init()
120 plat->platform_type = platform_type; in mraa_init()
127 if (plat == NULL) { in mraa_init()
128 plat = (mraa_board_t*) calloc(1, sizeof(mraa_board_t)); in mraa_init()
129 if (plat != NULL) { in mraa_init()
130 plat->platform_type = MRAA_NULL_PLATFORM; in mraa_init()
131 plat->platform_name = "Unknown platform"; in mraa_init()
135 if (plat != NULL) { in mraa_init()
136 mraa_platform_t usb_platform_type = mraa_usb_platform_extender(plat); in mraa_init()
137 … if (plat->platform_type == MRAA_UNKNOWN_PLATFORM && usb_platform_type != MRAA_UNKNOWN_PLATFORM) { in mraa_init()
138 plat->platform_type = usb_platform_type; in mraa_init()
143 if (plat == NULL) { in mraa_init()
152 if (plat != NULL) { in mraa_init()
153 int length = strlen(plat->platform_name) + 1; in mraa_init()
155 length += strlen(plat->sub_platform->platform_name); in mraa_init()
159 …snprintf(platform_name, length, "%s + %s", plat->platform_name, plat->sub_platform->platform_name); in mraa_init()
161 strncpy(platform_name, plat->platform_name, length); in mraa_init()
172 if (plat != NULL) { in mraa_deinit()
173 if (plat->pins != NULL) { in mraa_deinit()
174 free(plat->pins); in mraa_deinit()
176 mraa_board_t* sub_plat = plat->sub_platform; in mraa_deinit()
183 free(plat); in mraa_deinit()
338 return (plat != NULL) && (plat->sub_platform != NULL); in mraa_has_sub_platform()
344 if (plat == NULL) in mraa_pin_mode_test()
347 mraa_board_t* current_plat = plat; in mraa_pin_mode_test()
349 current_plat = plat->sub_platform; in mraa_pin_mode_test()
406 if (plat == NULL) in mraa_get_platform_type()
408 return plat->platform_type; in mraa_get_platform_type()
415 …int sub_type = mraa_has_sub_platform() ? plat->sub_platform->platform_type : MRAA_UNKNOWN_PLATFORM; in mraa_get_platform_combined_type()
422 if (plat == NULL) in mraa_adc_raw_bits()
425 if (plat->aio_count == 0) in mraa_adc_raw_bits()
428 return plat->adc_raw; in mraa_adc_raw_bits()
440 if (plat->sub_platform->aio_count == 0) in mraa_get_platform_adc_raw_bits()
443 return plat->sub_platform->adc_raw; in mraa_get_platform_adc_raw_bits()
451 if (plat == NULL) in mraa_adc_supported_bits()
454 if (plat->aio_count == 0) in mraa_adc_supported_bits()
457 return plat->adc_supported; in mraa_adc_supported_bits()
469 if (plat->sub_platform->aio_count == 0) in mraa_get_platform_adc_supported_bits()
472 return plat->sub_platform->adc_supported; in mraa_get_platform_adc_supported_bits()
485 if (plat == NULL) { in mraa_get_platform_version()
489 return plat->platform_version; in mraa_get_platform_version()
491 return plat->sub_platform->platform_version; in mraa_get_platform_version()
498 if (plat == NULL) { in mraa_get_i2c_bus_count()
501 return plat->i2c_bus_count; in mraa_get_i2c_bus_count()
507 if (plat == NULL) { in mraa_get_i2c_bus_id()
511 if (i2c_bus >= plat->i2c_bus_count) { in mraa_get_i2c_bus_id()
515 return plat->i2c_bus[i2c_bus].bus_id; in mraa_get_i2c_bus_id()
521 if (plat == NULL) { in mraa_get_pin_count()
524 return plat->phy_pin_count; in mraa_get_pin_count()
534 return plat->sub_platform->phy_pin_count; in mraa_get_platform_pin_count()
544 if (plat == NULL) in mraa_get_pin_name()
547 mraa_board_t* current_plat = plat; in mraa_get_pin_name()
549 current_plat = plat->sub_platform; in mraa_get_pin_name()
565 if (plat == NULL) in mraa_get_default_i2c_bus()
568 return plat->def_i2c_bus; in mraa_get_default_i2c_bus()
571 return plat->sub_platform->def_i2c_bus; in mraa_get_default_i2c_bus()