ezLCD+103 Driver  0.1
Driver code for the ezLCD+103
 All Files Functions Typedefs Enumerations Groups Pages
ezLCD_103_common.h
Go to the documentation of this file.
1 
15 /* Used to prevent multiple inclusion of the header file */
16 #ifndef EZLCD_COMMON_H
17 #define EZLCD_COMMON_H
18 
19 /*----------------------------------------------------------------------------*/
20 /* INCLUDES */
21 /*----------------------------------------------------------------------------*/
22 #include "ezLCD_103_user_config.h"
23 
24 /*----------------------------------------------------------------------------*/
25 /* CONSTANTS */
26 /*----------------------------------------------------------------------------*/
27 
29 #define EZLCD_WIDTH 320
30 
31 #define EZLCD_HEIGHT 240
32 
33 /*----------------------------------------------------------------------------*/
34 /* MACROS */
35 /*----------------------------------------------------------------------------*/
37 #ifndef SETBIT
38 #define SETBIT(port,bit) ((port) |= (1 << (bit)))
39 #endif /* SETBIT */
40 
42 #ifndef CLEARBIT
43 #define CLEARBIT(port,bit) ((port) &= ~(1 << (bit)))
44 #endif /* CLEARBIT */
45 
58 #ifdef EZLCD_SPR2X
59 #define EZLCD_INIT_SPI() EZLCD_SPCR = ((0 << EZLCD_SPIE) | \
60  (1 << EZLCD_SPE) | \
61  (0 << EZLCD_DORD) | \
62  (1 << EZLCD_MSTR) | \
63  (0 << EZLCD_CPOL) | \
64  (0 << EZLCD_CPHA) | \
65  (0 << EZLCD_SPR1) | \
66  (0 << EZLCD_SPR0)); \
67  CLEARBIT(EZLCD_SPSR, EZLCD_SPR2X);
68 #else
69 #define EZLCD_INIT_SPI() EZLCD_SPCR = ((0 << EZLCD_SPIE) | \
70  (1 << EZLCD_SPE) | \
71  (0 << EZLCD_DORD) | \
72  (1 << EZLCD_MSTR) | \
73  (0 << EZLCD_CPOL) | \
74  (0 << EZLCD_CPHA) | \
75  (0 << EZLCD_SPR1) | \
76  (0 << EZLCD_SPR0));
77 #endif /* SPR2X */
78 
80 #define EZLCD_SLAVE_SELECT() CLEARBIT(EZLCD_SPI_PORT, EZLCD_SS_BAR_PIN);
81 
83 #define EZLCD_SLAVE_DESELECT() SETBIT(EZLCD_SPI_PORT, EZLCD_SS_BAR_PIN);
84 
85 
86 /*----------------------------------------------------------------------------*/
87 /* TYPEDEFS */
88 /*----------------------------------------------------------------------------*/
89 
90 typedef unsigned char uint8_t ;
91 typedef signed char int8_t ;
92 typedef unsigned int uint16_t ;
93 typedef signed int int16_t ;
94 typedef unsigned long uint32_t ;
95 typedef unsigned long int32_t ;
96 
97 /*----------------------------------------------------------------------------*/
98 /* FUNCTIONS */
99 /*----------------------------------------------------------------------------*/
100 
121 
147 uint8_t ezLCD_transfer_data_long(uint8_t data, uint8_t end_transfer);
148 
149 #endif /* EZLCD_COMMON_H */
150  /* ezLCD_103_common */
signed char int8_t
Definition: ezLCD_103_common.h:91
signed int int16_t
Definition: ezLCD_103_common.h:93
unsigned int uint16_t
Definition: ezLCD_103_common.h:92
uint8_t ezLCD_transfer_data_long(uint8_t data, uint8_t end_transfer)
Definition: ezLCD_103_common.c:33
unsigned char uint8_t
Definition: ezLCD_103_common.h:90
unsigned long uint32_t
Definition: ezLCD_103_common.h:94
User configuration header file.
uint8_t ezLCD_transfer_data(uint8_t data)
Definition: ezLCD_103_common.c:22
unsigned long int32_t
Definition: ezLCD_103_common.h:95