Netcruzer Library API  V2.03
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
nz_lcd2s.h File Reference

Serial LCD Display handler. More...

Go to the source code of this file.

Detailed Description

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.

// *********************************************************************
// ------------ LCD2S Configuration (from nz_lcd2s.h) ---------------------
// *********************************************************************
#define NZ_LCD2S_ENABLED //Enable LCD2S module
//Define the I2C address for the LCD display
#define LCD2S_I2C_ADR LCD2S_DEFAULT_I2C_ADR //[-DEFAULT-]
//Define the default I2C address for the LCD display
#define LCD2S_DEFAULT_I2C_ADR (80ul) //[-DEFAULT-]
//Define which I2C bus the LCD2S should use, 1 is default. Is I2C 1 for all SBC66 Netcruzer boards
#define LCD2S_USE_I2C_BUS ( 1 ) //[-DEFAULT-]
//Define number of serial LCD displays supported, 1 is default
#define LCD2S_MAX_NUMBER ( 1 ) //[-DEFAULT-]
//Define size of keypad buffer for each serial LCD display, must be 8,16,32 or 64
#define KPAD_BUF_SIZE ( 8ul ) //[-DEFAULT-]
//Define keypad for each LCD2S. Can be 0 for no keypad, 4 for 1x4 keypad, 8 for 2x4 keypad,
//12 for a 3x4 keypad, or 16 for a 4x4 keypad. A value of -1 = no change.
#define LCD2S_0_KEYPAD ( 0 ) //[-DEFAULT-] No keypad
//#define LCD2S_0_KEYPAD ( 12 ) //LCD2S has a 3x4 keypad
//#define LCD2S_0_KEYPAD ( 16 ) //LCD2S has a 4x4 keypad. Ensure OUT1 jumper on back of LCD2S is REMOVED!
//Define default backlight for each LCD2S, a value from 0-254 (0 is off, -1 is don't change)
#define LCD2S_0_BACKLIGHT ( -1 ) //[-DEFAULT-]
//Define default contrast for each LCD2S, a value from 0-254 (0 is off, -1 is don't change)
#define LCD2S_0_CONTRAST ( -1 ) //[-DEFAULT-]
//Define default Keypad Buzzer Period for each LCD2S in ms (16ms increments). Use -1 for no change.
#define LCD2S_0_BUZZ_PERIOD_MS ( -1 ) //[-DEFAULT-] No Change
//Define default Key Repeat Rated for each LCD2S in ms (16ms increments). Use -1 for no change.
#define LCD2S_0_KEY_REPEAT_RATE_MS ( -1 ) //[-DEFAULT-] No Change
//Define default Key Repeat Delay for each LCD2S in ms (16ms increments). Use -1 for no change.
#define LCD2S_0_KEY_REPEAT_DELAY_MS ( -1 ) //[-DEFAULT-] No Change
//Define default Key Debounce time for each LCD2S in ms (8ms increments). Use -1 for 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