diff --git a/platform/srf06-cc26xx/sensortag/board.c b/platform/srf06-cc26xx/sensortag/board.c index f06545170..f1f4a29e1 100644 --- a/platform/srf06-cc26xx/sensortag/board.c +++ b/platform/srf06-cc26xx/sensortag/board.c @@ -75,7 +75,7 @@ shutdown_handler(uint8_t mode) SENSORS_DEACTIVATE(tmp_007_sensor); SENSORS_DEACTIVATE(hdc_1000_sensor); SENSORS_DEACTIVATE(mpu_9250_sensor); - ti_lib_gpio_pin_clear(BOARD_MPU_POWER); + ti_lib_gpio_clear_dio(BOARD_IOID_MPU_POWER); } /* In all cases, stop the I2C */ @@ -111,7 +111,7 @@ configure_unused_pins(void) /* Digital Microphone */ ti_lib_ioc_pin_type_gpio_output(BOARD_IOID_MIC_POWER); - ti_lib_gpio_pin_clear((1 << BOARD_IOID_MIC_POWER)); + ti_lib_gpio_clear_dio(BOARD_IOID_MIC_POWER); ti_lib_ioc_io_drv_strength_set(BOARD_IOID_MIC_POWER, IOC_CURRENT_2MA, IOC_STRENGTH_MIN); diff --git a/platform/srf06-cc26xx/sensortag/button-sensor.c b/platform/srf06-cc26xx/sensortag/button-sensor.c index 921d96b20..9df55d21d 100644 --- a/platform/srf06-cc26xx/sensortag/button-sensor.c +++ b/platform/srf06-cc26xx/sensortag/button-sensor.c @@ -86,7 +86,7 @@ button_press_handler(uint8_t ioid) * Start press duration counter on press (falling), notify on release * (rising) */ - if(ti_lib_gpio_pin_read(BOARD_KEY_LEFT) == 0) { + if(ti_lib_gpio_read_dio(BOARD_IOID_KEY_LEFT) == 0) { left_timer.start = clock_time(); left_timer.duration = 0; } else { @@ -107,7 +107,7 @@ button_press_handler(uint8_t ioid) * Start press duration counter on press (falling), notify on release * (rising) */ - if(ti_lib_gpio_pin_read(BOARD_KEY_RIGHT) == 0) { + if(ti_lib_gpio_read_dio(BOARD_IOID_KEY_RIGHT) == 0) { right_timer.start = clock_time(); right_timer.duration = 0; } else { @@ -132,19 +132,19 @@ config_buttons(int type, int c, uint32_t key) { switch(type) { case SENSORS_HW_INIT: - ti_lib_gpio_event_clear(1 << key); - ti_lib_ioc_port_configure_set(key, IOC_PORT_GPIO, BUTTON_GPIO_CFG); - ti_lib_gpio_dir_mode_set((1 << key), GPIO_DIR_MODE_IN); + ti_lib_gpio_clear_event_dio(key); + ti_lib_rom_ioc_pin_type_gpio_input(key); + ti_lib_rom_ioc_port_configure_set(key, IOC_PORT_GPIO, BUTTON_GPIO_CFG); gpio_interrupt_register_handler(key, button_press_handler); break; case SENSORS_ACTIVE: if(c) { - ti_lib_gpio_event_clear(1 << key); - ti_lib_ioc_port_configure_set(key, IOC_PORT_GPIO, BUTTON_GPIO_CFG); - ti_lib_gpio_dir_mode_set((1 << key), GPIO_DIR_MODE_IN); - ti_lib_ioc_int_enable(key); + ti_lib_gpio_clear_event_dio(key); + ti_lib_rom_ioc_pin_type_gpio_input(key); + ti_lib_rom_ioc_port_configure_set(key, IOC_PORT_GPIO, BUTTON_GPIO_CFG); + ti_lib_rom_ioc_int_enable(key); } else { - ti_lib_ioc_int_disable(key); + ti_lib_rom_ioc_int_disable(key); } break; default: @@ -225,7 +225,7 @@ static int value_left(int type) { if(type == BUTTON_SENSOR_VALUE_STATE) { - return ti_lib_gpio_pin_read(BOARD_KEY_LEFT) == 0 ? + return ti_lib_gpio_read_dio(BOARD_IOID_KEY_LEFT) == 0 ? BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED; } else if(type == BUTTON_SENSOR_VALUE_DURATION) { return (int)left_timer.duration; @@ -237,7 +237,7 @@ static int value_right(int type) { if(type == BUTTON_SENSOR_VALUE_STATE) { - return ti_lib_gpio_pin_read(BOARD_KEY_RIGHT) == 0 ? + return ti_lib_gpio_read_dio(BOARD_IOID_KEY_RIGHT) == 0 ? BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED; } else if(type == BUTTON_SENSOR_VALUE_DURATION) { return (int)right_timer.duration; diff --git a/platform/srf06-cc26xx/sensortag/cc2650/leds-arch.c b/platform/srf06-cc26xx/sensortag/cc2650/leds-arch.c index e415dca55..c36959063 100644 --- a/platform/srf06-cc26xx/sensortag/cc2650/leds-arch.c +++ b/platform/srf06-cc26xx/sensortag/cc2650/leds-arch.c @@ -55,7 +55,7 @@ leds_arch_init(void) ti_lib_rom_ioc_pin_type_gpio_output(BOARD_IOID_LED_1); ti_lib_rom_ioc_pin_type_gpio_output(BOARD_IOID_LED_2); - ti_lib_gpio_pin_write(BOARD_LED_ALL, 0); + ti_lib_gpio_clear_multi_dio(BOARD_LED_ALL); } /*---------------------------------------------------------------------------*/ unsigned char @@ -68,13 +68,13 @@ void leds_arch_set(unsigned char leds) { c = leds; - ti_lib_gpio_pin_write(BOARD_LED_ALL, 0); + ti_lib_gpio_clear_multi_dio(BOARD_LED_ALL); if((leds & LEDS_RED) == LEDS_RED) { - ti_lib_gpio_pin_write(BOARD_LED_1, 1); + ti_lib_gpio_set_dio(BOARD_IOID_LED_1); } if((leds & LEDS_YELLOW) == LEDS_YELLOW) { - ti_lib_gpio_pin_write(BOARD_LED_2, 1); + ti_lib_gpio_set_dio(BOARD_IOID_LED_2); } } /*---------------------------------------------------------------------------*/ diff --git a/platform/srf06-cc26xx/sensortag/mpu-9250-sensor.c b/platform/srf06-cc26xx/sensortag/mpu-9250-sensor.c index 275f2b352..5a97666b3 100644 --- a/platform/srf06-cc26xx/sensortag/mpu-9250-sensor.c +++ b/platform/srf06-cc26xx/sensortag/mpu-9250-sensor.c @@ -505,7 +505,7 @@ initialise(void *not_used) static void power_up(void) { - ti_lib_gpio_pin_write(BOARD_MPU_POWER, 1); + ti_lib_gpio_set_dio(BOARD_IOID_MPU_POWER); state = SENSOR_STATE_BOOTING; ctimer_set(&startup_timer, SENSOR_BOOT_DELAY, initialise, NULL); @@ -608,7 +608,7 @@ configure(int type, int enable) ti_lib_rom_ioc_pin_type_gpio_output(BOARD_IOID_MPU_POWER); ti_lib_ioc_io_drv_strength_set(BOARD_IOID_MPU_POWER, IOC_CURRENT_4MA, IOC_STRENGTH_MAX); - ti_lib_gpio_pin_clear(BOARD_MPU_POWER); + ti_lib_gpio_clear_dio(BOARD_IOID_MPU_POWER); elements = MPU_9250_SENSOR_TYPE_NONE; break; case SENSORS_ACTIVE: @@ -629,7 +629,7 @@ configure(int type, int enable) sensor_sleep(); while(ti_lib_i2c_master_busy(I2C0_BASE)); state = SENSOR_STATE_DISABLED; - ti_lib_gpio_pin_clear(BOARD_MPU_POWER); + ti_lib_gpio_clear_dio(BOARD_IOID_MPU_POWER); } } break; diff --git a/platform/srf06-cc26xx/sensortag/reed-relay.c b/platform/srf06-cc26xx/sensortag/reed-relay.c index 9be161b48..598bfd970 100644 --- a/platform/srf06-cc26xx/sensortag/reed-relay.c +++ b/platform/srf06-cc26xx/sensortag/reed-relay.c @@ -74,7 +74,7 @@ reed_interrupt_handler(uint8_t ioid) static int value(int type) { - return (int)ti_lib_gpio_pin_read(1 << BOARD_IOID_REED_RELAY); + return (int)ti_lib_gpio_read_dio(BOARD_IOID_REED_RELAY); } /*---------------------------------------------------------------------------*/ /** @@ -91,7 +91,7 @@ configure(int type, int value) switch(type) { case SENSORS_HW_INIT: ti_lib_ioc_int_disable(BOARD_IOID_REED_RELAY); - ti_lib_gpio_event_clear(1 << BOARD_IOID_REED_RELAY); + ti_lib_gpio_clear_event_dio(BOARD_IOID_REED_RELAY); /* Enable the GPIO clock when the CM3 is running */ ti_lib_prcm_peripheral_run_enable(PRCM_PERIPH_GPIO);