Eddy DK Programmer Guide
6.8 ADC Function
Eddy CPU provides 4 channels of ADC(Analog Digital Converter).
Eddy DK board has temperature and illumination sensor for testing and the status of the sensors can be checked in
real time with ADC.
Sample program ‚Eddy_Apps/test_adc.c‛ uses ADC interface so users can refer to this source for developing
programs.
Configures whether to use 4 channels of ADC device or not.
void ioctl(int fd, ADCSETCHANNEL, int *channel);
Handle to ADC device(‚/dev/adc‛)
Pointer to the buffer that stores channel configuration
X X X X X X X X (bits)
| | | |----- channel 1 (temperature sensor)
| | |--------- channel 2 (illumination sensor)
| |------------- channel 3 (future use)
|----------------- channel 4 (future use)
Reads operation status of 4channels of ADC device
void ioctl(int fd, ADCGETVALUE, struct adc_struct *channels);
Handle to ADC device(‚/dev/adc‛)
Pointer to the buffer that will store channel operation
status
Struct adc_value {
int ch1_value;
int ch2_value;
int ch3_value;
int ch4_value;
};
Commentaires sur ces manuels