NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
smart_dock.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, United States Government, as represented by the
2  * Administrator of the National Aeronautics and Space Administration.
3  *
4  * All rights reserved.
5  *
6  * The Astrobee platform is licensed under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with the
8  * License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15  * License for the specific language governing permissions and limitations
16  * under the License.
17  */
18 
19 #ifndef SMART_DOCK_SMART_DOCK_H_
20 #define SMART_DOCK_SMART_DOCK_H_
21 
22 #include <i2c/i2c_new.h>
23 
24 #include <eps_driver/eps_driver.h>
25 
26 #include <vector>
27 #include <string>
28 #include <map>
29 
30 namespace smart_dock {
31 
33 
34 // Class to arbitrate access to the Smart Dock
35 class SmartDock {
36  public:
37  static constexpr uint8_t OFF = 0;
38  static constexpr uint8_t ON = 1;
39 
40  // Berth connection state
41  typedef enum {
42  CONN_DISCONNECTED = 0x00, // when ASx_LOOP is high
43  CONN_CONNECTING = 0x01, // when ASx_LOOP goes low
44  CONN_CONNECTED = 0x02, // Auto CONNECTING to CONNECTED after 5s
47 
48  // Berth actuator state
49  typedef enum {
50  ACT_RETRACT = 0x00,
52  ACT_DEPLOYED = 0x03
53  } ActuatorState;
54 
55  // The DockState is the state of the whole dock system
56  typedef struct {
57  uint8_t serial_number[6];
58  uint8_t subsys_1_pwr;
59  uint8_t subsys_2_pwr;
60  uint8_t led_state;
61  uint8_t actuator_state[2];
62  uint8_t conn_state[2];
63  uint8_t loop_back[2];
64  uint32_t flags;
65  } DockState;
66 
67  // We reuse the various contants from the EPS driver to ensure that we keep
68  // the EPS and smart dock consistent with each other.
69  typedef struct {
70  uint8_t power_state; // EPS::DockStateValue
71  uint8_t serial[6]; // Serial number
72  uint8_t terminate; // Terminate button
73  uint32_t channel_mask; // EPS::Channel
74  uint8_t charge_mask; // EPS::Charger
75  uint8_t dock_state; // EPS::DockStateVal
76  EPS::BatteryInfo batteries[EPS::NUM_BATTERIES]; // Battery states
77  uint32_t fault_mask; // EPS::Fault mask
78  } BerthState;
79 
80  // All possible EPS commands
81  enum BerthCommand {
95  };
96 
97  // Berths
98  enum Berth {
102  };
103 
104  // String type
105  enum String : uint32_t {
110  };
111 
112  // Channel indexes
113  enum Channel : uint32_t {
147  };
148 
149  // Faults
150  enum Fault : uint32_t {
163  };
164 
165  // Housekeeping
166  enum Housekeeping : uint32_t {
184  };
185 
186  // LEDs
187  enum Led : uint32_t {
195  };
196 
197  // LED Mode
198  enum LedMode : uint8_t {
205  };
206 
207  // Constructor requires a vaid i2c device and sleep() callback function
208  explicit SmartDock(const i2c::Device &i2c_dev);
209 
210  // Destructor
211  ~SmartDock(void);
212 
213  // One-shot
214  bool ClearFaults(void);
215  bool Reboot(void);
216  bool SendBerthCommand(uint32_t mask, BerthCommand const value);
217 
218  // Getters
219  bool GetStrings(uint32_t mask, std::map<String, std::string> & data);
220  bool GetHousekeeping(uint32_t mask, std::map<Housekeeping, double> & data);
221  bool GetFaults(uint32_t mask, std::map<Fault, bool> & data);
222  bool GetChannels(uint32_t mask, std::map<Channel, bool> & data);
223  bool GetBerthStates(uint32_t mask, std::map<Berth, BerthState> & data);
224  bool GetSystemState(DockState & data);
225 
226  // Setters
227  bool SetLeds(uint32_t mask, LedMode const value);
228  bool SetChannels(uint32_t mask, bool const value);
229 
230  protected:
231  static constexpr size_t I2C_BUF_MAX_LEN = 256;
232  static constexpr uint8_t I2C_RESP_ACK = 0xEE;
233  static constexpr uint8_t I2C_RESP_NACK = 0xFF;
234  static constexpr uint8_t I2C_CMD_NONE = 0x00;
235  static constexpr uint8_t I2C_CMD_GET_SW_VERSION = 0x02;
236  static constexpr uint8_t I2C_CMD_GET_BUILD_TIME = 0x03;
237  static constexpr uint8_t I2C_CMD_SW_ON = 0x04;
238  static constexpr uint8_t I2C_CMD_SW_OFF = 0x05;
239  static constexpr uint8_t I2C_CMD_GET_SW_STATES = 0x06;
240  static constexpr uint8_t I2C_CMD_GET_SYSTEM_STATE = 0x07;
241  static constexpr uint8_t I2C_CMD_SET_LED_MODES = 0x08;
242  static constexpr uint8_t I2C_CMD_GET_HK = 0x09;
243  static constexpr uint8_t I2C_CMD_GET_HW_EXCEPTIONS = 0x0A;
244  static constexpr uint8_t I2C_CMD_CLR_HW_EXCEPTIONS = 0x0B;
245  static constexpr uint8_t I2C_CMD_GET_DIGITAL_TEMPS = 0x0C;
246  static constexpr uint8_t I2C_CMD_GET_SERIAL_NUMBER = 0x0D;
247  static constexpr uint8_t I2C_CMD_REBOOT = 0x0F;
248  static constexpr uint8_t I2C_CMD_ENTER_BOOTLOADER = 0x0E;
249  static constexpr uint8_t I2C_CMD_GET_BATTERY_STATUS = 0x40;
250  static constexpr uint8_t I2C_CMD_RING_BUZZER = 0x41;
251  static constexpr uint8_t I2C_CMD_CLR_TERMINATE_EVT = 0x42;
252  static constexpr uint8_t I2C_CMD_UNDOCK = 0x43;
253  static constexpr uint8_t I2C_CMD_GET_CONNECTION_STATE = 0x44;
254  static constexpr uint8_t I2C_CMD_SET_CHARGE_STATE = 0x45;
255  static constexpr uint8_t I2C_CMD_GET_CHARGE_STATE = 0x46;
256  static constexpr uint8_t I2C_CMD_SET_EPS_POWER_MODE = 0x47;
257  static constexpr uint8_t I2C_CMD_GET_EPS_POWER_MODE = 0x48;
258  static constexpr uint8_t I2C_CMD_GET_CONNECTED_EPS_STATE = 0x71;
259  static constexpr uint8_t I2C_CMD_GET_CONN_STATE = 0x72;
260  static constexpr uint8_t I2C_CMD_GET_EPS_CMD = 0x75;
261  static constexpr uint8_t I2C_CMD_SET_EPS_CMD = 0x76;
262  static constexpr uint8_t I2C_CMD_SEND_EPS_STATE_TO_DOCK = 0xD0;
263  static constexpr uint8_t DOCK_BERTH_ID_MIN = 1;
264  static constexpr uint8_t DOCK_BERTH_ID_MAX = 2;
265  static constexpr size_t kDockStateLength = 19;
266 
267  // Sleep function easy since ROS is not used
268  void Sleep(uint32_t microseconds);
269 
270  // Read an i2c frame + 1 byte checksum
271  uint16_t Read(uint8_t *buff);
272 
273  // Read an i2c frame size of len.
274  uint16_t Read(uint8_t *buff, uint16_t len);
275 
276  // Write an i2c frame + 1 byte checksum
277  uint16_t Write(uint8_t *buff, uint16_t len);
278 
279  // Compute checksum
280  uint8_t ComputeChecksum(uint8_t *buf, size_t size);
281 
282  private:
283  i2c::Device i2c_dev_; // Device
284 };
285 
286 } // namespace smart_dock
287 
288 #endif // SMART_DOCK_SMART_DOCK_H_
smart_dock::SmartDock::FAULT_OC_BERTH_2
@ FAULT_OC_BERTH_2
Definition: smart_dock.h:152
smart_dock::SmartDock::FAULT_WDT2_DOCKCTL_REBOOT
@ FAULT_WDT2_DOCKCTL_REBOOT
Definition: smart_dock.h:159
smart_dock::SmartDock::I2C_CMD_GET_SW_STATES
static constexpr uint8_t I2C_CMD_GET_SW_STATES
Definition: smart_dock.h:239
smart_dock::SmartDock::ACT_DEPLOYED
@ ACT_DEPLOYED
Definition: smart_dock.h:52
smart_dock::SmartDock::BerthState::dock_state
uint8_t dock_state
Definition: smart_dock.h:75
smart_dock::SmartDock::HK_AS1_I
@ HK_AS1_I
Definition: smart_dock.h:176
smart_dock::SmartDock::STRING_SW_VERSION
@ STRING_SW_VERSION
Definition: smart_dock.h:106
smart_dock::SmartDock::NUM_CONNECTION_STATES
@ NUM_CONNECTION_STATES
Definition: smart_dock.h:45
smart_dock::SmartDock::I2C_CMD_CLR_HW_EXCEPTIONS
static constexpr uint8_t I2C_CMD_CLR_HW_EXCEPTIONS
Definition: smart_dock.h:244
smart_dock::SmartDock::I2C_CMD_CLR_TERMINATE_EVT
static constexpr uint8_t I2C_CMD_CLR_TERMINATE_EVT
Definition: smart_dock.h:251
smart_dock::SmartDock::CHANNEL_RESERVED3
@ CHANNEL_RESERVED3
Definition: smart_dock.h:121
smart_dock::SmartDock::I2C_CMD_GET_CONN_STATE
static constexpr uint8_t I2C_CMD_GET_CONN_STATE
Definition: smart_dock.h:259
smart_dock::SmartDock::COMMAND_ENABLE_ALL_PMCS
@ COMMAND_ENABLE_ALL_PMCS
Definition: smart_dock.h:91
smart_dock::SmartDock::CHANNEL_RESERVED5
@ CHANNEL_RESERVED5
Definition: smart_dock.h:128
smart_dock::SmartDock::I2C_RESP_ACK
static constexpr uint8_t I2C_RESP_ACK
Definition: smart_dock.h:232
smart_dock::SmartDock::I2C_CMD_GET_SERIAL_NUMBER
static constexpr uint8_t I2C_CMD_GET_SERIAL_NUMBER
Definition: smart_dock.h:246
smart_dock::SmartDock::GetHousekeeping
bool GetHousekeeping(uint32_t mask, std::map< Housekeeping, double > &data)
Definition: smart_dock.cc:304
smart_dock::SmartDock::NUM_CHANNELS
@ NUM_CHANNELS
Definition: smart_dock.h:146
smart_dock::SmartDock::~SmartDock
~SmartDock(void)
Definition: smart_dock.cc:34
smart_dock::SmartDock::SetLeds
bool SetLeds(uint32_t mask, LedMode const value)
Definition: smart_dock.cc:320
smart_dock::SmartDock::CHANNEL_LED_5
@ CHANNEL_LED_5
Definition: smart_dock.h:134
smart_dock::SmartDock::BerthState::charge_mask
uint8_t charge_mask
Definition: smart_dock.h:74
smart_dock::SmartDock::I2C_BUF_MAX_LEN
static constexpr size_t I2C_BUF_MAX_LEN
Definition: smart_dock.h:231
smart_dock::SmartDock::HK_AS2_I
@ HK_AS2_I
Definition: smart_dock.h:175
smart_dock::SmartDock::CONN_DISCONNECTED
@ CONN_DISCONNECTED
Definition: smart_dock.h:42
smart_dock::SmartDock::I2C_CMD_SET_EPS_POWER_MODE
static constexpr uint8_t I2C_CMD_SET_EPS_POWER_MODE
Definition: smart_dock.h:256
smart_dock::SmartDock::CHANNEL_RESERVED4
@ CHANNEL_RESERVED4
Definition: smart_dock.h:127
smart_dock::SmartDock::CHANNEL_LED_2
@ CHANNEL_LED_2
Definition: smart_dock.h:131
smart_dock::SmartDock::FAULT_OT_CHARGER
@ FAULT_OT_CHARGER
Definition: smart_dock.h:155
smart_dock::SmartDock::LED_2
@ LED_2
Definition: smart_dock.h:189
smart_dock::SmartDock::DockState
Definition: smart_dock.h:56
smart_dock::SmartDock::CHANNEL_DEV1_PWR_EN
@ CHANNEL_DEV1_PWR_EN
Definition: smart_dock.h:117
smart_dock::SmartDock::STRING_BUILD
@ STRING_BUILD
Definition: smart_dock.h:107
smart_dock::SmartDock::GetSystemState
bool GetSystemState(DockState &data)
Definition: smart_dock.cc:294
smart_dock::SmartDock::I2C_CMD_UNDOCK
static constexpr uint8_t I2C_CMD_UNDOCK
Definition: smart_dock.h:252
smart_dock::SmartDock::BerthState::fault_mask
uint32_t fault_mask
Definition: smart_dock.h:77
smart_dock::SmartDock::HK_EC_PWR_I
@ HK_EC_PWR_I
Definition: smart_dock.h:173
smart_dock::SmartDock::I2C_CMD_GET_HW_EXCEPTIONS
static constexpr uint8_t I2C_CMD_GET_HW_EXCEPTIONS
Definition: smart_dock.h:243
smart_dock::SmartDock::HK_FAN_MAG_I
@ HK_FAN_MAG_I
Definition: smart_dock.h:167
smart_dock
Definition: smart_dock.h:30
smart_dock::SmartDock::CHANNEL_ACT_SIGOUT1
@ CHANNEL_ACT_SIGOUT1
Definition: smart_dock.h:123
smart_dock::SmartDock::HK_DEV1_I
@ HK_DEV1_I
Definition: smart_dock.h:182
smart_dock::SmartDock::CHANNEL_LED_4
@ CHANNEL_LED_4
Definition: smart_dock.h:133
smart_dock::SmartDock::Led
Led
Definition: smart_dock.h:187
smart_dock::SmartDock::CHANNEL_ACT_SIGOUT2
@ CHANNEL_ACT_SIGOUT2
Definition: smart_dock.h:122
smart_dock::SmartDock::I2C_CMD_GET_BUILD_TIME
static constexpr uint8_t I2C_CMD_GET_BUILD_TIME
Definition: smart_dock.h:236
smart_dock::SmartDock::BerthState::channel_mask
uint32_t channel_mask
Definition: smart_dock.h:73
smart_dock::SmartDock::kDockStateLength
static constexpr size_t kDockStateLength
Definition: smart_dock.h:265
smart_dock::SmartDock::CHANNEL_LED_6
@ CHANNEL_LED_6
Definition: smart_dock.h:135
smart_dock::SmartDock::CHANNEL_LED_1
@ CHANNEL_LED_1
Definition: smart_dock.h:130
smart_dock::SmartDock::LED_3
@ LED_3
Definition: smart_dock.h:190
smart_dock::SmartDock::ON
static constexpr uint8_t ON
Definition: smart_dock.h:38
smart_dock::SmartDock::Fault
Fault
Definition: smart_dock.h:150
smart_dock::SmartDock::SmartDock
SmartDock(const i2c::Device &i2c_dev)
Definition: smart_dock.cc:32
smart_dock::SmartDock::I2C_RESP_NACK
static constexpr uint8_t I2C_RESP_NACK
Definition: smart_dock.h:233
smart_dock::SmartDock::NUM_BERTHS
@ NUM_BERTHS
Definition: smart_dock.h:101
smart_dock::SmartDock::I2C_CMD_NONE
static constexpr uint8_t I2C_CMD_NONE
Definition: smart_dock.h:234
smart_dock::SmartDock::ClearFaults
bool ClearFaults(void)
Definition: smart_dock.cc:45
smart_dock::SmartDock::COMMAND_CLEAR_TERMINATE
@ COMMAND_CLEAR_TERMINATE
Definition: smart_dock.h:87
smart_dock::SmartDock::CHANNEL_RESERVED13
@ CHANNEL_RESERVED13
Definition: smart_dock.h:142
smart_dock::SmartDock::NUM_FAULTS
@ NUM_FAULTS
Definition: smart_dock.h:162
smart_dock::SmartDock::CHANNEL_RESERVED0
@ CHANNEL_RESERVED0
Definition: smart_dock.h:118
smart_dock::SmartDock::CHANNEL_RESERVED7
@ CHANNEL_RESERVED7
Definition: smart_dock.h:136
smart_dock::SmartDock::BerthState::power_state
uint8_t power_state
Definition: smart_dock.h:70
smart_dock::SmartDock::DockState::led_state
uint8_t led_state
Definition: smart_dock.h:60
smart_dock::SmartDock::COMMAND_SET_POWER_MODE_AWAKE_SAFE
@ COMMAND_SET_POWER_MODE_AWAKE_SAFE
Definition: smart_dock.h:85
smart_dock::SmartDock::BERTH_2
@ BERTH_2
Definition: smart_dock.h:100
smart_dock::SmartDock::HK_DEV2_T_PROTECT
@ HK_DEV2_T_PROTECT
Definition: smart_dock.h:179
mask
uint8_t mask
Definition: signal_lights.h:72
smart_dock::SmartDock::I2C_CMD_GET_SYSTEM_STATE
static constexpr uint8_t I2C_CMD_GET_SYSTEM_STATE
Definition: smart_dock.h:240
smart_dock::SmartDock::CHANNEL_RESERVED6
@ CHANNEL_RESERVED6
Definition: smart_dock.h:129
smart_dock::SmartDock::I2C_CMD_GET_EPS_POWER_MODE
static constexpr uint8_t I2C_CMD_GET_EPS_POWER_MODE
Definition: smart_dock.h:257
smart_dock::SmartDock::HK_DEV2_I
@ HK_DEV2_I
Definition: smart_dock.h:181
smart_dock::SmartDock::Read
uint16_t Read(uint8_t *buff)
Definition: smart_dock.cc:400
smart_dock::SmartDock::CHANNEL_DEV_EN
@ CHANNEL_DEV_EN
Definition: smart_dock.h:114
smart_dock::SmartDock::COMMAND_SET_POWER_MODE_AWAKE_NOMINAL
@ COMMAND_SET_POWER_MODE_AWAKE_NOMINAL
Definition: smart_dock.h:84
smart_dock::SmartDock::CHANNEL_RESERVED9
@ CHANNEL_RESERVED9
Definition: smart_dock.h:138
smart_dock::SmartDock::HK_A_GND_V1
@ HK_A_GND_V1
Definition: smart_dock.h:174
smart_dock::SmartDock::CHANNEL_FAN_EN
@ CHANNEL_FAN_EN
Definition: smart_dock.h:126
smart_dock::SmartDock::I2C_CMD_SET_LED_MODES
static constexpr uint8_t I2C_CMD_SET_LED_MODES
Definition: smart_dock.h:241
smart_dock::SmartDock::COMMAND_CLEAR_FAULTS
@ COMMAND_CLEAR_FAULTS
Definition: smart_dock.h:88
eps_driver::EPS::BatteryInfo
Definition: eps_driver.h:234
smart_dock::SmartDock::ConnectionState
ConnectionState
Definition: smart_dock.h:41
smart_dock::SmartDock::DockState::flags
uint32_t flags
Definition: smart_dock.h:64
smart_dock::SmartDock::FAULT_OC_BERTH_1
@ FAULT_OC_BERTH_1
Definition: smart_dock.h:151
smart_dock::SmartDock::OFF
static constexpr uint8_t OFF
Definition: smart_dock.h:37
smart_dock::SmartDock::FAULT_WDT3_DOCKPC_REBOOT
@ FAULT_WDT3_DOCKPC_REBOOT
Definition: smart_dock.h:160
smart_dock::SmartDock::CHANNEL_EC_PWR_EN
@ CHANNEL_EC_PWR_EN
Definition: smart_dock.h:115
smart_dock::SmartDock::FAULT_OC_DOCK_PROCESSOR
@ FAULT_OC_DOCK_PROCESSOR
Definition: smart_dock.h:154
smart_dock::SmartDock::DOCK_BERTH_ID_MIN
static constexpr uint8_t DOCK_BERTH_ID_MIN
Definition: smart_dock.h:263
smart_dock::SmartDock::I2C_CMD_REBOOT
static constexpr uint8_t I2C_CMD_REBOOT
Definition: smart_dock.h:247
smart_dock::SmartDock::FAULT_OT_ACTUATOR_2
@ FAULT_OT_ACTUATOR_2
Definition: smart_dock.h:157
smart_dock::SmartDock::FAULT_WDT4_DOCKCTL_REBOOT
@ FAULT_WDT4_DOCKCTL_REBOOT
Definition: smart_dock.h:161
smart_dock::SmartDock::COMMAND_SET_POWER_MODE_CRITICAL_FAULT
@ COMMAND_SET_POWER_MODE_CRITICAL_FAULT
Definition: smart_dock.h:86
smart_dock::SmartDock
Definition: smart_dock.h:35
smart_dock::SmartDock::I2C_CMD_SET_CHARGE_STATE
static constexpr uint8_t I2C_CMD_SET_CHARGE_STATE
Definition: smart_dock.h:254
smart_dock::SmartDock::COMMAND_UNKNOWN
@ COMMAND_UNKNOWN
Definition: smart_dock.h:82
smart_dock::SmartDock::String
String
Definition: smart_dock.h:105
smart_dock::SmartDock::NUM_LEDS
@ NUM_LEDS
Definition: smart_dock.h:194
smart_dock::SmartDock::CHANNEL_RESERVED8
@ CHANNEL_RESERVED8
Definition: smart_dock.h:137
smart_dock::SmartDock::CHANNEL_RESERVED14
@ CHANNEL_RESERVED14
Definition: smart_dock.h:143
smart_dock::SmartDock::LED_MODE_BLINK_0_5HZ
@ LED_MODE_BLINK_0_5HZ
Definition: smart_dock.h:203
smart_dock::SmartDock::DockState::subsys_1_pwr
uint8_t subsys_1_pwr
Definition: smart_dock.h:58
smart_dock::SmartDock::LED_4
@ LED_4
Definition: smart_dock.h:191
eps_driver.h
smart_dock::SmartDock::I2C_CMD_GET_CONNECTED_EPS_STATE
static constexpr uint8_t I2C_CMD_GET_CONNECTED_EPS_STATE
Definition: smart_dock.h:258
smart_dock::SmartDock::HK_VLIVE_I
@ HK_VLIVE_I
Definition: smart_dock.h:170
smart_dock::SmartDock::LED_1
@ LED_1
Definition: smart_dock.h:188
smart_dock::SmartDock::GetStrings
bool GetStrings(uint32_t mask, std::map< String, std::string > &data)
Definition: smart_dock.cc:179
smart_dock::SmartDock::NUM_STRINGS
@ NUM_STRINGS
Definition: smart_dock.h:109
smart_dock::SmartDock::LED_MODE_BLINK_2HZ
@ LED_MODE_BLINK_2HZ
Definition: smart_dock.h:201
smart_dock::SmartDock::I2C_CMD_ENTER_BOOTLOADER
static constexpr uint8_t I2C_CMD_ENTER_BOOTLOADER
Definition: smart_dock.h:248
smart_dock::SmartDock::CONN_CONNECTED
@ CONN_CONNECTED
Definition: smart_dock.h:44
smart_dock::SmartDock::STRING_SERIAL
@ STRING_SERIAL
Definition: smart_dock.h:108
smart_dock::SmartDock::BerthState::terminate
uint8_t terminate
Definition: smart_dock.h:72
smart_dock::SmartDock::NUM_COMMANDS
@ NUM_COMMANDS
Definition: smart_dock.h:94
smart_dock::SmartDock::HK_A_GND_V3
@ HK_A_GND_V3
Definition: smart_dock.h:180
smart_dock::SmartDock::HK_DEV1_T_PROTECT
@ HK_DEV1_T_PROTECT
Definition: smart_dock.h:178
smart_dock::SmartDock::GetFaults
bool GetFaults(uint32_t mask, std::map< Fault, bool > &data)
Definition: smart_dock.cc:224
smart_dock::SmartDock::HK_A_GND_V2
@ HK_A_GND_V2
Definition: smart_dock.h:177
smart_dock::SmartDock::Channel
Channel
Definition: smart_dock.h:113
smart_dock::SmartDock::Housekeeping
Housekeeping
Definition: smart_dock.h:166
smart_dock::SmartDock::NUM_LED_MODES
@ NUM_LED_MODES
Definition: smart_dock.h:204
smart_dock::SmartDock::Write
uint16_t Write(uint8_t *buff, uint16_t len)
Definition: smart_dock.cc:434
smart_dock::SmartDock::CHANNEL_DEV2_PWR_EN
@ CHANNEL_DEV2_PWR_EN
Definition: smart_dock.h:116
smart_dock::SmartDock::ComputeChecksum
uint8_t ComputeChecksum(uint8_t *buf, size_t size)
Definition: smart_dock.cc:448
smart_dock::SmartDock::CHANNEL_RESERVED15
@ CHANNEL_RESERVED15
Definition: smart_dock.h:144
smart_dock::SmartDock::I2C_CMD_GET_BATTERY_STATUS
static constexpr uint8_t I2C_CMD_GET_BATTERY_STATUS
Definition: smart_dock.h:249
smart_dock::SmartDock::I2C_CMD_GET_DIGITAL_TEMPS
static constexpr uint8_t I2C_CMD_GET_DIGITAL_TEMPS
Definition: smart_dock.h:245
smart_dock::SmartDock::BerthState
Definition: smart_dock.h:69
smart_dock::SmartDock::COMMAND_SET_POWER_MODE_HIBERNATE
@ COMMAND_SET_POWER_MODE_HIBERNATE
Definition: smart_dock.h:83
smart_dock::SmartDock::I2C_CMD_GET_HK
static constexpr uint8_t I2C_CMD_GET_HK
Definition: smart_dock.h:242
smart_dock::SmartDock::I2C_CMD_GET_CONNECTION_STATE
static constexpr uint8_t I2C_CMD_GET_CONNECTION_STATE
Definition: smart_dock.h:253
smart_dock::SmartDock::CHANNEL_RESERVED16
@ CHANNEL_RESERVED16
Definition: smart_dock.h:145
smart_dock::SmartDock::DOCK_BERTH_ID_MAX
static constexpr uint8_t DOCK_BERTH_ID_MAX
Definition: smart_dock.h:264
smart_dock::SmartDock::LED_MODE_OFF
@ LED_MODE_OFF
Definition: smart_dock.h:199
smart_dock::SmartDock::ActuatorState
ActuatorState
Definition: smart_dock.h:49
i2c_new.h
smart_dock::SmartDock::Sleep
void Sleep(uint32_t microseconds)
Definition: smart_dock.cc:357
smart_dock::SmartDock::COMMAND_DISABLE_ALL_PAYLOADS
@ COMMAND_DISABLE_ALL_PAYLOADS
Definition: smart_dock.h:90
smart_dock::SmartDock::COMMAND_DISABLE_ALL_PMCS
@ COMMAND_DISABLE_ALL_PMCS
Definition: smart_dock.h:92
smart_dock::SmartDock::ACT_RETRACTING
@ ACT_RETRACTING
Definition: smart_dock.h:51
smart_dock::SmartDock::FAULT_WDT1_EPS_REBOOT
@ FAULT_WDT1_EPS_REBOOT
Definition: smart_dock.h:158
smart_dock::SmartDock::I2C_CMD_GET_EPS_CMD
static constexpr uint8_t I2C_CMD_GET_EPS_CMD
Definition: smart_dock.h:260
smart_dock::SmartDock::GetChannels
bool GetChannels(uint32_t mask, std::map< Channel, bool > &data)
Definition: smart_dock.cc:211
smart_dock::SmartDock::CHANNEL_AS1_PWR_EN
@ CHANNEL_AS1_PWR_EN
Definition: smart_dock.h:125
smart_dock::SmartDock::NUM_HOUSEKEEPING
@ NUM_HOUSEKEEPING
Definition: smart_dock.h:183
smart_dock::SmartDock::I2C_CMD_SW_OFF
static constexpr uint8_t I2C_CMD_SW_OFF
Definition: smart_dock.h:238
smart_dock::SmartDock::Reboot
bool Reboot(void)
Definition: smart_dock.cc:39
smart_dock::SmartDock::COMMAND_REBOOT
@ COMMAND_REBOOT
Definition: smart_dock.h:93
smart_dock::SmartDock::CHANNEL_AS2_PWR_EN
@ CHANNEL_AS2_PWR_EN
Definition: smart_dock.h:124
eps_driver::EPS::NUM_BATTERIES
@ NUM_BATTERIES
Definition: eps_driver.h:197
smart_dock::SmartDock::CHANNEL_LED_3
@ CHANNEL_LED_3
Definition: smart_dock.h:132
smart_dock::SmartDock::FAULT_OC_SYSTEM
@ FAULT_OC_SYSTEM
Definition: smart_dock.h:153
smart_dock::SmartDock::LED_MODE_ON
@ LED_MODE_ON
Definition: smart_dock.h:200
smart_dock::SmartDock::CHANNEL_RESERVED10
@ CHANNEL_RESERVED10
Definition: smart_dock.h:139
smart_dock::EPS
eps_driver::EPS EPS
Definition: smart_dock.h:32
smart_dock::SmartDock::BerthCommand
BerthCommand
Definition: smart_dock.h:81
smart_dock::SmartDock::ACT_RETRACT
@ ACT_RETRACT
Definition: smart_dock.h:50
smart_dock::SmartDock::Berth
Berth
Definition: smart_dock.h:98
smart_dock::SmartDock::SendBerthCommand
bool SendBerthCommand(uint32_t mask, BerthCommand const value)
Definition: smart_dock.cc:51
i2c::Device
Definition: i2c_new.h:82
smart_dock::SmartDock::HK_CHR_V_V
@ HK_CHR_V_V
Definition: smart_dock.h:168
smart_dock::SmartDock::I2C_CMD_GET_CHARGE_STATE
static constexpr uint8_t I2C_CMD_GET_CHARGE_STATE
Definition: smart_dock.h:255
smart_dock::SmartDock::GetBerthStates
bool GetBerthStates(uint32_t mask, std::map< Berth, BerthState > &data)
Definition: smart_dock.cc:236
smart_dock::SmartDock::SetChannels
bool SetChannels(uint32_t mask, bool const value)
Definition: smart_dock.cc:342
eps_driver::EPS
Definition: eps_driver.h:32
smart_dock::SmartDock::HK_MAIN5_PWR_I
@ HK_MAIN5_PWR_I
Definition: smart_dock.h:171
smart_dock::SmartDock::LED_6
@ LED_6
Definition: smart_dock.h:193
smart_dock::SmartDock::CHANNEL_RESERVED2
@ CHANNEL_RESERVED2
Definition: smart_dock.h:120
smart_dock::SmartDock::CHANNEL_RESERVED12
@ CHANNEL_RESERVED12
Definition: smart_dock.h:141
smart_dock::SmartDock::FAULT_OT_ACTUATOR_1
@ FAULT_OT_ACTUATOR_1
Definition: smart_dock.h:156
smart_dock::SmartDock::I2C_CMD_SW_ON
static constexpr uint8_t I2C_CMD_SW_ON
Definition: smart_dock.h:237
smart_dock::SmartDock::I2C_CMD_SET_EPS_CMD
static constexpr uint8_t I2C_CMD_SET_EPS_CMD
Definition: smart_dock.h:261
smart_dock::SmartDock::CHANNEL_RESERVED11
@ CHANNEL_RESERVED11
Definition: smart_dock.h:140
smart_dock::SmartDock::I2C_CMD_GET_SW_VERSION
static constexpr uint8_t I2C_CMD_GET_SW_VERSION
Definition: smart_dock.h:235
smart_dock::SmartDock::BERTH_1
@ BERTH_1
Definition: smart_dock.h:99
smart_dock::SmartDock::LED_5
@ LED_5
Definition: smart_dock.h:192
smart_dock::SmartDock::HK_CHR_T_PROTECT
@ HK_CHR_T_PROTECT
Definition: smart_dock.h:169
smart_dock::SmartDock::DockState::subsys_2_pwr
uint8_t subsys_2_pwr
Definition: smart_dock.h:59
smart_dock::SmartDock::LedMode
LedMode
Definition: smart_dock.h:198
smart_dock::SmartDock::I2C_CMD_SEND_EPS_STATE_TO_DOCK
static constexpr uint8_t I2C_CMD_SEND_EPS_STATE_TO_DOCK
Definition: smart_dock.h:262
smart_dock::SmartDock::COMMAND_ENABLE_ALL_PAYLOADS
@ COMMAND_ENABLE_ALL_PAYLOADS
Definition: smart_dock.h:89
smart_dock::SmartDock::CONN_CONNECTING
@ CONN_CONNECTING
Definition: smart_dock.h:43
smart_dock::SmartDock::HK_DEV_I
@ HK_DEV_I
Definition: smart_dock.h:172
smart_dock::SmartDock::LED_MODE_BLINK_1HZ
@ LED_MODE_BLINK_1HZ
Definition: smart_dock.h:202
smart_dock::SmartDock::CHANNEL_RESERVED1
@ CHANNEL_RESERVED1
Definition: smart_dock.h:119
smart_dock::SmartDock::I2C_CMD_RING_BUZZER
static constexpr uint8_t I2C_CMD_RING_BUZZER
Definition: smart_dock.h:250