All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
vexlcd.h File Reference

LCD driver macros and prototypes. More...

Go to the source code of this file.

Data Structures

struct  _LcdData
 Holds all data for a single LCD display. More...
 

Macros

#define VEX_LCD_BACKLIGHT   0x01
 bit for turning backlight on More...
 
#define VEX_LCD_DISPLAY_1   0
 LCD display on UART1. More...
 
#define VEX_LCD_DISPLAY_2   1
 LCD display on UART2. More...
 
#define VEX_LCD_LINE_1   0
 Upper LCD display line. More...
 
#define VEX_LCD_LINE_2   1
 Lower LCD display line. More...
 
#define VEX_LCD_LINE_T   0
 Upper LCD display line. More...
 
#define VEX_LCD_LINE_B   1
 Lower LCD display line. More...
 

Typedefs

typedef struct _LcdData LcdData
 Holds all data for a single LCD display. More...
 
typedef enum _vexLcdButton vexLcdButton
 

Enumerations

enum  _vexLcdButton {
  kLcdButtonNone = 0, kLcdButtonLeft = 1, kLcdButtonCenter = 2, kLcdButtonLeftCenter = 3,
  kLcdButtonRight = 4, kLcdButtonLeftRight = 5, kLcdButtonCenterRight = 6, kLcdButtonLeftCenterRight = 7
}
 

Functions

void vexLcdInit (int16_t display, SerialDriver *sdp)
 Initialize a LCD and bind to serial port. More...
 
void vexLcdSet (int16_t display, int16_t line, char *buf)
 Show text from beginning of an LCD line. More...
 
void vexLcdSetAt (int16_t display, int16_t line, int16_t col, char *buf)
 Show text on LCD line and column. More...
 
void vexLcdPrintf (int16_t display, int16_t line, char *fmt,...)
 Formated output to LCD - similar to printf. More...
 
void vexLcdPrintfAt (int16_t display, int16_t line, int16_t col, char *fmt,...)
 Formated output to LCD - similar to printf. More...
 
void vexLcdClearLine (int16_t display, int16_t line)
 Clear a given lcd display line. More...
 
void vexLcdBacklight (int16_t display, int16_t value)
 Turn on or off the backlight. More...
 
vexLcdButton vexLcdButtonGet (int16_t display)
 Get the current button status. More...
 
void vexLcdCheckReceiveMessage (LcdData *lcd)
 Check for receive data and store. More...
 
void vexLcdSendMessage (LcdData *lcd, int16_t line)
 Form and send message to LCD. More...
 
void vexLcdDebug (vexStream *chp, int argc, char *argv[])
 Debug function to dump LCD buffers. More...
 

Detailed Description

LCD driver macros and prototypes.

Macro Definition Documentation

#define VEX_LCD_BACKLIGHT   0x01

bit for turning backlight on

#define VEX_LCD_DISPLAY_1   0

LCD display on UART1.

#define VEX_LCD_DISPLAY_2   1

LCD display on UART2.

#define VEX_LCD_LINE_1   0

Upper LCD display line.

#define VEX_LCD_LINE_2   1

Lower LCD display line.

#define VEX_LCD_LINE_T   0

Upper LCD display line.

#define VEX_LCD_LINE_B   1

Lower LCD display line.

Typedef Documentation

typedef struct _LcdData LcdData

Holds all data for a single LCD display.

Enumeration Type Documentation

Enumerator
kLcdButtonNone 
kLcdButtonLeft 
kLcdButtonCenter 
kLcdButtonLeftCenter 
kLcdButtonRight 
kLcdButtonLeftRight 
kLcdButtonCenterRight 
kLcdButtonLeftCenterRight 

Function Documentation

void vexLcdInit ( int16_t  display,
SerialDriver *  sdp 
)

Initialize a LCD and bind to serial port.

Parameters
[in]displayThe LCD display id, should be 0 or 1
[in]sdpA pointer to the serial driver (chibios hal serial driver)
void vexLcdSet ( int16_t  display,
int16_t  line,
char *  buf 
)

Show text from beginning of an LCD line.

Parameters
[in]displayThe LCD display id, 0 or 1
[in]lineThe line to display the text on, 0 or 1
[in]bufPointer to char buffer with test to display
void vexLcdSetAt ( int16_t  display,
int16_t  line,
int16_t  col,
char *  buf 
)

Show text on LCD line and column.

Parameters
[in]displayThe LCD display id, 0 or 1
[in]lineThe line to display the text on, 0 or 1
[in]colThe position at which to start displaying text
[in]bufPointer to char buffer with test to display
void vexLcdPrintf ( int16_t  display,
int16_t  line,
char *  fmt,
  ... 
)

Formated output to LCD - similar to printf.

Parameters
[in]displayThe LCD display id, 0 or 1
[in]lineThe line to display the text on, 0 or 1
[in]fmtA sprintf style format string with optional variables
void vexLcdPrintfAt ( int16_t  display,
int16_t  line,
int16_t  col,
char *  fmt,
  ... 
)

Formated output to LCD - similar to printf.

Parameters
[in]displayThe LCD display id, 0 or 1
[in]lineThe line to display the text on, 0 or 1
[in]colThe position at which to start displaying text
[in]fmtA sprintf style format string with optional variables
void vexLcdClearLine ( int16_t  display,
int16_t  line 
)

Clear a given lcd display line.

Parameters
[in]displayThe LCD display id, 0 or 1
[in]lineThe line to display the text on, 0 or 1
void vexLcdBacklight ( int16_t  display,
int16_t  value 
)

Turn on or off the backlight.

Parameters
[in]displayThe LCD display id, 0 or 1
[in]value1 for backlight on, 0 for off
vexLcdButton vexLcdButtonGet ( int16_t  display)

Get the current button status.

Parameters
[in]displayThe LCD display id, 0 or 1
Returns
The button (or buttons) pressed
void vexLcdCheckReceiveMessage ( LcdData lcd)

Check for receive data and store.

Parameters
[in]lcdPointer to LcdData structure
Note
Internal driver use only
void vexLcdSendMessage ( LcdData lcd,
int16_t  line 
)

Form and send message to LCD.

Parameters
[in]lcdPointer to LcdData structure
[in]lineThe line to display the text on, 0 or 1
Note
Internal driver use only
void vexLcdDebug ( vexStream chp,
int  argc,
char *  argv[] 
)

Debug function to dump LCD buffers.

Parameters
[in]chpA pointer to a vexStream object
[in]argcThe number of command line arguments
[in]argvAn array of pointers to the command line args