LCDDriver_NXP_Arduino 1.0.2
Temperature sensor device operation sample code for Arduino
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
PCA8561 Class Reference

#include <LCDDriver.h>

Inheritance diagram for PCA8561:

Public Types

enum  reg_num {
  Software_reset , Device_ctrl , Display_ctrl_1 , Display_ctrl_2 ,
  COM0_07_00 , COM0_15_08 , COM0_17_16 , COM1_07_00 ,
  COM1_15_08 , COM1_17_16 , COM2_07_00 , COM2_15_08 ,
  COM2_17_16 , COM3_07_00 , COM3_15_08 , COM3_17_16
}
 

Public Member Functions

 PCA8561 (uint8_t i2c_address=(0x70 > > 1))
 
 PCA8561 (TwoWire &wire, uint8_t i2c_address=(0x70 > > 1))
 
virtual ~PCA8561 ()
 
void begin (void)
 
void com_seg (int com, int seg, bool v)
 
void puts (const char *s, int dly=0)
 
void putchar (char c)
 
void clear (bool no_flush=false)
 
bool ping (void)
 
int reg_w (uint8_t reg_adr, const uint8_t *data, uint16_t size)
 
int reg_w (uint8_t reg_adr, uint8_t data)
 
int reg_r (uint8_t reg_adr, uint8_t *data, uint16_t size)
 
uint8_t reg_r (uint8_t reg_adr)
 
void write_r8 (uint8_t reg, uint8_t val)
 
uint8_t read_r8 (uint8_t reg)
 
void bit_op8 (uint8_t reg, uint8_t mask, uint8_t value)
 
void bit_op16 (uint8_t reg, uint16_t mask, uint16_t value)
 

Static Public Attributes

static constexpr int N_COM = 4
 
static constexpr int N_SEG = 18
 

Private Member Functions

void init (void)
 
void flush (void)
 
void char2seg (int pos, int c)
 

Private Attributes

uint8_t bf [12]
 
char str_buffer [4]
 
int str_pos = 0
 

Static Private Attributes

static uint16_t char_pattern [61]
 

Detailed Description

LCDDriver operation library for Arduino

Author
Tedd OKANO

Released under the MIT license License PCA8561 class

PCA8561 class is a sample code for the PCA8561AHN-ARD It demonstrates LCD operation by

Definition at line 24 of file LCDDriver.h.

Member Enumeration Documentation

◆ reg_num

Enumerator
Software_reset 
Device_ctrl 
Display_ctrl_1 
Display_ctrl_2 
COM0_07_00 
COM0_15_08 
COM0_17_16 
COM1_07_00 
COM1_15_08 
COM1_17_16 
COM2_07_00 
COM2_15_08 
COM2_17_16 
COM3_07_00 
COM3_15_08 
COM3_17_16 

Definition at line 32 of file LCDDriver.h.

Constructor & Destructor Documentation

◆ PCA8561() [1/2]

PCA8561::PCA8561 ( uint8_t i2c_address = (0x70 >> 1))

Create a PCA8561 instance with specified address

Parameters
i2c_addressI2C-bus address (default: (0x70>>1))

Definition at line 5 of file LCDDriver.cpp.

◆ PCA8561() [2/2]

PCA8561::PCA8561 ( TwoWire & wire,
uint8_t i2c_address = (0x70 >> 1) )

Create a PCA8561 instance with specified address

Parameters
wireTwoWire instance
i2c_addressI2C-bus address (default: (0x70>>1))

Definition at line 10 of file LCDDriver.cpp.

◆ ~PCA8561()

PCA8561::~PCA8561 ( )
virtual

Definition at line 15 of file LCDDriver.cpp.

Member Function Documentation

◆ begin()

void PCA8561::begin ( void )

Begin the device operation

This method turns-on the device

Definition at line 27 of file LCDDriver.cpp.

◆ bit_op16()

void PCA8561::bit_op16 ( uint8_t reg,
uint16_t mask,
uint16_t value )

◆ bit_op8()

void PCA8561::bit_op8 ( uint8_t reg,
uint8_t mask,
uint8_t value )

Register overwriting with bit-mask

Register can be updated by bit level

Parameters
regregister index/address/pointer
maskbit-mask to protect overwriting
valuevalue to overwrite

Referenced by com_seg().

◆ char2seg()

void PCA8561::char2seg ( int pos,
int c )
private

Definition at line 91 of file LCDDriver.cpp.

Referenced by putchar().

◆ clear()

void PCA8561::clear ( bool no_flush = false)

Clear display

Parameters
no_flushno immidiate display clear (display will be cleared at next "putchar()" or "puts()" call)

Definition at line 80 of file LCDDriver.cpp.

Referenced by putchar().

◆ com_seg()

void PCA8561::com_seg ( int com,
int seg,
bool v )

Access to a segment

Parameters
comLCD backplane output select
segLCD segment output select
vtrue for the segment ON

Definition at line 32 of file LCDDriver.cpp.

◆ flush()

void PCA8561::flush ( void )
private

Definition at line 75 of file LCDDriver.cpp.

Referenced by clear(), and putchar().

◆ init()

void PCA8561::init ( void )
private

Definition at line 17 of file LCDDriver.cpp.

Referenced by PCA8561(), and PCA8561().

◆ ping()

bool PCA8561::ping ( void )

Ping the device

Returns
true when ACK

◆ putchar()

void PCA8561::putchar ( char c)

Character output

Putting '
' or '\r' character to clear display in next "putchar()" or "puts()" call

Parameters
cA character to display

Definition at line 52 of file LCDDriver.cpp.

Referenced by puts().

◆ puts()

void PCA8561::puts ( const char * s,
int dly = 0 )

String output

Parameters
sA string to display
dlyOption parameter for scroll effect each character appears with this delay [mili-second] (default: 0)

Definition at line 44 of file LCDDriver.cpp.

◆ read_r8()

uint8_t PCA8561::read_r8 ( uint8_t reg)

Register read, 8 bit

Parameters
regregister index/address/pointer
Returns
data value

◆ reg_r() [1/2]

uint8_t PCA8561::reg_r ( uint8_t reg_adr)

Single register read

Parameters
regregister index/address/pointer
Returns
read data

◆ reg_r() [2/2]

int PCA8561::reg_r ( uint8_t reg_adr,
uint8_t * data,
uint16_t size )

Multiple register read

Parameters
regregister index/address/pointer
datapointer to data buffer
sizedata size
Returns
transferred data size

◆ reg_w() [1/2]

int PCA8561::reg_w ( uint8_t reg_adr,
const uint8_t * data,
uint16_t size )

Multiple register write

Parameters
regregister index/address/pointer
datapointer to data buffer
sizedata size
Returns
transferred data size

Referenced by begin(), and flush().

◆ reg_w() [2/2]

int PCA8561::reg_w ( uint8_t reg_adr,
uint8_t data )

Single register write

Parameters
regregister index/address/pointer
datapointer to data buffer
sizedata size
Returns
transferred data size

◆ write_r8()

void PCA8561::write_r8 ( uint8_t reg,
uint8_t val )

Register write, 8 bit

Parameters
regregister index/address/pointer
valdata value

Member Data Documentation

◆ bf

uint8_t PCA8561::bf[12]
private

Definition at line 163 of file LCDDriver.h.

Referenced by char2seg(), clear(), flush(), and init().

◆ char_pattern

uint16_t PCA8561::char_pattern
staticprivate
Initial value:
= {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4001,
0x0000, 0x0000, 0x2AA8, 0x8282, 0x8282, 0x0280, 0x4000, 0x0820,
0x1D74, 0x0440, 0x13C4, 0x16C4, 0x06D0, 0x1694, 0x1794, 0x0444,
0x17D4, 0x16D4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x07D4, 0x17B4, 0x1114, 0x9446, 0x1394, 0x0394, 0x1714,
0x07D0, 0x9006, 0x1540, 0x21B0, 0x1110, 0x0578, 0x2558, 0x1554,
0x03D4, 0x3554, 0x23D4, 0x1694, 0x8006, 0x1550, 0x0930, 0x2D50,
0x2828, 0x8028, 0x1824, 0x0000, 0x2008,
}

Definition at line 116 of file LCDDriver.h.

Referenced by char2seg().

◆ N_COM

constexpr int PCA8561::N_COM = 4
staticconstexpr

The number of LCD backplane output

Definition at line 28 of file LCDDriver.h.

◆ N_SEG

constexpr int PCA8561::N_SEG = 18
staticconstexpr

The number of LCD segment output

Definition at line 31 of file LCDDriver.h.

◆ str_buffer

char PCA8561::str_buffer[4]
private

Definition at line 164 of file LCDDriver.h.

Referenced by putchar().

◆ str_pos

int PCA8561::str_pos = 0
private

Definition at line 165 of file LCDDriver.h.

Referenced by clear(), init(), and putchar().


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