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

#include <VLCD.hh>

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

Public Member Functions

 Slave (LCD::Device *lcd, uint8_t addr=0x5a)
 
virtual void on_request (void *buf, size_t size)
 
void read_buf (void *buf, size_t size)
 
void write_buf (void *buf, size_t size)
 
void begin ()
 
virtual void on_completion (uint8_t type, int count)
 
bool is_async () const
 
void sync_request ()
 
void async_request ()
 

Static Public Attributes

static const uint8_t BUF_MAX = 40
 

Protected Member Functions

virtual void on_event (uint8_t type, uint16_t value)
 

Protected Attributes

uint8_t m_addr
 
bool m_async
 

Static Protected Attributes

static const uint8_t WRITE_IX = 0
 
static const uint8_t READ_IX = 1
 

Friends

class VLCD
 

Detailed Description

Virtual LCD Slave device

Definition at line 133 of file VLCD.hh.

Constructor & Destructor Documentation

VLCD::Slave::Slave ( LCD::Device lcd,
uint8_t  addr = 0x5a 
)
inline

Construct Virtual LCD Slave with given LCD and TWI address.

Parameters
[in]lcdimplementation.
[in]addrTWI address (default 0x5a).

Definition at line 144 of file VLCD.hh.

Member Function Documentation

void TWI::Driver::async_request ( )
inlineinherited

Set asynchronous request mode.

Definition at line 94 of file TWI.hh.

void TWI::Slave::begin ( )
inherited

Start TWI bus logic for the slave device.

Definition at line 290 of file TWI.cpp.

bool TWI::Driver::is_async ( ) const
inlineinherited

Return true(1) if the request is asyncrhonous otherwise false(0).

Definition at line 78 of file TWI.hh.

virtual void TWI::Slave::on_completion ( uint8_t  type,
int  count 
)
inlinevirtualinherited

Service completion callback when a read/write has been completed.

Parameters
[in]typeevent code.
[in]countnumber of bytes in request.

Reimplemented from TWI::Driver.

Definition at line 163 of file TWI.hh.

void TWI::Slave::on_event ( uint8_t  type,
uint16_t  value 
)
protectedvirtualinherited

Filter Event::WRITE_COMPLETED_TYPE(size) and calls on_request() with given write block as argument. The device is marked as ready when the request has been completed and a possible result block is available.

Parameters
[in]typethe event type.
[in]valuethe event value.

Reimplemented from Event::Handler.

Definition at line 302 of file TWI.cpp.

void VLCD::Slave::on_request ( void *  buf,
size_t  size 
)
virtual

Slave request handler; parse and dispatch LCD functions.

Parameters
[in]bufbuffer pointer.
[in]sizeof buffer.

Implements TWI::Slave.

Definition at line 25 of file VLCD.cpp.

void TWI::Slave::read_buf ( void *  buf,
size_t  size 
)
inherited

Set read (result) buffer. Must be called before starting TWI.

Parameters
[in]bufbuffer pointer.
[in]sizeof buffer.

Definition at line 319 of file TWI.cpp.

void TWI::Driver::sync_request ( )
inlineinherited

Set synchronous request mode.

Definition at line 86 of file TWI.hh.

void TWI::Slave::write_buf ( void *  buf,
size_t  size 
)
inherited

Set write (argument) buffer. Must be called before starting TWI.

Parameters
[in]bufbuffer pointer.
[in]sizeof buffer.

Definition at line 312 of file TWI.cpp.

Friends And Related Function Documentation

friend class VLCD
friend

Definition at line 134 of file VLCD.hh.

Member Data Documentation

const uint8_t VLCD::Slave::BUF_MAX = 40
static

Definition at line 137 of file VLCD.hh.

uint8_t TWI::Driver::m_addr
protectedinherited

Device bus address.

Definition at line 114 of file TWI.hh.

bool TWI::Driver::m_async
protectedinherited

Asynchronious mode.

Definition at line 117 of file TWI.hh.

const uint8_t TWI::Slave::READ_IX = 1
staticprotectedinherited

Definition at line 184 of file TWI.hh.

const uint8_t TWI::Slave::WRITE_IX = 0
staticprotectedinherited

Internal index in io-vector for read/write buffers.

Definition at line 183 of file TWI.hh.


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