Driver for PCD8544 LCD displays.
More...
Driver for PCD8544 LCD displays.
|
int | pcd8544_init (pcd8544_t *dev, spi_t spi, gpio_t cs, gpio_t reset, gpio_t mode) |
| Initialize the given display.
|
|
void | pcd8544_set_contrast (const pcd8544_t *dev, uint8_t contrast) |
| Set the contrast for the given display.
|
|
void | pcd8544_set_tempcoef (const pcd8544_t *dev, uint8_t coef) |
| Set the temperature coefficient for the given display.
|
|
void | pcd8544_set_bias (const pcd8544_t *dev, uint8_t bias) |
| Set the internal BIAS for the given display.
|
|
void | pcd8544_write_img (const pcd8544_t *dev, const uint8_t img[]) |
| Write an image to memory of the given display.
|
|
void | pcd8544_write_c (const pcd8544_t *dev, uint8_t x, uint8_t y, const char c) |
| Write a single ASCII character to the display.
|
|
void | pcd8544_write_s (const pcd8544_t *dev, uint8_t x, uint8_t y, const char *str) |
| Write a string to a given position on the display.
|
|
void | pcd8544_clear (const pcd8544_t *dev) |
| Clear the current display (clear the display memory)
|
|
void | pcd8544_invert (pcd8544_t *dev) |
| Invert the display (toggles dark and bright pixels)
|
|
int | pcd8544_is_inverted (const pcd8544_t *dev) |
| Get the current inversion status of the display.
|
|
void | pcd8544_poweron (const pcd8544_t *dev) |
| Power on the display.
|
|
void | pcd8544_poweroff (const pcd8544_t *dev) |
| Poser off the display.
|
|
void | pcd8544_riot (const pcd8544_t *dev) |
| I wonder what this does -> find out!
|
|
◆ PCD8544_COLS
#define PCD8544_COLS (14U) |
characters per row
Definition at line 40 of file pcd8544.h.
◆ PCD8544_DEFAULT_BIAS
#define PCD8544_DEFAULT_BIAS (3U) |
◆ PCD8544_DEFAULT_CONTRAST
#define PCD8544_DEFAULT_CONTRAST (45U) |
◆ PCD8544_DEFAULT_TEMPCOEF
#define PCD8544_DEFAULT_TEMPCOEF (0U) |
◆ PCD8544_RES_X
#define PCD8544_RES_X (84U) |
pixels per row
Definition at line 38 of file pcd8544.h.
◆ PCD8544_RES_Y
#define PCD8544_RES_Y (48U) |
pixels per column
Definition at line 39 of file pcd8544.h.
◆ PCD8544_ROWS
#define PCD8544_ROWS (6U) |
characters per column
Definition at line 41 of file pcd8544.h.
◆ pcd8544_clear()
Clear the current display (clear the display memory)
- Parameters
-
[in] | dev | device descriptor of display to use |
◆ pcd8544_init()
int pcd8544_init |
( |
pcd8544_t * |
dev, |
|
|
spi_t |
spi, |
|
|
gpio_t |
cs, |
|
|
gpio_t |
reset, |
|
|
gpio_t |
mode |
|
) |
| |
Initialize the given display.
- Parameters
-
[in] | dev | device descriptor of display to use |
[in] | spi | SPI bus the display is connected to |
[in] | cs | GPIO pin that is connected to the CS pin |
[in] | reset | GPIO pin that is connected to the RESET pin |
[in] | mode | GPIO pin that is connected to the MODE pin |
- Returns
- 0 on success
-
<0 on error
◆ pcd8544_invert()
Invert the display (toggles dark and bright pixels)
- Parameters
-
[in] | dev | device descriptor of display to use |
◆ pcd8544_is_inverted()
int pcd8544_is_inverted |
( |
const pcd8544_t * |
dev | ) |
|
Get the current inversion status of the display.
- Parameters
-
[in] | dev | device descriptor of display to use |
- Returns
- 0 -> display is not inverted
-
1 -> display is inverted
◆ pcd8544_poweroff()
void pcd8544_poweroff |
( |
const pcd8544_t * |
dev | ) |
|
Poser off the display.
- Parameters
-
[in] | dev | device descriptor of display to use |
◆ pcd8544_poweron()
void pcd8544_poweron |
( |
const pcd8544_t * |
dev | ) |
|
Power on the display.
- Parameters
-
[in] | dev | device descriptor of display to use |
◆ pcd8544_riot()
I wonder what this does -> find out!
- Parameters
-
[in] | dev | device descriptor of display to use |
◆ pcd8544_set_bias()
void pcd8544_set_bias |
( |
const pcd8544_t * |
dev, |
|
|
uint8_t |
bias |
|
) |
| |
Set the internal BIAS for the given display.
- Note
- Look at the datasheet for more information
- Parameters
-
[in] | dev | device descriptor of display to use |
[in] | bias | the BIAS to use [0 - 7] |
◆ pcd8544_set_contrast()
void pcd8544_set_contrast |
( |
const pcd8544_t * |
dev, |
|
|
uint8_t |
contrast |
|
) |
| |
Set the contrast for the given display.
- Note
- A contrast value of 45 yields good results for 3V3
- Parameters
-
[in] | dev | display device descriptor |
[in] | contrast | targeted contrast value [0 - 127] |
◆ pcd8544_set_tempcoef()
void pcd8544_set_tempcoef |
( |
const pcd8544_t * |
dev, |
|
|
uint8_t |
coef |
|
) |
| |
Set the temperature coefficient for the given display.
- Note
- Look at the datasheet for more information
- Parameters
-
[in] | dev | device descriptor of display to use |
[in] | coef | temperature coefficient to use [0 - 3] |
◆ pcd8544_write_c()
void pcd8544_write_c |
( |
const pcd8544_t * |
dev, |
|
|
uint8_t |
x, |
|
|
uint8_t |
y, |
|
|
const char |
c |
|
) |
| |
Write a single ASCII character to the display.
The position of the character is specified in columns (x) and rows (y)
- Parameters
-
[in] | dev | device descriptor of display to use |
[in] | x | column to put the character [0 - 13] |
[in] | y | row to put the character [0 - 5] |
[in] | c | ASCII code for the character to write |
◆ pcd8544_write_img()
void pcd8544_write_img |
( |
const pcd8544_t * |
dev, |
|
|
const uint8_t |
img[] |
|
) |
| |
Write an image to memory of the given display.
The image must be given as a char array with 504 elements. Each bit in the array represents one pixel on the display. Each byte in the array contains 8 stacked pixels, from top to bottom. So byte[0] contains the pixels from (0,0) to (0,7), byte[1] (1,0) to (1,7) and byte[503] the pixels from (83,40) to (83,47) -> see the 'horizontal addressing' section in the datasheet.
- Parameters
-
[in] | dev | device descriptor of display to use |
[in] | img | uint8_t array with image data (must be of size := 504) |
◆ pcd8544_write_s()
void pcd8544_write_s |
( |
const pcd8544_t * |
dev, |
|
|
uint8_t |
x, |
|
|
uint8_t |
y, |
|
|
const char * |
str |
|
) |
| |
Write a string to a given position on the display.
This function prints a given string to the given position on the display. The position is given in terms of columns (x) and rows (y). If a string does not fit completely in the given position (it overflows its row), the overflowing part of the string is cut off.
- Parameters
-
[in] | dev | device descriptor of display to use |
[in] | x | starting column of the string [0 - 13] |
[in] | y | row to write the string to [0 - 5] |
[in] | str | string to write to the display |