DUNE: Uniform Navigational Environment
2019.02.1
|
Public Types | |
typedef std::map< std::string, PowerChannel * > | PowerChannelMap |
Public Member Functions | |
Task (const std::string &name, Tasks::Context &ctx) | |
~Task (void) | |
void | onUpdateParameters (void) |
void | clearPowerChannels (void) |
void | onEntityReservation (void) |
void | onResourceAcquisition (void) |
void | onResourceInitialization (void) |
void | packParam (unsigned index, double value, uint8_t *bfr) |
void | updateParams (void) |
void | controlPowerChannel (PowerChannel *channel, IMC::PowerChannelControl::OperationEnum op, double sched=-1.0) |
void | writeLCD (unsigned line, const uint8_t *data, unsigned data_len) |
void | consume (const IMC::LcdControl *msg) |
void | consume (const IMC::PowerChannelControl *msg) |
void | consume (const IMC::QueryPowerChannelState *msg) |
void | onCommand (uint8_t cmd, const uint8_t *data, int data_size) |
void | sendMessages (const uint16_t *unpack) |
bool | waitForCommand (uint8_t code) |
void | onVersion (unsigned major, unsigned minor, unsigned patch) |
void | checkSchedules (void) |
void | updatePowerChannels (void) |
void | onMain (void) |
Public Attributes | |
Arguments | m_args |
Hardware::LUCL::Protocol | m_proto |
bool | m_pwr_down |
uint16_t | m_pwr_chns |
MCP23017 * | m_gpios |
bool | m_halt |
IMC::Message * | m_adcs [c_adcs_count] |
PowerChannelMap | m_pwr_chs |
Static Public Attributes | |
static const uint8_t | c_addr |
typedef std::map<std::string, PowerChannel*> Power::MCBv2::Task::PowerChannelMap |
Convenience type definition for a table of power channels.
|
inline |
References Power::MCBv2::Arguments::adc_elabels, Power::MCBv2::Arguments::adc_factors, Power::MCBv2::Arguments::adc_messages, Power::MCBv2::Arguments::adc_ref, Power::MCBv2::Arguments::charged_amp, Power::MCBv2::Arguments::i2c_dev, Power::MCBv2::Arguments::lcd, Power::MCBv2::Arguments::model, Power::MCBv2::Arguments::pwr_names, and Power::MCBv2::Arguments::pwr_states.
|
inline |
|
inline |
Check schedules.
References Power::MCBv2::PowerChannel::sched_off, Power::MCBv2::PowerChannel::sched_on, and Power::MCBv2::PowerChannel::state.
|
inline |
|
inline |
References Power::MCBv2::Arguments::lcd.
|
inline |
References Power::MCBv2::CMD_HALT, and Power::MCBv2::CMD_SAVE.
|
inline |
|
inline |
|
inline |
On Command call.
[in] | cmd | command. |
[in] | data | buffer of data. |
[in] | data_size | size of data. |
References Power::MCBv2::BIT_SW_SYS_ON, and Power::MCBv2::CMD_STATE.
|
inline |
Reserve entities.
References Power::MCBv2::Arguments::adc_elabels.
|
inline |
References Power::MCBv2::CMD_STATE.
|
inline |
Acquire resources.
References Power::MCBv2::MCP23017::getGPIOs(), and Power::MCBv2::Arguments::i2c_dev.
|
inline |
Initialize resources.
|
inline |
|
inline |
On version call.
[in] | major | major version number. |
[in] | minor | minor version number. |
[in] | patch | patch version number. |
|
inline |
Write value to position in a given buffer.
[in] | index | position index. |
[in] | value | value to be written. |
[out] | bfr | buffer. |
|
inline |
Send Message.
[in] | unpack | pointer to unpacked data buffer. |
References Power::MCBv2::Arguments::adc_factors, and Power::MCBv2::Arguments::adc_ref.
|
inline |
Update parameters.
References Power::MCBv2::Arguments::adc_factors, Power::MCBv2::Arguments::adc_ref, Power::MCBv2::Arguments::charged_amp, and Power::MCBv2::CMD_PARAMS.
|
inline |
|
inline |
Wait for command.
[in] | code | command code. |
|
inline |
References Power::MCBv2::CMD_LCD_LINE.
|
static |
Device I2C address.
IMC::Message* Power::MCBv2::Task::m_adcs[c_adcs_count] |
ADC messages.
MCP23017* Power::MCBv2::Task::m_gpios |
GPIO controller.
bool Power::MCBv2::Task::m_halt |
True if system was shutdown.
Hardware::LUCL::Protocol Power::MCBv2::Task::m_proto |
Device protocol handler.
uint16_t Power::MCBv2::Task::m_pwr_chns |
Power channels (1 bit per channel).
PowerChannelMap Power::MCBv2::Task::m_pwr_chs |
Power channels by name.
bool Power::MCBv2::Task::m_pwr_down |
True if power down is in progress.