53 #define d4dtchhw_mcf52259_adc_ID 1
58 #if (D4D_MK_STR(D4D_LLD_TCH_HW) == d4dtchhw_mcf52259_adc_ID)
71 static unsigned char D4DTCHHW_Init_MCF52259_adc(
void);
72 static unsigned char D4DTCHHW_DeInit_MCF52259_adc(
void);
73 static unsigned short D4DTCHHW_ReadTouchAxis_MCF52259_adc(
D4DTCHHW_PINS pinId);
88 D4DTCHHW_Init_MCF52259_adc,
89 D4DTCHHW_ReadTouchAxis_MCF52259_adc,
90 D4DTCHHW_GetRawLimits_MCF52259_adc,
91 D4DTCHHW_PinCtl_MCF52259_adc,
92 D4DTCHHW_DeInit_MCF52259_adc
128 static unsigned char D4DTCHHW_Init_MCF52259_adc(
void)
148 static unsigned char D4DTCHHW_DeInit_MCF52259_adc(
void)
163 static unsigned short D4DTCHHW_ReadTouchAxis_MCF52259_adc(
D4DTCHHW_PINS pinId)
171 if(MCF_ADC_ADSTAT & MCF_ADC_ADSTAT_CIP0)
175 MCF_ADC_CTRL1 = 0x0000;
176 MCF_ADC_CTRL2 = 0x0007;
177 MCF_ADC_ADSDIS = 0x00FE;
180 MCF_ADC_ADLST1 = D4DTCH_X_PLUS_ADCH;
182 MCF_ADC_ADLST1 = D4DTCH_Y_PLUS_ADCH;
186 MCF_ADC_POWER &= ~0x0003;
190 MCF_ADC_CTRL1 |= MCF_ADC_CTRL1_START0;
192 while ((!(MCF_ADC_ADSTAT & MCF_ADC_ADSTAT_EOSI0)) && (++cnt))
197 MCF_ADC_ADSTAT |= MCF_ADC_ADSTAT_EOSI0;
203 while ((!(MCF_ADC_ADSTAT & MCF_ADC_ADSTAT_RDY0)) && (++cnt))
211 return (
unsigned short)(MCF_ADC_ADRSLT0 >> 3);
228 ADCSC1_ADCH = D4DTCH_X_PLUS_ADCH;
230 ADCSC1_ADCH = D4DTCH_Y_PLUS_ADCH;
236 while ((!ADCSC1_COCO) && (++cnt))
240 ADCSC1_ADCH = 0b11111;
286 INPUT(D4DTCH_X_PLUS);
309 INPUT(D4DTCH_X_MINUS);
315 D4DTCH_RESET_X_MINUS;
326 INPUT(D4DTCH_Y_PLUS);
349 INPUT(D4DTCH_Y_MINUS);
355 D4DTCH_RESET_Y_MINUS;
364 #endif //(D4D_MK_STR(D4D_LLD_TCH) == d4dtchhw_mcf52259_adc_ID)
Switch on the pin for read by ADC.
#define D4DTCH_Y_PLUS_ADCH_PIN_DISABLE
#define D4DTCH_Y_TOUCH_OFFMAX
Analog touch screen X- signal.
#define D4DTCH_FULL_SCALE
D4DTCHHW_PINS
D4D low level MCU types definition for analog resistive touch screen signals.
#define D4DTCH_Y_TOUCH_MIN
D4D Driver main header file.
D4DHW_PIN_STATE
D4D low level MCU pin state enumeration type.
D4D Driver private header file.
#define D4DTCH_X_TOUCH_OFFMAX
Switch pin to input mode (equivalent to high-Z)
D4D low level touch screen limitation structure.
Switch pin to output mode.
#define D4DTCH_X_PLUS_ADCH_PIN_ENABLE
Set pin output register to logic 1.
Switch off the pin for read by ADC.
Analog touch screen X+ signal.
#define D4DTCH_X_TOUCH_MIN
Set pin output register to logic 0.
D4D driver - resistive touch screen driver function header file.
D4D low level touch screen hardware interface API structure.
D4D driver - low level driver of ADC and gpio for resistive touch screen header file.
#define D4DTCH_X_PLUS_ADCH_PIN_DISABLE
#define D4DTCH_Y_PLUS_ADCH_PIN_ENABLE
Analog touch screen Y- signal.
Analog touch screen Y+ signal.