Merge pull request #1756 from g-oikonomou/contrib/cc26xx/new-ccxxwares

Update to latest TI CC13xxware/CC26xxware
master-31012017
Antonio Lignan 2016-08-16 15:44:41 +02:00 committed by GitHub
commit cb42bafbfb
33 changed files with 476 additions and 331 deletions

4
.gitmodules vendored
View File

@ -6,10 +6,10 @@
url = https://github.com/JelmerT/cc2538-bsl.git
[submodule "cpu/cc26xx-cc13xx/lib/cc26xxware"]
path = cpu/cc26xx-cc13xx/lib/cc26xxware
url = https://github.com/g-oikonomou/cc26xxware.git
url = https://github.com/contiki-os/cc26xxware.git
[submodule "cpu/cc26xx-cc13xx/lib/cc13xxware"]
path = cpu/cc26xx-cc13xx/lib/cc13xxware
url = https://github.com/g-oikonomou/cc13xxware.git
url = https://github.com/contiki-os/cc13xxware.git
[submodule "platform/stm32nucleo-spirit1/stm32cube-lib"]
path = platform/stm32nucleo-spirit1/stm32cube-lib
url = https://github.com/STclab/stm32nucleo-spirit1-lib

View File

@ -101,6 +101,12 @@ $(OBJECTDIR)/ieee-addr.o: ieee-addr.c FORCE | $(OBJECTDIR)
$(TRACE_CC)
$(Q)$(CC) $(CFLAGS) -c $< -o $@
### Always re-build ccfg.c so changes to ccfg-conf.h will apply without having
### to make clean first
$(OBJECTDIR)/ccfg.o: ccfg.c FORCE | $(OBJECTDIR)
$(TRACE_CC)
$(Q)$(CC) $(CFLAGS) -include "contiki-conf.h" -c $< -o $@
### Compilation rules
CUSTOM_RULE_LINK=1

View File

@ -120,7 +120,7 @@ static void
disable_interrupts(void)
{
/* Acknowledge UART interrupts */
ti_lib_int_disable(INT_UART0);
ti_lib_int_disable(INT_UART0_COMB);
/* Disable all UART module interrupts */
ti_lib_uart_int_disable(UART0_BASE, CC26XX_UART_INTERRUPT_ALL);
@ -141,7 +141,7 @@ enable_interrupts(void)
ti_lib_uart_int_enable(UART0_BASE, CC26XX_UART_RX_INTERRUPT_TRIGGERS);
/* Acknowledge UART interrupts */
ti_lib_int_enable(INT_UART0);
ti_lib_int_enable(INT_UART0_COMB);
}
}
/*---------------------------------------------------------------------------*/
@ -154,7 +154,7 @@ configure(void)
* to avoid falling edge glitches
*/
ti_lib_ioc_pin_type_gpio_output(BOARD_IOID_UART_TX);
ti_lib_gpio_pin_write(BOARD_UART_TX, 1);
ti_lib_gpio_set_dio(BOARD_IOID_UART_TX);
/*
* Map UART signals to the correct GPIO pins and configure them as

View File

@ -55,7 +55,7 @@ gpio_interrupt_register_handler(uint8_t ioid, gpio_interrupt_handler_t f)
uint8_t interrupts_disabled = ti_lib_int_master_disable();
/* Clear interrupts on specified pins */
ti_lib_gpio_event_clear(1 << ioid);
ti_lib_gpio_clear_event_dio(ioid);
handlers[ioid] = f;
@ -74,7 +74,7 @@ gpio_interrupt_init()
handlers[i] = NULL;
}
ti_lib_int_enable(INT_EDGE_DETECT);
ti_lib_int_enable(INT_AON_GPIO_EDGE);
}
/*---------------------------------------------------------------------------*/
void
@ -86,13 +86,13 @@ gpio_interrupt_isr(void)
ENERGEST_ON(ENERGEST_TYPE_IRQ);
/* Read interrupt flags */
pin_mask = (HWREG(GPIO_BASE + GPIO_O_EVFLAGS31_0) & GPIO_PIN_MASK);
pin_mask = (HWREG(GPIO_BASE + GPIO_O_EVFLAGS31_0) & GPIO_DIO_ALL_MASK);
/* Clear the interrupt flags */
HWREG(GPIO_BASE + GPIO_O_EVFLAGS31_0) = pin_mask;
/* Run custom ISRs */
for(i = 0; i < NUM_GPIO_PINS; i++) {
for(i = 0; i < NUM_IO_MAX; i++) {
/* Call the handler if there is one registered for this event */
if((pin_mask & (1 << i)) && handlers[i] != NULL) {
handlers[i](i);

View File

@ -100,7 +100,7 @@ soc_rtc_init(void)
ti_lib_aon_rtc_channel_enable(AON_RTC_CH1);
ti_lib_aon_rtc_enable();
ti_lib_int_enable(INT_AON_RTC);
ti_lib_rom_int_enable(INT_AON_RTC_COMB);
/* Re-enable interrupts */
if(!interrupts_disabled) {

View File

@ -71,7 +71,7 @@ static void
disable_number_ready_interrupt(void)
{
ti_lib_trng_int_disable(TRNG_NUMBER_READY);
ti_lib_rom_int_disable(INT_TRNG);
ti_lib_rom_int_disable(INT_TRNG_IRQ);
}
/*---------------------------------------------------------------------------*/
static void
@ -79,7 +79,7 @@ enable_number_ready_interrupt(void)
{
ti_lib_trng_int_clear(TRNG_NUMBER_READY);
ti_lib_trng_int_enable(TRNG_NUMBER_READY);
ti_lib_rom_int_enable(INT_TRNG);
ti_lib_rom_int_enable(INT_TRNG_IRQ);
}
/*---------------------------------------------------------------------------*/
static bool

@ -1 +1 @@
Subproject commit 6bdb6da3fa9682303799e5c3b1f755398e87fc99
Subproject commit f7bdc430225db8f9204c3f02faddd7f8f8752fe8

@ -1 +1 @@
Subproject commit 0270b50ac750f8f3348a98f900a470e7a65ffce8
Subproject commit 0e8396b97921049575763dff45d564ff2cf6d0d6

View File

@ -127,7 +127,7 @@ lpm_shutdown(uint32_t wakeup_pin, uint32_t io_pull, uint32_t wake_on)
/* Configure the wakeup trigger */
if(wakeup_pin != IOID_UNUSED) {
ti_lib_gpio_dir_mode_set((1 << wakeup_pin), GPIO_DIR_MODE_IN);
ti_lib_gpio_set_output_enable_dio(wakeup_pin, GPIO_OUTPUT_DISABLE);
ti_lib_ioc_port_configure_set(wakeup_pin, IOC_PORT_GPIO, io_cfg);
}
@ -584,7 +584,7 @@ lpm_pin_set_default_state(uint32_t ioid)
}
ti_lib_ioc_port_configure_set(ioid, IOC_PORT_GPIO, IOC_STD_OUTPUT);
ti_lib_gpio_dir_mode_set((1 << ioid), GPIO_DIR_MODE_IN);
ti_lib_gpio_set_output_enable_dio(ioid, GPIO_OUTPUT_DISABLE);
}
/*---------------------------------------------------------------------------*/
/**

View File

@ -236,10 +236,10 @@ rf_core_power_up()
uint32_t cmd_status;
bool interrupts_disabled = ti_lib_int_master_disable();
ti_lib_int_pend_clear(INT_RF_CPE0);
ti_lib_int_pend_clear(INT_RF_CPE1);
ti_lib_int_disable(INT_RF_CPE0);
ti_lib_int_disable(INT_RF_CPE1);
ti_lib_int_pend_clear(INT_RFC_CPE_0);
ti_lib_int_pend_clear(INT_RFC_CPE_1);
ti_lib_int_disable(INT_RFC_CPE_0);
ti_lib_int_disable(INT_RFC_CPE_1);
/* Enable RF Core power domain */
ti_lib_prcm_power_domain_on(PRCM_DOMAIN_RFCORE);
@ -252,8 +252,8 @@ rf_core_power_up()
HWREG(RFC_DBELL_NONBUF_BASE + RFC_DBELL_O_RFCPEIFG) = 0x0;
HWREG(RFC_DBELL_NONBUF_BASE + RFC_DBELL_O_RFCPEIEN) = 0x0;
ti_lib_int_enable(INT_RF_CPE0);
ti_lib_int_enable(INT_RF_CPE1);
ti_lib_int_enable(INT_RFC_CPE_0);
ti_lib_int_enable(INT_RFC_CPE_1);
if(!interrupts_disabled) {
ti_lib_int_master_enable();
@ -335,8 +335,8 @@ void
rf_core_power_down()
{
bool interrupts_disabled = ti_lib_int_master_disable();
ti_lib_int_disable(INT_RF_CPE0);
ti_lib_int_disable(INT_RF_CPE1);
ti_lib_int_disable(INT_RFC_CPE_0);
ti_lib_int_disable(INT_RFC_CPE_1);
if(rf_core_is_accessible()) {
HWREG(RFC_DBELL_NONBUF_BASE + RFC_DBELL_O_RFCPEIFG) = 0x0;
@ -358,10 +358,10 @@ rf_core_power_down()
while(ti_lib_prcm_power_domain_status(PRCM_DOMAIN_RFCORE)
!= PRCM_DOMAIN_POWER_OFF);
ti_lib_int_pend_clear(INT_RF_CPE0);
ti_lib_int_pend_clear(INT_RF_CPE1);
ti_lib_int_enable(INT_RF_CPE0);
ti_lib_int_enable(INT_RF_CPE1);
ti_lib_int_pend_clear(INT_RFC_CPE_0);
ti_lib_int_pend_clear(INT_RFC_CPE_1);
ti_lib_int_enable(INT_RFC_CPE_0);
ti_lib_int_enable(INT_RFC_CPE_1);
if(!interrupts_disabled) {
ti_lib_int_master_enable();
}
@ -371,26 +371,17 @@ uint8_t
rf_core_set_modesel()
{
uint8_t rv = RF_CORE_CMD_ERROR;
ChipType_t chip_type = ti_lib_chipinfo_get_chip_type();
if(ti_lib_chipinfo_chip_family_is_cc26xx()) {
if(ti_lib_chipinfo_supports_ble() == true &&
ti_lib_chipinfo_supports_ieee_802_15_4() == true) {
/* CC2650 */
HWREG(PRCM_BASE + PRCM_O_RFCMODESEL) = PRCM_RFCMODESEL_CURR_MODE5;
rv = RF_CORE_CMD_OK;
} else if(ti_lib_chipinfo_supports_ble() == false &&
ti_lib_chipinfo_supports_ieee_802_15_4() == true) {
/* CC2630 */
HWREG(PRCM_BASE + PRCM_O_RFCMODESEL) = PRCM_RFCMODESEL_CURR_MODE2;
rv = RF_CORE_CMD_OK;
}
} else if(ti_lib_chipinfo_chip_family_is_cc13xx()) {
if(ti_lib_chipinfo_supports_ble() == false &&
ti_lib_chipinfo_supports_ieee_802_15_4() == false) {
/* CC1310 */
HWREG(PRCM_BASE + PRCM_O_RFCMODESEL) = PRCM_RFCMODESEL_CURR_MODE3;
rv = RF_CORE_CMD_OK;
}
if(chip_type == CHIP_TYPE_CC2650) {
HWREG(PRCM_BASE + PRCM_O_RFCMODESEL) = PRCM_RFCMODESEL_CURR_MODE5;
rv = RF_CORE_CMD_OK;
} else if(chip_type == CHIP_TYPE_CC2630) {
HWREG(PRCM_BASE + PRCM_O_RFCMODESEL) = PRCM_RFCMODESEL_CURR_MODE2;
rv = RF_CORE_CMD_OK;
} else if(chip_type == CHIP_TYPE_CC1310) {
HWREG(PRCM_BASE + PRCM_O_RFCMODESEL) = PRCM_RFCMODESEL_CURR_MODE3;
rv = RF_CORE_CMD_OK;
}
return rv;
@ -462,10 +453,10 @@ rf_core_setup_interrupts(bool poll_mode)
/* Clear interrupt flags, active low clear(?) */
HWREG(RFC_DBELL_NONBUF_BASE + RFC_DBELL_O_RFCPEIFG) = 0x0;
ti_lib_int_pend_clear(INT_RF_CPE0);
ti_lib_int_pend_clear(INT_RF_CPE1);
ti_lib_int_enable(INT_RF_CPE0);
ti_lib_int_enable(INT_RF_CPE1);
ti_lib_int_pend_clear(INT_RFC_CPE_0);
ti_lib_int_pend_clear(INT_RFC_CPE_1);
ti_lib_int_enable(INT_RFC_CPE_0);
ti_lib_int_enable(INT_RFC_CPE_1);
if(!interrupts_disabled) {
ti_lib_int_master_enable();

View File

@ -0,0 +1,193 @@
/*
* Copyright (c) 2016, Texas Instruments Incorporated - http://www.ti.com/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*---------------------------------------------------------------------------*/
/**
* \addtogroup cc26xx-ti-lib
* @{
*
* \file
* Header file with CC13xxware/CC26xxware ROM API.
*/
/*---------------------------------------------------------------------------*/
#ifndef TI_LIB_ROM_H_
#define TI_LIB_ROM_H_
/*---------------------------------------------------------------------------*/
/* rom.h */
#include "driverlib/rom.h"
/* AON API */
#define ti_lib_rom_aon_event_mcu_wake_up_set ROM_AONEventMcuWakeUpSet
#define ti_lib_rom_aon_event_mcu_wake_up_get ROM_AONEventMcuWakeUpGet
#define ti_lib_rom_aon_event_aux_wake_up_set ROM_AONEventAuxWakeUpSet
#define ti_lib_rom_aon_event_aux_wake_up_get ROM_AONEventAuxWakeUpGet
#define ti_lib_rom_aon_event_mcu_set ROM_AONEventMcuSet
#define ti_lib_rom_aon_event_mcu_get ROM_AONEventMcuGet
/* AON_WUC API */
#define ti_lib_rom_aon_wuc_aux_reset ROM_AONWUCAuxReset
#define ti_lib_rom_aon_wuc_recharge_ctrl_config_set ROM_AONWUCRechargeCtrlConfigSet
#define ti_lib_rom_aon_wuc_osc_config ROM_AONWUCOscConfig
/* AUX_TDC API */
#define ti_lib_rom_aux_tdc_config_set ROM_AUXTDCConfigSet
#define ti_lib_rom_aux_tdc_measurement_done ROM_AUXTDCMeasurementDone
/* AUX_WUC API */
#define ti_lib_rom_aux_wuc_clock_enable ROM_AUXWUCClockEnable
#define ti_lib_rom_aux_wuc_clock_disable ROM_AUXWUCClockDisable
#define ti_lib_rom_aux_wuc_clock_status ROM_AUXWUCClockStatus
#define ti_lib_rom_aux_wuc_power_ctrl ROM_AUXWUCPowerCtrl
/* FLASH API */
#define ti_lib_rom_flash_power_mode_get ROM_FlashPowerModeGet
#define ti_lib_rom_flash_protection_set ROM_FlashProtectionSet
#define ti_lib_rom_flash_protection_get ROM_FlashProtectionGet
#define ti_lib_rom_flash_protection_save ROM_FlashProtectionSave
#define ti_lib_rom_flash_efuse_read_row ROM_FlashEfuseReadRow
#define ti_lib_rom_flash_disable_sectors_for_write ROM_FlashDisableSectorsForWrite
/* I2C API */
#define ti_lib_rom_i2c_master_init_exp_clk ROM_I2CMasterInitExpClk
#define ti_lib_rom_i2c_master_err ROM_I2CMasterErr
/* INTERRUPT API */
#define ti_lib_rom_int_priority_grouping_set ROM_IntPriorityGroupingSet
#define ti_lib_rom_int_priority_grouping_get ROM_IntPriorityGroupingGet
#define ti_lib_rom_int_priority_set ROM_IntPrioritySet
#define ti_lib_rom_int_priority_get ROM_IntPriorityGet
#define ti_lib_rom_int_enable ROM_IntEnable
#define ti_lib_rom_int_disable ROM_IntDisable
#define ti_lib_rom_int_pend_set ROM_IntPendSet
#define ti_lib_rom_int_pend_get ROM_IntPendGet
#define ti_lib_rom_int_pend_clear ROM_IntPendClear
/* IOC API */
#define ti_lib_rom_ioc_port_configure_set ROM_IOCPortConfigureSet
#define ti_lib_rom_ioc_port_configure_get ROM_IOCPortConfigureGet
#define ti_lib_rom_ioc_io_shutdown_set ROM_IOCIOShutdownSet
#define ti_lib_rom_ioc_io_mode_set ROM_IOCIOModeSet
#define ti_lib_rom_ioc_io_int_set ROM_IOCIOIntSet
#define ti_lib_rom_ioc_io_port_pull_set ROM_IOCIOPortPullSet
#define ti_lib_rom_ioc_io_hyst_set ROM_IOCIOHystSet
#define ti_lib_rom_ioc_io_input_set ROM_IOCIOInputSet
#define ti_lib_rom_ioc_io_slew_ctrl_set ROM_IOCIOSlewCtrlSet
#define ti_lib_rom_ioc_io_drv_strength_set ROM_IOCIODrvStrengthSet
#define ti_lib_rom_ioc_io_port_id_set ROM_IOCIOPortIdSet
#define ti_lib_rom_ioc_int_enable ROM_IOCIntEnable
#define ti_lib_rom_ioc_int_disable ROM_IOCIntDisable
#define ti_lib_rom_ioc_pin_type_gpio_input ROM_IOCPinTypeGpioInput
#define ti_lib_rom_ioc_pin_type_gpio_output ROM_IOCPinTypeGpioOutput
#define ti_lib_rom_ioc_pin_type_uart ROM_IOCPinTypeUart
#define ti_lib_rom_ioc_pin_type_ssi_master ROM_IOCPinTypeSsiMaster
#define ti_lib_rom_ioc_pin_type_ssi_slave ROM_IOCPinTypeSsiSlave
#define ti_lib_rom_ioc_pin_type_i2c ROM_IOCPinTypeI2c
#define ti_lib_rom_ioc_pin_type_aux ROM_IOCPinTypeAux
/* PRCM API */
#define ti_lib_rom_prcm_inf_clock_configure_set ROM_PRCMInfClockConfigureSet
#define ti_lib_rom_prcm_inf_clock_configure_get ROM_PRCMInfClockConfigureGet
#define ti_lib_rom_prcm_audio_clock_config_set ROM_PRCMAudioClockConfigSet
#define ti_lib_rom_prcm_power_domain_on ROM_PRCMPowerDomainOn
#define ti_lib_rom_prcm_power_domain_off ROM_PRCMPowerDomainOff
#define ti_lib_rom_prcm_peripheral_run_enable ROM_PRCMPeripheralRunEnable
#define ti_lib_rom_prcm_peripheral_run_disable ROM_PRCMPeripheralRunDisable
#define ti_lib_rom_prcm_peripheral_sleep_enable ROM_PRCMPeripheralSleepEnable
#define ti_lib_rom_prcm_peripheral_sleep_disable ROM_PRCMPeripheralSleepDisable
#define ti_lib_rom_prcm_peripheral_deep_sleep_enable ROM_PRCMPeripheralDeepSleepEnable
#define ti_lib_rom_prcm_peripheral_deep_sleep_disable ROM_PRCMPeripheralDeepSleepDisable
#define ti_lib_rom_prcm_power_domain_status ROM_PRCMPowerDomainStatus
#define ti_lib_rom_prcm_deep_sleep ROM_PRCMDeepSleep
/* SMPH API */
#define ti_lib_rom_smph_acquire ROM_SMPHAcquire
/* SSI API */
#define ti_lib_rom_ssi_config_set_exp_clk ROM_SSIConfigSetExpClk
#define ti_lib_rom_ssi_data_put ROM_SSIDataPut
#define ti_lib_rom_ssi_data_put_non_blocking ROM_SSIDataPutNonBlocking
#define ti_lib_rom_ssi_data_get ROM_SSIDataGet
#define ti_lib_rom_ssi_data_get_non_blocking ROM_SSIDataGetNonBlocking
/* TIMER API */
#define ti_lib_rom_timer_configure ROM_TimerConfigure
#define ti_lib_rom_timer_level_control ROM_TimerLevelControl
#define ti_lib_rom_timer_stall_control ROM_TimerStallControl
#define ti_lib_rom_timer_wait_on_trigger_control ROM_TimerWaitOnTriggerControl
/* TRNG API */
#define ti_lib_rom_trng_number_get ROM_TRNGNumberGet
/* UART API */
#define ti_lib_rom_uart_fifo_level_get ROM_UARTFIFOLevelGet
#define ti_lib_rom_uart_config_set_exp_clk ROM_UARTConfigSetExpClk
#define ti_lib_rom_uart_config_get_exp_clk ROM_UARTConfigGetExpClk
#define ti_lib_rom_uart_disable ROM_UARTDisable
#define ti_lib_rom_uart_char_get_non_blocking ROM_UARTCharGetNonBlocking
#define ti_lib_rom_uart_char_get ROM_UARTCharGet
#define ti_lib_rom_uart_char_put_non_blocking ROM_UARTCharPutNonBlocking
#define ti_lib_rom_uart_char_put ROM_UARTCharPut
/* UDMA API */
#define ti_lib_rom_udma_channel_attribute_enable ROM_uDMAChannelAttributeEnable
#define ti_lib_rom_udma_channel_attribute_disable ROM_uDMAChannelAttributeDisable
#define ti_lib_rom_udma_channel_attribute_get ROM_uDMAChannelAttributeGet
#define ti_lib_rom_udma_channel_control_set ROM_uDMAChannelControlSet
#define ti_lib_rom_udma_channel_transfer_set ROM_uDMAChannelTransferSet
#define ti_lib_rom_udma_channel_scatter_gather_set ROM_uDMAChannelScatterGatherSet
#define ti_lib_rom_udma_channel_size_get ROM_uDMAChannelSizeGet
#define ti_lib_rom_udma_channel_mode_get ROM_uDMAChannelModeGet
/* VIMS API */
#define ti_lib_rom_vims_configure ROM_VIMSConfigure
#define ti_lib_rom_vims_mode_set ROM_VIMSModeSet
/* HAPI */
#define ti_lib_hapi_crc32(a, b, c) HapiCrc32(a, b, c)
#define ti_lib_hapi_get_flash_size() HapiGetFlashSize()
#define ti_lib_hapi_get_chip_id() HapiGetChipId()
#define ti_lib_hapi_sector_erase(a) HapiSectorErase(a)
#define ti_lib_hapi_program_flash(a, b, c) HapiProgramFlash(a, b, c)
#define ti_lib_hapi_reset_device() HapiResetDevice()
#define ti_lib_hapi_fletcher32(a, b, c) HapiFletcher32(a, b, c)
#define ti_lib_hapi_min_value(a, b) HapiMinValue(a,b)
#define ti_lib_hapi_max_value(a, b) HapiMaxValue(a,b)
#define ti_lib_hapi_mean_value(a, b) HapiMeanValue(a,b)
#define ti_lib_hapi_stand_deviation_value(a, b) HapiStandDeviationValue(a,b)
#define ti_lib_hapi_hf_source_safe_switch() HapiHFSourceSafeSwitch()
#define ti_lib_hapi_select_comp_a_input(a) HapiSelectCompAInput(a)
#define ti_lib_hapi_select_comp_a_ref(a) HapiSelectCompARef(a)
#define ti_lib_hapi_select_adc_comp_b_input(a) HapiSelectADCCompBInput(a)
#define ti_lib_hapi_select_comp_b_ref(a) HapiSelectCompBRef(a)
/*---------------------------------------------------------------------------*/
#endif /* TI_LIB_ROM_H_ */
/*---------------------------------------------------------------------------*/
/**
* @}
*/

View File

@ -52,6 +52,9 @@
#ifndef TI_LIB_H_
#define TI_LIB_H_
/*---------------------------------------------------------------------------*/
/* Include ROM API */
#include "ti-lib-rom.h"
/*---------------------------------------------------------------------------*/
/* aon_batmon.h */
#include "driverlib/aon_batmon.h"
@ -195,6 +198,7 @@
#define ti_lib_chipinfo_package_type_is_5x5(...) ChipInfo_PackageTypeIs5x5(__VA_ARGS__)
#define ti_lib_chipinfo_package_type_is_7x7(...) ChipInfo_PackageTypeIs7x7(__VA_ARGS__)
#define ti_lib_chipinfo_get_device_id_hw_rev_code(...) ChipInfo_GetDeviceIdHwRevCode(__VA_ARGS__)
#define ti_lib_chipinfo_get_chip_type(...) ChipInfo_GetChipType(__VA_ARGS__)
#define ti_lib_chipinfo_get_chip_family(...) ChipInfo_GetChipFamily(__VA_ARGS__)
#define ti_lib_chipinfo_chip_family_is_cc26xx(...) ChipInfo_ChipFamilyIsCC26xx(__VA_ARGS__)
#define ti_lib_chipinfo_chip_family_is_cc13xx(...) ChipInfo_ChipFamilyIsCC13xx(__VA_ARGS__)
@ -225,14 +229,24 @@
/* gpio.h */
#include "driverlib/gpio.h"
#define ti_lib_gpio_dir_mode_set(...) GPIODirModeSet(__VA_ARGS__)
#define ti_lib_gpio_dir_mode_get(...) GPIODirModeGet(__VA_ARGS__)
#define ti_lib_gpio_pin_write(...) GPIOPinWrite(__VA_ARGS__)
#define ti_lib_gpio_pin_read(...) GPIOPinRead(__VA_ARGS__)
#define ti_lib_gpio_pin_clear(...) GPIOPinClear(__VA_ARGS__)
#define ti_lib_gpio_pin_toggle(...) GPIOPinToggle(__VA_ARGS__)
#define ti_lib_gpio_event_get(...) GPIOEventGet(__VA_ARGS__)
#define ti_lib_gpio_event_clear(...) GPIOEventClear(__VA_ARGS__)
#define ti_lib_gpio_read_dio(...) GPIO_readDio(__VA_ARGS__)
#define ti_lib_gpio_read_multi_dio(...) GPIO_readMultiDio(__VA_ARGS__)
#define ti_lib_gpio_write_dio(...) GPIO_writeDio(__VA_ARGS__)
#define ti_lib_gpio_write_multi_dio(...) GPIO_writeMultiDio(__VA_ARGS__)
#define ti_lib_gpio_set_dio(...) GPIO_setDio(__VA_ARGS__)
#define ti_lib_gpio_set_multi_dio(...) GPIO_setMultiDio(__VA_ARGS__)
#define ti_lib_gpio_clear_dio(...) GPIO_clearDio(__VA_ARGS__)
#define ti_lib_gpio_clear_multi_dio(...) GPIO_clearMultiDio(__VA_ARGS__)
#define ti_lib_gpio_toggle_dio(...) GPIO_toggleDio(__VA_ARGS__)
#define ti_lib_gpio_toggle_multi_dio(...) GPIO_toggleMultiDio(__VA_ARGS__)
#define ti_lib_gpio_get_output_enable_dio(...) GPIO_getOutputEnableDio(__VA_ARGS__)
#define ti_lib_gpio_get_output_enable_multi_dio(...) GPIO_getOutputEnableMultiDio(__VA_ARGS__)
#define ti_lib_gpio_set_output_enable_dio(...) GPIO_setOutputEnableDio(__VA_ARGS__)
#define ti_lib_gpio_set_output_enable_multi_dio(...) GPIO_setOutputEnableMultiDio(__VA_ARGS__)
#define ti_lib_gpio_get_event_dio(...) GPIO_getEventDio(__VA_ARGS__)
#define ti_lib_gpio_get_event_multi_dio(...) GPIO_getEventMultiDio(__VA_ARGS__)
#define ti_lib_gpio_clear_event_dio(...) GPIO_clearEventDio(__VA_ARGS__)
#define ti_lib_gpio_clear_event_multi_dio(...) GPIO_clearEventMultiDio(__VA_ARGS__)
/*---------------------------------------------------------------------------*/
/* i2c.h */
#include "driverlib/i2c.h"
@ -317,15 +331,22 @@
#include "driverlib/osc.h"
#define ti_lib_osc_xhf_power_mode_set(...) OSCXHfPowerModeSet(__VA_ARGS__)
#define ti_lib_osc_clock_loss_event_enable(...) OSCClockLossEventEnable(__VA_ARGS__)
#define ti_lib_osc_clock_loss_event_disable(...) OSCClockLossEventDisable(__VA_ARGS__)
#define ti_lib_osc_clock_source_set(...) OSCClockSourceSet(__VA_ARGS__)
#define ti_lib_osc_clock_source_get(...) OSCClockSourceGet(__VA_ARGS__)
#define ti_lib_osc_hf_source_ready(...) OSCHfSourceReady(__VA_ARGS__)
#define ti_lib_osc_hf_source_switch(...) OSCHfSourceSwitch(__VA_ARGS__)
#define ti_lib_osc_interface_enable(...) OSCInterfaceEnable(__VA_ARGS__)
#define ti_lib_osc_interface_disable(...) OSCInterfaceDisable(__VA_ARGS__)
#define ti_lib_osc_hf_get_startup_time(...) OSCHF_GetStartupTime(__VA_ARGS__)
#define ti_lib_osc_hf_turn_on_xosc(...) OSCHF_TurnOnXosc(__VA_ARGS__)
#define ti_lib_osc_hf_attempt_to_switch_to_xosc(...) OSCHF_AttemptToSwitchToXosc(__VA_ARGS__)
#define ti_lib_osc_hf_debug_get_crystal_amplitude(...) OSCHF_DebugGetCrystalAmplitude(__VA_ARGS__)
#define ti_lib_osc_hf_debug_get_expected_average_crystal_amplitude(...) \
OSCHF_DebugGetExpectedAverageCrystalAmplitude(__VA_ARGS__)
#define ti_lib_osc_hposc_relative_frequency_offset_get(...) \
OSC_HPOSCRelativeFrequencyOffsetGet(__VA_ARGS__)
#define ti_lib_osc_hposc_relative_frequency_offset_to_rf_core_format_convert(...) \
OSC_HPOSCRelativeFrequencyOffsetToRFCoreFormatConvert(__VA_ARGS__)
#define ti_lib_osc_hf_switch_to_rc_osc_turn_off_xosc(...) OSCHF_SwitchToRcOscTurnOffXosc(__VA_ARGS__)
/*---------------------------------------------------------------------------*/
/* prcm.h */
@ -370,192 +391,6 @@
#define ti_lib_pwr_ctrl_io_freeze_enable(...) PowerCtrlIOFreezeEnable(__VA_ARGS__)
#define ti_lib_pwr_ctrl_io_freeze_disable(...) PowerCtrlIOFreezeDisable(__VA_ARGS__)
/*---------------------------------------------------------------------------*/
/* rom.h */
#include "driverlib/rom.h"
/* AON API */
#define ti_lib_rom_aon_event_mcu_wake_up_set ROM_AONEventMcuWakeUpSet
#define ti_lib_rom_aon_event_mcu_wake_up_get ROM_AONEventMcuWakeUpGet
#define ti_lib_rom_aon_event_aux_wake_up_set ROM_AONEventAuxWakeUpSet
#define ti_lib_rom_aon_event_aux_wake_up_get ROM_AONEventAuxWakeUpGet
#define ti_lib_rom_aon_event_mcu_set ROM_AONEventMcuSet
#define ti_lib_rom_aon_event_mcu_get ROM_AONEventMcuGet
/* AON_IOC API */
#define ti_lib_rom_aon_ioc_drive_strength_set ROM_AONIOCDriveStrengthSet
#define ti_lib_rom_aon_ioc_drive_strength_get ROM_AONIOCDriveStrengthGet
/* AON_RTC API */
#define ti_lib_rom_aon_rtc_status ROM_AONRTCStatus
#define ti_lib_rom_aon_rtc_event_clear ROM_AONRTCEventClear
#define ti_lib_rom_aon_rtc_event_get ROM_AONRTCEventGet
#define ti_lib_rom_aon_rtc_mode_ch1_set ROM_AONRTCModeCh1Set
#define ti_lib_rom_aon_rtc_mode_ch1_get ROM_AONRTCModeCh1Get
#define ti_lib_rom_aon_rtc_mode_ch2_set ROM_AONRTCModeCh2Set
#define ti_lib_rom_aon_rtc_mode_ch2_get ROM_AONRTCModeCh2Get
#define ti_lib_rom_aon_rtc_channel_enable ROM_AONRTCChannelEnable
#define ti_lib_rom_aon_rtc_channel_disable ROM_AONRTCChannelDisable
#define ti_lib_rom_aon_rtc_compare_value_set ROM_AONRTCCompareValueSet
#define ti_lib_rom_aon_rtc_compare_value_get ROM_AONRTCCompareValueGet
#define ti_lib_rom_aon_rtc_current_compare_value_get ROM_AONRTCCurrentCompareValueGet
/* AON_WUC API */
#define ti_lib_rom_aon_wuc_aux_s_ram_config ROM_AONWUCAuxSRamConfig
#define ti_lib_rom_aon_wuc_aux_wakeup_event ROM_AONWUCAuxWakeupEvent
#define ti_lib_rom_aon_wuc_aux_reset ROM_AONWUCAuxReset
#define ti_lib_rom_aon_wuc_recharge_ctrl_config_set ROM_AONWUCRechargeCtrlConfigSet
#define ti_lib_rom_aon_wuc_osc_config ROM_AONWUCOscConfig
/* AUX_TDC API */
#define ti_lib_rom_aux_tdc_config_set ROM_AUXTDCConfigSet
#define ti_lib_rom_aux_tdc_measurement_done ROM_AUXTDCMeasurementDone
/* AUX_TIMER API */
#define ti_lib_rom_aux_timer_configure ROM_AUXTimerConfigure
#define ti_lib_rom_aux_timer_start ROM_AUXTimerStart
#define ti_lib_rom_aux_timer_stop ROM_AUXTimerStop
#define ti_lib_rom_aux_timer_prescale_set ROM_AUXTimerPrescaleSet
#define ti_lib_rom_aux_timer_prescale_get ROM_AUXTimerPrescaleGet
/* AUX_WUC API */
#define ti_lib_rom_aux_wuc_clock_enable ROM_AUXWUCClockEnable
#define ti_lib_rom_aux_wuc_clock_disable ROM_AUXWUCClockDisable
#define ti_lib_rom_aux_wuc_clock_status ROM_AUXWUCClockStatus
#define ti_lib_rom_aux_wuc_power_ctrl ROM_AUXWUCPowerCtrl
/* FLASH API */
#define ti_lib_rom_flash_power_mode_get ROM_FlashPowerModeGet
#define ti_lib_rom_flash_protection_set ROM_FlashProtectionSet
#define ti_lib_rom_flash_protection_get ROM_FlashProtectionGet
#define ti_lib_rom_flash_protection_save ROM_FlashProtectionSave
#define ti_lib_rom_flash_efuse_read_row ROM_FlashEfuseReadRow
#define ti_lib_rom_flash_disable_sectors_for_write ROM_FlashDisableSectorsForWrite
/* I2C API */
#define ti_lib_rom_i2c_master_init_exp_clk ROM_I2CMasterInitExpClk
#define ti_lib_rom_i2c_master_err ROM_I2CMasterErr
/* INTERRUPT API */
#define ti_lib_rom_int_priority_grouping_set ROM_IntPriorityGroupingSet
#define ti_lib_rom_int_priority_grouping_get ROM_IntPriorityGroupingGet
#define ti_lib_rom_int_priority_set ROM_IntPrioritySet
#define ti_lib_rom_int_priority_get ROM_IntPriorityGet
#define ti_lib_rom_int_enable ROM_IntEnable
#define ti_lib_rom_int_disable ROM_IntDisable
#define ti_lib_rom_int_pend_set ROM_IntPendSet
#define ti_lib_rom_int_pend_get ROM_IntPendGet
#define ti_lib_rom_int_pend_clear ROM_IntPendClear
/* IOC API */
#define ti_lib_rom_ioc_port_configure_set ROM_IOCPortConfigureSet
#define ti_lib_rom_ioc_port_configure_get ROM_IOCPortConfigureGet
#define ti_lib_rom_ioc_io_shutdown_set ROM_IOCIOShutdownSet
#define ti_lib_rom_ioc_io_jtag_set ROM_IOCIOJTagSet
#define ti_lib_rom_ioc_io_mode_set ROM_IOCIOModeSet
#define ti_lib_rom_ioc_io_int_set ROM_IOCIOIntSet
#define ti_lib_rom_ioc_io_port_pull_set ROM_IOCIOPortPullSet
#define ti_lib_rom_ioc_io_hyst_set ROM_IOCIOHystSet
#define ti_lib_rom_ioc_io_input_set ROM_IOCIOInputSet
#define ti_lib_rom_ioc_io_slew_ctrl_set ROM_IOCIOSlewCtrlSet
#define ti_lib_rom_ioc_io_drv_strength_set ROM_IOCIODrvStrengthSet
#define ti_lib_rom_ioc_io_port_id_set ROM_IOCIOPortIdSet
#define ti_lib_rom_ioc_int_enable ROM_IOCIntEnable
#define ti_lib_rom_ioc_int_disable ROM_IOCIntDisable
#define ti_lib_rom_ioc_pin_type_gpio_input ROM_IOCPinTypeGpioInput
#define ti_lib_rom_ioc_pin_type_gpio_output ROM_IOCPinTypeGpioOutput
#define ti_lib_rom_ioc_pin_type_uart ROM_IOCPinTypeUart
#define ti_lib_rom_ioc_pin_type_ssi_master ROM_IOCPinTypeSsiMaster
#define ti_lib_rom_ioc_pin_type_ssi_slave ROM_IOCPinTypeSsiSlave
#define ti_lib_rom_ioc_pin_type_i2c ROM_IOCPinTypeI2c
#define ti_lib_rom_ioc_pin_type_spis ROM_IOCPinTypeSpis
#define ti_lib_rom_ioc_pin_type_aux ROM_IOCPinTypeAux
/* PRCM API */
#define ti_lib_rom_prcm_inf_clock_configure_set ROM_PRCMInfClockConfigureSet
#define ti_lib_rom_prcm_inf_clock_configure_get ROM_PRCMInfClockConfigureGet
#define ti_lib_rom_prcm_audio_clock_config_set ROM_PRCMAudioClockConfigSet
#define ti_lib_rom_prcm_power_domain_on ROM_PRCMPowerDomainOn
#define ti_lib_rom_prcm_power_domain_off ROM_PRCMPowerDomainOff
#define ti_lib_rom_prcm_peripheral_run_enable ROM_PRCMPeripheralRunEnable
#define ti_lib_rom_prcm_peripheral_run_disable ROM_PRCMPeripheralRunDisable
#define ti_lib_rom_prcm_peripheral_sleep_enable ROM_PRCMPeripheralSleepEnable
#define ti_lib_rom_prcm_peripheral_sleep_disable ROM_PRCMPeripheralSleepDisable
#define ti_lib_rom_prcm_peripheral_deep_sleep_enable ROM_PRCMPeripheralDeepSleepEnable
#define ti_lib_rom_prcm_peripheral_deep_sleep_disable ROM_PRCMPeripheralDeepSleepDisable
#define ti_lib_rom_prcm_power_domain_status ROM_PRCMPowerDomainStatus
#define ti_lib_rom_prcm_deep_sleep ROM_PRCMDeepSleep
/* SMPH API */
#define ti_lib_rom_smph_acquire ROM_SMPHAcquire
/* SPIS API */
#define ti_lib_rom_spis_data_put ROM_SPISDataPut
#define ti_lib_rom_spis_tx_get_value ROM_SPISTxGetValue
#define ti_lib_rom_spis_data_get ROM_SPISDataGet
#define ti_lib_rom_spis_rx_get_value ROM_SPISRxGetValue
#define ti_lib_rom_spis_int_status ROM_SPISIntStatus
/* SSI API */
#define ti_lib_rom_ssi_config_set_exp_clk ROM_SSIConfigSetExpClk
#define ti_lib_rom_ssi_data_put ROM_SSIDataPut
#define ti_lib_rom_ssi_data_put_non_blocking ROM_SSIDataPutNonBlocking
#define ti_lib_rom_ssi_data_get ROM_SSIDataGet
#define ti_lib_rom_ssi_data_get_non_blocking ROM_SSIDataGetNonBlocking
/* TIMER API */
#define ti_lib_rom_timer_configure ROM_TimerConfigure
#define ti_lib_rom_timer_level_control ROM_TimerLevelControl
#define ti_lib_rom_timer_trigger_control ROM_TimerTriggerControl
#define ti_lib_rom_timer_stall_control ROM_TimerStallControl
#define ti_lib_rom_timer_wait_on_trigger_control ROM_TimerWaitOnTriggerControl
/* TRNG API */
#define ti_lib_rom_trng_configure ROM_TRNGConfigure
#define ti_lib_rom_trng_number_get ROM_TRNGNumberGet
/* UART API */
#define ti_lib_rom_uart_fifo_level_get ROM_UARTFIFOLevelGet
#define ti_lib_rom_uart_config_set_exp_clk ROM_UARTConfigSetExpClk
#define ti_lib_rom_uart_config_get_exp_clk ROM_UARTConfigGetExpClk
#define ti_lib_rom_uart_disable ROM_UARTDisable
#define ti_lib_rom_uart_char_get_non_blocking ROM_UARTCharGetNonBlocking
#define ti_lib_rom_uart_char_get ROM_UARTCharGet
#define ti_lib_rom_uart_char_put_non_blocking ROM_UARTCharPutNonBlocking
#define ti_lib_rom_uart_char_put ROM_UARTCharPut
/* UDMA API */
#define ti_lib_rom_udma_channel_attribute_enable ROM_uDMAChannelAttributeEnable
#define ti_lib_rom_udma_channel_attribute_disable ROM_uDMAChannelAttributeDisable
#define ti_lib_rom_udma_channel_attribute_get ROM_uDMAChannelAttributeGet
#define ti_lib_rom_udma_channel_control_set ROM_uDMAChannelControlSet
#define ti_lib_rom_udma_channel_transfer_set ROM_uDMAChannelTransferSet
#define ti_lib_rom_udma_channel_scatter_gather_set ROM_uDMAChannelScatterGatherSet
#define ti_lib_rom_udma_channel_size_get ROM_uDMAChannelSizeGet
#define ti_lib_rom_udma_channel_mode_get ROM_uDMAChannelModeGet
/* VIMS API */
#define ti_lib_rom_vims_configure ROM_VIMSConfigure
#define ti_lib_rom_vims_mode_set ROM_VIMSModeSet
#define ti_lib_rom_vims_mode_get ROM_VIMSModeGet
/* HAPI */
#define ti_lib_hapi_crc32(a, b, c) HapiCrc32(a, b, c)
#define ti_lib_hapi_get_chip_id() HapiGetChipId()
#define ti_lib_hapi_reset_device() HapiResetDevice()
#define ti_lib_hapi_fletcher32(a, b, c) HapiFletcher32(a, b, c)
#define ti_lib_hapi_min_value(a, b) HapiMinValue(a,b)
#define ti_lib_hapi_max_value(a, b) HapiMaxValue(a,b)
#define ti_lib_hapi_mean_value(a, b) HapiMeanValue(a,b)
#define ti_lib_hapi_stand_deviation_value(a, b) HapiStandDeviationValue(a,b)
#define ti_lib_hapi_hf_source_safe_switch() HapiHFSourceSafeSwitch()
#define ti_lib_hapi_select_comp_a_input(a) HapiSelectCompAInput(a)
#define ti_lib_hapi_select_comp_a_ref(a) HapiSelectCompARef(a)
#define ti_lib_hapi_select_adc_comp_b_input(a) HapiSelectADCCompBInput(a)
#define ti_lib_hapi_select_comp_b_ref(a) HapiSelectCompBRef(a)
#define ti_lib_hapi_get_flash_size() HapiGetFlashSize()
#define ti_lib_hapi_sector_erase(a) HapiSectorErase(a)
#define ti_lib_hapi_program_flash(a, b, c) HapiProgramFlash(a, b, c)
/*---------------------------------------------------------------------------*/
/* sys_ctrl.h */
#include "driverlib/sys_ctrl.h"

View File

@ -42,13 +42,16 @@
#define CC26XX_WEB_DEMO_CONF_COAP_SERVER 1
#define CC26XX_WEB_DEMO_CONF_NET_UART 1
/*---------------------------------------------------------------------------*/
/* Enable the ROM bootloader */
#define ROM_BOOTLOADER_ENABLE 1
/*---------------------------------------------------------------------------*/
/*
* Shrink the size of the uIP buffer, routing table and ND cache.
* Set the TCP MSS
*/
#define UIP_CONF_BUFFER_SIZE 900
#define NBR_TABLE_CONF_MAX_NEIGHBORS 8
#define UIP_CONF_MAX_ROUTES 8
#define NBR_TABLE_CONF_MAX_NEIGHBORS 5
#define UIP_CONF_MAX_ROUTES 5
#define UIP_CONF_TCP_MSS 128
/*---------------------------------------------------------------------------*/
#endif /* PROJECT_CONF_H_ */

View File

@ -34,6 +34,9 @@
/* Disable button shutdown functionality */
#define BUTTON_SENSOR_CONF_ENABLE_SHUTDOWN 0
/*---------------------------------------------------------------------------*/
/* Enable the ROM bootloader */
#define ROM_BOOTLOADER_ENABLE 1
/*---------------------------------------------------------------------------*/
/* Change to match your configuration */
#define IEEE802154_CONF_PANID 0xABCD
#define RF_CORE_CONF_CHANNEL 25

View File

@ -35,6 +35,9 @@
#define IEEE802154_CONF_PANID 0xABCD
#define RF_CORE_CONF_CHANNEL 25
/*---------------------------------------------------------------------------*/
/* Enable the ROM bootloader */
#define ROM_BOOTLOADER_ENABLE 1
/*---------------------------------------------------------------------------*/
/* For very sleepy operation */
#define RF_BLE_CONF_ENABLED 0
#define UIP_DS6_CONF_PERIOD CLOCK_SECOND

View File

@ -107,23 +107,31 @@ If the `BOARD` variable is unspecified, an image for the Srf06 CC26XXEM will be
If you want to switch between building for one platform to the other, make certain to `make clean` before building for the new one, or you will get linker
errors.
If you want to upload the compiled firmware to a node via the serial boot loader you need to manually enable the boot loader and then use `make cc26xx-demo.upload`. On the SmartRF06 board you enable the boot loader by resetting the board (EM RESET button) while holding the `select` button. (The boot loader backdoor needs to be enabled on the chip, and the chip needs to be configured correctly, for this to work. See README in the `tools/cc2538-bsl` directory for more info). The serial uploader script will automatically pick the first available serial port. If this is not the port where your node is connected, you can force the script to use a specific port by defining the `PORT` argument eg. `make cc26xx-demo.upload PORT=/dev/tty.usbserial`
The serial bootloader can also be used with the LaunchPad and the changes required to achieve this are the same as those required for the SmartRF. The only difference is that you will need to map `BL_PIN_NUMBER` to either the left or right user button (values to be used for `BL_PIN_NUMBER` in `ccfg.c` are `0x0D` and `0x0E` respectively).
Note that uploading over serial doesn't work for the Sensortag, you can use TI's SmartRF Flash Programmer in this case.
For the `cc26xx-demo`, the included readme describes in detail what the example does.
To generate an assembly listing of the compiled firmware, run `make cc26xx-demo.lst`. This may be useful for debugging or optimizing your application code. To intersperse the C source code within the assembly listing, you must instruct the compiler to include debugging information by adding `CFLAGS += -g` to the project Makefile and rebuild by running `make clean cc26xx-demo.lst`.
How to Program your Device
--------------------------
To program your device on Windows, use TI's [SmartRF Flash Programmer][smart-rf-flashprog] (FLASH-PROGRAMMER-2).
On Linux and OS X, you can program your device via the chip's serial ROM boot loader. In order for this to work, the following conditions need to be met:
* The board can support the bootloader. This is the case for SmartRF06EB with CC26xx/CC13xx EMs and it is also the case for LaunchPads. Note that uploading over serial does not (and will not) work for the Sensortag.
* The chip is not programmed with a valid image, or the image has the bootloader backdoor unlocked. To enable the bootloader backdoor in your image, define `ROM_BOOTLOADER_ENABLE` to 1 in `contiki-conf.h`.
You will then need to manually enter the boot loader and use the `.upload` make target (e.g. `make cc26xx-demo.upload` for the `cc26xx-demo`). On the SmartRF06, you enter the boot loader by resetting the EM (EM RESET button) while holding the `select` button. For the LaunchPad, you enter the bootloader by resetting the chip while holding `BTN_1`. It is possible to change the pin and its corresponding level (High/Low) that will trigger bootloader mode by changing `SET_CCFG_BL_CONFIG_BL_LEVEL` and `SET_CCFG_BL_CONFIG_BL_PIN_NUMBER` in `board.h`.
The serial uploader script will automatically pick the first available serial port. If this is not the port where your node is connected, you can force the script to use a specific port by defining the `PORT` argument eg. `make cc26xx-demo.upload PORT=/dev/tty.usbserial`.
For more information on the serial bootloader, see its README under the `tools/cc2538-bsl` directory.
CC13xx/CC26xx Border Router over UART
=====================================
The platform code can be used as a border router (SLIP over UART) by using the
example under `examples/ipv6/rpl-border-router`. This example defines the
following:
#ifndef UIP_CONF_BUFFER_SIZE
#define UIP_CONF_BUFFER_SIZE 140
#endif
@ -234,3 +242,5 @@ The chip will come out of low power mode by one of the following events:
is an AON RTC Channel 2 compare interrupt.
* Rtimer triggers, as part of ContikiMAC's sleep/wake-up cycles. The rtimer
sits on the AON RTC channel 0.
[smart-rf-flashprog]: http://www.ti.com/tool/flash-programmer "SmartRF Flash Programmer"

View File

@ -94,7 +94,7 @@
static void
select_on_bus(void)
{
ti_lib_gpio_pin_write(BOARD_FLASH_CS, 0);
ti_lib_gpio_clear_dio(BOARD_IOID_FLASH_CS);
}
/*---------------------------------------------------------------------------*/
/**
@ -103,7 +103,7 @@ select_on_bus(void)
static void
deselect(void)
{
ti_lib_gpio_pin_write(BOARD_FLASH_CS, 1);
ti_lib_gpio_set_dio(BOARD_IOID_FLASH_CS);
}
/*---------------------------------------------------------------------------*/
/**

View File

@ -284,6 +284,19 @@
#endif
/** @} */
/*---------------------------------------------------------------------------*/
/**
* \name ROM Bootloader configuration
*
* Enable/Disable the ROM bootloader in your image, if the board supports it.
* Look in board.h to choose the DIO and corresponding level that will cause
* the chip to enter bootloader mode.
* @{
*/
#ifndef ROM_BOOTLOADER_ENABLE
#define ROM_BOOTLOADER_ENABLE 0
#endif
/** @} */
/*---------------------------------------------------------------------------*/
/**
* \name Button configurations
*

View File

@ -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;

View File

@ -150,6 +150,28 @@
#define BOARD_IOID_SDA IOID_5
/** @} */
/*---------------------------------------------------------------------------*/
/**
* \brief ROM bootloader configuration
*
* Change SET_CCFG_BL_CONFIG_BL_PIN_NUMBER to BOARD_IOID_KEY_xyz to select
* which button triggers the bootloader on reset.
*
* The remaining values are not meant to be modified by the user
* @{
*/
#if ROM_BOOTLOADER_ENABLE
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0xC5
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x00
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER BOARD_IOID_KEY_LEFT
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xC5
#else
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0x00
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x01
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER 0xFF
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xFF
#endif
/** @} */
/*---------------------------------------------------------------------------*/
/**
* \brief Remaining pins
*

View File

@ -150,6 +150,28 @@
#define BOARD_IOID_SDA IOID_5
/** @} */
/*---------------------------------------------------------------------------*/
/**
* \brief ROM bootloader configuration
*
* Change SET_CCFG_BL_CONFIG_BL_PIN_NUMBER to BOARD_IOID_KEY_xyz to select
* which button triggers the bootloader on reset.
*
* The remaining values are not meant to be modified by the user
* @{
*/
#if ROM_BOOTLOADER_ENABLE
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0xC5
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x00
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER BOARD_IOID_KEY_LEFT
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xC5
#else
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0x00
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x01
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER 0xFF
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xFF
#endif
/** @} */
/*---------------------------------------------------------------------------*/
/**
* \brief Remaining pins
*

View File

@ -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);
}
}
/*---------------------------------------------------------------------------*/

View File

@ -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);

View File

@ -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;

View File

@ -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);
}
}
/*---------------------------------------------------------------------------*/

View File

@ -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;

View File

@ -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);

View File

@ -59,18 +59,18 @@ config(int type, int enable)
ti_lib_ioc_pin_type_gpio_output(BOARD_IOID_ALS_PWR);
break;
case SENSORS_ACTIVE:
ti_lib_ioc_pin_type_gpio_output(BOARD_IOID_ALS_PWR);
ti_lib_ioc_port_configure_set(BOARD_IOID_ALS_OUT, IOC_PORT_GPIO,
IOC_STD_OUTPUT);
ti_lib_gpio_dir_mode_set(BOARD_ALS_OUT, GPIO_DIR_MODE_IN);
ti_lib_rom_ioc_pin_type_gpio_output(BOARD_IOID_ALS_PWR);
ti_lib_rom_ioc_port_configure_set(BOARD_IOID_ALS_OUT, IOC_PORT_GPIO,
IOC_STD_OUTPUT);
ti_lib_rom_ioc_pin_type_gpio_input(BOARD_IOID_ALS_OUT);
if(enable) {
ti_lib_gpio_pin_write(BOARD_ALS_PWR, 1);
ti_lib_gpio_set_dio(BOARD_IOID_ALS_PWR);
aux_ctrl_register_consumer(&als_aux);
ti_lib_aux_adc_select_input(ADC_COMPB_IN_AUXIO7);
clock_delay_usec(2000);
} else {
ti_lib_gpio_pin_write(BOARD_ALS_PWR, 0);
ti_lib_gpio_clear_dio(BOARD_IOID_ALS_PWR);
aux_ctrl_unregister_consumer(&als_aux);
}
break;

View File

@ -50,7 +50,7 @@ lpm_handler(uint8_t mode)
{
/* Ambient light sensor (off, output low) */
ti_lib_ioc_pin_type_gpio_output(BOARD_IOID_ALS_PWR);
ti_lib_gpio_pin_write(BOARD_ALS_PWR, 0);
ti_lib_gpio_clear_dio(BOARD_IOID_ALS_PWR);
ti_lib_ioc_pin_type_gpio_input(BOARD_IOID_ALS_OUT);
ti_lib_ioc_io_port_pull_set(BOARD_IOID_ALS_OUT, IOC_NO_IOPULL);
}
@ -77,11 +77,11 @@ configure_unused_pins(void)
{
/* Turn off 3.3-V domain (lcd/sdcard power, output low) */
ti_lib_ioc_pin_type_gpio_output(BOARD_IOID_3V3_EN);
ti_lib_gpio_pin_write(BOARD_3V3_EN, 0);
ti_lib_gpio_clear_dio(BOARD_IOID_3V3_EN);
/* Accelerometer (PWR output low, CSn output, high) */
ti_lib_ioc_pin_type_gpio_output(BOARD_IOID_ACC_PWR);
ti_lib_gpio_pin_write(BOARD_ACC_PWR, 0);
ti_lib_gpio_clear_dio(BOARD_IOID_ACC_PWR);
}
/*---------------------------------------------------------------------------*/
void

View File

@ -87,7 +87,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_SELECT) == 0) {
if(ti_lib_gpio_read_dio(BOARD_IOID_KEY_SELECT) == 0) {
sel_timer.start = clock_time();
sel_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_LEFT) == 0) {
if(ti_lib_gpio_read_dio(BOARD_IOID_KEY_LEFT) == 0) {
left_timer.start = clock_time();
left_timer.duration = 0;
} else {
@ -128,7 +128,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 {
@ -151,7 +151,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_UP) == 0) {
if(ti_lib_gpio_read_dio(BOARD_IOID_KEY_UP) == 0) {
up_timer.start = clock_time();
up_timer.duration = 0;
} else {
@ -171,7 +171,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_DOWN) == 0) {
if(ti_lib_gpio_read_dio(BOARD_IOID_KEY_DOWN) == 0) {
down_timer.start = clock_time();
down_timer.duration = 0;
} else {
@ -193,19 +193,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:
@ -327,7 +327,7 @@ static int
value_select(int type)
{
if(type == BUTTON_SENSOR_VALUE_STATE) {
return ti_lib_gpio_pin_read(BOARD_KEY_SELECT) == 0 ?
return ti_lib_gpio_read_dio(BOARD_IOID_KEY_SELECT) == 0 ?
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
return (int)sel_timer.duration;
@ -339,7 +339,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;
@ -351,7 +351,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;
@ -363,7 +363,7 @@ static int
value_up(int type)
{
if(type == BUTTON_SENSOR_VALUE_STATE) {
return ti_lib_gpio_pin_read(BOARD_KEY_UP) == 0 ?
return ti_lib_gpio_read_dio(BOARD_IOID_KEY_UP) == 0 ?
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
return (int)up_timer.duration;
@ -375,7 +375,7 @@ static int
value_down(int type)
{
if(type == BUTTON_SENSOR_VALUE_STATE) {
return ti_lib_gpio_pin_read(BOARD_KEY_DOWN) == 0 ?
return ti_lib_gpio_read_dio(BOARD_IOID_KEY_DOWN) == 0 ?
BUTTON_SENSOR_VALUE_PRESSED : BUTTON_SENSOR_VALUE_RELEASED;
} else if(type == BUTTON_SENSOR_VALUE_DURATION) {
return (int)down_timer.duration;

View File

@ -227,6 +227,28 @@
#define BOARD_ACC_MISO BOARD_SPI_MISO
/** @} */
/*---------------------------------------------------------------------------*/
/**
* \brief ROM bootloader configuration
*
* Change SET_CCFG_BL_CONFIG_BL_PIN_NUMBER to BOARD_IOID_KEY_xyz to select
* which button triggers the bootloader on reset.
*
* The remaining values are not meant to be modified by the user
* @{
*/
#if ROM_BOOTLOADER_ENABLE
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0xC5
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x00
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER BOARD_IOID_KEY_SELECT
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xC5
#else
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0x00
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x01
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER 0xFF
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xFF
#endif
/** @} */
/*---------------------------------------------------------------------------*/
/**
* \name Device string used on startup
* @{

View File

@ -227,6 +227,28 @@
#define BOARD_ACC_MISO BOARD_SPI_MISO
/** @} */
/*---------------------------------------------------------------------------*/
/**
* \brief ROM bootloader configuration
*
* Change SET_CCFG_BL_CONFIG_BL_PIN_NUMBER to BOARD_IOID_KEY_xyz to select
* which button triggers the bootloader on reset.
*
* The remaining values are not meant to be modified by the user
* @{
*/
#if ROM_BOOTLOADER_ENABLE
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0xC5
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x00
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER BOARD_IOID_KEY_SELECT
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xC5
#else
#define SET_CCFG_BL_CONFIG_BOOTLOADER_ENABLE 0x00
#define SET_CCFG_BL_CONFIG_BL_LEVEL 0x01
#define SET_CCFG_BL_CONFIG_BL_PIN_NUMBER 0xFF
#define SET_CCFG_BL_CONFIG_BL_ENABLE 0xFF
#endif
/** @} */
/*---------------------------------------------------------------------------*/
/**
* \name Device string used on startup
* @{

View File

@ -56,7 +56,7 @@ leds_arch_init(void)
ti_lib_ioc_pin_type_gpio_output(BOARD_IOID_LED_3);
ti_lib_ioc_pin_type_gpio_output(BOARD_IOID_LED_4);
ti_lib_gpio_pin_write(BOARD_LED_ALL, 0);
ti_lib_gpio_clear_multi_dio(BOARD_LED_ALL);
}
/*---------------------------------------------------------------------------*/
unsigned char
@ -71,19 +71,19 @@ leds_arch_set(unsigned char leds)
c = leds;
/* Clear everything */
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);
}
if((leds & LEDS_GREEN) == LEDS_GREEN) {
ti_lib_gpio_pin_write(BOARD_LED_3, 1);
ti_lib_gpio_set_dio(BOARD_IOID_LED_3);
}
if((leds & LEDS_ORANGE) == LEDS_ORANGE) {
ti_lib_gpio_pin_write(BOARD_LED_4, 1);
ti_lib_gpio_set_dio(BOARD_IOID_LED_4);
}
}
/*---------------------------------------------------------------------------*/