Choco OS  V.0.16.9.0
Join to the chocolate world
oc_lcdtft_lld.h
Go to the documentation of this file.
1 
32 #ifndef _OC_LCDTFT_LLD_H
33 #define _OC_LCDTFT_LLD_H
34 
35 #include <oc_machine.h>
36 #include <oc_errors.h>
37 #include <oc_frequency.h>
38 #include <oc_color.h>
39 #include <oc_pixel.h>
40 
41 #if oC_Channel_IsModuleDefined(LCDTFT) == true && oC_ModulePinFunctions_IsModuleDefined(LCDTFT) == true && oC_ModulePin_IsModuleDefined(LCDTFT) == true
42 #define oC_LCDTFT_LLD_AVAILABLE
43 
49 #define _________________________________________TYPES_SECTION______________________________________________________________________________
50 #define MODULE_NAME LCDTFT
53 
54 
55 //==========================================================================================================================================
62 //==========================================================================================================================================
64 
65 //==========================================================================================================================================
72 //==========================================================================================================================================
73 oC_ModulePinFunction_DefineType;
74 
75 //==========================================================================================================================================
82 //==========================================================================================================================================
83 oC_ModulePin_DefineType;
84 //==========================================================================================================================================
90 //==========================================================================================================================================
92 
93 typedef enum
94 {
95  oC_LCDTFT_LLD_PixelClockPolarity_InputPixelClock ,
96  oC_LCDTFT_LLD_PixelClockPolarity_InvertedInputPixelClock
97 } oC_LCDTFT_LLD_PixelClockPolarity_t;
98 
99 typedef enum
100 {
101  oC_LCDTFT_LLD_Polarity_ActiveLow ,
102  oC_LCDTFT_LLD_Polarity_ActiveHigh
103 } oC_LCDTFT_LLD_Polarity_t;
104 
105 typedef enum
106 {
107  oC_LCDTFT_LLD_PinIndex_R0 ,
108  oC_LCDTFT_LLD_PinIndex_R1 ,
109  oC_LCDTFT_LLD_PinIndex_R2 ,
110  oC_LCDTFT_LLD_PinIndex_R3 ,
111  oC_LCDTFT_LLD_PinIndex_R4 ,
112  oC_LCDTFT_LLD_PinIndex_R5 ,
113  oC_LCDTFT_LLD_PinIndex_R6 ,
114  oC_LCDTFT_LLD_PinIndex_R7 ,
115  oC_LCDTFT_LLD_PinIndex_G0 ,
116  oC_LCDTFT_LLD_PinIndex_G1 ,
117  oC_LCDTFT_LLD_PinIndex_G2 ,
118  oC_LCDTFT_LLD_PinIndex_G3 ,
119  oC_LCDTFT_LLD_PinIndex_G4 ,
120  oC_LCDTFT_LLD_PinIndex_G5 ,
121  oC_LCDTFT_LLD_PinIndex_G6 ,
122  oC_LCDTFT_LLD_PinIndex_G7 ,
123  oC_LCDTFT_LLD_PinIndex_B0 ,
124  oC_LCDTFT_LLD_PinIndex_B1 ,
125  oC_LCDTFT_LLD_PinIndex_B2 ,
126  oC_LCDTFT_LLD_PinIndex_B3 ,
127  oC_LCDTFT_LLD_PinIndex_B4 ,
128  oC_LCDTFT_LLD_PinIndex_B5 ,
129  oC_LCDTFT_LLD_PinIndex_B6 ,
130  oC_LCDTFT_LLD_PinIndex_B7 ,
131  oC_LCDTFT_LLD_PinIndex_VSYNC ,
132  oC_LCDTFT_LLD_PinIndex_HSYNC ,
133  oC_LCDTFT_LLD_PinIndex_CLK ,
134  oC_LCDTFT_LLD_PinIndex_DE ,
135  oC_LCDTFT_LLD_PinIndex_DISP ,
136  oC_LCDTFT_LLD_PinIndex_BL_CTRL ,
137  oC_LCDTFT_LLD_PinIndex_LED_K ,
138  oC_LCDTFT_LLD_PinIndex_LED_A ,
139  oC_LCDTFT_LLD_PinIndex_NC_XR ,
140  oC_LCDTFT_LLD_PinIndex_NC_YD ,
141  oC_LCDTFT_LLD_PinIndex_NC_XL ,
142  oC_LCDTFT_LLD_PinIndex_NC_YU ,
143  oC_LCDTFT_LLD_PinIndex_NumberOfPins ,
144 } oC_LCDTFT_LLD_PinIndex_t;
145 
146 
147 typedef union
148 {
149  struct
150  {
151  oC_Pin_t R[8];
152  oC_Pin_t G[8];
153  oC_Pin_t B[8];
154  oC_Pin_t VSYNC;
155  oC_Pin_t HSYNC;
156  oC_Pin_t CLK;
157  oC_Pin_t DE;
158  oC_Pin_t DISP;
159  oC_Pin_t BL_CTRL;
160  oC_Pin_t LED_K;
161  oC_Pin_t LED_A;
162  /* Pins from the TouchScreen */
163  oC_Pin_t NC_XR;
164  oC_Pin_t NC_YD;
165  oC_Pin_t NC_XL;
166  oC_Pin_t NC_YU;
167  };
168  oC_Pin_t PinsArray[oC_LCDTFT_LLD_PinIndex_NumberOfPins];
170 
171 typedef struct
172 {
173  uint32_t PulseWidth;
174  uint32_t BackPorch;
175  uint32_t FrontPorch;
177 
178 typedef struct
179 {
183 
184 #undef MODULE_NAME
185 #undef _________________________________________TYPES_SECTION______________________________________________________________________________
186 
193 #define _________________________________________MACROS_SECTION_____________________________________________________________________________
194 
195 #undef _________________________________________MACROS_SECTION_____________________________________________________________________________
196 
197 
203 #define _________________________________________FUNCTIONS_SECTION__________________________________________________________________________
204 
207 extern oC_ErrorCode_t oC_LCDTFT_LLD_TurnOnDriver( void );
208 extern oC_ErrorCode_t oC_LCDTFT_LLD_TurnOffDriver( void );
209 extern oC_ErrorCode_t oC_LCDTFT_LLD_SetPower( oC_Power_t Power );
210 extern oC_ErrorCode_t oC_LCDTFT_LLD_ReadPower( oC_Power_t * outPower );
211 extern oC_ErrorCode_t oC_LCDTFT_LLD_EnableOperations( void );
212 extern oC_ErrorCode_t oC_LCDTFT_LLD_DisableOperations( void );
213 extern oC_ErrorCode_t oC_LCDTFT_LLD_SetFrequency( oC_Frequency_t Frequency , oC_Frequency_t PermissibleDifference );
214 extern oC_ErrorCode_t oC_LCDTFT_LLD_ReadFrequency( oC_Frequency_t * outFrequency );
215 extern oC_ErrorCode_t oC_LCDTFT_LLD_SetPixelClockPolarity( oC_LCDTFT_LLD_PixelClockPolarity_t PixelPolarity );
216 extern oC_ErrorCode_t oC_LCDTFT_LLD_ReadPixelClockPolarity( oC_LCDTFT_LLD_PixelClockPolarity_t * outPixelPolarity );
217 extern oC_ErrorCode_t oC_LCDTFT_LLD_SetPolarities( oC_LCDTFT_LLD_Polarity_t HSyncPolarity , oC_LCDTFT_LLD_Polarity_t VSyncPolarity , oC_LCDTFT_LLD_Polarity_t DataEnablePolarity );
218 extern oC_ErrorCode_t oC_LCDTFT_LLD_ReadPolarities( oC_LCDTFT_LLD_Polarity_t * outHSyncPolarity , oC_LCDTFT_LLD_Polarity_t * outVSyncPolarity , oC_LCDTFT_LLD_Polarity_t * outDataEnablePolarity );
219 extern oC_ErrorCode_t oC_LCDTFT_LLD_SetResolution( oC_Pixel_ResolutionUInt_t Width , oC_Pixel_ResolutionUInt_t Height );
220 extern oC_ErrorCode_t oC_LCDTFT_LLD_ReadResolution( oC_Pixel_ResolutionUInt_t * outWidth , oC_Pixel_ResolutionUInt_t * outHeight );
221 extern oC_ErrorCode_t oC_LCDTFT_LLD_RestoreDefaultState( void );
222 extern oC_ErrorCode_t oC_LCDTFT_LLD_ConnectPins( const oC_LCDTFT_LLD_Pins_t * Pins );
223 extern oC_ErrorCode_t oC_LCDTFT_LLD_DisconnectPins( const oC_LCDTFT_LLD_Pins_t * Pins );
224 extern oC_ErrorCode_t oC_LCDTFT_LLD_SetColormapBuffer( const void * Buffer );
225 extern oC_ErrorCode_t oC_LCDTFT_LLD_SetPixelFormat( oC_ColorFormat_t PixelFormat );
226 extern oC_ErrorCode_t oC_LCDTFT_LLD_ReadPixelFormat( oC_ColorFormat_t * outPixelFormat );
227 extern oC_ErrorCode_t oC_LCDTFT_LLD_SetTimingParameters( const oC_LCDTFT_LLD_TimingParameters_t * TimingParameters );
228 extern oC_ErrorCode_t oC_LCDTFT_LLD_ReadTimingParameters( oC_LCDTFT_LLD_TimingParameters_t * outTimingParameters );
229 extern oC_ErrorCode_t oC_LCDTFT_LLD_SetBackgroundColor( oC_Color_t Color , oC_ColorFormat_t ColorFormat );
230 extern oC_ErrorCode_t oC_LCDTFT_LLD_ReadBackgroundColor( oC_Color_t * outColor , oC_ColorFormat_t ColorFormat );
231 
232 #undef _________________________________________FUNCTIONS_SECTION__________________________________________________________________________
233 
235 
236 #endif /* _OC_LCDTFT_LLD_H */
237 #endif
oC_ErrorCode_t oC_LCDTFT_LLD_SetTimingParameters(const oC_LCDTFT_LLD_TimingParameters_t *TimingParameters)
oC_ErrorCode_t oC_LCDTFT_LLD_SetBackgroundColor(oC_Color_t Color, oC_ColorFormat_t ColorFormat)
oC_ErrorCode_t oC_LCDTFT_LLD_RestoreDefaultState(void)
oC_ErrorCode_t oC_LCDTFT_LLD_EnableOperations(void)
oC_ErrorCode_t oC_LCDTFT_LLD_SetPixelFormat(oC_ColorFormat_t PixelFormat)
The file with frequency definitions.
double oC_Frequency_t
type to store frequency
Definition: oc_frequency.h:76
oC_ErrorCode_t oC_LCDTFT_LLD_SetResolution(oC_Pixel_ResolutionUInt_t Width, oC_Pixel_ResolutionUInt_t Height)
oC_ErrorCode_t oC_LCDTFT_LLD_SetPower(oC_Power_t Power)
#define oC_ModuleChannel_DefineType
defines module channel type
Definition: oc_channels.h:541
oC_ErrorCode_t oC_LCDTFT_LLD_SetColormapBuffer(const void *Buffer)
oC_ErrorCode_t oC_LCDTFT_LLD_SetPolarities(oC_LCDTFT_LLD_Polarity_t HSyncPolarity, oC_LCDTFT_LLD_Polarity_t VSyncPolarity, oC_LCDTFT_LLD_Polarity_t DataEnablePolarity)
#define B(Bytes)
Number of bytes.
Definition: oc_cfg.h:73
oC_ErrorCode_t oC_LCDTFT_LLD_ReadPixelClockPolarity(oC_LCDTFT_LLD_PixelClockPolarity_t *outPixelPolarity)
The file with interface for the color library.
oC_ErrorCode_t oC_LCDTFT_LLD_ReadPower(oC_Power_t *outPower)
oC_ErrorCode_t oC_LCDTFT_LLD_ReadTimingParameters(oC_LCDTFT_LLD_TimingParameters_t *outTimingParameters)
oC_Channel_t
stores machine channel
Definition: oc_channels.h:573
The file with interface for the GPIO driver.
oC_ErrorCode_t oC_LCDTFT_LLD_ReadResolution(oC_Pixel_ResolutionUInt_t *outWidth, oC_Pixel_ResolutionUInt_t *outHeight)
oC_ErrorCode_t oC_LCDTFT_LLD_TurnOffDriver(void)
oC_ErrorCode_t oC_LCDTFT_LLD_TurnOnDriver(void)
oC_ErrorCode_t oC_LCDTFT_LLD_DisconnectPins(const oC_LCDTFT_LLD_Pins_t *Pins)
oC_ErrorCode_t oC_LCDTFT_LLD_ConnectPins(const oC_LCDTFT_LLD_Pins_t *Pins)
oC_ErrorCode_t oC_LCDTFT_LLD_ReadPolarities(oC_LCDTFT_LLD_Polarity_t *outHSyncPolarity, oC_LCDTFT_LLD_Polarity_t *outVSyncPolarity, oC_LCDTFT_LLD_Polarity_t *outDataEnablePolarity)
oC_ErrorCode_t oC_LCDTFT_LLD_ReadPixelFormat(oC_ColorFormat_t *outPixelFormat)
oC_ErrorCode_t oC_LCDTFT_LLD_ReadFrequency(oC_Frequency_t *outFrequency)
The file with interface for the machine module.
oC_ChannelIndex_t oC_LCDTFT_LLD_ChannelIndex_t
stores index of channel in the LCDTFT
Definition: oc_lcdtft_lld.h:91
oC_ErrorCode_t oC_LCDTFT_LLD_SetPixelClockPolarity(oC_LCDTFT_LLD_PixelClockPolarity_t PixelPolarity)
oC_ErrorCode_t oC_LCDTFT_LLD_SetFrequency(oC_Frequency_t Frequency, oC_Frequency_t PermissibleDifference)
oC_ErrorCode_t oC_LCDTFT_LLD_ReadBackgroundColor(oC_Color_t *outColor, oC_ColorFormat_t ColorFormat)
oC_Power_t
stores registers power state
Definition: oc_stdtypes.h:249
oC_ErrorCode_t oC_LCDTFT_LLD_DisableOperations(void)