DUNE: Uniform Navigational Environment  2016.09.0
UserInterfaces::LCD::Task Struct Reference

Public Member Functions

 Task (const std::string &name, Tasks::Context &ctx)
 
 ~Task (void)
 
void onResourceRelease (void)
 
void onResourceAcquisition (void)
 
void onResourceInitialization (void)
 
void setBackLight (bool state)
 
void setDisplay (bool state)
 
void checkBacklight (void)
 
void enableBacklight (void)
 
void setCursor (unsigned col, unsigned row)
 
void clear (void)
 
void sendByte (uint8_t reg, uint8_t byte)
 
void writeNibble (uint8_t value, uint8_t pin=0x00)
 
void writeByte (uint8_t value, uint8_t pin=0x00)
 
void writeChar (char value)
 
void write (const char *str)
 
void writeLine (const char *str, unsigned nr=0)
 
void refresh (void)
 
void consume (const IMC::LcdControl *msg)
 
void onMain (void)
 

Public Attributes

Arguments m_args
 
Hardware::I2C * m_i2c
 
std::string m_lines [2]
 
std::string m_last_lines [2]
 
double m_last_refresh
 
Hardware::GPIO * m_blight
 
double m_blight_time
 
bool m_blight_state
 
bool m_display_state
 

Static Public Attributes

static const uint8_t c_addr
 
static const unsigned c_row_size
 

Constructor & Destructor Documentation

UserInterfaces::LCD::Task::Task ( const std::string &  name,
Tasks::Context &  ctx 
)
inline
UserInterfaces::LCD::Task::~Task ( void  )
inline

References setDisplay().

Member Function Documentation

void UserInterfaces::LCD::Task::checkBacklight ( void  )
inline
void UserInterfaces::LCD::Task::clear ( void  )
inline

References UserInterfaces::LCD::INST_CLEAR, and writeByte().

Referenced by consume().

void UserInterfaces::LCD::Task::consume ( const IMC::LcdControl *  msg)
inline

References clear(), and writeLine().

void UserInterfaces::LCD::Task::enableBacklight ( void  )
inline

References m_blight_time, and setBackLight().

Referenced by writeLine().

void UserInterfaces::LCD::Task::onMain ( void  )
inline
void UserInterfaces::LCD::Task::onResourceAcquisition ( void  )
inline
void UserInterfaces::LCD::Task::onResourceRelease ( void  )
inline

References m_blight, and m_i2c.

void UserInterfaces::LCD::Task::refresh ( void  )
inline

References m_last_lines, m_last_refresh, m_lines, write(), and writeByte().

Referenced by writeLine().

void UserInterfaces::LCD::Task::sendByte ( uint8_t  reg,
uint8_t  byte 
)
inline

References m_i2c.

Referenced by onResourceInitialization(), and writeNibble().

void UserInterfaces::LCD::Task::setBackLight ( bool  state)
inline
void UserInterfaces::LCD::Task::setCursor ( unsigned  col,
unsigned  row 
)
inline
void UserInterfaces::LCD::Task::setDisplay ( bool  state)
inline
void UserInterfaces::LCD::Task::write ( const char *  str)
inline

References writeChar().

Referenced by refresh().

void UserInterfaces::LCD::Task::writeByte ( uint8_t  value,
uint8_t  pin = 0x00 
)
inline
void UserInterfaces::LCD::Task::writeChar ( char  value)
inline

References UserInterfaces::LCD::PIN_RS, and writeByte().

Referenced by write().

void UserInterfaces::LCD::Task::writeLine ( const char *  str,
unsigned  nr = 0 
)
inline

References enableBacklight(), m_lines, and refresh().

Referenced by consume().

void UserInterfaces::LCD::Task::writeNibble ( uint8_t  value,
uint8_t  pin = 0x00 
)
inline

Member Data Documentation

const uint8_t UserInterfaces::LCD::Task::c_addr
static

Referenced by onResourceAcquisition().

const unsigned UserInterfaces::LCD::Task::c_row_size
static
Arguments UserInterfaces::LCD::Task::m_args
Hardware::GPIO* UserInterfaces::LCD::Task::m_blight
bool UserInterfaces::LCD::Task::m_blight_state

Referenced by setBackLight().

double UserInterfaces::LCD::Task::m_blight_time

Referenced by checkBacklight(), and enableBacklight().

bool UserInterfaces::LCD::Task::m_display_state

Referenced by setDisplay().

Hardware::I2C* UserInterfaces::LCD::Task::m_i2c
std::string UserInterfaces::LCD::Task::m_last_lines[2]

Referenced by refresh().

double UserInterfaces::LCD::Task::m_last_refresh

Referenced by onMain(), and refresh().

std::string UserInterfaces::LCD::Task::m_lines[2]

Referenced by refresh(), and writeLine().

Collaboration diagram for UserInterfaces::LCD::Task:
Collaboration graph