EFM32 Pearl Gecko 12 Software Documentation  efm32pg12-doc-5.1.2
bsp_bcp.h
Go to the documentation of this file.
1 /**************************************************************************/
18 #ifndef __BSP_BCP_H
19 #define __BSP_BCP_H
20 #include <stdint.h>
21 
22 #include "bspconfig.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /***************************************************************************/
32 /***************************************************************************/
37 /* BCP Packet Types */
38 #define BSP_BCP_INVALID 0
40 #define BSP_BCP_FIRST 1
42 #define BSP_BCP_ACK 5
43 #define BSP_BCP_ECHO_REQ 10
44 #define BSP_BCP_ECHO_REPLY 11
45 #define BSP_BCP_CURRENT_REQ 14
46 #define BSP_BCP_CURRENT_REPLY 16
47 #define BSP_BCP_VOLTAGE_REQ 18
48 #define BSP_BCP_VOLTAGE_REPLY 20
49 #define BSP_BCP_ENERGYMODE 22
50 #define BSP_BCP_STDOUT 24
51 #define BSP_BCP_STDERR 26
52 #define BSP_BCP_TEST 32
53 #define BSP_BCP_TEST_REPLY 33
54 #define BSP_BCP_NET_REQUEST 64
55 #define BSP_BCP_NET_REPLY 65
57 #define BSP_BCP_LAST 100
59 #define BSP_BCP_MAGIC 0xF1
64 #if ( ( BSP_BCP_VERSION == 1 ) || DOXY_DOC_ONLY )
65 
66 #ifdef DOXY_DOC_ONLY
67  /* Hack for doxygen doc ! */
68 #define BSP_BCP_PACKET_SIZe 30
69 #else
70 #define BSP_BCP_PACKET_SIZE 30
71 #endif
72 
74 typedef struct
75 {
76  uint8_t magic;
77  uint8_t type;
78  uint8_t payloadLength;
79  uint8_t data[BSP_BCP_PACKET_SIZE];
80 #ifdef DOXY_DOC_ONLY
81 } BCP_Packet_; /* Hack for doxygen doc ! */
82 #else
83 } BCP_Packet;
84 #endif
85 #endif
86 
87 
88 
89 
90 #if ( ( BSP_BCP_VERSION == 2 ) || DOXY_DOC_ONLY )
91 
92 #define BSP_BCP_PACKET_SIZE 132
95 typedef struct
96 {
97  uint8_t magic;
98  uint8_t type;
99  uint8_t payloadLength;
100  uint8_t reserved;
101  uint8_t data[BSP_BCP_PACKET_SIZE];
102 } BCP_Packet;
103 
105 typedef struct
106 {
107  uint8_t magic;
108  uint8_t type;
109  uint8_t payloadLength;
110  uint8_t reserved;
112 #endif
113 
114 
115 
116 
117 #if ( ( BSP_BCP_VERSION != 1 ) && ( BSP_BCP_VERSION != 2 ) )
118 #error "BSP BCP Board Controller communications protocol version error."
119 #endif
120 
121 #if ( BSP_BCP_PACKET_SIZE >= 255 )
122 #error "BSP BCP Board Controller communications packets must be less than 255 bytes in size!"
123 #endif
124 
128 #ifdef __cplusplus
129 }
130 #endif
131 
132 #endif /* __BSP_BCP_H */
uint8_t payloadLength
Definition: bsp_bcp.h:78
BCP Packet Structure - Board controller communication protocol version 1.
Definition: bsp_bcp.h:74
BCP Packet Structure - Board controller communication protocol version 2.
Definition: bsp_bcp.h:95
uint8_t magic
Definition: bsp_bcp.h:97
uint8_t payloadLength
Definition: bsp_bcp.h:99
uint8_t reserved
Definition: bsp_bcp.h:100
uint8_t magic
Definition: bsp_bcp.h:76
uint8_t type
Definition: bsp_bcp.h:108
uint8_t reserved
Definition: bsp_bcp.h:110
uint8_t magic
Definition: bsp_bcp.h:107
#define BSP_BCP_PACKET_SIZE
Definition: bsp_bcp.h:92
uint8_t type
Definition: bsp_bcp.h:77
uint8_t type
Definition: bsp_bcp.h:98
uint8_t payloadLength
Definition: bsp_bcp.h:109
BCP Packet Header definition.
Definition: bsp_bcp.h:105