-
Notifications
You must be signed in to change notification settings - Fork 0
/
slave_comm.h
51 lines (45 loc) · 1.04 KB
/
slave_comm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* @file slave_comm.h
* @brief Master slave communication
*
* Contains all information/functions used to communicate between master and slave muCs.
*/
#ifndef SLAVE_COMM_H
#define SLAVE_COMM_H
#include "common.h"
/**
* Data packet from master:
* Command
* <size of transmission>
* Data
* END_SPI
* END_SPI
*/
/**
* @defgroup slave_commands
* @brief Commands from master to slave
*/
//@{
/// Health Monitoring Data Transmission
#define HM_DATA 0x00
/// Real Time HM Data
#define REAL_TIME 0b11010101
/// Begin transmission to GS
#define BEGIN_TX_GS 0b01010101
/// Begin transmission but not the one for GS
#define BEGIN_TX_COMM 0b01011010
/// End transmission
#define END_TX 0b00110011
//@}
/// Flags
#define END_SPI 0b10101010
#define N_END_SPI 2
#define ACK 0b10010010
/**
* @brief Send data to slave
* @param command Command to be sent
* @param buffer String pointer
* @param size Size of string/packet
*/
void slave_send (uint8_t command, char* buffer, uint8_t size);
#endif