From 5de7b1bbacda4e27d3f8e8f3e190c891fb1a16df Mon Sep 17 00:00:00 2001 From: George Oikonomou Date: Sat, 11 Jun 2016 19:42:00 +0100 Subject: [PATCH] Update to latest CCxxwares: Launchpad drivers --- .../srf06-cc26xx/launchpad/button-sensor.c | 26 +++++++++---------- platform/srf06-cc26xx/launchpad/leds-arch.c | 8 +++--- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/platform/srf06-cc26xx/launchpad/button-sensor.c b/platform/srf06-cc26xx/launchpad/button-sensor.c index d37369d0a..eb8bd3033 100644 --- a/platform/srf06-cc26xx/launchpad/button-sensor.c +++ b/platform/srf06-cc26xx/launchpad/button-sensor.c @@ -83,7 +83,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 { @@ -104,7 +104,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 { @@ -122,19 +122,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: @@ -164,7 +164,7 @@ status(int type, uint32_t key_io_id) switch(type) { case SENSORS_ACTIVE: case SENSORS_READY: - if(ti_lib_ioc_port_configure_get(key_io_id) & IOC_INT_ENABLE) { + if(ti_lib_rom_ioc_port_configure_get(key_io_id) & IOC_INT_ENABLE) { return 1; } break; @@ -178,7 +178,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; @@ -190,7 +190,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/launchpad/leds-arch.c b/platform/srf06-cc26xx/launchpad/leds-arch.c index e853487fd..0d8385ad6 100644 --- a/platform/srf06-cc26xx/launchpad/leds-arch.c +++ b/platform/srf06-cc26xx/launchpad/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); } } /*---------------------------------------------------------------------------*/