COSA
An Object-Oriented Platform for Arduino Programming
LCD::SPI3W Class Reference

#include <LCD.hh>

Inheritance diagram for LCD::SPI3W:
Inheritance graph
Collaboration diagram for LCD::SPI3W:
Collaboration graph

Public Member Functions

 SPI3W (Board::DigitalPin sce=Board::D9)
 
virtual void begin ()
 
virtual void end ()
 
virtual void write (uint8_t data)
 
virtual void write (const void *buf, size_t size)
 
void set_clock (Clock rate)
 
void set_clock (uint32_t freq)
 

Static Public Member Functions

static Clock clock (uint32_t freq)
 
static Clock cycle (uint16_t ns)
 

Protected Attributes

Driverm_next
 List of drivers. More...
 
Interrupt::Handlerm_irq
 Interrupt handler. More...
 
OutputPin m_cs
 Device chip select pin. More...
 
Pulse m_pulse
 Chip select pulse width. More...
 
uint8_t m_spcr
 SPI/SPCR hardware control register setting. More...
 
uint8_t m_spsr
 SPI/SPSR hardware status register. More...
 

Detailed Description

LCD IO adapter for 3 wire SPI (MOSI, SCK and SCE).

Definition at line 300 of file LCD.hh.

Constructor & Destructor Documentation

LCD::SPI3W::SPI3W ( Board::DigitalPin  sce = Board::D9)
inline

Construct display device driver adapter with given pins. Implicit usage of SPI SCK(D13/D4) and MOSI(D11/D5).

Parameters
[in]scescreen chip enable pin (default D9/D3).

Definition at line 308 of file LCD.hh.

Member Function Documentation

virtual void LCD::SPI3W::begin ( )
inlinevirtual

Start of data/command transfer block.

Implements LCD::IO.

Definition at line 317 of file LCD.hh.

static Clock SPI::Driver::clock ( uint32_t  freq)
inlinestaticinherited

Calculate SPI clock rate (scale factor) for given frequency.

Parameters
[in]freqdevice max frequency (in Hz).
Returns
clock rate.

Definition at line 117 of file SPI.hh.

static Clock SPI::Driver::cycle ( uint16_t  ns)
inlinestaticinherited

Calculate SPI clock rate (scale factor) for given clock cycle time in nano seconds.

Parameters
[in]nsmin device clock cycle time.
Returns
clock rate.

Definition at line 135 of file SPI.hh.

virtual void LCD::SPI3W::end ( )
inlinevirtual

End of data/command transfer block.

Implements LCD::IO.

Definition at line 327 of file LCD.hh.

void SPI::Driver::set_clock ( Clock  rate)
inherited

Set SPI master clock rate.

Parameters
[in]clockrate.

Definition at line 297 of file SPI.cpp.

void SPI::Driver::set_clock ( uint32_t  freq)
inlineinherited

Set SPI master clock frequency.

Parameters
[in]freqdevice max frequency (in Hz).

Definition at line 157 of file SPI.hh.

virtual void LCD::SPI3W::write ( uint8_t  data)
inlinevirtual

Write byte (8bit) to display. Must be in data/command transfer block.

Parameters
[in]data(8b) to write.

Implements LCD::IO.

Definition at line 339 of file LCD.hh.

virtual void LCD::SPI3W::write ( const void *  buf,
size_t  size 
)
inlinevirtual

Write character buffer to display. Must be in data/command transfer block.

Parameters
[in]bufpointer to buffer.
[in]sizenumber of bytes in buffer.

Implements LCD::IO.

Definition at line 351 of file LCD.hh.

Member Data Documentation

OutputPin SPI::Driver::m_cs
protectedinherited

Device chip select pin.

Definition at line 166 of file SPI.hh.

Interrupt::Handler* SPI::Driver::m_irq
protectedinherited

Interrupt handler.

Definition at line 165 of file SPI.hh.

Driver* SPI::Driver::m_next
protectedinherited

List of drivers.

Definition at line 164 of file SPI.hh.

Pulse SPI::Driver::m_pulse
protectedinherited

Chip select pulse width.

Definition at line 167 of file SPI.hh.

uint8_t SPI::Driver::m_spcr
protectedinherited

SPI/SPCR hardware control register setting.

Definition at line 173 of file SPI.hh.

uint8_t SPI::Driver::m_spsr
protectedinherited

SPI/SPSR hardware status register.

Definition at line 174 of file SPI.hh.


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