25 #if defined( BSP_BCC_LEUART )
31 #if defined( BSP_STK )
36 static uint32_t rxByteCount;
37 static uint32_t txByteCount;
40 static void TxByte( uint8_t data );
41 static uint8_t RxByte(
void );
64 rxByteCount = 0xFFFFFFFFUL;
65 txByteCount = 0xFFFFFFFFUL;
69 #if defined( BSP_BCC_LEUART )
91 #if defined( BSP_BCC_LEUART )
109 #if defined( BSP_BCC_LEUART )
144 bptr = (uint8_t *) pkt;
167 #if ( BSP_BCP_VERSION == 2 )
180 for( i=0; i<length; i++ )
203 TxByte( pkt->
magic );
211 #if ( BSP_BCP_VERSION == 2 )
219 TxByte( pkt->
data[i] );
241 #if defined(BSP_BCC_ENABLE_PORT)
246 #if defined( BSP_BCC_LEUART )
250 #if defined( USART_ROUTEPEN_TXPEN )
251 BSP_BCC_USART->ROUTEPEN = USART_ROUTEPEN_TXPEN | USART_ROUTEPEN_RXPEN;
252 BSP_BCC_USART->ROUTELOC0 =
253 ( BSP_BCC_USART->ROUTELOC0 &
254 ~( _USART_ROUTELOC0_TXLOC_MASK | _USART_ROUTELOC0_RXLOC_MASK ) )
255 | ( BSP_BCC_TX_LOCATION << _USART_ROUTELOC0_TXLOC_SHIFT )
256 | ( BSP_BCC_RX_LOCATION << _USART_ROUTELOC0_RXLOC_SHIFT );
264 #if defined(BSP_BCC_ENABLE_PORT)
267 #if defined( BSP_BCC_LEUART )
270 #if defined( USART_ROUTEPEN_TXPEN )
271 BSP_BCC_USART->ROUTEPEN &= ~(USART_ROUTEPEN_TXPEN | USART_ROUTEPEN_RXPEN);
285 static uint8_t RxByte(
void )
291 #if defined( BSP_BCC_LEUART )
293 byte = BSP_BCC_LEUART->RXDATA;
296 byte = BSP_BCC_USART->RXDATA;
303 static void TxByte( uint8_t data )
307 #if defined( BSP_BCC_LEUART )
309 BSP_BCC_LEUART->TXDATA = (uint32_t) data;
312 BSP_BCC_USART->TXDATA = (uint32_t) data;
Clock management unit (CMU) API.
void CMU_ClockSelectSet(CMU_Clock_TypeDef clock, CMU_Select_TypeDef ref)
Select reference clock/oscillator used for a clock branch.
#define USART_STATUS_TXBL
Board support package API definitions.
BCP Packet Structure - Board controller communication protocol version 2.
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
Universal synchronous/asynchronous receiver/transmitter (USART/UART) peripheral API.
void LEUART_Init(LEUART_TypeDef *leuart, LEUART_Init_TypeDef const *init)
Init LEUART.
#define USART_STATUS_RXDATAV
#define LEUART_IF_RXDATAV
void BSP_BccPinsEnable(bool enable)
Enable GPIO pins for the USART/LEUART used for board communication.
void GPIO_PinModeSet(GPIO_Port_TypeDef port, unsigned int pin, GPIO_Mode_TypeDef mode, unsigned int out)
Set the mode for a GPIO pin.
General Purpose IO (GPIO) peripheral API.
#define USART_ROUTE_RXPEN
int BSP_BccInit(void)
Initialize board controller communication support (BCC) functionality.
#define LEUART_ROUTE_RXPEN
void CMU_ClockEnable(CMU_Clock_TypeDef clock, bool enable)
Enable/disable a clock.
uint8_t data[BSP_BCP_PACKET_SIZE]
Low Energy Universal Asynchronous Receiver/Transmitter (LEUART) peripheral API.
void LEUART_Reset(LEUART_TypeDef *leuart)
Reset LEUART to same state as after a HW reset.
#define BSP_BCP_PACKET_SIZE
int BSP_BccPacketSend(BCP_Packet *pkt)
Send a packet to the board controller.
void USART_Reset(USART_TypeDef *usart)
Reset USART/UART to same state as after a HW reset.
#define USART_ROUTE_TXPEN
#define USART_INITASYNC_DEFAULT
#define LEUART_STATUS_TXBL
#define LEUART_ROUTE_TXPEN
void USART_InitAsync(USART_TypeDef *usart, const USART_InitAsync_TypeDef *init)
Init USART/UART for normal asynchronous mode.
#define LEUART_INIT_DEFAULT
bool BSP_BccPacketReceive(BCP_Packet *pkt)
Get a packet from the board controller.
int BSP_BccDeInit(void)
Deinitialize board controller communication support (BCC) functionality. Reverse actions performed by...