Merge pull request #985 from g-oikonomou/cc26xx-minor-updates
Minor Updates to the CC26xx Port
This commit is contained in:
commit
33526be5ab
|
@ -464,7 +464,7 @@ rf_is_accessible(void)
|
||||||
{
|
{
|
||||||
if(ti_lib_prcm_rf_ready() &&
|
if(ti_lib_prcm_rf_ready() &&
|
||||||
ti_lib_prcm_power_domain_status(PRCM_DOMAIN_RFCORE) ==
|
ti_lib_prcm_power_domain_status(PRCM_DOMAIN_RFCORE) ==
|
||||||
PRCM_DOMAIN_POWER_ON) {
|
PRCM_DOMAIN_POWER_ON) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
#define CC26XX_RF_AUTOACK 1
|
#define CC26XX_RF_AUTOACK 1
|
||||||
#endif /* CC26XX_RF_CONF_AUTOACK */
|
#endif /* CC26XX_RF_CONF_AUTOACK */
|
||||||
|
|
||||||
#if defined (CC26XX_RF_CONF_BLE_SUPPORT) && (CC26XX_MODEL_CPU_VARIANT == 2650)
|
#if (CC26XX_RF_CONF_BLE_SUPPORT) && (CC26XX_MODEL_CPU_VARIANT == 2650)
|
||||||
#define CC26XX_RF_BLE_SUPPORT CC26XX_RF_CONF_BLE_SUPPORT
|
#define CC26XX_RF_BLE_SUPPORT CC26XX_RF_CONF_BLE_SUPPORT
|
||||||
#else
|
#else
|
||||||
#define CC26XX_RF_BLE_SUPPORT 0
|
#define CC26XX_RF_BLE_SUPPORT 0
|
||||||
|
|
|
@ -91,7 +91,7 @@ cc26xx_rtc_get_next_trigger()
|
||||||
if(HWREG(AON_RTC_BASE + AON_RTC_O_CHCTL) & AON_RTC_CHCTL_CH0_EN) {
|
if(HWREG(AON_RTC_BASE + AON_RTC_O_CHCTL) & AON_RTC_CHCTL_CH0_EN) {
|
||||||
rtimer_clock_t ch0 = ti_lib_aon_rtc_compare_value_get(AON_RTC_CH2);
|
rtimer_clock_t ch0 = ti_lib_aon_rtc_compare_value_get(AON_RTC_CH2);
|
||||||
|
|
||||||
return RTIMER_CLOCK_LT(ch0 ,ch2) ? ch0 : ch2;
|
return RTIMER_CLOCK_LT(ch0, ch2) ? ch0 : ch2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ch2;
|
return ch2;
|
||||||
|
|
|
@ -852,7 +852,7 @@ PROCESS_THREAD(cc26xx_web_demo_process, ev, data)
|
||||||
while(1) {
|
while(1) {
|
||||||
if(ev == sensors_event && data == CC26XX_WEB_DEMO_SENSOR_READING_TRIGGER) {
|
if(ev == sensors_event && data == CC26XX_WEB_DEMO_SENSOR_READING_TRIGGER) {
|
||||||
if((CC26XX_WEB_DEMO_SENSOR_READING_TRIGGER)->value(
|
if((CC26XX_WEB_DEMO_SENSOR_READING_TRIGGER)->value(
|
||||||
BUTTON_SENSOR_VALUE_DURATION) > CLOCK_SECOND * 5) {
|
BUTTON_SENSOR_VALUE_DURATION) > CLOCK_SECOND * 5) {
|
||||||
printf("Restoring defaults!\n");
|
printf("Restoring defaults!\n");
|
||||||
cc26xx_web_demo_restore_defaults();
|
cc26xx_web_demo_restore_defaults();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -76,8 +76,9 @@ the section ["Drivers" in the CC2538DK readme](https://github.com/contiki-os/con
|
||||||
Environment
|
Environment
|
||||||
===========
|
===========
|
||||||
To use this port, you will need to download and extract CC26xxware sources,
|
To use this port, you will need to download and extract CC26xxware sources,
|
||||||
provided by TI here http://www.ti.com/tool/cc26xxware. Once you have done this, you will need to configure the Contiki
|
provided by TI here http://www.ti.com/tool/cc26xxware. Once you have done this,
|
||||||
build system so that it can locate and compile them as part of the build process.
|
you will need to configure the Contiki build system so that it can locate and
|
||||||
|
compile them as part of the build process.
|
||||||
|
|
||||||
To do this, you will need to set the following environment variable:
|
To do this, you will need to set the following environment variable:
|
||||||
|
|
||||||
|
|
|
@ -244,10 +244,6 @@
|
||||||
#ifndef ENERGEST_CONF_ON
|
#ifndef ENERGEST_CONF_ON
|
||||||
#define ENERGEST_CONF_ON 0 /**< Energest Module */
|
#define ENERGEST_CONF_ON 0 /**< Energest Module */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef STARTUP_CONF_VERBOSE
|
|
||||||
#define STARTUP_CONF_VERBOSE 1 /**< Set to 0 to decrease startup verbosity */
|
|
||||||
#endif
|
|
||||||
/** @} */
|
/** @} */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
|
@ -273,29 +269,10 @@
|
||||||
* This will keep working while UIP_FALLBACK_INTERFACE and CMD_CONF_OUTPUT
|
* This will keep working while UIP_FALLBACK_INTERFACE and CMD_CONF_OUTPUT
|
||||||
* keep using SLIP
|
* keep using SLIP
|
||||||
*/
|
*/
|
||||||
#if defined (UIP_FALLBACK_INTERFACE) || defined (CMD_CONF_OUTPUT)
|
#if defined(UIP_FALLBACK_INTERFACE) || defined(CMD_CONF_OUTPUT)
|
||||||
#define SLIP_ARCH_CONF_ENABLED 1
|
#define SLIP_ARCH_CONF_ENABLED 1
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Define this as 1 to build a headless node.
|
|
||||||
*
|
|
||||||
* The UART will not be initialised its clock will be gated, offering some
|
|
||||||
* energy savings. The USB will not be initialised either
|
|
||||||
*/
|
|
||||||
#ifndef CC26XX_CONF_QUIET
|
|
||||||
#define CC26XX_CONF_QUIET 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* CC26XX_CONF_QUIET is hard and overrides all other related defines */
|
|
||||||
#if CC26XX_CONF_QUIET
|
|
||||||
#undef CC26XX_UART_CONF_ENABLE
|
|
||||||
#define CC26XX_UART_CONF_ENABLE 0
|
|
||||||
|
|
||||||
#undef STARTUP_CONF_VERBOSE
|
|
||||||
#define STARTUP_CONF_VERBOSE 0
|
|
||||||
#endif /* CC26XX_CONF_QUIET */
|
|
||||||
/** @} */
|
/** @} */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/**
|
/**
|
||||||
|
@ -332,14 +309,14 @@ typedef uint32_t clock_time_t;
|
||||||
typedef uint32_t uip_stats_t;
|
typedef uint32_t uip_stats_t;
|
||||||
|
|
||||||
/* Clock (time) comparison macro */
|
/* Clock (time) comparison macro */
|
||||||
#define CLOCK_LT(a,b) ((signed long)((a)-(b)) < 0)
|
#define CLOCK_LT(a, b) ((signed long)((a) - (b)) < 0)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* rtimer.h typedefs rtimer_clock_t as unsigned short. We need to define
|
* rtimer.h typedefs rtimer_clock_t as unsigned short. We need to define
|
||||||
* RTIMER_CLOCK_LT to override this
|
* RTIMER_CLOCK_LT to override this
|
||||||
*/
|
*/
|
||||||
typedef uint32_t rtimer_clock_t;
|
typedef uint32_t rtimer_clock_t;
|
||||||
#define RTIMER_CLOCK_LT(a,b) ((int32_t)((a)-(b)) < 0)
|
#define RTIMER_CLOCK_LT(a, b) ((int32_t)((a) - (b)) < 0)
|
||||||
/** @} */
|
/** @} */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/* board.h assumes that basic configuration is done */
|
/* board.h assumes that basic configuration is done */
|
||||||
|
|
|
@ -193,7 +193,7 @@ main(void)
|
||||||
serial_line_init();
|
serial_line_init();
|
||||||
|
|
||||||
printf("Starting " CONTIKI_VERSION_STRING "\n");
|
printf("Starting " CONTIKI_VERSION_STRING "\n");
|
||||||
printf("With CC26xxware v%u.%02u.%02u.%u\n", DRIVERLIB_MAJOR_VER,
|
printf("With DriverLib v%u.%02u.%02u.%u\n", DRIVERLIB_MAJOR_VER,
|
||||||
DRIVERLIB_MINOR_VER, DRIVERLIB_PATCH_VER, DRIVERLIB_BUILD_ID);
|
DRIVERLIB_MINOR_VER, DRIVERLIB_PATCH_VER, DRIVERLIB_BUILD_ID);
|
||||||
printf(BOARD_STRING " using CC%u\n", CC26XX_MODEL_CPU_VARIANT);
|
printf(BOARD_STRING " using CC%u\n", CC26XX_MODEL_CPU_VARIANT);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
CFLAGS += -DBOARD_SENSORTAG=1 -DTI_BSP_BOARD_HDR=\"ti-bsp-st.h\"
|
CFLAGS += -DBOARD_SENSORTAG=1
|
||||||
CFLAGS += -DBACKDOOR_IOID=0x00000000
|
CFLAGS += -DBACKDOOR_IOID=0x00000000
|
||||||
|
|
||||||
BOARD_SOURCEFILES += leds-arch.c sensortag-sensors.c sensor-common.c
|
BOARD_SOURCEFILES += leds-arch.c sensortag-sensors.c sensor-common.c
|
||||||
|
|
|
@ -227,7 +227,7 @@ value_left(int type)
|
||||||
{
|
{
|
||||||
if(type == BUTTON_SENSOR_VALUE_STATE) {
|
if(type == BUTTON_SENSOR_VALUE_STATE) {
|
||||||
return ti_lib_gpio_pin_read(BOARD_KEY_LEFT) == 0 ?
|
return ti_lib_gpio_pin_read(BOARD_KEY_LEFT) == 0 ?
|
||||||
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
|
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
|
||||||
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
|
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
|
||||||
return (int)left_timer.duration;
|
return (int)left_timer.duration;
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,7 @@ value_right(int type)
|
||||||
{
|
{
|
||||||
if(type == BUTTON_SENSOR_VALUE_STATE) {
|
if(type == BUTTON_SENSOR_VALUE_STATE) {
|
||||||
return ti_lib_gpio_pin_read(BOARD_KEY_RIGHT) == 0 ?
|
return ti_lib_gpio_pin_read(BOARD_KEY_RIGHT) == 0 ?
|
||||||
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
|
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
|
||||||
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
|
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
|
||||||
return (int)right_timer.duration;
|
return (int)right_timer.duration;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static struct timer debouncetimer;
|
static struct timer debouncetimer;
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
#define REED_ISR_CFG (IOC_CURRENT_2MA | IOC_STRENGTH_AUTO | \
|
#define REED_IO_CFG (IOC_CURRENT_2MA | IOC_STRENGTH_AUTO | \
|
||||||
IOC_IOPULL_DOWN | IOC_SLEW_DISABLE | \
|
IOC_IOPULL_DOWN | IOC_SLEW_DISABLE | \
|
||||||
IOC_HYST_DISABLE | IOC_BOTH_EDGES | \
|
IOC_HYST_DISABLE | IOC_BOTH_EDGES | \
|
||||||
IOC_INT_DISABLE | IOC_IOMODE_NORMAL | \
|
IOC_INT_DISABLE | IOC_IOMODE_NORMAL | \
|
||||||
|
@ -94,10 +94,12 @@ configure(int type, int value)
|
||||||
ti_lib_ioc_int_disable(BOARD_IOID_REED_RELAY);
|
ti_lib_ioc_int_disable(BOARD_IOID_REED_RELAY);
|
||||||
ti_lib_gpio_event_clear(1 << BOARD_IOID_REED_RELAY);
|
ti_lib_gpio_event_clear(1 << BOARD_IOID_REED_RELAY);
|
||||||
|
|
||||||
/* Enabled the GPIO clock when the CM3 is running */
|
/* Enable the GPIO clock when the CM3 is running */
|
||||||
ti_lib_prcm_peripheral_run_enable(PRCM_PERIPH_GPIO);
|
ti_lib_prcm_peripheral_run_enable(PRCM_PERIPH_GPIO);
|
||||||
|
|
||||||
|
/* S/W control, input, pull-down */
|
||||||
ti_lib_ioc_port_configure_set(BOARD_IOID_REED_RELAY, IOC_PORT_GPIO,
|
ti_lib_ioc_port_configure_set(BOARD_IOID_REED_RELAY, IOC_PORT_GPIO,
|
||||||
REED_ISR_CFG);
|
REED_IO_CFG);
|
||||||
|
|
||||||
gpio_interrupt_register_handler(BOARD_IOID_REED_RELAY,
|
gpio_interrupt_register_handler(BOARD_IOID_REED_RELAY,
|
||||||
reed_interrupt_handler);
|
reed_interrupt_handler);
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
CFLAGS += -DBOARD_SMARTRF06EB=1
|
CFLAGS += -DBOARD_SMARTRF06EB=1
|
||||||
|
|
||||||
BOARD_SOURCEFILES += leds-arch.c srf06-sensors.c button-sensor.c board.c
|
BOARD_SOURCEFILES += leds-arch.c srf06-sensors.c button-sensor.c board.c
|
||||||
|
|
||||||
CONTIKI_TARGET_DIRS += $(BOARD)/bsp
|
|
||||||
|
|
|
@ -329,7 +329,7 @@ value_select(int type)
|
||||||
{
|
{
|
||||||
if(type == BUTTON_SENSOR_VALUE_STATE) {
|
if(type == BUTTON_SENSOR_VALUE_STATE) {
|
||||||
return ti_lib_gpio_pin_read(BOARD_KEY_SELECT) == 0 ?
|
return ti_lib_gpio_pin_read(BOARD_KEY_SELECT) == 0 ?
|
||||||
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
|
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
|
||||||
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
|
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
|
||||||
return (int)sel_timer.duration;
|
return (int)sel_timer.duration;
|
||||||
}
|
}
|
||||||
|
@ -341,7 +341,7 @@ value_left(int type)
|
||||||
{
|
{
|
||||||
if(type == BUTTON_SENSOR_VALUE_STATE) {
|
if(type == BUTTON_SENSOR_VALUE_STATE) {
|
||||||
return ti_lib_gpio_pin_read(BOARD_KEY_LEFT) == 0 ?
|
return ti_lib_gpio_pin_read(BOARD_KEY_LEFT) == 0 ?
|
||||||
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
|
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
|
||||||
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
|
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
|
||||||
return (int)left_timer.duration;
|
return (int)left_timer.duration;
|
||||||
}
|
}
|
||||||
|
@ -353,7 +353,7 @@ value_right(int type)
|
||||||
{
|
{
|
||||||
if(type == BUTTON_SENSOR_VALUE_STATE) {
|
if(type == BUTTON_SENSOR_VALUE_STATE) {
|
||||||
return ti_lib_gpio_pin_read(BOARD_KEY_RIGHT) == 0 ?
|
return ti_lib_gpio_pin_read(BOARD_KEY_RIGHT) == 0 ?
|
||||||
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
|
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
|
||||||
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
|
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
|
||||||
return (int)right_timer.duration;
|
return (int)right_timer.duration;
|
||||||
}
|
}
|
||||||
|
@ -365,7 +365,7 @@ value_up(int type)
|
||||||
{
|
{
|
||||||
if(type == BUTTON_SENSOR_VALUE_STATE) {
|
if(type == BUTTON_SENSOR_VALUE_STATE) {
|
||||||
return ti_lib_gpio_pin_read(BOARD_KEY_UP) == 0 ?
|
return ti_lib_gpio_pin_read(BOARD_KEY_UP) == 0 ?
|
||||||
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
|
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
|
||||||
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
|
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
|
||||||
return (int)up_timer.duration;
|
return (int)up_timer.duration;
|
||||||
}
|
}
|
||||||
|
@ -377,7 +377,7 @@ value_down(int type)
|
||||||
{
|
{
|
||||||
if(type == BUTTON_SENSOR_VALUE_STATE) {
|
if(type == BUTTON_SENSOR_VALUE_STATE) {
|
||||||
return ti_lib_gpio_pin_read(BOARD_KEY_DOWN) == 0 ?
|
return ti_lib_gpio_pin_read(BOARD_KEY_DOWN) == 0 ?
|
||||||
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
|
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
|
||||||
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
|
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
|
||||||
return (int)down_timer.duration;
|
return (int)down_timer.duration;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue