49 #include "contiki-net.h" 54 #include "ieee-addr.h" 63 #include "sys/clock.h" 67 #include "lib/random.h" 68 #include "lib/sensors.h" 69 #include "button-sensor.h" 73 #include "board-peripherals.h" 75 #include "driverlib/driverlib_release.h" 81 #define LOG_MODULE "CC26xx/CC13xx" 82 #define LOG_LEVEL LOG_LEVEL_MAIN 87 #ifdef BOARD_CONF_HAS_SENSORS 88 #define BOARD_HAS_SENSORS BOARD_CONF_HAS_SENSORS 90 #define BOARD_HAS_SENSORS 1 98 for(k = 0; k < 800; ++k) {
99 j = k > 400 ? 800 - k : k;
102 for(i = 0; i < j; ++i) {
106 for(i = 0; i < 400 - j; ++i) {
117 #if MAC_CONF_WITH_BLE 119 NETSTACK_RADIO.set_object(RADIO_PARAM_64BIT_ADDR, ext_addr, 8);
124 short_addr = ext_addr[7];
125 short_addr |= ext_addr[6] << 8;
127 NETSTACK_RADIO.set_value(RADIO_PARAM_PAN_ID, IEEE802154_PANID);
128 NETSTACK_RADIO.set_value(RADIO_PARAM_16BIT_ADDR, short_addr);
130 NETSTACK_RADIO.set_object(RADIO_PARAM_64BIT_ADDR, ext_addr, 8);
138 ti_lib_vims_mode_set(VIMS_BASE, VIMS_MODE_ENABLED);
139 ti_lib_vims_configure(VIMS_BASE,
true,
true);
141 ti_lib_int_master_disable();
161 ti_lib_aon_ioc_freeze_disable();
162 HWREG(AON_SYSCTL_BASE + AON_SYSCTL_O_SLEEPCTL) = 1;
163 ti_lib_sys_ctrl_aon_sync();
165 ti_lib_int_enable(INT_AON_GPIO_EDGE);
166 ti_lib_int_master_enable();
178 #if CC26XX_UART_CONF_ENABLE 189 #if MAC_CONF_WITH_BLE 210 NETSTACK_RADIO.get_value(RADIO_PARAM_CHANNEL, &chan);
212 LOG_DBG(
"With DriverLib v%u.%u\n", DRIVERLIB_RELEASE_GROUP,
213 DRIVERLIB_RELEASE_BUILD);
214 LOG_INFO(BOARD_STRING
"\n");
215 LOG_DBG(
"IEEE 802.15.4: %s, Sub-GHz: %s, BLE: %s, Prop: %s\n",
216 ti_lib_chipinfo_supports_ieee_802_15_4() ==
true ?
"Yes" :
"No",
217 ti_lib_chipinfo_chip_family_is_cc13xx() ==
true ?
"Yes" :
"No",
218 ti_lib_chipinfo_supports_ble() ==
true ?
"Yes" :
"No",
219 ti_lib_chipinfo_supports_proprietary() ==
true ?
"Yes" :
"No");
220 LOG_INFO(
" RF: Channel %d", chan);
222 if(NETSTACK_RADIO.get_value(RADIO_PARAM_PAN_ID, &pan) == RADIO_RESULT_OK) {
223 LOG_INFO_(
", PANID 0x%04X", pan);
227 #if BOARD_HAS_SENSORS Header file for the cc2538 UART driver.
Header file with macros which rename TI CC26xxware functions.
void platform_init_stage_two()
Stage 2 of platform driver initialisation.
void platform_idle()
The platform's idle/sleep function.
void leds_init(void)
Initialise the LED HAL.
void oscillators_select_lf_xosc(void)
Set the LF clock source to be the LF XOSC.
Node-id (simple 16-bit identifiers) handling.
Header file for the CC13xx/CC26xx RF core driver.
int radio_value_t
Each radio has a set of parameters that designate the current configuration and state of the radio...
void leds_on(unsigned char leds)
Turn on multiple LEDs.
void leds_off(unsigned char leds)
Turn off multiple LEDs.
void ble_eui64_addr_cpy_to(uint8_t *dst)
Copy the node's EUI64 address that is based on its factory BLE address to a destination memory area...
void gpio_hal_init()
Initialise the GPIO HAL.
linkaddr_t linkaddr_node_addr
The link-layer address of the node.
void ieee_addr_cpy_to(uint8_t *dst, uint8_t len)
Copy the node's IEEE address to a destination memory area.
#define IEEE802154_DEFAULT_CHANNEL
The default channel for IEEE 802.15.4 networks.
Header file for the CC13xx/CC26xx oscillator control.
void lpm_drop()
Drop the cortex to sleep / deep sleep and shut down peripherals.
int serial_line_input_byte(unsigned char c)
Get one byte of input from the serial driver.
void board_init(void)
Board specific iniatialisation.
void cc26xx_uart_init()
Initialises the UART controller, configures I/O control and interrupts.
void soc_rtc_init(void)
Initialise the CC13XX/CC26XX AON RTC module.
Header file for the real-time timer module.
void cc26xx_uart_set_input(int(*input)(unsigned char c))
Assigns a callback to be called when the UART receives a byte.
802.15.4 frame creation and parsing functions
void platform_init_stage_three()
Final stage of platform driver initialisation.
Header file for the CC13xx/CC26xx UART driver.
void random_init(unsigned short seed)
Seed the cc2538 random number generator.
Generic serial I/O process header filer.
void lpm_init()
Initialise the low-power mode management module.
Header file for the GPIO HAL.
Header file for the logging system
Header file for the CC13xx/CC26xx AON RTC driver.
Header file for the LED HAL.
void platform_init_stage_one(void)
Basic (Stage 1) platform driver initialisation.
uint8_t leds_mask_t
An OR mask datatype to represents multiple LEDs.
void process_start(struct process *p, process_data_t data)
Start a process.