#ifndef MISSION_DEVICES_DEVICEDEFINITIONS_SCEXDEFINITIONS_H_ #define MISSION_DEVICES_DEVICEDEFINITIONS_SCEXDEFINITIONS_H_ #include #include #include #include #include // Definitions for the Solar Cell Experiment namespace scex { static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::SCEX_HANDLER; static constexpr Event MISSING_PACKET = event::makeEvent(SUBSYSTEM_ID, 0, severity::LOW); static constexpr Event EXPERIMENT_TIMEDOUT = event::makeEvent(SUBSYSTEM_ID, 0, severity::LOW); enum Cmds : DeviceCommandId_t { PING = 0b00111, ALL_CELLS_CMD = 0b00101, ONE_CELL = 0b00110, FRAM = 0b00001, EXP_STATUS_CMD = 0b00010, TEMP_CMD = 0b00011, ION_CMD = 0b00100, ERROR_REPLY = 0b01000, INVALID = 255 }; static const std::vector VALID_CMDS = { PING, ALL_CELLS_CMD, ONE_CELL, FRAM, EXP_STATUS_CMD, TEMP_CMD, ION_CMD}; static constexpr uint8_t HEADER_LEN = 5; static constexpr uint8_t CRC_LEN = 2; static constexpr uint8_t IDLE_BIT_0_DEF_STATE = 0; static constexpr uint8_t IDLE_BIT_1_DEF_STATE = 1; uint8_t createCmdByte(Cmds cmd, bool tempCheck); ReturnValue_t prepareScexCmd(scex::Cmds cmd, bool tempCheck, std::pair cmdBufPair, size_t& cmdLen, std::pair usrDataPair); } // namespace scex #endif /* MISSION_DEVICES_DEVICEDEFINITIONS_SCEXDEFINITIONS_H_ */