I'm using MQX4.0 to work my touch panel, but i stock at the function ioctl(tchscr_dev_ptr->ADC_CHANNEL_X, ADC_IOCTL_FIRE_TRIGGER, (pointer) tchscr_dev_ptr->ADC_CHANNEL_X_STRUCT->trigger)!
I don't know how this function work, please help me on this problem!
Best regard
Victor
Hi Wang:
The two IOCTL commands is to use two different ADC modules to read X/Y axis.
ioctl(tchscr_dev_ptr->ADC_CHANNEL_X, ADC_IOCTL_FIRE_TRIGGER, (pointer) tchscr_dev_ptr->ADC_CHANNEL_X_STRUCT->trigger)
will call function _adc_ioctl (mqx/source/io/adc) , case ADC_IOCTL_FIRE_TRIGGER.
I assume you are using Kinties MCU, the function will then call function _adt_trigger (mqx/source/io/adc/kadc),
starts channel measurement , and get the adc value.
You can read the chapter 8 ADC driver in MQX_IO_User_Guide.pdf for more details about ADC. This file located in MQX installation folder.
Freescale_MQX_4_0\doc\mqx\MQX_IO_User_Guide.pdf
Regards
Daniel