LCDDriver_NXP_Arduino 1.0.2
Temperature sensor device operation sample code for Arduino
|
#include <LCDDriver.h>
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] |
LCDDriver operation library for Arduino
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.
enum PCA8561::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.
PCA8561::PCA8561 | ( | uint8_t | i2c_address = (0x70 >> 1) | ) |
Create a PCA8561 instance with specified address
i2c_address | I2C-bus address (default: (0x70>>1)) |
Definition at line 5 of file LCDDriver.cpp.
PCA8561::PCA8561 | ( | TwoWire & | wire, |
uint8_t | i2c_address = (0x70 >> 1) ) |
Create a PCA8561 instance with specified address
wire | TwoWire instance |
i2c_address | I2C-bus address (default: (0x70>>1)) |
Definition at line 10 of file LCDDriver.cpp.
|
virtual |
Definition at line 15 of file LCDDriver.cpp.
void PCA8561::begin | ( | void | ) |
Begin the device operation
This method turns-on the device
Definition at line 27 of file LCDDriver.cpp.
void PCA8561::bit_op16 | ( | uint8_t | reg, |
uint16_t | mask, | ||
uint16_t | value ) |
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
reg | register index/address/pointer |
mask | bit-mask to protect overwriting |
value | value to overwrite |
Referenced by com_seg().
|
private |
Definition at line 91 of file LCDDriver.cpp.
Referenced by putchar().
void PCA8561::clear | ( | bool | no_flush = false | ) |
Clear display
no_flush | no immidiate display clear (display will be cleared at next "putchar()" or "puts()" call) |
Definition at line 80 of file LCDDriver.cpp.
Referenced by putchar().
void PCA8561::com_seg | ( | int | com, |
int | seg, | ||
bool | v ) |
Access to a segment
com | LCD backplane output select |
seg | LCD segment output select |
v | true for the segment ON |
Definition at line 32 of file LCDDriver.cpp.
|
private |
Definition at line 75 of file LCDDriver.cpp.
|
private |
Definition at line 17 of file LCDDriver.cpp.
bool PCA8561::ping | ( | void | ) |
Ping the device
void PCA8561::putchar | ( | char | c | ) |
Character output
Putting '
' or '\r' character to clear display in next "putchar()" or "puts()" call
c | A character to display |
Definition at line 52 of file LCDDriver.cpp.
Referenced by puts().
void PCA8561::puts | ( | const char * | s, |
int | dly = 0 ) |
String output
s | A string to display |
dly | Option parameter for scroll effect each character appears with this delay [mili-second] (default: 0) |
Definition at line 44 of file LCDDriver.cpp.
uint8_t PCA8561::read_r8 | ( | uint8_t | reg | ) |
Register read, 8 bit
reg | register index/address/pointer |
uint8_t PCA8561::reg_r | ( | uint8_t | reg_adr | ) |
Single register read
reg | register index/address/pointer |
int PCA8561::reg_r | ( | uint8_t | reg_adr, |
uint8_t * | data, | ||
uint16_t | size ) |
Multiple register read
reg | register index/address/pointer |
data | pointer to data buffer |
size | data size |
int PCA8561::reg_w | ( | uint8_t | reg_adr, |
const uint8_t * | data, | ||
uint16_t | size ) |
int PCA8561::reg_w | ( | uint8_t | reg_adr, |
uint8_t | data ) |
Single register write
reg | register index/address/pointer |
data | pointer to data buffer |
size | data size |
void PCA8561::write_r8 | ( | uint8_t | reg, |
uint8_t | val ) |
Register write, 8 bit
reg | register index/address/pointer |
val | data value |
|
private |
Definition at line 163 of file LCDDriver.h.
Referenced by char2seg(), clear(), flush(), and init().
|
staticprivate |
Definition at line 116 of file LCDDriver.h.
Referenced by char2seg().
|
staticconstexpr |
The number of LCD backplane output
Definition at line 28 of file LCDDriver.h.
|
staticconstexpr |
The number of LCD segment output
Definition at line 31 of file LCDDriver.h.
|
private |
Definition at line 164 of file LCDDriver.h.
Referenced by putchar().
|
private |
Definition at line 165 of file LCDDriver.h.