MAX20361 Demo Firmware

Dependencies:   SX1276GenericLib USBDevice

Fork of PICO_LoRa_Module_developing by Walter Luu

Committer:
walterluu
Date:
Wed Oct 14 00:19:02 2020 +0000
Revision:
6:51f492ca61a2
Parent:
5:9e751733a6f3
Firmware Oct13

Who changed what in which revision?

UserRevisionLine numberNew contents of line
walterluu 3:85fc843a9d7d 1 /** Description:
walterluu 3:85fc843a9d7d 2 * This File is responsible for defining the buffers that will be used in
walterluu 3:85fc843a9d7d 3 * various areas of the program. The buffers that are defined here will be
walterluu 3:85fc843a9d7d 4 * refferenced in the main.cpp and will be filled with data in one of two ways:
walterluu 3:85fc843a9d7d 5 *
walterluu 3:85fc843a9d7d 6 * 1. The buffers will be filled with data upon receiving a successful payload
walterluu 3:85fc843a9d7d 7 * transmission over LoRa. In GenericPingPong.cpp, the function OnRxDone()
walterluu 3:85fc843a9d7d 8 * will call the function fillGlobalBufsWithPayload() that is responsible for
walterluu 3:85fc843a9d7d 9 * filling the appropriate buffers with the payload data that was received
walterluu 3:85fc843a9d7d 10 * by either the master or slave device by the other device that sent it.
walterluu 3:85fc843a9d7d 11 *
walterluu 3:85fc843a9d7d 12 * 2. The buffers will be used to fill up a payload buffer that will be sent
walterluu 3:85fc843a9d7d 13 * over LoRa by either the master or slave device to the receiving device.
walterluu 3:85fc843a9d7d 14 * The function fillPayloadWithGlobalBufs() will use the global buffers that
walterluu 3:85fc843a9d7d 15 * are filled with data for various sensors in the main.cpp to construct a
walterluu 3:85fc843a9d7d 16 * payload to deliver to the other device when SX1276PingPong() is called
walterluu 3:85fc843a9d7d 17 * in file GenericPingPong.cpp.
walterluu 3:85fc843a9d7d 18 *
walterluu 3:85fc843a9d7d 19 */
walterluu 3:85fc843a9d7d 20
walterluu 3:85fc843a9d7d 21 #ifndef __GLOBAL_BUFFERS_H__
walterluu 3:85fc843a9d7d 22 #define __GLOBAL_BUFFERS_H__\
walterluu 3:85fc843a9d7d 23
walterluu 3:85fc843a9d7d 24 #include "mbed.h"
walterluu 3:85fc843a9d7d 25 //#include "GenericPingPong2.h"
walterluu 3:85fc843a9d7d 26 //#include "support.h"
walterluu 3:85fc843a9d7d 27
walterluu 3:85fc843a9d7d 28 /***************************************************************************
walterluu 3:85fc843a9d7d 29 * MASTER Device
walterluu 3:85fc843a9d7d 30 **************************************************************************/\
walterluu 6:51f492ca61a2 31 //#define MASTER 1
walterluu 3:85fc843a9d7d 32
walterluu 3:85fc843a9d7d 33 /***************************************************************************
walterluu 3:85fc843a9d7d 34 * SLAVE Device
walterluu 3:85fc843a9d7d 35 **************************************************************************/\
walterluu 6:51f492ca61a2 36 #define SLAVE 1
walterluu 3:85fc843a9d7d 37
walterluu 3:85fc843a9d7d 38
walterluu 3:85fc843a9d7d 39 /***************************************************************************
walterluu 3:85fc843a9d7d 40 * Indexes for which byte specific data begins at in the payload buffer
walterluu 3:85fc843a9d7d 41 **************************************************************************/
walterluu 3:85fc843a9d7d 42 /* size of ID data that defines what the signature of the device is */
walterluu 6:51f492ca61a2 43 const uint8_t size_signature = 1;
walterluu 3:85fc843a9d7d 44
walterluu 3:85fc843a9d7d 45 /* size of data in bytes that is acquired by the master device */
walterluu 3:85fc843a9d7d 46 //const uint8_t size_of_ble = 2;
walterluu 6:51f492ca61a2 47 //const uint8_t size_of_dum = 2;
walterluu 3:85fc843a9d7d 48
walterluu 3:85fc843a9d7d 49 /* size of data in bytes that is acquired by the slave device */
walterluu 3:85fc843a9d7d 50 //const uint8_t size_of_grid_eye = 128;
walterluu 3:85fc843a9d7d 51 //const uint8_t size_of_gps = 20;
walterluu 3:85fc843a9d7d 52 //const uint8_t size_of_MAX17055 = 22;
walterluu 3:85fc843a9d7d 53 //const uint8_t size_of_MAX77650 = 5;
walterluu 3:85fc843a9d7d 54
walterluu 3:85fc843a9d7d 55 const uint8_t size_of_MAX30208 = 2; // temperature data
walterluu 3:85fc843a9d7d 56 const uint8_t size_of_MAX44009 = 2; // light data
walterluu 3:85fc843a9d7d 57 const uint8_t size_of_MAX20361 = 4; // AO32 data
walterluu 3:85fc843a9d7d 58 const uint8_t size_of_other = 0; // other data
walterluu 3:85fc843a9d7d 59
walterluu 3:85fc843a9d7d 60
walterluu 3:85fc843a9d7d 61 /* These are the sizes of each payload in bytes. Since there is different amount
walterluu 3:85fc843a9d7d 62 * of data being sent in each direction, we need to declare the total size of
walterluu 3:85fc843a9d7d 63 * the payload so we can instatiate the correct buffer sizes to store data that
walterluu 3:85fc843a9d7d 64 * is to be delivered and for data that is received.
walterluu 3:85fc843a9d7d 65 */
walterluu 3:85fc843a9d7d 66
walterluu 6:51f492ca61a2 67 const uint16_t PAYLOAD_BUFFER_SIZE_MASTER_TO_SLAVE = size_signature;
walterluu 6:51f492ca61a2 68 //const uint16_t PAYLOAD_BUFFER_SIZE_MASTER_TO_SLAVE = 0;
walterluu 3:85fc843a9d7d 69 const uint16_t PAYLOAD_BUFFER_SIZE_SLAVE_TO_MASTER = size_signature + size_of_MAX30208 + size_of_MAX44009 + size_of_MAX20361;
walterluu 3:85fc843a9d7d 70
walterluu 3:85fc843a9d7d 71 /* determine the appropriate buffer sizes */
walterluu 3:85fc843a9d7d 72 //#if defined(TARGET_MAX32630FTHR) // Master Device: Bluetooth Gateway
walterluu 3:85fc843a9d7d 73 // const uint16_t BufferSizeTx = PAYLOAD_BUFFER_SIZE_MASTER_TO_SLAVE;
walterluu 3:85fc843a9d7d 74 // const uint16_t BufferSizeRx = PAYLOAD_BUFFER_SIZE_SLAVE_TO_MASTER;
walterluu 3:85fc843a9d7d 75 //#elif defined(TARGET_MAX32620FTHR) // Slave Device: Robot
walterluu 3:85fc843a9d7d 76 // const uint16_t BufferSizeTx = PAYLOAD_BUFFER_SIZE_SLAVE_TO_MASTER;
walterluu 3:85fc843a9d7d 77 // const uint16_t BufferSizeRx = PAYLOAD_BUFFER_SIZE_MASTER_TO_SLAVE;
walterluu 3:85fc843a9d7d 78 //#endif
walterluu 3:85fc843a9d7d 79
walterluu 3:85fc843a9d7d 80 /* determine the appropriate buffer sizes */
walterluu 3:85fc843a9d7d 81 #if MASTER == 1 // Master Device
walterluu 3:85fc843a9d7d 82 const uint16_t BufferSizeTx = PAYLOAD_BUFFER_SIZE_MASTER_TO_SLAVE;
walterluu 3:85fc843a9d7d 83 const uint16_t BufferSizeRx = PAYLOAD_BUFFER_SIZE_SLAVE_TO_MASTER;
walterluu 3:85fc843a9d7d 84 #elif SLAVE == 1 // Slave Device
walterluu 3:85fc843a9d7d 85 const uint16_t BufferSizeTx = PAYLOAD_BUFFER_SIZE_SLAVE_TO_MASTER;
walterluu 3:85fc843a9d7d 86 const uint16_t BufferSizeRx = PAYLOAD_BUFFER_SIZE_MASTER_TO_SLAVE;
walterluu 3:85fc843a9d7d 87 #endif
walterluu 3:85fc843a9d7d 88
walterluu 3:85fc843a9d7d 89
walterluu 3:85fc843a9d7d 90 //#if defined(TARGET_MAX32630FTHR) // Master Device: BLE-to-LoRa Gateway
walterluu 3:85fc843a9d7d 91 // /* These are indexs used to create the payload buffer to send to Slave */
walterluu 3:85fc843a9d7d 92 // const uint8_t tx_idx_signature = 0; // 1st buf in tx payload (begins at byte 0)
walterluu 3:85fc843a9d7d 93 // const uint8_t tx_idx_ble = tx_idx_signature + size_signature; // 2nd buf in tx payload
walterluu 3:85fc843a9d7d 94 //
walterluu 3:85fc843a9d7d 95 // /* These are indexs used to deconstruct received payload buffer sent by the Slave */
walterluu 3:85fc843a9d7d 96 // const uint8_t rx_idx_signature = 0; // 1st buf in rx payload (begins at byte 0)
walterluu 3:85fc843a9d7d 97 // const uint8_t rx_idx_grid_eye = rx_idx_signature + size_signature; // 2nd buf in rx payload
walterluu 3:85fc843a9d7d 98 // const uint8_t rx_idx_gps = rx_idx_grid_eye + size_of_grid_eye; // 3rd buf in rx payload
walterluu 3:85fc843a9d7d 99 // const uint8_t rx_idx_MAX17055 = rx_idx_gps + size_of_gps; // 4th buf in rx payload
walterluu 3:85fc843a9d7d 100 // const uint8_t rx_idx_MAX77650 = rx_idx_MAX17055 + size_of_MAX17055; // 5th buf in rx payload
walterluu 3:85fc843a9d7d 101 //
walterluu 3:85fc843a9d7d 102 //#elif defined(TARGET_MAX32620FTHR) // Client Device: LoRa Controlled Robot
walterluu 3:85fc843a9d7d 103 // /* These are indexs used to create the payload buffer to send to Master */
walterluu 3:85fc843a9d7d 104 // const uint8_t tx_idx_signature = 0; // 1st buf in tx payload (begins at byte 0)
walterluu 3:85fc843a9d7d 105 // const uint8_t tx_idx_grid_eye = tx_idx_signature + size_signature; // 2nd buf in tx payload
walterluu 3:85fc843a9d7d 106 // const uint8_t tx_idx_gps = tx_idx_grid_eye + size_of_grid_eye; // 3rd buf in tx payload
walterluu 3:85fc843a9d7d 107 // const uint8_t tx_idx_MAX17055 = tx_idx_gps + size_of_gps; // 4th buf in tx payload
walterluu 3:85fc843a9d7d 108 // const uint8_t tx_idx_MAX77650 = tx_idx_MAX17055 + size_of_MAX17055; // 5th buf in tx payload
walterluu 3:85fc843a9d7d 109 //
walterluu 3:85fc843a9d7d 110 // /* These are indexs used to deconstruct received payload buffer sent by the Master */
walterluu 3:85fc843a9d7d 111 // const uint8_t rx_idx_signature = 0; // 1st buf in rx payload (begins at byte 0)
walterluu 3:85fc843a9d7d 112 // const uint8_t rx_idx_ble = rx_idx_signature + size_signature; // 2nd buf in rx payload
walterluu 3:85fc843a9d7d 113 //#endif
walterluu 3:85fc843a9d7d 114
walterluu 3:85fc843a9d7d 115 #if MASTER == 1 // Master Device
walterluu 3:85fc843a9d7d 116 /* These are indexs used to create the payload buffer to send to Slave */
walterluu 3:85fc843a9d7d 117 const uint8_t tx_idx_signature = 0; // 1st buf in tx payload (begins at byte 0)
walterluu 6:51f492ca61a2 118 // const uint8_t tx_idx_dum = tx_idx_signature + size_signature; // 2nd buf in tx payload
walterluu 3:85fc843a9d7d 119
walterluu 3:85fc843a9d7d 120 /* These are indexs used to deconstruct received payload buffer sent by the Slave */
walterluu 3:85fc843a9d7d 121 const uint8_t rx_idx_signature = 0; // 1st buf in rx payload (begins at byte 0)
walterluu 3:85fc843a9d7d 122 const uint8_t rx_idx_MAX30208 = rx_idx_signature + size_signature; // 2nd buf in rx payload
walterluu 3:85fc843a9d7d 123 const uint8_t rx_idx_MAX44009 = rx_idx_MAX30208 + size_of_MAX30208; // 3rd buf in rx payload
walterluu 3:85fc843a9d7d 124 const uint8_t rx_idx_MAX20361 = rx_idx_MAX44009 + size_of_MAX44009; // 4th buf in rx payload
walterluu 3:85fc843a9d7d 125 // const uint8_t rx_idx_other = rx_idx_MAX20361 + size_of_MAX20361; // 5th buf in rx payload
walterluu 3:85fc843a9d7d 126
walterluu 3:85fc843a9d7d 127 #elif SLAVE == 1 // Slave Device: LoRa Controlled Robot
walterluu 3:85fc843a9d7d 128 /* These are indexs used to create the payload buffer to send to Master */
walterluu 3:85fc843a9d7d 129 const uint8_t tx_idx_signature = 0; // 1st buf in tx payload (begins at byte 0)
walterluu 3:85fc843a9d7d 130 const uint8_t tx_idx_MAX30208 = tx_idx_signature + size_signature; // 2nd buf in tx payload
walterluu 3:85fc843a9d7d 131 const uint8_t tx_idx_MAX44009 = tx_idx_MAX30208 + size_of_MAX30208; // 3rd buf in tx payload
walterluu 3:85fc843a9d7d 132 const uint8_t tx_idx_MAX20361 = tx_idx_MAX44009 + size_of_MAX44009 ; // 4th buf in tx payload
walterluu 3:85fc843a9d7d 133 // const uint8_t tx_idx_other = tx_idx_MAX20361 + size_of_MAX20361; // 5th buf in tx payload
walterluu 3:85fc843a9d7d 134
walterluu 3:85fc843a9d7d 135 /* These are indexs used to deconstruct received payload buffer sent by the Master */
walterluu 3:85fc843a9d7d 136 const uint8_t rx_idx_signature = 0; // 1st buf in rx payload (begins at byte 0)
walterluu 6:51f492ca61a2 137 // const uint8_t rx_idx_dum = rx_idx_signature + size_signature; // 2nd buf in rx payload
walterluu 3:85fc843a9d7d 138 #endif
walterluu 3:85fc843a9d7d 139
walterluu 3:85fc843a9d7d 140
walterluu 3:85fc843a9d7d 141 /***************************************************************************
walterluu 3:85fc843a9d7d 142 * BLE Data Buffers
walterluu 3:85fc843a9d7d 143 **************************************************************************/
walterluu 3:85fc843a9d7d 144 //#if defined(TARGET_MAX32630FTHR) // Master Device: BLE-to-LoRa Gateway
walterluu 3:85fc843a9d7d 145 // static char curr_ble_data_to_slave[size_of_ble];
walterluu 3:85fc843a9d7d 146 //#elif defined(TARGET_MAX32620FTHR) // Slave Device: LoRa Controlled Robot
walterluu 3:85fc843a9d7d 147 // static char curr_ble_data_from_master[size_of_ble];
walterluu 3:85fc843a9d7d 148 // static char prev_ble_data_from_master[size_of_ble];
walterluu 3:85fc843a9d7d 149 //#endif
walterluu 3:85fc843a9d7d 150
walterluu 3:85fc843a9d7d 151 /***************************************************************************
walterluu 3:85fc843a9d7d 152 * Dummy Data Buffers
walterluu 3:85fc843a9d7d 153 **************************************************************************/
walterluu 3:85fc843a9d7d 154 #if MASTER == 1 // Master Device
walterluu 6:51f492ca61a2 155 // static char curr_dum_data_to_slave[size_of_dum];
walterluu 3:85fc843a9d7d 156 #elif SLAVE == 1 // Slave Device
walterluu 6:51f492ca61a2 157 // static char curr_dum_data_from_master[size_of_dum];
walterluu 6:51f492ca61a2 158 // static char prev_dum_data_from_master[size_of_dum];
walterluu 3:85fc843a9d7d 159 #endif
walterluu 3:85fc843a9d7d 160
walterluu 3:85fc843a9d7d 161
walterluu 3:85fc843a9d7d 162 /***************************************************************************
walterluu 3:85fc843a9d7d 163 * Grid Eye Sensor Data Buffers
walterluu 3:85fc843a9d7d 164 **************************************************************************/
walterluu 3:85fc843a9d7d 165 //#if defined(TARGET_MAX32630FTHR) // Master Device: BLE-to-LoRa Gateway
walterluu 3:85fc843a9d7d 166 // static char curr_raw_frame_data_from_slave[size_of_grid_eye];
walterluu 3:85fc843a9d7d 167 // static char prev_raw_frame_data_from_slave[size_of_grid_eye];
walterluu 3:85fc843a9d7d 168 // static int16_t conv_frame_data_from_slave[64];
walterluu 3:85fc843a9d7d 169 //#elif defined(TARGET_MAX32620FTHR) // Client Device: LoRa Controlled Robot
walterluu 3:85fc843a9d7d 170 // static char curr_raw_frame_data_to_master[size_of_grid_eye];
walterluu 3:85fc843a9d7d 171 // static char prev_raw_frame_data_to_master[size_of_grid_eye];
walterluu 3:85fc843a9d7d 172 // static int16_t conv_frame_data_to_master[64];
walterluu 3:85fc843a9d7d 173 //#endif
walterluu 3:85fc843a9d7d 174
walterluu 3:85fc843a9d7d 175
walterluu 3:85fc843a9d7d 176 /***************************************************************************
walterluu 3:85fc843a9d7d 177 * MAX30208 Data Buffers
walterluu 3:85fc843a9d7d 178 **************************************************************************/
walterluu 3:85fc843a9d7d 179 #if MASTER == 1 // Master Device
walterluu 3:85fc843a9d7d 180 static char curr_raw_temp_data_from_slave[size_of_MAX30208];
walterluu 3:85fc843a9d7d 181 static char prev_raw_temp_data_from_slave[size_of_MAX30208];
walterluu 3:85fc843a9d7d 182 // static int16_t conv_frame_data_from_slave[64];
walterluu 3:85fc843a9d7d 183 #elif SLAVE == 1 // Slave Device
walterluu 3:85fc843a9d7d 184 static char curr_raw_temp_data_to_master[size_of_MAX30208];
walterluu 3:85fc843a9d7d 185 // static char prev_raw_temp_data_to_master[size_of_MAX30208];
walterluu 3:85fc843a9d7d 186 // static int16_t conv_frame_data_to_master[64];
walterluu 3:85fc843a9d7d 187 #endif
walterluu 3:85fc843a9d7d 188
walterluu 3:85fc843a9d7d 189 /***************************************************************************
walterluu 3:85fc843a9d7d 190 * MAX44009 Data Buffers
walterluu 3:85fc843a9d7d 191 **************************************************************************/
walterluu 3:85fc843a9d7d 192 #if MASTER == 1 // Master Device
walterluu 3:85fc843a9d7d 193 static char curr_raw_light_data_from_slave[size_of_MAX44009];
walterluu 3:85fc843a9d7d 194 static char prev_raw_light_data_from_slave[size_of_MAX44009];
walterluu 3:85fc843a9d7d 195 // static int16_t conv_frame_data_from_slave[64];
walterluu 3:85fc843a9d7d 196 #elif SLAVE == 1 // Slave Device
walterluu 3:85fc843a9d7d 197 static char curr_raw_light_data_to_master[size_of_MAX44009];
walterluu 3:85fc843a9d7d 198 // static char prev_raw_light_data_to_master[size_of_MAX44009];
walterluu 3:85fc843a9d7d 199 // static int16_t conv_frame_data_to_master[64];
walterluu 3:85fc843a9d7d 200 #endif
walterluu 3:85fc843a9d7d 201
walterluu 3:85fc843a9d7d 202 /***************************************************************************
walterluu 3:85fc843a9d7d 203 * MAX20361 Data Buffers
walterluu 3:85fc843a9d7d 204 **************************************************************************/
walterluu 3:85fc843a9d7d 205 #if MASTER == 1 // Master Device
walterluu 3:85fc843a9d7d 206 static char curr_raw_AO32_data_from_slave[size_of_MAX20361];
walterluu 3:85fc843a9d7d 207 static char prev_raw_AO32_data_from_slave[size_of_MAX20361];
walterluu 3:85fc843a9d7d 208 // static int16_t conv_frame_data_from_slave[64];
walterluu 3:85fc843a9d7d 209 #elif SLAVE == 1 // Slave Device
walterluu 3:85fc843a9d7d 210 static char curr_raw_AO32_data_to_master[size_of_MAX20361];
walterluu 3:85fc843a9d7d 211 // static char prev_raw_AO32_data_to_master[size_of_MAX20361];
walterluu 3:85fc843a9d7d 212 // static int16_t conv_frame_data_to_master[64];
walterluu 3:85fc843a9d7d 213 #endif
walterluu 3:85fc843a9d7d 214
walterluu 3:85fc843a9d7d 215 /***************************************************************************
walterluu 3:85fc843a9d7d 216 * Other Data Buffers
walterluu 3:85fc843a9d7d 217 **************************************************************************/
walterluu 3:85fc843a9d7d 218 #if MASTER == 1 // Master Device
walterluu 3:85fc843a9d7d 219 // static char curr_raw_other_data_from_slave[size_of_other];
walterluu 3:85fc843a9d7d 220 // static char prev_raw_other_data_from_slave[size_of_other];
walterluu 3:85fc843a9d7d 221 // static int16_t conv_frame_data_from_slave[64];
walterluu 3:85fc843a9d7d 222 #elif SLAVE == 1 // Slave Device
walterluu 3:85fc843a9d7d 223 // static char curr_raw_other_data_to_master[size_of_other];
walterluu 3:85fc843a9d7d 224 // static char prev_raw_other_data_to_master[size_of_other];
walterluu 3:85fc843a9d7d 225 // static int16_t conv_frame_data_to_master[64];
walterluu 3:85fc843a9d7d 226 #endif
walterluu 3:85fc843a9d7d 227
walterluu 3:85fc843a9d7d 228 /***************************************************************************
walterluu 3:85fc843a9d7d 229 * GPS Data Buffers
walterluu 3:85fc843a9d7d 230 **************************************************************************/
walterluu 3:85fc843a9d7d 231 //#if defined(TARGET_MAX32630FTHR) // Master Device: BLE-to-LoRa Gateway
walterluu 3:85fc843a9d7d 232 // static char curr_gps_data_from_slave[size_of_gps];
walterluu 3:85fc843a9d7d 233 // static char prev_gps_data_from_slave[size_of_gps];
walterluu 3:85fc843a9d7d 234 //#elif defined(TARGET_MAX32620FTHR) // Slave Device: LoRa Controlled Robot
walterluu 3:85fc843a9d7d 235 // static char curr_gps_data_to_master[size_of_gps];
walterluu 3:85fc843a9d7d 236 //#endif
walterluu 3:85fc843a9d7d 237
walterluu 3:85fc843a9d7d 238 /***************************************************************************
walterluu 3:85fc843a9d7d 239 * MAX17055 Data Buffers
walterluu 3:85fc843a9d7d 240 **************************************************************************/
walterluu 3:85fc843a9d7d 241 //#if defined(TARGET_MAX32630FTHR) // Master Device: BLE-to-LoRa Gateway
walterluu 3:85fc843a9d7d 242 // static char curr_MAX17055_from_slave[size_of_MAX17055];
walterluu 3:85fc843a9d7d 243 // static char prev_MAX17055_from_slave[size_of_MAX17055];
walterluu 3:85fc843a9d7d 244 //#elif defined(TARGET_MAX32620FTHR) // Slave Device: LoRa Controlled Robot
walterluu 3:85fc843a9d7d 245 // static char curr_MAX17055_to_master[size_of_MAX17055];
walterluu 3:85fc843a9d7d 246 //#endif
walterluu 3:85fc843a9d7d 247
walterluu 3:85fc843a9d7d 248 /***************************************************************************
walterluu 3:85fc843a9d7d 249 * MAX77650 Data Buffers
walterluu 3:85fc843a9d7d 250 **************************************************************************/
walterluu 3:85fc843a9d7d 251 //#if defined(TARGET_MAX32630FTHR) // Master Device: BLE-to-LoRa Gateway
walterluu 3:85fc843a9d7d 252 // static char curr_MAX77650_from_slave[size_of_MAX77650];
walterluu 3:85fc843a9d7d 253 // static char prev_MAX77650_from_slave[size_of_MAX77650];
walterluu 3:85fc843a9d7d 254 //#elif defined(TARGET_MAX32620FTHR) // Slave Device: LoRa Controlled Robot
walterluu 3:85fc843a9d7d 255 // static char curr_MAX77650_to_master[size_of_MAX77650];
walterluu 3:85fc843a9d7d 256 //#endif
walterluu 3:85fc843a9d7d 257
walterluu 3:85fc843a9d7d 258 /**
walterluu 3:85fc843a9d7d 259 * @brief This function constructs a payload buffer that is used in transmitting data in a LoRa Message
walterluu 3:85fc843a9d7d 260 */
walterluu 3:85fc843a9d7d 261 void fillPayloadWithGlobalBufs(uint8_t * payload_buffer_tx);
walterluu 3:85fc843a9d7d 262
walterluu 3:85fc843a9d7d 263 /**
walterluu 3:85fc843a9d7d 264 * @brief This function deconstructs a payload buffer that contains data from a received LoRa Message
walterluu 3:85fc843a9d7d 265 */
walterluu 3:85fc843a9d7d 266 void fillGlobalBufsWithPayload(uint8_t * payload_buffer_rx);
walterluu 3:85fc843a9d7d 267
walterluu 3:85fc843a9d7d 268 #endif // __GLOBAL_BUFFERS_H__