Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:xu3_hardware_adc [2016/01/22 10:12] john1117 [Using mmap] |
en:xu3_hardware_adc [2016/12/19 16:03] charles.park [Using mmap] |
||
---|---|---|---|
Line 21: | Line 21: | ||
===== Using mmap ===== | ===== Using mmap ===== | ||
- | Example c source code | + | Example C source code to access the ADC. |
<file c mmap_adc.c> | <file c mmap_adc.c> | ||
#include <stdio.h> | #include <stdio.h> | ||
Line 28: | Line 28: | ||
#include <stdint.h> | #include <stdint.h> | ||
- | /* EXYNOS4412/5250 ADC_V1 registers definitions */ | + | /* EXYNOS ADC_V1 registers definitions */ |
#define ADC_V1_DATAX 0x0C | #define ADC_V1_DATAX 0x0C | ||
Line 84: | Line 84: | ||
{ | { | ||
// End of A/D conversion | // End of A/D conversion | ||
- | if (*(adc + (ADC_V2_STAT >> 2)) && 4) { | + | if (*(adc + (ADC_V2_STAT >> 2)) & 4) { |
/* Read value */ | /* Read value */ | ||
if (channel == 0x0) { | if (channel == 0x0) { |