Adc function, 8 adc function – Solvline Eddy DKV2.1.0.3 User Manual
Page 98

Chapter 6. Library
Introduction
98
GETGPIOPUL_LA
GETGPIOPUL_LB
GETGPIOPUL_LC
Function
Reads Read/Write status value for one of Port A, B, C
Format
void ioctl(int fd, GETGPIOVAL_L?, int *mode[3]);
Parameter
fd
Handle to GPIO device(‚/dev/eddy_gpio‛)
mode
Pointer to the buffer that will store the ‚pullup‛
value.
Returns
None
Notice
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