API for STK's
[BSP]

Collaboration diagram for API for STK's:

Data Structures

struct  BCP_Packet_
 BCP Packet Structure - Board controller communication protocol version 1. More...
struct  BCP_Packet
 BCP Packet Structure - Board controller communication protocol version 2. More...
struct  BCP_PacketHeader
 BCP Packet Header definition. More...

Defines

#define BSP_BCP_INVALID   0
 Invalid packet received.
#define BSP_BCP_FIRST   1
 Smallest numerical value of message type.
#define BSP_BCP_ACK   5
 Generic ACK for one way packages.
#define BSP_BCP_ECHO_REQ   10
 EFM32 BC alive request.
#define BSP_BCP_ECHO_REPLY   11
 BC alive response.
#define BSP_BCP_CURRENT_REQ   14
 EFM32 Request AEM current.
#define BSP_BCP_CURRENT_REPLY   16
 BC Response AEM current.
#define BSP_BCP_VOLTAGE_REQ   18
 EFM32 Request AEM voltage.
#define BSP_BCP_VOLTAGE_REPLY   20
 BC Response AEM voltage.
#define BSP_BCP_ENERGYMODE   22
 EFM32 Report Energy Mode (for AEM).
#define BSP_BCP_STDOUT   24
 Debug packet (not used).
#define BSP_BCP_STDERR   26
 Debug packet (not used).
#define BSP_BCP_TEST   32
 Reserved type for test.
#define BSP_BCP_TEST_REPLY   33
 Reserved type for test (reply).
#define BSP_BCP_NET_REQUEST   64
 Net gateway request packet.
#define BSP_BCP_NET_REPLY   65
 Net gateway reply packet.
#define BSP_BCP_LAST   100
 Last defined message type.
#define BSP_BCP_MAGIC   0xF1
 Magic byte to indicate start of packet.
#define BSP_BCP_PACKET_SIZe   30
 Max packet size for version 1 of the protocol.
#define BSP_BCP_PACKET_SIZE   132
 Max packet size for version 2 of the protocol.

Functions

int BSP_BccDeInit (void)
 Deinitialize board controller communication support (BCC) functionality.
int BSP_BccInit (void)
 Initialize board controller communication support (BCC) functionality.
bool BSP_BccPacketReceive (BCP_Packet *pkt)
 Get a packet from the board controller.
int BSP_BccPacketSend (BCP_Packet *pkt)
 Send a packet to the board controller.
void BSP_BccPinsEnable (bool enable)
 Enable GPIO pins for the USART/LEUART used for board communication.
int BSP_EbiInit (void)
 Initialize the EBI interface for accessing the onboard nandflash.
int BSP_EbiDeInit (void)
 Deinitialize the EBI interface for accessing the onboard nandflash.
float BSP_CurrentGet (void)
 Request AEM (Advanced Energy Monitoring) current from board controller.
float BSP_VoltageGet (void)
 Request AEM (Advanced Energy Monitoring) voltage from board controller.

Define Documentation

#define BSP_BCP_ACK   5

Generic ACK for one way packages.

Definition at line 38 of file bsp_bcp.h.

#define BSP_BCP_CURRENT_REPLY   16

BC Response AEM current.

Definition at line 42 of file bsp_bcp.h.

Referenced by BSP_CurrentGet().

#define BSP_BCP_CURRENT_REQ   14

EFM32 Request AEM current.

Definition at line 41 of file bsp_bcp.h.

Referenced by BSP_CurrentGet().

#define BSP_BCP_ECHO_REPLY   11

BC alive response.

Definition at line 40 of file bsp_bcp.h.

#define BSP_BCP_ECHO_REQ   10

EFM32 BC alive request.

Definition at line 39 of file bsp_bcp.h.

#define BSP_BCP_ENERGYMODE   22

EFM32 Report Energy Mode (for AEM).

Definition at line 45 of file bsp_bcp.h.

#define BSP_BCP_FIRST   1

Smallest numerical value of message type.

Definition at line 36 of file bsp_bcp.h.

Referenced by BSP_BccPacketReceive().

#define BSP_BCP_INVALID   0

Invalid packet received.

Definition at line 34 of file bsp_bcp.h.

#define BSP_BCP_LAST   100

Last defined message type.

Definition at line 53 of file bsp_bcp.h.

Referenced by BSP_BccPacketReceive().

#define BSP_BCP_MAGIC   0xF1

Magic byte to indicate start of packet.

Definition at line 55 of file bsp_bcp.h.

Referenced by BSP_BccPacketReceive(), and BSP_BccPacketSend().

#define BSP_BCP_NET_REPLY   65

Net gateway reply packet.

Definition at line 51 of file bsp_bcp.h.

#define BSP_BCP_NET_REQUEST   64

Net gateway request packet.

Definition at line 50 of file bsp_bcp.h.

#define BSP_BCP_PACKET_SIZE   132

Max packet size for version 2 of the protocol.

Definition at line 88 of file bsp_bcp.h.

Referenced by BSP_BccPacketReceive().

#define BSP_BCP_PACKET_SIZe   30

Max packet size for version 1 of the protocol.

Definition at line 64 of file bsp_bcp.h.

#define BSP_BCP_STDERR   26

Debug packet (not used).

Definition at line 47 of file bsp_bcp.h.

#define BSP_BCP_STDOUT   24

Debug packet (not used).

Definition at line 46 of file bsp_bcp.h.

#define BSP_BCP_TEST   32

Reserved type for test.

Definition at line 48 of file bsp_bcp.h.

#define BSP_BCP_TEST_REPLY   33

Reserved type for test (reply).

Definition at line 49 of file bsp_bcp.h.

#define BSP_BCP_VOLTAGE_REPLY   20

BC Response AEM voltage.

Definition at line 44 of file bsp_bcp.h.

Referenced by BSP_VoltageGet().

#define BSP_BCP_VOLTAGE_REQ   18

EFM32 Request AEM voltage.

Definition at line 43 of file bsp_bcp.h.

Referenced by BSP_VoltageGet().


Function Documentation

int BSP_BccDeInit ( void   ) 

Deinitialize board controller communication support (BCC) functionality.

Reverse actions performed by BSP_BccInit().

Returns:
BSP_STATUS_OK.

Definition at line 61 of file bsp_bcc.c.

References BSP_BccPinsEnable(), and BSP_STATUS_OK.

Here is the call graph for this function:

int BSP_BccInit ( void   ) 

Initialize board controller communication support (BCC) functionality.

Returns:
BSP_STATUS_OK.

Definition at line 89 of file bsp_bcc.c.

References BSP_BccPinsEnable(), and BSP_STATUS_OK.

Here is the call graph for this function:

bool BSP_BccPacketReceive ( BCP_Packet pkt  ) 

Get a packet from the board controller.

Parameters:
[in] pkt Pointer to a BCP_Packet instance.
Returns:
True if packet received without errors, false otherwise.

Definition at line 137 of file bsp_bcc.c.

References BSP_BCP_FIRST, BSP_BCP_LAST, BSP_BCP_MAGIC, BSP_BCP_PACKET_SIZE, BCP_Packet::magic, BCP_Packet::payloadLength, and BCP_Packet::type.

Referenced by BSP_CurrentGet(), and BSP_VoltageGet().

Here is the caller graph for this function:

int BSP_BccPacketSend ( BCP_Packet pkt  ) 

Send a packet to the board controller.

Parameters:
[in] pkt Pointer to a BCP_Packet instance.
Returns:
BSP_STATUS_OK.

Definition at line 195 of file bsp_bcc.c.

References BSP_BCP_MAGIC, BSP_STATUS_OK, BCP_Packet::data, BCP_Packet::magic, BCP_Packet::payloadLength, BCP_Packet::reserved, and BCP_Packet::type.

Referenced by BSP_CurrentGet(), and BSP_VoltageGet().

Here is the caller graph for this function:

void BSP_BccPinsEnable ( bool  enable  ) 

Enable GPIO pins for the USART/LEUART used for board communication.

Parameters:
[in] enable Set to true to enable pins, set to false to disable.

Definition at line 230 of file bsp_bcc.c.

Referenced by BSP_BccDeInit(), and BSP_BccInit().

Here is the caller graph for this function:

float BSP_CurrentGet ( void   ) 

Request AEM (Advanced Energy Monitoring) current from board controller.

Note:
Assumes that BSP_Init() has been called with BSP_INIT_BCC bitmask.
Returns:
The current expressed in milliamperes. Returns 0.0 on board controller communication error.

Definition at line 196 of file bsp_stk.c.

References BSP_BccPacketReceive(), BSP_BccPacketSend(), BSP_BCP_CURRENT_REPLY, BSP_BCP_CURRENT_REQ, BCP_Packet::data, BCP_Packet::payloadLength, and BCP_Packet::type.

Here is the call graph for this function:

int BSP_EbiDeInit ( void   ) 

Deinitialize the EBI interface for accessing the onboard nandflash.

Note:
This function is not relevant for Gxxx_STK's. This function is provided for API completeness, it does not perform an actual EBI deinitialization.
Returns:
BSP_STATUS_OK or BSP_STATUS_NOT_IMPLEMENTED

Definition at line 157 of file bsp_stk.c.

References BSP_STATUS_NOT_IMPLEMENTED, and BSP_STATUS_OK.

int BSP_EbiInit ( void   ) 

Initialize the EBI interface for accessing the onboard nandflash.

Note:
This function is not relevant for Gxxx_STK's.
Returns:
BSP_STATUS_OK or BSP_STATUS_NOT_IMPLEMENTED

Definition at line 64 of file bsp_stk.c.

References BSP_STATUS_NOT_IMPLEMENTED, and BSP_STATUS_OK.

float BSP_VoltageGet ( void   ) 

Request AEM (Advanced Energy Monitoring) voltage from board controller.

Note:
Assumes that BSP_Init() has been called with BSP_INIT_BCC bitmask.
Returns:
The voltage. Returns 0.0 on board controller communication error.

Definition at line 228 of file bsp_stk.c.

References BSP_BccPacketReceive(), BSP_BccPacketSend(), BSP_BCP_VOLTAGE_REPLY, BSP_BCP_VOLTAGE_REQ, BCP_Packet::data, BCP_Packet::payloadLength, and BCP_Packet::type.

Here is the call graph for this function: