CTS-SAT-1-OBC-Firmware
Loading...
Searching...
No Matches
eps_internal_drivers.h
Go to the documentation of this file.
1
2#ifndef INCLUDE_GUARD__EPS_INTERNAL_DRIVERS_H__
3#define INCLUDE_GUARD__EPS_INTERNAL_DRIVERS_H__
4
5#include <stdint.h>
6
7// #pragma region Constants
8
9#define EPS_I2C_ADDR (0x20 << 1) // EPS I2C address
10
11#define EPS_COMMAND_STID 0x1A // "System Type Identifier (STID)" (Software ICD, page 17)
12#define EPS_COMMAND_IVID 0x07 // "Interface Version Identifier (IVID)" (Software ICD, page 18)
13#define EPS_COMMAND_BID 0x00 // "Board Identifier (BID)" (Software ICD, page 20)
14
15#define EPS_DEFAULT_RX_LEN_MIN 5 // for commands with no response params, 5 bytes are returned
16
17#define EPS_MAX_RESPONSE_POLL_TIME_MS 100
18
19
20// #pragma endregion Constants
21
22
23// #pragma region Function_Prototypes
24
25uint8_t EPS_send_cmd_get_response(const uint8_t cmd_buf[], uint8_t cmd_buf_len,
26 uint8_t rx_buf[], uint16_t rx_buf_len);
27
28uint8_t EPS_run_argumentless_cmd(uint8_t command_code);
29
30// #pragma endregion Function_Prototypes
31
32#endif /* INCLUDE_GUARD__EPS_INTERNAL_DRIVERS_H__ */
uint8_t EPS_run_argumentless_cmd(uint8_t command_code)
Sends an argumentless command to the EPS (expecting no data in the response).
Definition eps_internal_drivers.c:207
uint8_t EPS_send_cmd_get_response(const uint8_t cmd_buf[], uint8_t cmd_buf_len, uint8_t rx_buf[], uint16_t rx_buf_len)
Sends a command to the EPS, and receives the response.
Definition eps_internal_drivers.c:31