Using CPLD/4
From Manuals
Contents |
Extended IO API
XioInit
Initializes SSI port.
Prototype:
void XioInit(void);
Description:
Setups SSI0 port for transmission to CPLD using 9-bit frames. Must be executed before any extended I/O functions.
XioWrite
Write one byte to an extended I/O port
Prototype:
unsigned long XioWrite(unsigned long port, unsigned long data);
Description:
The default CPLD firmare implements ten 8-bit I/O ports XIO_PXA to XIO_PXJ and four internal 8-bit registers XIO_RXA to XIO_RXD. This function allows you to write data to any of those 14 locations.
==XioWriteBlock==
Write a block of data to an extended I/O port
Prototype:
unsigned long XioWriteBlock(unsigned long port, unsigned long* ptr, unsigned long count);
Description:
This function allows you to write extended I/O data in blocks with better performance than byte per byte.
XioRead
Read a byte from an extended I/O port
Prototype:
unsigned long XioRead(unsigned long port);
Description:
Allows you to read any of the extended I/O ports (XIO_PXA to XIO_PXJ) or internal registers (XIO_RXA to XIO_RXD).
XioReadBlock
Read a block of data into a buffer
Prototype:
unsigned long XioReadBlock(unsigned long port, unsigned long* ptr, unsigned long count);
Description:
This function allows you to read extended I/O data in blocks with better performance than byte per byte.
IsaInit
Initialize PC/104 controller
Prototype:
void IsaInit(void);
Description:
Initializes registers to allow the board to be a bus master over the PC/104 bus. Must be executed before other PC/104 functions.
IsaWrite
Write data to card at a specified I/O address
Prototype:
unsigned long IsaWrite(unsigned long addr, unsigned long data);
Description:
Writes a byte of data to the expansion card at the specified address.
IsaWriteBlock
Write block of data to card at a specified I/O address
Prototype:
unsigned long IsaWriteBlock(unsigned long addr, unsigned long* ptr, unsigned long count);
Description:
This function allows you to write data to PC/104 cards in blocks with better performance than byte per byte.
IsaRead
Read data from card at a specified I/O address
Prototype:
unsigned long IsaRead(unsigned long addr);
Description:
Reads a byte of data from the expansion card at the specified address.
IsaReadBlock
Read block of data from card at a specified I/O address
Prototype:
unsigned long IsaReadBlock(unsigned long addr, unsigned long* ptr, unsigned long count);
Description:
This function allows you to read from PC/104 cards in blocks with better performance than byte per byte.
LcdInit
Initialize HD44780 LCD Controller
Prototype:
void LcdInit(void);
Description:
Initializes the LCD registers. Must be called before any other LCD function.
LcdCommand
Write command byte to LCD
Prototype:
unsigned long LcdCommand(unsigned long data);
Description:
Writes a command to the LCD. Can be used to send commands that are not supported by the current API.
LcdWrite
Write data byte to LCD
Prototype:
unsigned long LcdWrite(unsigned long data);
Description:
Writes a data byte to the current position in the LCD display.
LcdWriteByte
Write command byte to LCD
Prototype:
unsigned long LcdWriteByte(unsigned long data, unsigned long ctl);
Description:
Write data to the current position in the LCD display using specific control flags. This is a low level function that is normally not used from applications.
LcdWriteStr
Write string to LCD
Prototype:
unsigned long LcdWriteStr(char* str);
Description:
Writes a null terminated string to the current position in the LCD display.
LcdGoTo
Position LCD cursor assuming 20x4 display
Prototype:
unsigned long LcdGoTo(unsigned long col, unsigned long row);
Description:
Moves the LCD cursor to the desired column and row.
LcdWriteAt
Write string to LCD at a specified coordinate
Prototype:
unsigned long LcdWriteAt(unsigned long col, unsigned long row, char* str)
Description:
Moves the LCD cursor to the desired column and row to write a null terminated string.
LcdClear
Clear LCD display
Prototype:
unsigned long LcdClear(void);
Description:
Clears the contents of the LCD display.
LcdDisplay
Turn display on or off
Prototype:
unsigned long LcdDisplay(unsigned long val);
Description:
Makes the display data not visible. Data can still be written to the LCD display and it will be visible when the display is turned on.
LcdCursor
Turn cursor on or off
Prototype:
unsigned long LcdCursor(unsigned long val);
Description:
Makes a blinking cursor visible at the current display position.
LcdBacklight
Turn backlight on or off
Prototype:
unsigned long LcdBacklight(unsigned long val);
Description:
Turning backlight to improve visibility in dim environments. This will increase power requirements.
