Serial LCD Display handler.
- Author
- Modtronix Engineering
- Compiler:
- MPLAB XC16 compiler
Description
This module implements a driver for the LCD2S range of serial LCD Displays. To add LCD2S support to a project, do one of the following:
--— Option 2 --—
- Add nz_lcd2s.c to the project, this is the main LCD2S driver file.
- The following additional files are required by nz_lcd2s.c, and must be added to the project: nz_circularBufferPwr2.c, nz_helpers.c, nz_netcruzer.c and nz_serI2C.c
- Add "NZ_I2C1_ENABLE" to projdefs.h file.
- In code, initialize LCD2S. Ensure to delay 300ms from power up. For example: delay_ms(300); lcdInit();
- In projdefs.h, do any LCD2S, I2C or other configuration required. This is done by copying the configuration section from the *.h files to projdefs.h. Nothing required, defaults will work!
- In code, call lcd2sTask() repetitively in main loop
Can now use LCD2S functions to write to LCD and perform other tasks. Some examples: lcdDisplayString(0, "\fHello\nWorld, Again!"); //Write parsed string to LCD display lcdDisplayChar(0, 'x'); //Display 'x' at current cursor position
--— Option 1 (Add LCD support via nz_netcruzer.c) --—
- Add nz_netcruzer.c to project
- Add "#define NZSYS_ENABLE_LCD2S_AND_I2C1" to projdefs.h !!!!! This is broken, fix !!!!!
- In code, call nzSysInitDefault() once at initialization stage
- In code, call nzSysTaskDefault() repetitively in main loop
- Can now use LCD2S functions to write to LCD and perform other tasks. Some examples: lcdDisplayString(0, "\fHello\nWorld, Again!"); //Write parsed string to LCD display lcdDisplayChar(0, 'x'); //Display 'x' at current cursor position
LCD2S Configuration
The following defines are used to configure this module, and should be placed in projdefs.h. Note that all items marked [-DEFAULT-] are defaults, and do not have to be placed in projdefs.h if they contain desired configuration! For details, see Project Configuration.
#define NZ_LCD2S_ENABLED //Enable LCD2S module
#define LCD2S_I2C_ADR LCD2S_DEFAULT_I2C_ADR //[-DEFAULT-]
#define LCD2S_DEFAULT_I2C_ADR (80ul) //[-DEFAULT-]
#define LCD2S_USE_I2C_BUS ( 1 ) //[-DEFAULT-]
#define LCD2S_MAX_NUMBER ( 1 ) //[-DEFAULT-]
#define KPAD_BUF_SIZE ( 8ul ) //[-DEFAULT-]
#define LCD2S_0_KEYPAD ( 0 ) //[-DEFAULT-] No keypad
#define LCD2S_0_BACKLIGHT ( -1 ) //[-DEFAULT-]
#define LCD2S_0_CONTRAST ( -1 ) //[-DEFAULT-]
#define LCD2S_0_BUZZ_PERIOD_MS ( -1 ) //[-DEFAULT-] No Change
#define LCD2S_0_KEY_REPEAT_RATE_MS ( -1 ) //[-DEFAULT-] No Change
#define LCD2S_0_KEY_REPEAT_DELAY_MS ( -1 ) //[-DEFAULT-] No Change
#define LCD2S_0_KEY_DEBOUNCE_TIME_MS ( -1 ) //[-DEFAULT-] No Change
Software License Agreement
The software supplied herewith is owned by Modtronix Engineering, and is protected under applicable copyright laws. The software supplied herewith is intended and supplied to you, the Company customer, for use solely and exclusively on products manufactured by Modtronix Engineering. The code may be modified and can be used free of charge for commercial and non commercial applications. All rights are reserved. Any use in violation of the foregoing restrictions may subject the user to criminal sanctions under applicable laws, as well as to civil liability for the breach of the terms and conditions of this license.
THIS SOFTWARE IS PROVIDED IN AN 'AS IS' CONDITION. NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
File History
2007-07-16, David Hosken (DH):
- Created documentation for existing code