Midnight Sun Firmware
Loading...
Searching...
No Matches
command_code.h
1#pragma once
2
3/************************************************************************************************
4 * @file command_code.h
5 *
6 * @brief Header file defining the CommandCodes
7 *
8 * @date 2025-01-04
9 * @author Aryan Kashem
10 ************************************************************************************************/
11
12/* Standard library Headers */
13#include <string>
14
15/* Inter-component Headers */
16
17/* Intra-component Headers */
18
28enum class CommandCode {
29 /* MISC Commands */
30 METADATA,
32 /* GPIO Commands */
42 /* I2C Commands */
43
44 /* SPI Commands */
45
46 /* UART Commands */
47
48 /* FLASH Commands */
49
51};
52
59std::string encodeCommand(const CommandCode commandCode, std::string &message);
60
66std::pair<CommandCode, std::string> decodeCommand(std::string &message);
67
std::string encodeCommand(const CommandCode commandCode, std::string &message)
Encode a command code into an existing data payload.
Definition: command_code.cc:18
CommandCode
Command Code Class.
Definition: command_code.h:28
std::pair< CommandCode, std::string > decodeCommand(std::string &message)
Decode a command code from existing data.
Definition: command_code.cc:22
@ GPIO_GET_PIN_ALT_FUNCTION
@ GPIO_GET_ALL_ALT_FUNCTIONS