ardupilot/libraries/AP_ICEngine/AP_ICEngine_TCA9554.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
664 B
C
Raw Normal View History

/*
optional control of starter via a TCA9554 I2C
*/
#include "AP_ICEngine_config.h"
#if AP_ICENGINE_TCA9554_STARTER_ENABLED
#include "AP_ICEngine.h"
class AP_ICEngine_TCA9554 {
public:
void set_starter(bool on);
private:
AP_HAL::OwnPtr<AP_HAL::I2CDevice> dev_TCA9554;
enum TCA9554_state_t {
STARTER_OFF = 0x30, // output register - 0011 0000
STARTER_ON = 0x11, // output register - 0001 0001 - Forward direction
};
TCA9554_state_t last_state;
bool initialised;
bool TCA9554_init();
void TCA9554_set(TCA9554_state_t value);
uint32_t last_reg_check_ms;
};
#endif // AP_ICENGINE_TCA9554_STARTER_ENABLED