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 )
247 BSP_BCC_LEUART->ROUTE |= LEUART_ROUTE_RXPEN | LEUART_ROUTE_TXPEN | BSP_BCC_LOCATION;
250 #if defined( USART_ROUTEPEN_TXPEN )
252 BSP_BCC_USART->ROUTELOC0 =
253 ( BSP_BCC_USART->ROUTELOC0 &
258 BSP_BCC_USART->ROUTE |= USART_ROUTE_RXPEN | USART_ROUTE_TXPEN | BSP_BCC_LOCATION;
264 #if defined(BSP_BCC_ENABLE_PORT)
267 #if defined( BSP_BCC_LEUART )
268 BSP_BCC_LEUART->ROUTE &= ~(LEUART_ROUTE_RXPEN | LEUART_ROUTE_TXPEN);
270 #if defined( USART_ROUTEPEN_TXPEN )
273 BSP_BCC_USART->ROUTE &= ~(USART_ROUTE_RXPEN | USART_ROUTE_TXPEN);
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.
Board support package API definitions.
#define _USART_ROUTELOC0_RXLOC_SHIFT
#define _USART_ROUTELOC0_TXLOC_SHIFT
BCP Packet Structure - Board controller communication protocol version 2.
#define USART_ROUTEPEN_TXPEN
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_ROUTELOC0_RXLOC_MASK
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 LEUART_IF_RXDATAV
int BSP_BccInit(void)
Initialize board controller communication support (BCC) functionality.
#define LEUART_STATUS_TXBL
void CMU_ClockEnable(CMU_Clock_TypeDef clock, bool enable)
Enable/disable a clock.
uint8_t data[BSP_BCP_PACKET_SIZE]
#define USART_STATUS_TXBL
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_INITASYNC_DEFAULT
#define USART_ROUTEPEN_RXPEN
void USART_InitAsync(USART_TypeDef *usart, const USART_InitAsync_TypeDef *init)
Init USART/UART for normal asynchronous mode.
#define USART_STATUS_RXDATAV
#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...
#define _USART_ROUTELOC0_TXLOC_MASK