ezLCD+103 Driver
0.1
Driver code for the ezLCD+103
|
Macros | |
#define | EZLCD_WIDTH 320 |
#define | EZLCD_HEIGHT 240 |
#define | SETBIT(port, bit) ((port) |= (1 << (bit))) |
#define | CLEARBIT(port, bit) ((port) &= ~(1 << (bit))) |
#define | EZLCD_INIT_SPI() |
#define | EZLCD_SLAVE_SELECT() CLEARBIT(EZLCD_SPI_PORT, EZLCD_SS_BAR_PIN); |
#define | EZLCD_SLAVE_DESELECT() SETBIT(EZLCD_SPI_PORT, EZLCD_SS_BAR_PIN); |
Typedefs | |
typedef unsigned char | uint8_t |
typedef signed char | int8_t |
typedef unsigned int | uint16_t |
typedef signed int | int16_t |
typedef unsigned long | uint32_t |
typedef unsigned long | int32_t |
Functions | |
uint8_t | ezLCD_transfer_data (uint8_t data) |
uint8_t | ezLCD_transfer_data_long (uint8_t data, uint8_t end_transfer) |
This header file contains various macros and functions needed by other child header files in this library. Among them are functions to send SPI data as well as
#define CLEARBIT | ( | port, | |
bit | |||
) | ((port) &= ~(1 << (bit))) |
Define CLEARBIT if not previously defined
#define EZLCD_HEIGHT 240 |
Height of the entire display in pixels
#define EZLCD_INIT_SPI | ( | ) |
Initialize SPI communication:
SPIE - SPI Interrupt DISABLED (we will poll instead)
SPE - SPI ENABLED
DORD - MSB First
MSTR - Configured as a MASTER
CPOL - Clock Polarity = 0
CPHA - Clock Phase = 0
SPI - Clock = f_clk/4 (EA EZLCD+103 can handle up to 4MHz)
SPR1 - CLEARED
SPR0 - CLEARED
SPR2X - CLEARED
#define EZLCD_SLAVE_DESELECT | ( | ) | SETBIT(EZLCD_SPI_PORT, EZLCD_SS_BAR_PIN); |
Deselect the EZLCD+103
#define EZLCD_SLAVE_SELECT | ( | ) | CLEARBIT(EZLCD_SPI_PORT, EZLCD_SS_BAR_PIN); |
Select the EZLCD+103
#define EZLCD_WIDTH 320 |
Width of the entire display in pixels
#define SETBIT | ( | port, | |
bit | |||
) | ((port) |= (1 << (bit))) |
Define SETBIT if not previously defined
typedef signed int int16_t |
portable 16-bit signed integer
typedef unsigned long int32_t |
portable 32-bit signed number
typedef signed char int8_t |
portable 8-bit signed integer
typedef unsigned int uint16_t |
portable 16-bit unsigned integer
typedef unsigned long uint32_t |
portable 32-bit unsigned number
typedef unsigned char uint8_t |
portable 8-bit unsigned integer
This function is used to send one byte of data over SPI. It may be modified should the user choose to use a different serial protocol instead of SPI.
This function is used to send multiple bytes of data over SPI through subsequent calls to this function. In other words, it does not unassert the chip select until the transmission has been completed. It may be modified should the user choose to use a different serial protocol instead of SPI.