COSA
An Object-Oriented Platform for Arduino Programming
TWI::Driver Class Reference

#include <TWI.hh>

Inheritance diagram for TWI::Driver:
Inheritance graph
Collaboration diagram for TWI::Driver:
Collaboration graph

Public Member Functions

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

Protected Attributes

uint8_t m_addr
 
bool m_async
 

Friends

class TWI
 
void TWI_vect (void)
 

Detailed Description

TWI Device Driver support class. Holds the address of the device. Should be sub-classed to implement a device driver and access functions.

Definition at line 64 of file TWI.hh.

Constructor & Destructor Documentation

TWI::Driver::Driver ( uint8_t  addr)
inline

Construct TWI driver with given bus address.

Parameters
[in]addrbus address (7-bit LSB).

Definition at line 70 of file TWI.hh.

Member Function Documentation

void TWI::Driver::async_request ( )
inline

Set asynchronous request mode.

Definition at line 94 of file TWI.hh.

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

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

Definition at line 78 of file TWI.hh.

virtual void TWI::Driver::on_completion ( uint8_t  type,
int  count 
)
inlinevirtual

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

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

Reimplemented in TWI::Slave.

Definition at line 106 of file TWI.hh.

void TWI::Driver::sync_request ( )
inline

Set synchronous request mode.

Definition at line 86 of file TWI.hh.

Friends And Related Function Documentation

friend class TWI
friend

Allow access.

Definition at line 120 of file TWI.hh.

void TWI_vect ( void  )
friend

Member Data Documentation

uint8_t TWI::Driver::m_addr
protected

Device bus address.

Definition at line 114 of file TWI.hh.

bool TWI::Driver::m_async
protected

Asynchronious mode.

Definition at line 117 of file TWI.hh.


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