px-fwlib 0.10.0
Cross-platform embedded library and documentation for 8/16/32-bit microcontrollers generated with Doxygen 1.9.2
px_lcd_st7565p_tse2g0330e.h
1#ifndef __PX_LCD_ST7565P_TSE2G0330E_H__
2#define __PX_LCD_ST7565P_TSE2G0330E_H__
3/* =============================================================================
4 _____ _____ _____ ____ _ _ ____ __ __ _____ __ __
5 | __ \ |_ _| / ____| / __ \ | \ | | / __ \ | \/ | |_ _| \ \ / /
6 | |__) | | | | | | | | | | \| | | | | | | \ / | | | \ V /
7 | ___/ | | | | | | | | | . ` | | | | | | |\/| | | | > <
8 | | _| |_ | |____ | |__| | | |\ | | |__| | | | | | _| |_ / . \
9 |_| |_____| \_____| \____/ |_| \_| \____/ |_| |_| |_____| /_/ \_\
10
11 Copyright (c) 2013 Pieter Conradie <https://piconomix.com>
12
13 License: MIT
14 https://github.com/piconomix/px-fwlib/blob/master/LICENSE.md
15
16 Title: px_lcd_st7565p_tse2g0330e.h : Truly TSE2G0330-E 128x64 monochrome LCD wtih Sitronix ST7565P driver
17 Author(s): Pieter Conradie
18 Creation Date: 2013-12-05
19
20============================================================================= */
21
22/**
23 * @ingroup DEVICES_DISPLAY
24 * @defgroup PX_LCD_ST7565P_TSE2G0330E px_lcd_st7565p_tse2g0330e.h : Truly TSE2G0330-E 128x64 monochrome LCD wtih Sitronix ST7565P driver
25 *
26 * File(s):
27 * - devices/display/inc/px_lcd_st7565p_tse2g0330e.h
28 * - devices/display/src/px_lcd_st7565p_tse2g0330e.c
29 *
30 * @{
31 */
32
33/* _____STANDARD INCLUDES____________________________________________________ */
34
35/* _____PROJECT INCLUDES_____________________________________________________ */
36#include "px_defs.h"
37#include "px_spi.h"
38
39// Include project specific configuration. See "px_lcd_st7565p_tse2g0330e_cfg_template.h"
40#include "px_lcd_st7565p_tse2g0330e_cfg.h"
41
42// Check that all project specific options have been specified in "px_lcd_st7565p_tse2g0330e_cfg.h"
43#if ( !defined(PX_LCD_CFG_RST_LO ) \
44 || !defined(PX_LCD_CFG_RST_HI ) \
45 || !defined(PX_LCD_CFG_RS_LO ) \
46 || !defined(PX_LCD_CFG_RS_HI ) \
47 || !defined(PX_LCD_CFG_ROT_180_DEG) )
48#error "One or more options not defined in 'px_lcd_st7565p_tse2g0330e_cfg.h'"
49#endif
50
51/* _____DEFINITIONS__________________________________________________________ */
52/// Maximum PX_SPI Clock rate
53#define PX_LCD_MAX_SPI_CLOCK_HZ 20000000ul
54/// PX_SPI Clock / Data phase
55#define PX_LCD_SPI_MODE PX_SPI_MODE3
56/// PX_SPI Data order
57#define PX_LCD_SPI_DATA_ORDER PX_SPI_DATA_ORDER_MSB
58/// Number of columns
59#define PX_LCD_NR_OF_COLS 128
60/// Number of rows
61#define PX_LCD_NR_OF_ROWS 64
62/// Number of pages
63#define PX_LCD_NR_OF_PAGES (PX_LCD_NR_OF_ROWS / 8)
64
65/* _____TYPE DEFINITIONS_____________________________________________________ */
66
67/* _____GLOBAL VARIABLES_____________________________________________________ */
68
69/* _____GLOBAL FUNCTION DECLARATIONS_________________________________________ */
70/**
71 * Initialise LCD driver.
72 *
73 * @param handle Pointer to SPI handle data structure
74 */
75void px_lcd_init(px_spi_handle_t * handle);
76
77/**
78 * Clear LCD display.
79 *
80 */
81void px_lcd_clr(void);
82
83/**
84 * Select LCD page (y) for display data.
85 *
86 * The LCD is divided up into 8 rows of 128 bytes. Each row is called a page.
87 *
88 * @param page 0 to (PX_LCD_NR_OF_PAGES - 1)
89 */
90void px_lcd_sel_page(uint8_t page);
91
92/**
93 * Select LCD starting column (x) for display data.
94 *
95 * The LCD is divided up into 8 rows of 128 bytes. Each byte in the row maps to
96 * a column value.
97 *
98 * @param col 0 to (PX_LCD_NR_OF_COLS - 1)
99 */
100void px_lcd_sel_col(uint8_t col);
101
102/**
103 * Write one byte of display data.
104 *
105 * The value will be written to the selected page (@see px_lcd_sel_page)
106 * and selected column (@see px_lcd_sel_col).
107 *
108 * @param data Value to write to display
109 */
110void px_lcd_wr_disp_u8(uint8_t data);
111
112/**
113 * Write data to display.
114 *
115 * The data will be written to the selected page (@see px_lcd_sel_page)
116 * and start at the selected column (@see px_lcd_sel_col).
117 *
118 * @note If data is written past the end of the column, it will not
119 * automatically wrap to the next page.
120 *
121 * @param data Pointer to data to write
122 * @param nr_of_bytes Number of bytes to write
123 */
124void px_lcd_wr_disp_data(uint8_t * data, size_t nr_of_bytes);
125
126/* _____MACROS_______________________________________________________________ */
127
128/// @}
129#endif
void px_lcd_wr_disp_data(uint8_t *data, size_t nr_of_bytes)
Write data to display.
void px_lcd_init(px_spi_handle_t *handle)
Initialise LCD driver.
void px_lcd_sel_page(uint8_t page)
Select LCD page (y) for display data.
void px_lcd_wr_disp_u8(uint8_t data)
Write one byte of display data.
void px_lcd_clr(void)
Clear LCD display.
void px_lcd_sel_col(uint8_t col)
Select LCD starting column (x) for display data.
Define SPI handle.
Definition: px_spi.h:126