Skip to content

Commit 48ba38f

Browse files
author
andygock
committed
More info on compiler symbol usage
1 parent 5ae72ea commit 48ba38f

File tree

1 file changed

+45
-39
lines changed

1 file changed

+45
-39
lines changed

README.md

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
glcd - Graphic LCD Library
2-
==========================
1+
# glcd - Graphic LCD Library
32

43
by Andy Gock
54

6-
Up to date documentation
7-
------------------------
5+
## Up to date documentation
86

97
For up to date documentation, please see the doxygen pages under the `doxygen_pages` directory.
108

@@ -14,8 +12,7 @@ http://s.agock.com/glcd-documentation
1412

1513
However this site may not always be kept up to date.
1614

17-
Introduction
18-
============
15+
# Introduction
1916

2017
Welcome to GLCD, an open source graphic LCD library written by Andy Gock.
2118

@@ -27,8 +24,9 @@ This library has been written cleanly, to allow easy modification for use with d
2724

2825
It is suitable for monochrome (black and white) LCDs with page by page data and command write style data transfer protocol. It is not suitable for color graphic LCDs.
2926

30-
Supported controllers and chipsets
31-
----------------------------------
27+
# Supported devices
28+
29+
## Controllers and chipsets
3230

3331
Works with:
3432

@@ -43,10 +41,9 @@ The following Newhaven displays have been physically tested with and confirmed w
4341
- NHD-C12832A1Z-FSW-FBW-3V3
4442
- ZOLEN-12864-FFSSWE-NAA
4543

46-
Supported microcontrollers
47-
--------------------------
44+
## Microcontrollers
4845

49-
MCUs supported:
46+
### MCUs supported
5047

5148
- Atmel AVR 8-bit
5249
- NXP LPC111x ARM Cortex-M0
@@ -55,24 +52,25 @@ MCUs supported:
5552
- ST STM32 F4 ARM Cortex-M4
5653
- Microchip PIC24H (and probably other 16-bit MCUs)
5754

58-
Development boards tested on (with on-board LCD):
55+
### Development boards tested on (with on-board LCD)
5956

6057
- NGX BlueBoard LPC11U37 (with on-board NT75451 graphic LCD)
6158

62-
Development boards tested on (without on-board LCD):
59+
### Development boards tested on (without on-board LCD)
6360

6461
- Microstick II with PIC24H and Nokia 3310/5110 LCD, ST7565R and ST7565P
65-
- ST Nucleo F401RE.
62+
- ST Nucleo F401RE
6663

67-
### Special note
64+
## Special note
6865

6966
Not all combinations of microcontroller platform and LCD controllers are supported out of the box. However you can edit the files `devices/` and `controllers/` and add your desired combination. More information on how to do this can be read in the doxygen documentation.
7067

71-
Setup of symbols for compiler
72-
-----------------------------
68+
# Setup of symbols for compiler
7369

7470
The following symbols need to be defined for the compiler:
7571

72+
## Select microcontroller
73+
7674
Pick microcontroller type (pick one only):
7775

7876
GLCD_DEVICE_LPX111X
@@ -82,6 +80,7 @@ Pick microcontroller type (pick one only):
8280
GLCD_DEVICE_STM32F4XX
8381
GLCD_DEVICE_PIC24H
8482

83+
## Select LCD controller
8584
Pick LCD controller type (pick one only):
8685

8786
GLCD_CONTROLLER_PCD8544
@@ -90,6 +89,8 @@ Pick LCD controller type (pick one only):
9089

9190
For ST7565P controllers, treat as ST7565R. For most if not all parts here, they behave the same way.
9291

92+
## Select SPI or parallel interface
93+
9394
If using a parallel interface LCD (e.g NT75451 on NGX BlueBoard):
9495

9596
GLCD_USE_PARALLEL
@@ -100,47 +101,52 @@ When using SPI controllers:
100101

101102
Note the SPI symbol isn't actually checked by the source at the moment, and it is fine if it is not used. It is for forward compatibility only. One day I may decide to check for it.
102103

103-
For the Newhaven displays using ST7565 based controllers listed above which have been tested as working, there
104-
are certain initialisation sequences which should be followed, and this may vary
105-
from display to display. To force a certain (and tested) initialisation
106-
sequence, define one of the following:
104+
## Initialisation sequence
105+
106+
For the Newhaven displays using ST7565 based controllers listed above which have been tested as working, there are certain initialisation sequences which should be followed, and this may vary from display to display. To force a certain (and tested) initialisation sequence, define one of the following:
107107

108108
GLCD_INIT_NHD_C12832A1Z_FSW_FBW_3V3
109109
GLCD_INIT_NHD_C12864A1Z_FSW_FBW_HTT
110110
GLCD_INIT_NHD_C12864WC_FSW_FBW_3V3_M
111111
GLCD_INIT_ZOLEN_12864_FFSSWE_NAA
112112

113-
If you don't specify a NHD model, ST7565 controller selection will default to `GLCD_INIT_NHD_C12864WC_FSW_FBW_3V3_M` sequence.
114-
This however may change in the future.
113+
If you don't specify a NHD model, ST7565 controller selection will default to `GLCD_INIT_NHD_C12864WC_FSW_FBW_3V3_M` sequence. This however may change in the future.
114+
115+
## Reset time
115116

116117
To set a reset time, used by the `glcd_reset()` function, set `GLCD_RESET_TIME` to desired duration in milliseconds.
117118

118-
These symbols need to be set in the configuration options of your IDE, usually
119-
in the "defined symbols" section, or they can be defined in a makefile
120-
as `-D` options.
119+
## Contrast
120+
121+
When using PCD8544 controllers, define a `PCD8544_CONTRAST` symbol with a 8-bit unsigned integer for the contast value. If this is not defined, a default value will be used.
122+
123+
## LCD dimensions
124+
125+
Set `GLCD_LCD_WIDTH` and `GLCD_LCD_HEIGHT` to define custom LCD dimensions. If these are not user defined, then a default width and height is used. The default dimensions are 128x64 except for PCD8544 controllers which is 84x48.
126+
127+
## Compiler setup
128+
129+
These symbols need to be set in the configuration options of your IDE, usually in the "defined symbols" section, or they can be defined in a makefile as `-D` options.
121130

122131
Example:
123132

124133
-DGLCD_DEVICE_LPC111X
125134

126-
Delay Timing
127-
------------
135+
## Delay Timing
128136

129-
Some operations such as sending a reset pulse, requires the use of a delay timer. The library will refer to a
130-
external function called `delay_ms(t)` where t is the delay required in milliseconds. Please ensure you have
131-
this function elsewhere in your program.
137+
Some operations such as sending a reset pulse, requires the use of a delay timer. The library will refer to a external function called `delay_ms(t)` where t is the delay required in milliseconds. Please ensure you have this function elsewhere in your program.
132138

133-
If you are using avr-gcc with Atmel devices, you can force the library to use the built-in `_delay_ms()` function
134-
by setting the compiler symbols:
139+
### AVR devices
140+
141+
If you are using avr-gcc with Atmel devices, you can force the library to use the built-in `_delay_ms()` function by setting the compiler symbols:
135142

136143
GLCD_USE_AVR_DELAY
137144
__DELAY_BACKWARD_COMPATIBLE__
138-
139-
Documentation
140-
-------------
141145

142-
Refer to Doxygen generated pages for detailed documentation. You'll can generate the documentation yourself,
143-
simply install Doxygen and load the doxygen file in the root directory of the library and generate the documents
144-
in a file format of your choice (HTML, PDF, TEX etc).
146+
`F_CPU` must be set to your clock frequency for the above AVR built-in delay routine to work.
147+
148+
# Documentation
149+
150+
Refer to Doxygen generated pages for detailed documentation. You'll can generate the documentation yourself, simply install Doxygen and load the doxygen file in the root directory of the library and generate the documents in a file format of your choice (HTML, PDF, TEX etc).
145151

146152
There is also a online version (link at top of this document)

0 commit comments

Comments
 (0)