API common for all kits
[BSP]

Collaboration diagram for API common for all kits:

Defines

#define BSP_STATUS_OK   0
 BSP API return code, no errors.
#define BSP_STATUS_ILLEGAL_PARAM   (-1)
 BSP API return code, illegal input parameter.
#define BSP_STATUS_NOT_IMPLEMENTED   (-2)
 BSP API return code, function not implemented (dummy).
#define BSP_STATUS_UNSUPPORTED_MODE   (-3)
 BSP API return code, unsupported BSP mode.
#define BSP_INIT_DK_SPI   0x01
 Mode flag for BSP_Init(), init DK in SPI mode (DK3x50 only).
#define BSP_INIT_DK_EBI   0x02
 Mode flag for BSP_Init(), init DK in EBI mode (DK3x50 only).
#define BSP_INIT_BCC   0x04
 Mode flag for BSP_Init(), init board controller communication.

Functions

int BSP_Disable (void)
 Deinitialize board support package functionality.
int BSP_Init (uint32_t flags)
 Initialize board support package functionality.
int BSP_LedsInit (void)
 Initialize LED drivers.
uint32_t BSP_LedsGet (void)
 Get status of all LED's.
int BSP_LedsSet (uint32_t leds)
 Update all LED's.
int BSP_LedClear (int ledNo)
 Turn off a single LED.
int BSP_LedGet (int ledNo)
 Get current status of a single LED.
int BSP_LedSet (int ledNo)
 Turn on a single LED.
int BSP_LedToggle (int ledNo)
 Toggle a single LED.
void BSP_TraceEtmSetup (void)
 Configure EFM32 for ETM trace output.
bool BSP_TraceProfilerSetup (void)
 Profiler configuration.
void BSP_TraceSwoSetup (void)
 Configure trace output for energyAware Profiler.
__STATIC_INLINE void BSP_TraceProfilerEnable (bool enable)
 Set or clear word in user page which enables or disables SWO in BSP_TraceProfilerSetup.

Define Documentation

#define BSP_INIT_BCC   0x04

Mode flag for BSP_Init(), init board controller communication.

Definition at line 58 of file bsp.h.

#define BSP_INIT_DK_EBI   0x02

Mode flag for BSP_Init(), init DK in EBI mode (DK3x50 only).

Definition at line 57 of file bsp.h.

Referenced by BSP_Disable(), BSP_Init(), BSP_RegisterRead(), and BSP_RegisterWrite().

#define BSP_INIT_DK_SPI   0x01

Mode flag for BSP_Init(), init DK in SPI mode (DK3x50 only).

Definition at line 56 of file bsp.h.

Referenced by BSP_Disable(), and BSP_Init().

#define BSP_STATUS_ILLEGAL_PARAM   (-1)

BSP API return code, illegal input parameter.

Definition at line 51 of file bsp.h.

Referenced by BSP_BusControlModeSet(), BSP_LedClear(), BSP_LedGet(), BSP_LedSet(), and BSP_LedToggle().

#define BSP_STATUS_NOT_IMPLEMENTED   (-2)

BSP API return code, function not implemented (dummy).

Definition at line 52 of file bsp.h.

Referenced by BSP_EbiDeInit(), BSP_EbiInit(), BSP_McuBoard_UsbStatusLedEnable(), and BSP_McuBoard_UsbVbusPowerEnable().

#define BSP_STATUS_OK   0
#define BSP_STATUS_UNSUPPORTED_MODE   (-3)

BSP API return code, unsupported BSP mode.

Definition at line 53 of file bsp.h.


Function Documentation

int BSP_Disable ( void   ) 

Deinitialize board support package functionality.

Reverse actions performed by BSP_Init(). This function is a dummy on STK's.

Returns:
BSP_STATUS_OK on DK's, BSP_STATUS_NOT_IMPLEMENTED on STK's.

Definition at line 113 of file bsp_dk_3201.c.

References BSP_BusControl_OFF, BSP_BusControlModeSet(), BSP_INIT_DK_EBI, BSP_INIT_DK_SPI, and BSP_STATUS_OK.

Here is the call graph for this function:

int BSP_Init ( uint32_t  flags  ) 

Initialize board support package functionality.

Parameters:
[in] flags DK3x50: Initialize in EBI or SPI mode using BSP_INIT_DK_EBI or BSP_INIT_DK_SPI. Gxxx_DK: Use 0. STK: Use BSP_INIT_BCC to initialize board controller UART, 0 otherwise.

The value BSP_INIT_DEFAULT is defined and is: BSP_INIT_DK_EBI on DK3x50, 0 on all other kits.

Returns:
BSP_STATUS_OK

Definition at line 143 of file bsp_dk_3201.c.

References BC_REGISTER, BSP_BusControl_EBI, BSP_BusControl_SPI, BSP_BusControlModeSet(), BSP_INIT_DK_EBI, BSP_INIT_DK_SPI, BSP_RegisterWrite(), and BSP_STATUS_OK.

Here is the call graph for this function:

int BSP_LedClear ( int  ledNo  ) 

Turn off a single LED.

Parameters:
[in] ledNo The number of the LED (counting from zero) to turn off.
Returns:
BSP_STATUS_OK or BSP_STATUS_ILLEGAL_PARAM if illegal LED number.

Definition at line 85 of file bsp_dk_leds.c.

References BSP_RegisterRead(), BSP_RegisterWrite(), BSP_STATUS_ILLEGAL_PARAM, and BSP_STATUS_OK.

Here is the call graph for this function:

int BSP_LedGet ( int  ledNo  ) 

Get current status of a single LED.

Parameters:
[in] ledNo The number of the LED (counting from zero) to check.
Returns:
1 if LED is on, 0 if LED is off, BSP_STATUS_ILLEGAL_PARAM if illegal LED number.

Definition at line 106 of file bsp_dk_leds.c.

References BSP_RegisterRead(), and BSP_STATUS_ILLEGAL_PARAM.

Here is the call graph for this function:

int BSP_LedSet ( int  ledNo  ) 

Turn on a single LED.

Parameters:
[in] ledNo The number of the LED (counting from zero) to turn on.
Returns:
BSP_STATUS_OK or BSP_STATUS_ILLEGAL_PARAM if illegal LED number.

Definition at line 124 of file bsp_dk_leds.c.

References BSP_RegisterRead(), BSP_RegisterWrite(), BSP_STATUS_ILLEGAL_PARAM, and BSP_STATUS_OK.

Here is the call graph for this function:

uint32_t BSP_LedsGet ( void   ) 

Get status of all LED's.

Returns:
Bitmask with current status for all LED's.

Definition at line 61 of file bsp_dk_leds.c.

References BSP_RegisterRead().

Here is the call graph for this function:

int BSP_LedsInit ( void   ) 

Initialize LED drivers.

Note:
LED's are initially turned off.
Returns:
BSP_STATUS_OK

Definition at line 50 of file bsp_dk_leds.c.

References BSP_RegisterWrite(), and BSP_STATUS_OK.

Here is the call graph for this function:

int BSP_LedsSet ( uint32_t  leds  ) 

Update all LED's.

Parameters:
[in] leds Bitmask representing new status for all LED's. A 1 turns a LED on, a 0 turns a LED off.
Returns:
BSP_STATUS_OK

Definition at line 73 of file bsp_dk_leds.c.

References BSP_RegisterWrite(), and BSP_STATUS_OK.

Here is the call graph for this function:

int BSP_LedToggle ( int  ledNo  ) 

Toggle a single LED.

Parameters:
[in] ledNo The number of the LED (counting from zero) to toggle.
Returns:
BSP_STATUS_OK or BSP_STATUS_ILLEGAL_PARAM if illegal LED number.

Definition at line 144 of file bsp_dk_leds.c.

References BSP_RegisterRead(), BSP_RegisterWrite(), BSP_STATUS_ILLEGAL_PARAM, and BSP_STATUS_OK.

Here is the call graph for this function:

void BSP_TraceEtmSetup ( void   ) 

Configure EFM32 for ETM trace output.

Note:
You need to configure ETM trace on kit config menu as well!

Definition at line 47 of file bsp_trace.c.

__STATIC_INLINE void BSP_TraceProfilerEnable ( bool  enable  ) 

Set or clear word in user page which enables or disables SWO in BSP_TraceProfilerSetup.

If BSP_TraceProfilerEnable(false) has been run, no example project will enable SWO trace.

Parameters:
[in] enable 
Note:
Add "em_msc.c" to build to use this function.

Definition at line 74 of file bsp_trace.h.

bool BSP_TraceProfilerSetup ( void   ) 

Profiler configuration.

Returns:
true if energyAware Profiler/SWO is enabled, false if not
Note:
If first word of the user page is zero, this will not enable SWO profiler output.

Definition at line 123 of file bsp_trace.c.

References BSP_TraceSwoSetup().

Here is the call graph for this function:

void BSP_TraceSwoSetup ( void   ) 

Configure trace output for energyAware Profiler.

Note:
Enabling trace will add 80uA current for the EFM32_Gxxx_STK. DK's needs to be initialized with SPI-mode:
BSP_Init(BSP_INIT_DK_SPI); 

Definition at line 79 of file bsp_trace.c.

Referenced by BSP_TraceProfilerSetup().

Here is the caller graph for this function: