Skip to content

Commit 35a5612

Browse files
authored
Merge pull request #3934 from stevew817/siliconlabs/update_sdk_tbsense_12
[Silicon Labs] Update to HAL and devices
2 parents a49144a + d217357 commit 35a5612

File tree

779 files changed

+108594
-4578
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

779 files changed

+108594
-4578
lines changed

features/nanostack/FEATURE_NANOSTACK/targets/TARGET_SL_RAIL/NanostackRfPhyEfr32.cpp

Lines changed: 91 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ static const RAIL_CsmaConfig_t csma_config = RAIL_CSMA_CONFIG_802_15_4_2003_2p4_
6767
#if defined(TARGET_EFR32MG1)
6868
#include "ieee802154_subg_efr32xg1_configurator_out.h"
6969
#include "ieee802154_efr32xg1_configurator_out.h"
70+
#elif defined(TARGET_EFR32MG12)
71+
#include "ieee802154_efr32xg12_configurator_out.h"
7072
#else
7173
#error "Not a valid target."
7274
#endif
@@ -78,23 +80,23 @@ static const RAIL_ChannelConfigEntry_t entry[] = {
7880
};
7981

8082
#if MBED_CONF_SL_RAIL_BAND == 868
81-
#ifndef DEVICE_RF_SUBGHZ
83+
#ifndef MBED_CONF_SL_RAIL_HAS_SUBGIG
8284
#error "Sub-Gigahertz band is not supported on this target."
8385
#endif
8486
static const RAIL_ChannelConfig_t channels = {
8587
(RAIL_ChannelConfigEntry_t *) &entry[0],
8688
1
8789
};
8890
#elif MBED_CONF_SL_RAIL_BAND == 915
89-
#ifndef DEVICE_RF_SUBGHZ
91+
#ifndef MBED_CONF_SL_RAIL_HAS_SUBGIG
9092
#error "Sub-Gigahertz band is not supported on this target."
9193
#endif
9294
static const RAIL_ChannelConfig_t channels = {
9395
(RAIL_ChannelConfigEntry_t *) &entry[1],
9496
1
9597
};
9698
#elif MBED_CONF_SL_RAIL_BAND == 2400
97-
#ifndef DEVICE_RF_2P4GHZ
99+
#ifndef MBED_CONF_SL_RAIL_HAS_2P4
98100
#error "2.4GHz band is not supported on this target."
99101
#endif
100102
static const RAIL_ChannelConfig_t channels = {
@@ -111,7 +113,7 @@ static const RAIL_IEEE802154_Config_t config = { false, false,
111113

112114
static const RAIL_Init_t railInitParams = { 140, 38400000, RAIL_CAL_ALL_PENDING };
113115

114-
#if defined (DEVICE_RF_2P4GHZ)
116+
#if defined (MBED_CONF_SL_RAIL_HAS_2P4)
115117
// Set up the PA for 2.4 GHz operation
116118
static const RADIO_PAInit_t paInit2p4 = {
117119
PA_SEL_2P4_HP, /* Power Amplifier mode */
@@ -122,7 +124,7 @@ static const RADIO_PAInit_t paInit2p4 = {
122124
};
123125
#endif
124126

125-
#if defined (DEVICE_RF_SUBGHZ)
127+
#if defined (MBED_CONF_SL_RAIL_HAS_SUBGIG)
126128
// Set up the PA for sub-GHz operation
127129
static const RADIO_PAInit_t paInitSubGhz = {
128130
PA_SEL_SUBGIG, /* Power Amplifier mode */
@@ -173,21 +175,19 @@ static int8_t rf_device_register(void)
173175
#endif
174176

175177
// Set up PTI since it makes life so much easier
176-
#if defined(DEVICE_SL_PTI)
178+
#if defined(MBED_CONF_SL_RAIL_PTI) && (MBED_CONF_SL_RAIL_PTI == 1)
177179
RADIO_PTIInit_t ptiInit = {
178-
RADIO_PTI_MODE_UART,
179-
1600000,
180-
6,
181-
// TODO: Configure PTI pinout using config system.
182-
// Not very urgent, since all boards use the same pins now.
183-
gpioPortB,
184-
12,
185-
6,
186-
gpioPortB,
187-
11,
188-
6,
189-
gpioPortB,
190-
13,
180+
MBED_CONF_SL_RAIL_PTI_MODE,
181+
MBED_CONF_SL_RAIL_PTI_BAUDRATE,
182+
MBED_CONF_SL_RAIL_PTI_DOUT_LOCATION,
183+
MBED_CONF_SL_RAIL_PTI_DOUT_PORT,
184+
MBED_CONF_SL_RAIL_PTI_DOUT_PIN,
185+
MBED_CONF_SL_RAIL_PTI_DCLK_LOCATION,
186+
MBED_CONF_SL_RAIL_PTI_DCLK_PORT,
187+
MBED_CONF_SL_RAIL_PTI_DCLK_PIN,
188+
MBED_CONF_SL_RAIL_PTI_DFRAME_LOCATION,
189+
MBED_CONF_SL_RAIL_PTI_DFRAME_PORT,
190+
MBED_CONF_SL_RAIL_PTI_DFRAME_PIN
191191
};
192192

193193
RADIO_PTI_Init(&ptiInit);
@@ -196,13 +196,13 @@ static int8_t rf_device_register(void)
196196
// Set up RAIL
197197
RAIL_RfInit(&railInitParams);
198198
RAIL_ChannelConfig(&channels);
199-
#if MBED_CONF_SL_RAIL_BAND == 2400
199+
#if (MBED_CONF_SL_RAIL_BAND == 2400)
200200
RAIL_RadioConfig((void*) ieee802154_config_base);
201201
channel = 11;
202202
#elif (MBED_CONF_SL_RAIL_BAND == 915)
203203
RAIL_RadioConfig((void*) ieee802154_config_915);
204204
channel = 1;
205-
#elif MBED_CONF_SL_RAIL_BAND == 868
205+
#elif (MBED_CONF_SL_RAIL_BAND == 868)
206206
RAIL_RadioConfig((void*) ieee802154_config_863);
207207
channel = 0;
208208
#endif
@@ -286,8 +286,6 @@ static int8_t rf_start_cca(uint8_t *data_ptr, uint16_t data_length, uint8_t tx_h
286286
data_length + 3
287287
};
288288

289-
tr_debug("Called TX, len %d, chan %d\n", data_length, channel);
290-
291289
switch(radio_state) {
292290
case RADIO_UNINIT:
293291
tr_debug("Radio uninit\n");
@@ -327,6 +325,8 @@ static int8_t rf_start_cca(uint8_t *data_ptr, uint16_t data_length, uint8_t tx_h
327325
txOpt.waitForAck = false;
328326
}
329327

328+
//tr_debug("Called TX, len %d, chan %d, ack %d\n", data_length, channel, waiting_for_ack ? 1 : 0);
329+
330330
if(RAIL_TxStartWithOptions(channel, &txOpt, &RAIL_CcaCsma, (RAIL_CsmaConfig_t*) &csma_config) == 0) {
331331
//Save packet number and sequence
332332
current_tx_handle = tx_handle;
@@ -612,7 +612,6 @@ void RAILCb_RfReady(void) {
612612
* @param[in] status A bit field that defines what event caused the callback
613613
*/
614614
void RAILCb_TxRadioStatus(uint8_t status) {
615-
tr_debug("Packet TX error %d\n", status);
616615
if(device_driver.phy_tx_done_cb != NULL) {
617616
if(status == RAIL_TX_CONFIG_BUFFER_UNDERFLOW ||
618617
status == RAIL_TX_CONFIG_CHANNEL_BUSY ||
@@ -624,6 +623,8 @@ void RAILCb_TxRadioStatus(uint8_t status) {
624623
PHY_LINK_CCA_FAIL,
625624
8,
626625
1);
626+
} else {
627+
tr_debug("Packet TX error %d\n", status);
627628
}
628629
}
629630
radio_state = RADIO_RX;
@@ -643,7 +644,13 @@ void RAILCb_TxRadioStatus(uint8_t status) {
643644
* @param[in] status The event that triggered this callback
644645
*/
645646
void RAILCb_RxRadioStatus(uint8_t status) {
646-
tr_debug("RXE %d\n", status);
647+
switch(status) {
648+
case RAIL_RX_CONFIG_ADDRESS_FILTERED:
649+
break;
650+
default:
651+
tr_debug("RXE %d\n", status);
652+
break;
653+
}
647654
}
648655

649656
/**
@@ -724,10 +731,10 @@ void RAILCb_RxPacketReceived(void *rxPacketHandle) {
724731
/* Save the pending bit */
725732
last_ack_pending_bit = (rxPacketInfo->dataPtr[1] & (1 << 4)) != 0;
726733
/* Tell the stack we got an ACK */
727-
tr_debug("rACK\n");
734+
//tr_debug("rACK\n");
728735
device_driver.phy_tx_done_cb( rf_radio_driver_id,
729736
current_tx_handle,
730-
PHY_LINK_TX_DONE,
737+
last_ack_pending_bit ? PHY_LINK_TX_DONE_PENDING : PHY_LINK_TX_DONE,
731738
1,
732739
1);
733740
} else {
@@ -745,7 +752,7 @@ void RAILCb_RxPacketReceived(void *rxPacketHandle) {
745752
RAIL_AutoAckCancelAck();
746753
}
747754

748-
tr_debug("rPKT %d\n", rxPacketInfo->dataLength);
755+
//tr_debug("rPKT %d\n", rxPacketInfo->dataLength);
749756
/* Feed the received packet into the stack */
750757
device_driver.phy_rx_cb(rxPacketInfo->dataPtr + 1,
751758
rxPacketInfo->dataLength - 1,
@@ -785,6 +792,7 @@ void RAILCb_IEEE802154_DataRequestCommand(RAIL_IEEE802154_Address_t *address) {
785792
*/
786793
void RAILCb_RxAckTimeout(void) {
787794
if(waiting_for_ack) {
795+
tr_debug("nACK\n");
788796
waiting_for_ack = false;
789797
device_driver.phy_tx_done_cb( rf_radio_driver_id,
790798
current_tx_handle,
@@ -824,4 +832,59 @@ static bool rail_checkAndSwitchChannel(uint8_t newChannel) {
824832
} else {
825833
return false;
826834
}
835+
}
836+
837+
/**
838+
* Callback that fires when the receive fifo exceeds the configured threshold
839+
* value
840+
*
841+
* @param[in] bytesAvailable Number of bytes available in the receive fifo at
842+
* the time of the callback dispatch
843+
*
844+
* @return void
845+
* @warning You must implement a stub for this in your RAIL application.
846+
*
847+
* Callback that fires when the receive fifo exceeds the configured threshold
848+
* value. Provides the number of bytes available in the receive fifo at the
849+
* time of the callback dispatch.
850+
*/
851+
void RAILCb_RxFifoAlmostFull(uint16_t bytesAvailable) {
852+
tr_debug("RX near full (%d)\n", bytesAvailable);
853+
}
854+
855+
/**
856+
* Callback that fires when the transmit fifo falls under the configured
857+
* threshold value
858+
*
859+
* @param[in] spaceAvailable Number of bytes open in the transmit fifo at the
860+
* time of the callback dispatch
861+
*
862+
* @return void
863+
* @warning You must implement a stub for this in your RAIL application.
864+
*
865+
* Callback that fires when the transmit fifo falls under the configured
866+
* threshold value. It only fires if a rising edge occurs across this
867+
* threshold. This callback will not fire on initailization nor after resetting
868+
* the transmit fifo with RAIL_ResetFifo().
869+
*
870+
* Provides the number of bytes open in the transmit fifo at the time of the
871+
* callback dispatch.
872+
*/
873+
void RAILCb_TxFifoAlmostEmpty(uint16_t spaceAvailable) {
874+
tr_debug("TX near empty (%d)\n", spaceAvailable);
875+
}
876+
877+
/**
878+
* Callback for when AGC averaged RSSI is done
879+
*
880+
* @param avgRssi Contains the the RSSI in quarter dBm (dbm*4) on success and
881+
* returns \ref RAIL_RSSI_INVALID if there was a problem computing the result.
882+
*
883+
* Called in response to RAIL_StartAverageRSSI() to indicate that the hardware
884+
* has completed averaging. If you would like you can instead use the
885+
* RAIL_AverageRSSIReady() to wait for completion and RAIL_GetAverageRSSI() to
886+
* get the result.
887+
*/
888+
void RAILCb_RssiAverageDone(int16_t avgRssi) {
889+
tr_debug("RSSI done (%d)\n", avgRssi);
827890
}

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG/device/efm32gg230f1024.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
* @file efm32gg230f1024.h
33
* @brief CMSIS Cortex-M Peripheral Access Layer Header File
44
* for EFM32GG230F1024
5-
* @version 5.0.0
5+
* @version 5.1.2
66
******************************************************************************
77
* @section License
8-
* <b>Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com</b>
8+
* <b>Copyright 2017 Silicon Laboratories, Inc. http://www.silabs.com</b>
99
******************************************************************************
1010
*
1111
* Permission is granted to anyone to use this software for any purpose,
@@ -115,12 +115,14 @@ typedef enum IRQn
115115
******************************************************************************/
116116

117117
/** Part family */
118-
#define _EFM32_GIANT_FAMILY 1 /**< Giant/Leopard Gecko EFM32LG/GG MCU Family */
119-
#define _EFM_DEVICE /**< Silicon Labs EFM-type microcontroller */
120-
#define _SILICON_LABS_32B_SERIES_0 /**< Silicon Labs series number */
121-
#define _SILICON_LABS_32B_SERIES 0 /**< Silicon Labs series number */
122-
#define _SILICON_LABS_32B_PLATFORM_1 /**< Silicon Labs platform name */
123-
#define _SILICON_LABS_32B_PLATFORM 1 /**< Silicon Labs platform name */
118+
#define _EFM32_GIANT_FAMILY 1 /**< Giant/Leopard Gecko EFM32LG/GG MCU Family */
119+
#define _EFM_DEVICE /**< Silicon Labs EFM-type microcontroller */
120+
#define _SILICON_LABS_32B_SERIES_0 /**< Silicon Labs series number */
121+
#define _SILICON_LABS_32B_SERIES 0 /**< Silicon Labs series number */
122+
#define _SILICON_LABS_GECKO_INTERNAL_SDID 72 /** Silicon Labs internal use only, may change any time */
123+
#define _SILICON_LABS_GECKO_INTERNAL_SDID_72 /** Silicon Labs internal use only, may change any time */
124+
#define _SILICON_LABS_32B_PLATFORM_1 /**< @deprecated Silicon Labs platform name */
125+
#define _SILICON_LABS_32B_PLATFORM 1 /**< @deprecated Silicon Labs platform name */
124126

125127
/* If part number is not defined as compiler option, define it */
126128
#if !defined(EFM32GG230F1024)

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG/device/efm32gg230f512.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
* @file efm32gg230f512.h
33
* @brief CMSIS Cortex-M Peripheral Access Layer Header File
44
* for EFM32GG230F512
5-
* @version 5.0.0
5+
* @version 5.1.2
66
******************************************************************************
77
* @section License
8-
* <b>Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com</b>
8+
* <b>Copyright 2017 Silicon Laboratories, Inc. http://www.silabs.com</b>
99
******************************************************************************
1010
*
1111
* Permission is granted to anyone to use this software for any purpose,
@@ -115,12 +115,14 @@ typedef enum IRQn
115115
******************************************************************************/
116116

117117
/** Part family */
118-
#define _EFM32_GIANT_FAMILY 1 /**< Giant/Leopard Gecko EFM32LG/GG MCU Family */
119-
#define _EFM_DEVICE /**< Silicon Labs EFM-type microcontroller */
120-
#define _SILICON_LABS_32B_SERIES_0 /**< Silicon Labs series number */
121-
#define _SILICON_LABS_32B_SERIES 0 /**< Silicon Labs series number */
122-
#define _SILICON_LABS_32B_PLATFORM_1 /**< Silicon Labs platform name */
123-
#define _SILICON_LABS_32B_PLATFORM 1 /**< Silicon Labs platform name */
118+
#define _EFM32_GIANT_FAMILY 1 /**< Giant/Leopard Gecko EFM32LG/GG MCU Family */
119+
#define _EFM_DEVICE /**< Silicon Labs EFM-type microcontroller */
120+
#define _SILICON_LABS_32B_SERIES_0 /**< Silicon Labs series number */
121+
#define _SILICON_LABS_32B_SERIES 0 /**< Silicon Labs series number */
122+
#define _SILICON_LABS_GECKO_INTERNAL_SDID 72 /** Silicon Labs internal use only, may change any time */
123+
#define _SILICON_LABS_GECKO_INTERNAL_SDID_72 /** Silicon Labs internal use only, may change any time */
124+
#define _SILICON_LABS_32B_PLATFORM_1 /**< @deprecated Silicon Labs platform name */
125+
#define _SILICON_LABS_32B_PLATFORM 1 /**< @deprecated Silicon Labs platform name */
124126

125127
/* If part number is not defined as compiler option, define it */
126128
#if !defined(EFM32GG230F512)

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG/device/efm32gg232f1024.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
* @file efm32gg232f1024.h
33
* @brief CMSIS Cortex-M Peripheral Access Layer Header File
44
* for EFM32GG232F1024
5-
* @version 5.0.0
5+
* @version 5.1.2
66
******************************************************************************
77
* @section License
8-
* <b>Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com</b>
8+
* <b>Copyright 2017 Silicon Laboratories, Inc. http://www.silabs.com</b>
99
******************************************************************************
1010
*
1111
* Permission is granted to anyone to use this software for any purpose,
@@ -115,12 +115,14 @@ typedef enum IRQn
115115
******************************************************************************/
116116

117117
/** Part family */
118-
#define _EFM32_GIANT_FAMILY 1 /**< Giant/Leopard Gecko EFM32LG/GG MCU Family */
119-
#define _EFM_DEVICE /**< Silicon Labs EFM-type microcontroller */
120-
#define _SILICON_LABS_32B_SERIES_0 /**< Silicon Labs series number */
121-
#define _SILICON_LABS_32B_SERIES 0 /**< Silicon Labs series number */
122-
#define _SILICON_LABS_32B_PLATFORM_1 /**< Silicon Labs platform name */
123-
#define _SILICON_LABS_32B_PLATFORM 1 /**< Silicon Labs platform name */
118+
#define _EFM32_GIANT_FAMILY 1 /**< Giant/Leopard Gecko EFM32LG/GG MCU Family */
119+
#define _EFM_DEVICE /**< Silicon Labs EFM-type microcontroller */
120+
#define _SILICON_LABS_32B_SERIES_0 /**< Silicon Labs series number */
121+
#define _SILICON_LABS_32B_SERIES 0 /**< Silicon Labs series number */
122+
#define _SILICON_LABS_GECKO_INTERNAL_SDID 72 /** Silicon Labs internal use only, may change any time */
123+
#define _SILICON_LABS_GECKO_INTERNAL_SDID_72 /** Silicon Labs internal use only, may change any time */
124+
#define _SILICON_LABS_32B_PLATFORM_1 /**< @deprecated Silicon Labs platform name */
125+
#define _SILICON_LABS_32B_PLATFORM 1 /**< @deprecated Silicon Labs platform name */
124126

125127
/* If part number is not defined as compiler option, define it */
126128
#if !defined(EFM32GG232F1024)

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG/device/efm32gg232f512.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
* @file efm32gg232f512.h
33
* @brief CMSIS Cortex-M Peripheral Access Layer Header File
44
* for EFM32GG232F512
5-
* @version 5.0.0
5+
* @version 5.1.2
66
******************************************************************************
77
* @section License
8-
* <b>Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com</b>
8+
* <b>Copyright 2017 Silicon Laboratories, Inc. http://www.silabs.com</b>
99
******************************************************************************
1010
*
1111
* Permission is granted to anyone to use this software for any purpose,
@@ -115,12 +115,14 @@ typedef enum IRQn
115115
******************************************************************************/
116116

117117
/** Part family */
118-
#define _EFM32_GIANT_FAMILY 1 /**< Giant/Leopard Gecko EFM32LG/GG MCU Family */
119-
#define _EFM_DEVICE /**< Silicon Labs EFM-type microcontroller */
120-
#define _SILICON_LABS_32B_SERIES_0 /**< Silicon Labs series number */
121-
#define _SILICON_LABS_32B_SERIES 0 /**< Silicon Labs series number */
122-
#define _SILICON_LABS_32B_PLATFORM_1 /**< Silicon Labs platform name */
123-
#define _SILICON_LABS_32B_PLATFORM 1 /**< Silicon Labs platform name */
118+
#define _EFM32_GIANT_FAMILY 1 /**< Giant/Leopard Gecko EFM32LG/GG MCU Family */
119+
#define _EFM_DEVICE /**< Silicon Labs EFM-type microcontroller */
120+
#define _SILICON_LABS_32B_SERIES_0 /**< Silicon Labs series number */
121+
#define _SILICON_LABS_32B_SERIES 0 /**< Silicon Labs series number */
122+
#define _SILICON_LABS_GECKO_INTERNAL_SDID 72 /** Silicon Labs internal use only, may change any time */
123+
#define _SILICON_LABS_GECKO_INTERNAL_SDID_72 /** Silicon Labs internal use only, may change any time */
124+
#define _SILICON_LABS_32B_PLATFORM_1 /**< @deprecated Silicon Labs platform name */
125+
#define _SILICON_LABS_32B_PLATFORM 1 /**< @deprecated Silicon Labs platform name */
124126

125127
/* If part number is not defined as compiler option, define it */
126128
#if !defined(EFM32GG232F512)

0 commit comments

Comments
 (0)