Loading...
Searching...
No Matches
pcd8544.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015 Freie Universität Berlin
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
22#ifndef PCD8544_H
23#define PCD8544_H
24
25#include <stdint.h>
26
27#include "periph/gpio.h"
28#include "periph/spi.h"
29
30#ifdef __cplusplus
31 extern "C" {
32#endif
33
38#define PCD8544_RES_X (84U)
39#define PCD8544_RES_Y (48U)
40#define PCD8544_COLS (14U)
41#define PCD8544_ROWS (6U)
48#define PCD8544_DEFAULT_CONTRAST (45U)
49#define PCD8544_DEFAULT_BIAS (3U)
50#define PCD8544_DEFAULT_TEMPCOEF (0U)
56typedef struct {
57 spi_t spi;
58 gpio_t cs;
59 gpio_t reset;
60 gpio_t mode;
61 uint8_t inverted;
62} pcd8544_t;
63
76int pcd8544_init(pcd8544_t *dev, spi_t spi, gpio_t cs,
77 gpio_t reset, gpio_t mode);
78
87void pcd8544_set_contrast(const pcd8544_t *dev, uint8_t contrast);
88
97void pcd8544_set_tempcoef(const pcd8544_t *dev, uint8_t coef);
98
108void pcd8544_set_bias(const pcd8544_t *dev, uint8_t bias);
109
123void pcd8544_write_img(const pcd8544_t *dev, const uint8_t img[]);
124
135void pcd8544_write_c(const pcd8544_t *dev, uint8_t x, uint8_t y, const char c);
136
150void pcd8544_write_s(const pcd8544_t *dev, uint8_t x, uint8_t y, const char* str);
151
157void pcd8544_clear(const pcd8544_t *dev);
158
165
175
181void pcd8544_poweron(const pcd8544_t *dev);
182
189
195void pcd8544_riot(const pcd8544_t *dev);
196
197#ifdef __cplusplus
198}
199#endif
200
201#endif /* PCD8544_H */
Low-level GPIO peripheral driver interface definitions.
void pcd8544_riot(const pcd8544_t *dev)
I wonder what this does -> find out!
void pcd8544_set_contrast(const pcd8544_t *dev, uint8_t contrast)
Set the contrast for the given display.
void pcd8544_poweroff(const pcd8544_t *dev)
Poser off the display.
void pcd8544_poweron(const pcd8544_t *dev)
Power on the display.
void pcd8544_set_bias(const pcd8544_t *dev, uint8_t bias)
Set the internal BIAS for the given display.
int pcd8544_init(pcd8544_t *dev, spi_t spi, gpio_t cs, gpio_t reset, gpio_t mode)
Initialize 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_invert(pcd8544_t *dev)
Invert the display (toggles dark and bright pixels)
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)
int pcd8544_is_inverted(const pcd8544_t *dev)
Get the current inversion status of the display.
void pcd8544_write_img(const pcd8544_t *dev, const uint8_t img[])
Write an image to memory of the given display.
void pcd8544_set_tempcoef(const pcd8544_t *dev, uint8_t coef)
Set the temperature coefficient for the given display.
Low-level SPI peripheral driver interface definition.
PCD8544 device descriptor.
Definition pcd8544.h:56
gpio_t mode
mode pin: low: cmd mode, high: data mode
Definition pcd8544.h:60
spi_t spi
SPI bus the display is connected to.
Definition pcd8544.h:57
gpio_t reset
reset pin, low: active
Definition pcd8544.h:59
uint8_t inverted
internal flag to keep track of inversion state
Definition pcd8544.h:61
gpio_t cs
chip-select pin, low: active
Definition pcd8544.h:58