COSA
An Object-Oriented Platform for Arduino Programming
VLCD Class Reference

#include <VLCD.hh>

Inheritance diagram for VLCD:
Inheritance graph
Collaboration diagram for VLCD:
Collaboration graph

Classes

class  Slave
 

Public Types

enum  TextMode { NORMAL_TEXT_MODE = 0x00, INVERTED_TEXT_MODE = 0xff }
 

Public Member Functions

 VLCD (uint8_t addr=0x5a)
 
virtual bool begin ()
 
virtual bool end ()
 
virtual void backlight_on ()
 
virtual void backlight_off ()
 
virtual void display_on ()
 
virtual void display_off ()
 
virtual void display_clear ()
 
virtual void set_cursor (uint8_t x, uint8_t y)
 
virtual int putchar (char c)
 
virtual int write (const void *buf, size_t size)
 
virtual void display_contrast (uint8_t level)
 
virtual void display_normal ()
 
virtual void display_inverse ()
 
void get_cursor (uint8_t &x, uint8_t &y) const
 
uint8_t get_tab_step () const
 
void set_tab_step (uint8_t step)
 
TextMode text_mode (TextMode mode)
 
void non_blocking ()
 
void blocking ()
 
bool is_blocking () const
 
void eol (Mode mode)
 
Mode eol () const
 
virtual int available ()
 
virtual int room ()
 
virtual int puts (const char *s)
 
virtual int puts (str_P s)
 
virtual int write (const iovec_t *vec)
 
virtual int write_P (const void *buf, size_t size)
 
virtual int peekchar ()
 
virtual int peekchar (char c)
 
virtual int getchar ()
 
virtual char * gets (char *s, size_t count)
 
virtual int read (void *buf, size_t size)
 
virtual int read (iovec_t *vec)
 
virtual int flush ()
 
virtual void empty ()
 

Public Attributes

uint8_t MAJOR
 
uint8_t MINOR
 
uint8_t WIDTH
 
uint8_t HEIGHT
 

Protected Attributes

uint8_t m_x
 Cursor position x. More...
 
uint8_t m_y
 Cursor position y. More...
 
uint8_t m_tab
 Tab step. More...
 
uint8_t m_mode
 Text mode. More...
 
bool m_blocking
 
Mode m_eol
 

Private Member Functions

bool is_async () const
 
void sync_request ()
 
void async_request ()
 
virtual void on_completion (uint8_t type, int count)
 

Private Attributes

uint8_t m_addr
 
bool m_async
 

Detailed Description

Virtual Dot Matix Liquid Crystal Display Controller/Driver for LCD/IOStream access. Acts as a proxy for an LCD slave.

Definition at line 31 of file VLCD.hh.

Member Enumeration Documentation

enum LCD::Device::TextMode
inherited

Text display mode.

Enumerator
NORMAL_TEXT_MODE 
INVERTED_TEXT_MODE 

Definition at line 45 of file LCD.hh.

Constructor & Destructor Documentation

VLCD::VLCD ( uint8_t  addr = 0x5a)
inline

Construct Virtual LCD connected to given TWI address.

Parameters
[in]addraddress of Virtual LCD (Default 0x5a);

Definition at line 45 of file VLCD.hh.

Member Function Documentation

int IOStream::Device::available ( )
virtualinherited

Number of bytes available (possible to read).

Returns
bytes.

Reimplemented in W5200::Driver, W5500::Driver, W5100::Driver, Soft::UART, UART, IOBuffer< SIZE >, and CC3000::Driver.

Definition at line 24 of file IOStream_Device.cpp.

void VLCD::backlight_off ( )
virtual

Turn display backlight off.

Reimplemented from LCD::Device.

Definition at line 110 of file VLCD.cpp.

void VLCD::backlight_on ( )
virtual

Turn display backlight on.

Reimplemented from LCD::Device.

Definition at line 116 of file VLCD.cpp.

bool VLCD::begin ( )
virtual

Start display for text output. Initiate display and retrieve version and dimension information (MAJOR/MINOR and WIDTH/HEIGHT). Returns true if successful otherwise false.

Returns
boolean.

Implements LCD::Device.

Definition at line 83 of file VLCD.cpp.

void IOStream::Device::blocking ( )
inlineinherited

Set blocking mode.

Definition at line 85 of file IOStream.hh.

void VLCD::display_clear ( )
virtual

Clear display and move cursor to home.

Implements LCD::Device.

Definition at line 134 of file VLCD.cpp.

virtual void LCD::Device::display_contrast ( uint8_t  level)
inlinevirtualinherited

Set display contrast level.

Parameters
[in]levelto set.

Reimplemented in ST7565, PCD8544, and MAX72XX.

Definition at line 93 of file LCD.hh.

virtual void LCD::Device::display_inverse ( )
inlinevirtualinherited

Display inverse mode.

Reimplemented in ST7565, and PCD8544.

Definition at line 120 of file LCD.hh.

virtual void LCD::Device::display_normal ( )
inlinevirtualinherited

Display normal mode.

Reimplemented in ST7565, and PCD8544.

Definition at line 114 of file LCD.hh.

void VLCD::display_off ( )
virtual

Turn display off.

Implements LCD::Device.

Definition at line 122 of file VLCD.cpp.

void VLCD::display_on ( )
virtual

Turn display on.

Implements LCD::Device.

Definition at line 128 of file VLCD.cpp.

void IOStream::Device::empty ( )
virtualinherited

Empty internal device buffers.

Reimplemented in Soft::UART, UART, and IOBuffer< SIZE >.

Definition at line 175 of file IOStream_Device.cpp.

bool VLCD::end ( )
virtual

Stop display and power down. Returns true if successful otherwise false.

Implements LCD::Device.

Definition at line 103 of file VLCD.cpp.

void IOStream::Device::eol ( Mode  mode)
inlineinherited

Set end of line mode.

Parameters
[in]modefor end of line.

Definition at line 103 of file IOStream.hh.

Mode IOStream::Device::eol ( ) const
inlineinherited

Get end of line mode.

Returns
mode.

Definition at line 112 of file IOStream.hh.

int IOStream::Device::flush ( )
virtualinherited

Flush internal device buffers. Wait for device to become idle.

Returns
zero(0) or negative error code.

Reimplemented in W5200::Driver, W5500::Driver, W5100::Driver, UART, IOBuffer< SIZE >, CC3000::Driver, and WIO.

Definition at line 169 of file IOStream_Device.cpp.

void LCD::Device::get_cursor ( uint8_t &  x,
uint8_t &  y 
) const
inlineinherited

Get current cursor position.

Parameters
[out]x.
[out]y.

Definition at line 133 of file LCD.hh.

uint8_t LCD::Device::get_tab_step ( ) const
inlineinherited

Get tab step.

Returns
tab step.

Definition at line 152 of file LCD.hh.

int IOStream::Device::getchar ( )
virtualinherited

Read character from device.

Returns
character or EOF(-1).

Reimplemented in FAT16::File, CFFS::File, Soft::UART, UART, IOBuffer< SIZE >, and Socket.

Definition at line 112 of file IOStream_Device.cpp.

char * IOStream::Device::gets ( char *  s,
size_t  count 
)
virtualinherited

Read string terminated by new-line or until size into given string buffer. Returns pointer to string or NULL if empty line.

Parameters
[in]sstring buffer to read into.
[in]countmax number of bytes to read.
Returns
string pointer or NULL.

Definition at line 118 of file IOStream_Device.cpp.

bool IOStream::Device::is_blocking ( ) const
inlineinherited

Is blocking mode?

Returns
bool.

Definition at line 94 of file IOStream.hh.

void IOStream::Device::non_blocking ( )
inlineinherited

Set non-blocking mode.

Definition at line 77 of file IOStream.hh.

int IOStream::Device::peekchar ( )
virtualinherited

Peek at the next character from device.

Returns
character or EOF(-1).

Reimplemented in Soft::UART, UART, and IOBuffer< SIZE >.

Definition at line 99 of file IOStream_Device.cpp.

int IOStream::Device::peekchar ( char  c)
virtualinherited

Peek for the given character in device buffer. Return number of characters or EOF(-1).

Parameters
[in]ccharacter to peek for.
Returns
available or EOF(-1).

Reimplemented in Soft::UART, UART, and IOBuffer< SIZE >.

Definition at line 105 of file IOStream_Device.cpp.

int VLCD::putchar ( char  c)
virtual

Write character to display. Handles carriage-return-line-feed, back- space, alert, horizontal tab and form-feed. Returns character or EOF on error.

Parameters
[in]ccharacter to write.
Returns
character written or EOF(-1).

Reimplemented from IOStream::Device.

Definition at line 154 of file VLCD.cpp.

int IOStream::Device::puts ( const char *  s)
virtualinherited

Write null terminated string to device. Terminating null is not written.

Parameters
[in]sstring to write.
Returns
zero(0) or negative error code.

Definition at line 43 of file IOStream_Device.cpp.

int IOStream::Device::puts ( str_P  s)
virtualinherited

Write null terminated string from program memory to device. Terminating null is not written.

Parameters
[in]sstring in program memory to write.
Returns
zero(0) or negative error code.

Definition at line 54 of file IOStream_Device.cpp.

int IOStream::Device::read ( void *  buf,
size_t  size 
)
virtualinherited

Read data to given buffer with given size from device.

Parameters
[in]bufbuffer to read into.
[in]sizenumber of bytes to read.
Returns
number of bytes read or EOF(-1).

Reimplemented in FAT16::File, W5200::Driver, W5500::Driver, W5100::Driver, CFFS::File, Socket, and CC3000::Driver.

Definition at line 144 of file IOStream_Device.cpp.

int IOStream::Device::read ( iovec_t vec)
virtualinherited

Read data to given buffers in null terminated io vector.

Parameters
[in]vecio vector with buffers to read into.
Returns
number of bytes read or EOF(-1).

Definition at line 157 of file IOStream_Device.cpp.

int IOStream::Device::room ( )
virtualinherited

Number of bytes room (write without blocking).

Returns
bytes.

Reimplemented in W5200::Driver, W5500::Driver, W5100::Driver, UART, IOBuffer< SIZE >, CC3000::Driver, and WIO.

Definition at line 30 of file IOStream_Device.cpp.

void VLCD::set_cursor ( uint8_t  x,
uint8_t  y 
)
virtual

Set cursor position to given position.

Parameters
[in]x.
[in]y.

Implements LCD::Device.

Definition at line 140 of file VLCD.cpp.

void LCD::Device::set_tab_step ( uint8_t  step)
inlineinherited

Set tab step to given value.

Parameters
[in]steptab.

Definition at line 161 of file LCD.hh.

TextMode LCD::Device::text_mode ( TextMode  mode)
inlineinherited

Set text mode. Return previous text mode.

Parameters
[in]modenew text mode.
Returns
previous text mode.

Definition at line 171 of file LCD.hh.

int VLCD::write ( const void *  buf,
size_t  size 
)
virtual

Write data from buffer with given size to device.

Parameters
[in]bufbuffer to write.
[in]sizenumber of bytes to write.
Returns
number of bytes written or EOF(-1).

Reimplemented from IOStream::Device.

Definition at line 187 of file VLCD.cpp.

int IOStream::Device::write ( const iovec_t vec)
virtualinherited

Write data from buffers in null terminated io vector.

Parameters
[in]vecio vector with buffers to write.
Returns
number of bytes written or EOF(-1).

Definition at line 87 of file IOStream_Device.cpp.

int IOStream::Device::write_P ( const void *  buf,
size_t  size 
)
virtualinherited

Write data from buffer in program memory with given size to device.

Parameters
[in]bufbuffer to write.
[in]sizenumber of bytes to write.
Returns
number of bytes written or EOF(-1).

Reimplemented in CFFS::File, Socket, and CC3000::Driver.

Definition at line 76 of file IOStream_Device.cpp.

Member Data Documentation

uint8_t VLCD::HEIGHT

Definition at line 39 of file VLCD.hh.

bool IOStream::Device::m_blocking
protectedinherited

Blocking state

Definition at line 248 of file IOStream.hh.

Mode IOStream::Device::m_eol
protectedinherited

End of line mode

Definition at line 251 of file IOStream.hh.

uint8_t LCD::Device::m_mode
protectedinherited

Text mode.

Definition at line 183 of file LCD.hh.

uint8_t LCD::Device::m_tab
protectedinherited

Tab step.

Definition at line 182 of file LCD.hh.

uint8_t LCD::Device::m_x
protectedinherited

Cursor position x.

Definition at line 180 of file LCD.hh.

uint8_t LCD::Device::m_y
protectedinherited

Cursor position y.

Definition at line 181 of file LCD.hh.

uint8_t VLCD::MAJOR

Definition at line 34 of file VLCD.hh.

uint8_t VLCD::MINOR

Definition at line 35 of file VLCD.hh.

uint8_t VLCD::WIDTH

Definition at line 38 of file VLCD.hh.


The documentation for this class was generated from the following files: