FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
Loading...
Searching...
No Matches
devices::display::LCD5110< SCE, DC, RST > Class Template Reference

SPI device driver for Nokia 5110 display chip. More...

#include <fastarduino/devices/lcd5110.h>

Inheritance diagram for devices::display::LCD5110< SCE, DC, RST >:
Collaboration diagram for devices::display::LCD5110< SCE, DC, RST >:

Public Member Functions

void reset ()
 Reset PCD8544 chip and Nokia 5110 display. More...
 
void set_display_bias (uint8_t bias=DEFAULT_BIAS)
 Set bias for Nokia5110 LCD display. More...
 
void set_display_contrast (uint8_t contrast=DEFAULT_VOP)
 Set contrast for Nokia5110 LCD display. More...
 
void set_temperature_control (TemperatureCoefficient coef)
 Set temperature coefficient for Nokia5110 display. More...
 
void power_down ()
 Set Nokia5110 display to power down mode. More...
 
void power_up ()
 Set Nokia5110 display to power up mode. More...
 
void blank ()
 Blank Nokia5110 LCD display. More...
 
void full ()
 Blacken Nokia5110 LCD display. More...
 
void invert ()
 Invert Nokia5110 LCD display. More...
 
void normal ()
 Set Nokia5110 LCD display to normal mode. More...
 

Additional Inherited Members

- Protected Member Functions inherited from spi::SPIDevice< SCE, spi::ChipSelect::ACTIVE_LOW, spi::compute_clockrate(4 '000 '000UL)>
 SPIDevice () INLINE=default
 Create a new SPIDevice; this sets up the CS pin for later use during transfers.
 
void start_transfer ()
 Start an SPI transfer to this device. More...
 
void end_transfer () INLINE
 End the current SPI ransfer tot hsi device. More...
 
- Protected Member Functions inherited from spi::AbstractSPIDevice
 AbstractSPIDevice (const AbstractSPIDevice &)=delete
 
AbstractSPIDeviceoperator= (const AbstractSPIDevice &)=delete
 
uint8_t transfer (uint8_t data)
 Transfer one byte to the currently selected SPI slave device through MOSI pin, and get the byte returned by the device through MISO pin. More...
 
void transfer (uint8_t *data, uint16_t size)
 Transfer an array of payload data to the currently selected SPI slave device through MOSI pin, and get all data bytes simultaneously received from that device through MISO pin. More...
 
void transfer (const uint8_t *data, uint16_t size)
 Transfer an array of payload data to the currently selected SPI slave device through MOSI pin; any data bytes simultaneously received from that device through MISO pin are lost. More...
 
void transfer (uint8_t *data, uint16_t size, uint8_t sent)
 Transfer the provided byte sent several times to the currently selected SPI slave device through MOSI pin, and get all data bytes simultaneously received from that device through MISO pin. More...
 
void transfer (uint16_t size, uint8_t sent)
 Transfer the provided byte sent several times to the currently selected SPI slave device through MOSI pin; any data bytes simultaneously received from that device through MISO pin are lost. More...
 

Detailed Description

template<board::DigitalPin SCE, board::DigitalPin DC, board::DigitalPin RST>
class devices::display::LCD5110< SCE, DC, RST >

SPI device driver for Nokia 5110 display chip.

This driver offers various API to:

  • display characters or strings
  • display pixels All drawing API work on a pixel buffer in memory, never directly on the LCD device. Buffer is copied to the LCD device through update() calls.
Warning
This class shall be used along with devices::display::Display template class. It cannot be instantiated on its own.

All public API in LCD5110 is available through the encapsulating Display instance.

Once Display has been instantiated for LCD5110 driver, you should call the following API before it can be used to display anything:

  1. reset() device
  2. set_display_bias() to relevant value
  3. set_display_contrast() to relevant value
  4. power_up() device
  5. set_color() to define the pixel color (black or white) to use in all subsequent drawing primitives
  6. set_mode() if you want to use a specific drawing mode, other than default Mode::COPY.
  7. set_font() if you intend to display text
Warning
For optimization reasons, text display can always occur at a y position that must be a multiple of 8, otherwise nothing will get drawn.
Template Parameters
SCEthe output pin used for Chip Selection of the PCD8544 chip on the SPI bus.
DCthe output pin used to select Data (high) or Command (low) mode of PCD8544 chip.
See also
Display

Definition at line 115 of file lcd5110.h.

Member Function Documentation

◆ reset()

void devices::display::LCD5110< SCE, DC, RST >::reset ( )
inline

Reset PCD8544 chip and Nokia 5110 display.

This shall be called at launch time.

Definition at line 129 of file lcd5110.h.

◆ set_display_bias()

void devices::display::LCD5110< SCE, DC, RST >::set_display_bias ( uint8_t  bias = DEFAULT_BIAS)
inline

Set bias for Nokia5110 LCD display.

Must be called before first use.

Parameters
biasnew bias value for the display, must be between 0 and 7 included.

Definition at line 143 of file lcd5110.h.

◆ set_display_contrast()

void devices::display::LCD5110< SCE, DC, RST >::set_display_contrast ( uint8_t  contrast = DEFAULT_VOP)
inline

Set contrast for Nokia5110 LCD display.

Must be called before first use.

Parameters
contrastnew contrast value for the display, must be between 0 and 127 included.

Definition at line 159 of file lcd5110.h.

◆ set_temperature_control()

void devices::display::LCD5110< SCE, DC, RST >::set_temperature_control ( TemperatureCoefficient  coef)
inline

Set temperature coefficient for Nokia5110 display.

Parameters
coefnew temperature coefficent for the display
See also
TemperatureCoefficient

Definition at line 176 of file lcd5110.h.

◆ power_down()

void devices::display::LCD5110< SCE, DC, RST >::power_down ( )
inline

Set Nokia5110 display to power down mode.

Definition at line 188 of file lcd5110.h.

◆ power_up()

void devices::display::LCD5110< SCE, DC, RST >::power_up ( )
inline

Set Nokia5110 display to power up mode.

This must be called before first display use.

Definition at line 197 of file lcd5110.h.

◆ blank()

void devices::display::LCD5110< SCE, DC, RST >::blank ( )
inline

Blank Nokia5110 LCD display.

See also
normal()
full()

Definition at line 207 of file lcd5110.h.

◆ full()

void devices::display::LCD5110< SCE, DC, RST >::full ( )
inline

Blacken Nokia5110 LCD display.

See also
normal()
blank()

Definition at line 217 of file lcd5110.h.

◆ invert()

void devices::display::LCD5110< SCE, DC, RST >::invert ( )
inline

Invert Nokia5110 LCD display.

See also
normal()

Definition at line 226 of file lcd5110.h.

◆ normal()

void devices::display::LCD5110< SCE, DC, RST >::normal ( )
inline

Set Nokia5110 LCD display to normal mode.

This must be called before first display use.

See also
blank()

Definition at line 236 of file lcd5110.h.


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