Eddy DK Programmer Guide
118
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.
ADCSETCHANNEL
Function
Configures whether to use 4 channels of ADC device or not.
Format
void ioctl(int fd, ADCSETCHANNEL, int *channel);
Parameter
fd
Handle to ADC device(“/dev/adc”)
mode
Pointer to the buffer that stores channel configuration
Returns
None
Notice
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)
ADCGETVALUE
Function
Reads operation status of 4channels of ADC device
Format
void ioctl(int fd, ADCGETVALUE, struct adc_struct *channels);
Parameter
fd
Handle to ADC device(“/dev/adc”)
mode
Pointer to the buffer that will store channel operation
status
Returns
None
Notice
Struct adc_value {
int ch1_value;
int ch2_value;
int ch3_value;
int ch4_value;
};
Содержание Eddy DK
Страница 1: ...1 Eddy DK Programmer Guide Ver 2 5 1 1 2011 02 15...
Страница 10: ...Eddy DK Programmer Guide 10 2 3 Eddy CPU v2 1 v2 5...
Страница 36: ...Eddy DK Programmer Guide 36 2 4 4 External Device Interface Description...
Страница 47: ...Eddy DK Programmer Guide 47 Eddy S4M v2 1 Eddy S4M v2 5...