|
NASA Astrobee Robot Software
0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
|
Go to the documentation of this file.
19 #ifndef EPS_DRIVER_EPS_DRIVER_H_
20 #define EPS_DRIVER_EPS_DRIVER_H_
36 static constexpr uint8_t
OFF = 0;
37 static constexpr uint8_t
ON = 1;
257 const i2c::Device &i2c_dev, std::function<
void(uint32_t)> usleep_cb);
271 bool GetStrings(uint32_t
mask, std::map<String, std::string> & data);
272 bool GetStates(uint32_t
mask, std::map<State, uint8_t> & data);
278 bool GetTemps(uint32_t
mask, std::map<Temp, TempInfo> & data);
324 uint16_t
Read(uint8_t *buff);
327 uint16_t
Read(uint8_t *buff, uint16_t len);
330 uint16_t
Write(uint8_t *buff, uint16_t len);
337 std::function<void(uint32_t)> usleep_cb_;
342 #endif // EPS_DRIVER_EPS_DRIVER_H_
uint8_t addr
Definition: eps_driver.h:251
@ HK_PAYLOAD_PWR4_I
Definition: eps_driver.h:164
static constexpr uint8_t I2C_CMD_GET_BATTERY_STATUS
Definition: eps_driver.h:308
uint16_t temperature
Definition: eps_driver.h:245
@ FAULT_OC_PAYLOAD_1
Definition: eps_driver.h:139
@ FAULT_OC_HLP
Definition: eps_driver.h:130
static constexpr uint8_t I2C_CMD_GET_CONNECTED_EPS_STATE
Definition: eps_driver.h:317
@ HK_AGND2_V
Definition: eps_driver.h:161
@ FAULT_RESERVED4
Definition: eps_driver.h:119
@ NUM_POWER_STATES
Definition: eps_driver.h:98
static constexpr size_t I2C_BUF_MAX_LEN
Definition: eps_driver.h:290
@ FAULT_RESERVED8
Definition: eps_driver.h:126
@ HK_SUPPLY_I
Definition: eps_driver.h:159
@ CHANNEL_PAYLOAD_EN_BOT_AFT
Definition: eps_driver.h:58
DockStateValue
Definition: eps_driver.h:102
bool GetStates(uint32_t mask, std::map< State, uint8_t > &data)
Definition: eps_driver.cc:103
static constexpr uint8_t I2C_RESP_ACK
Definition: eps_driver.h:291
@ HK_5VLIVE_V
Definition: eps_driver.h:160
@ LED_MODE_OFF
Definition: eps_driver.h:225
@ CHANNEL_FAN_EN
Definition: eps_driver.h:55
@ NUM_FAULTS
Definition: eps_driver.h:143
@ FAULT_OC_LLP
Definition: eps_driver.h:128
static constexpr uint8_t I2C_CMD_GET_CONNECTION_STATE
Definition: eps_driver.h:312
@ HK_BAT2V_V
Definition: eps_driver.h:157
@ DOCK_CONNECTING
Definition: eps_driver.h:104
static constexpr uint8_t I2C_CMD_SW_OFF
Definition: eps_driver.h:297
@ BATTERY_TOP_RIGHT
Definition: eps_driver.h:193
static constexpr uint8_t I2C_CMD_SW_ON
Definition: eps_driver.h:296
static constexpr uint8_t I2C_CMD_GET_DIGITAL_TEMPS
Definition: eps_driver.h:304
@ STATE_POWER
Definition: eps_driver.h:86
Housekeeping
Definition: eps_driver.h:147
@ HK_MOTOR1_I
Definition: eps_driver.h:168
@ LED_SC2
Definition: eps_driver.h:216
@ CHANNEL_HLP_EN
Definition: eps_driver.h:51
@ DOCK_DISCONNECTED
Definition: eps_driver.h:103
Definition: eps_driver.h:29
State
Definition: eps_driver.h:85
@ POWER_STATE_AWAKE_SAFE
Definition: eps_driver.h:96
@ CHARGER_BOTTOM_RIGHT
Definition: eps_driver.h:203
@ HK_PAYLOAD_PWR1_I
Definition: eps_driver.h:166
@ CHARGER_BOTTOM_LEFT
Definition: eps_driver.h:205
@ NUM_CHANNELS
Definition: eps_driver.h:81
@ LED_LIVE
Definition: eps_driver.h:219
LedMode
Definition: eps_driver.h:224
@ FAULT_OC_PAYLOAD_3
Definition: eps_driver.h:142
Led
Definition: eps_driver.h:210
@ CHANNEL_PAYLOAD_EN_BOT_FRONT
Definition: eps_driver.h:59
@ HK_PAYLOAD_PWR3_I
Definition: eps_driver.h:150
EPS(const i2c::Device &i2c_dev, std::function< void(uint32_t)> usleep_cb)
Definition: eps_driver.cc:33
@ CHANNEL_LLP_EN
Definition: eps_driver.h:49
@ CHANNEL_RESERVED4
Definition: eps_driver.h:76
PowerStateValue
Definition: eps_driver.h:92
@ CHANNEL_STATUSA1_LED
Definition: eps_driver.h:66
@ STRING_SW_VERSION
Definition: eps_driver.h:41
static constexpr uint8_t I2C_CMD_GET_HW_EXCEPTIONS
Definition: eps_driver.h:302
static std::string SerialToString(uint8_t serial[6])
Definition: eps_driver.cc:281
bool GetTemps(uint32_t mask, std::map< Temp, TempInfo > &data)
Definition: eps_driver.cc:210
@ FAULT_OC_FAN
Definition: eps_driver.h:114
@ CHANNEL_LIVE_LED
Definition: eps_driver.h:75
@ DOCK_CONNECTED
Definition: eps_driver.h:105
bool GetFaults(uint32_t mask, std::map< Fault, bool > &data)
Definition: eps_driver.cc:151
@ FAULT_RESERVED1
Definition: eps_driver.h:116
static constexpr uint8_t I2C_CMD_CLR_HW_EXCEPTIONS
Definition: eps_driver.h:303
uint16_t status
Definition: eps_driver.h:244
uint16_t voltage
Definition: eps_driver.h:237
@ HK_AUX_PWR_I
Definition: eps_driver.h:163
@ CHANNEL_PAYLOAD_EN_TOP_FRONT
Definition: eps_driver.h:60
Temp
Definition: eps_driver.h:184
@ NUM_DOCK_STATES
Definition: eps_driver.h:106
@ CHANNEL_STATUSA2_LED
Definition: eps_driver.h:65
@ CHANNEL_RESERVED7
Definition: eps_driver.h:79
static constexpr uint8_t ON
Definition: eps_driver.h:37
String
Definition: eps_driver.h:40
@ CHANNEL_AUX_PWR_EN
Definition: eps_driver.h:53
@ BATTERY_BOTTOM_LEFT
Definition: eps_driver.h:196
@ HK_ENET_PWR_I
Definition: eps_driver.h:179
@ HK_5A_REG2_PWR_I
Definition: eps_driver.h:171
@ FAULT_RESERVED5
Definition: eps_driver.h:123
@ NUM_STATES
Definition: eps_driver.h:88
bool SetChannels(uint32_t mask, bool const value)
Definition: eps_driver.cc:260
int16_t current
Definition: eps_driver.h:238
@ FAULT_RESERVED3
Definition: eps_driver.h:118
static constexpr uint8_t I2C_CMD_SET_EPS_CMD
Definition: eps_driver.h:320
@ HK_SUPPLY_IN_V
Definition: eps_driver.h:149
@ LED_SA1
Definition: eps_driver.h:211
@ TEMP_TOP
Definition: eps_driver.h:186
@ HK_BAT1V_V
Definition: eps_driver.h:158
@ LED_SA2
Definition: eps_driver.h:212
static constexpr uint8_t I2C_RESP_NACK
Definition: eps_driver.h:292
@ HK_BAT3V_V
Definition: eps_driver.h:156
bool SetLeds(uint32_t mask, LedMode const value)
Definition: eps_driver.cc:227
@ FAULT_ST_5A_REG_1
Definition: eps_driver.h:138
@ FAULT_ST_5A_REG_3
Definition: eps_driver.h:132
@ HK_5A_REG1_PWR_I
Definition: eps_driver.h:167
bool GetStrings(uint32_t mask, std::map< String, std::string > &data)
Definition: eps_driver.cc:76
bool Reboot(void)
Definition: eps_driver.cc:71
@ NUM_STRINGS
Definition: eps_driver.h:44
uint8_t mask
Definition: signal_lights.h:72
@ LED_SB2
Definition: eps_driver.h:214
@ FAULT_RESERVED6
Definition: eps_driver.h:124
static constexpr uint32_t EVERYTHING
Definition: eps_driver.h:35
static constexpr uint8_t I2C_CMD_GET_CONN_STATE
Definition: eps_driver.h:318
@ FAULT_RESERVED0
Definition: eps_driver.h:115
static constexpr uint8_t I2C_CMD_UNDOCK
Definition: eps_driver.h:311
@ HK_MLP_I
Definition: eps_driver.h:178
@ CHANNEL_STATUSC2_LED
Definition: eps_driver.h:69
uint16_t percentage
Definition: eps_driver.h:242
static constexpr uint8_t I2C_CMD_GET_SW_STATES
Definition: eps_driver.h:298
static constexpr uint8_t I2C_CMD_GET_BUILD_TIME
Definition: eps_driver.h:295
bool SetChargers(uint32_t mask, bool const value)
Definition: eps_driver.cc:250
Definition: eps_driver.h:234
@ CHANNEL_STATUSB1_LED
Definition: eps_driver.h:68
@ HK_FAN_PWR_I
Definition: eps_driver.h:162
Channel
Definition: eps_driver.h:48
Definition: eps_driver.h:250
uint16_t Read(uint8_t *buff)
Definition: eps_driver.cc:322
bool GetBatteries(uint32_t mask, std::map< Battery, BatteryInfo > &data)
Definition: eps_driver.cc:165
@ POWER_STATE_UNKNOWN
Definition: eps_driver.h:93
@ CHANNEL_RESERVED1
Definition: eps_driver.h:64
bool GetChannels(uint32_t mask, std::map< Channel, bool > &data)
Definition: eps_driver.cc:123
@ NUM_TEMPERATURES
Definition: eps_driver.h:188
@ HK_SUBSYS1_1_PWR_V
Definition: eps_driver.h:151
@ POWER_STATE_AWAKE_NOMINAL
Definition: eps_driver.h:95
@ LED_MODE_ON
Definition: eps_driver.h:226
@ CHANNEL_ENET_PWR_EN
Definition: eps_driver.h:54
@ NUM_LEDS
Definition: eps_driver.h:220
@ FAULT_OT_HLP
Definition: eps_driver.h:122
static constexpr uint8_t I2C_CMD_GET_SERIAL_NUMBER
Definition: eps_driver.h:305
@ HK_PAYLOAD_PWR2_I
Definition: eps_driver.h:165
@ CHANNEL_USB_PWR_EN
Definition: eps_driver.h:52
static constexpr uint8_t I2C_CMD_GET_CHARGE_STATE
Definition: eps_driver.h:314
@ CHANNEL_AUDIO_LED
Definition: eps_driver.h:74
uint8_t ComputeChecksum(uint8_t *buf, size_t size)
Definition: eps_driver.cc:370
@ FAULT_OT_FLASHLIGHT_2
Definition: eps_driver.h:113
@ FAULT_OC_AUX
Definition: eps_driver.h:131
@ HK_SUBSYS2_PWR_V
Definition: eps_driver.h:169
@ HK_SYSTEM_I
Definition: eps_driver.h:154
double temp
Definition: eps_driver.h:252
@ CHANNEL_VIDEO_LED
Definition: eps_driver.h:73
uint16_t Write(uint8_t *buff, uint16_t len)
Definition: eps_driver.cc:356
bool GetHousekeeping(uint32_t mask, std::map< Housekeeping, double > &data)
Definition: eps_driver.cc:194
@ LED_MODE_BLINK_2HZ
Definition: eps_driver.h:227
bool ClearFaults(void)
Definition: eps_driver.cc:56
static constexpr uint8_t I2C_CMD_GET_HK
Definition: eps_driver.h:301
@ CHANNEL_MLP_EN
Definition: eps_driver.h:50
@ CHANNEL_RESERVED6
Definition: eps_driver.h:78
@ FAULT_OT_FLASHLIGHT_1
Definition: eps_driver.h:112
@ NUM_CHARGERS
Definition: eps_driver.h:206
@ CHARGER_TOP_LEFT
Definition: eps_driver.h:204
@ FAULT_OC_5A_REG_2
Definition: eps_driver.h:133
uint16_t design
Definition: eps_driver.h:241
@ FAULT_RESERVED9
Definition: eps_driver.h:137
static constexpr uint8_t I2C_CMD_SEND_EPS_STATE_TO_DOCK
Definition: eps_driver.h:321
@ CHANNEL_MOTOR_EN2
Definition: eps_driver.h:62
@ HK_AGND1_V
Definition: eps_driver.h:148
@ HK_MOTOR2_I
Definition: eps_driver.h:170
static constexpr uint8_t I2C_CMD_CLR_TERMINATE_EVT
Definition: eps_driver.h:310
Battery
Definition: eps_driver.h:192
static constexpr uint8_t OFF
Definition: eps_driver.h:36
@ NUM_LED_MODES
Definition: eps_driver.h:230
@ LED_SC1
Definition: eps_driver.h:215
@ POWER_STATE_HIBERNATE
Definition: eps_driver.h:94
static constexpr uint8_t I2C_CMD_REBOOT
Definition: eps_driver.h:306
@ LED_SB1
Definition: eps_driver.h:213
@ FAULT_OC_ENET
Definition: eps_driver.h:111
@ TEMP_BOTTOM
Definition: eps_driver.h:185
@ POWER_STATE_CRITICAL_FAULT
Definition: eps_driver.h:97
@ HK_USB_PWR_I
Definition: eps_driver.h:176
bool RingBuzzer(uint16_t freq, uint8_t secs)
Definition: eps_driver.cc:38
Fault
Definition: eps_driver.h:110
@ HK_BAT4V_V
Definition: eps_driver.h:155
@ FAULT_RESERVED2
Definition: eps_driver.h:117
@ FAULT_OC_5A_REG_1
Definition: eps_driver.h:134
@ HK_AUO_PWR_I
Definition: eps_driver.h:174
static constexpr uint8_t I2C_CMD_GET_SW_VERSION
Definition: eps_driver.h:294
@ CHANNEL_RESERVED8
Definition: eps_driver.h:80
@ CHANNEL_STATUSB2_LED
Definition: eps_driver.h:67
uint16_t remaining
Definition: eps_driver.h:240
static constexpr uint8_t I2C_CMD_SET_EPS_POWER_MODE
Definition: eps_driver.h:315
static constexpr uint8_t I2C_CMD_GET_EPS_CMD
Definition: eps_driver.h:319
@ NUM_HOUSEKEEPING
Definition: eps_driver.h:180
@ LED_MODE_BLINK_0_5HZ
Definition: eps_driver.h:229
uint16_t cell[4]
Definition: eps_driver.h:243
@ STRING_SERIAL
Definition: eps_driver.h:43
@ NUM_BATTERIES
Definition: eps_driver.h:197
@ CHANNEL_RESERVED5
Definition: eps_driver.h:77
@ CHANNEL_MOTOR_EN1
Definition: eps_driver.h:61
uint16_t full
Definition: eps_driver.h:239
@ FAULT_OC_PAYLOAD_4
Definition: eps_driver.h:136
@ LED_AUDIO
Definition: eps_driver.h:218
@ CHANNEL_PAYLOAD_EN_TOP_AFT
Definition: eps_driver.h:57
@ HK_UNREG_V
Definition: eps_driver.h:153
static constexpr uint8_t I2C_CMD_SET_CHARGE_STATE
Definition: eps_driver.h:313
@ CHANNEL_STATUSC1_LED
Definition: eps_driver.h:70
@ HK_SUBSYS1_2_PWR_V
Definition: eps_driver.h:152
@ BATTERY_TOP_LEFT
Definition: eps_driver.h:195
@ CHANNEL_RESERVED3
Definition: eps_driver.h:72
@ FAULT_OC_5A_REG_3
Definition: eps_driver.h:140
@ FAULT_OC_MLP
Definition: eps_driver.h:129
@ LED_VIDEO
Definition: eps_driver.h:217
@ HK_5A_REG3_PWR_I
Definition: eps_driver.h:172
@ CHARGER_TOP_RIGHT
Definition: eps_driver.h:202
Definition: eps_driver.h:32
@ HK_HLP_I
Definition: eps_driver.h:175
@ CHANNEL_RESERVED2
Definition: eps_driver.h:71
bool GetChargers(uint32_t mask, std::map< Charger, bool > &data)
Definition: eps_driver.cc:137
@ FAULT_OT_MLP
Definition: eps_driver.h:120
@ FAULT_OT_LLP
Definition: eps_driver.h:121
@ HK_MAIN5_PWR_I
Definition: eps_driver.h:173
bool Undock(void)
Definition: eps_driver.cc:66
@ STRING_BUILD
Definition: eps_driver.h:42
@ CHANNEL_RESERVED0
Definition: eps_driver.h:63
@ FAULT_ST_5A_REG_2
Definition: eps_driver.h:135
bool SetPowerState(PowerStateValue const value)
Definition: eps_driver.cc:272
static constexpr uint8_t I2C_CMD_SET_LED_MODES
Definition: eps_driver.h:300
Charger
Definition: eps_driver.h:201
@ HK_LLP_I
Definition: eps_driver.h:177
@ BATTERY_BOTTOM_RIGHT
Definition: eps_driver.h:194
@ FAULT_RESERVED7
Definition: eps_driver.h:125
static constexpr uint8_t I2C_CMD_GET_SYSTEM_STATE
Definition: eps_driver.h:299
@ LED_MODE_BLINK_1HZ
Definition: eps_driver.h:228
@ FAULT_OC_USB
Definition: eps_driver.h:127
uint8_t chan
Definition: eps_driver.h:235
@ CHANNEL_SPEAKER_EN
Definition: eps_driver.h:56
uint16_t serial
Definition: eps_driver.h:246
bool EnterBootloader(void)
Definition: eps_driver.cc:51
bool present
Definition: eps_driver.h:236
static constexpr uint8_t I2C_CMD_RING_BUZZER
Definition: eps_driver.h:309
static constexpr uint8_t I2C_CMD_ENTER_BOOTLOADER
Definition: eps_driver.h:307
static constexpr uint8_t I2C_CMD_NONE
Definition: eps_driver.h:293
bool Unterminate(void)
Definition: eps_driver.cc:61
static constexpr uint8_t I2C_CMD_GET_EPS_POWER_MODE
Definition: eps_driver.h:316
@ FAULT_OC_PAYLOAD_2
Definition: eps_driver.h:141
@ STATE_DOCK
Definition: eps_driver.h:87
~EPS(void)
Definition: eps_driver.cc:36
@ TEMP_CONNECTOR
Definition: eps_driver.h:187