This section describes functions and macros of the driver's API.
#define ADC_Start |
( |
|
ch, |
|
|
|
inp |
|
) |
| |
This macro triggers conversion by software. Note that only conversion upon SC1A register (CHA) can be triggered by both software and hardware. The conversions upon SC1B (CHB),SC1C (CHC) and SC1D (CHD) registers can only be triggered by HW trigger source.
- Parameters
-
- Note
- Implemented as an inline macro.
This macro returns nonzero value when conversion completed and new value converted by the ADC resides in the result register. Read value from the respective result register by ADC_Read()
.
- Parameters
-
- Returns
- true (non-zero) conversion completed (COCO flag is asserted),
-
false conversion pending (COCO flag is deasserted).
- Note
- Implemented as an inline macro.
- See also
- ADC_Read
This macro returns value from the respective result register.
- Parameters
-
- Returns
- uint16 right-justified value converted by the ADC. The number of effective bits depends on the conversion mode.
- Note
- Implemented as an inline macro.
- See also
- ADC_Ready
#define ADC_Init |
( |
|
cfg, |
|
|
|
avg, |
|
|
|
CHA, |
|
|
|
CHB, |
|
|
|
CHC, |
|
|
|
CHD, |
|
|
|
ip, |
|
|
|
callback |
|
) |
| |
This function initializes Analogue Digital Converter (ADC). It also installs callback function for interrupt vector 32.
- Parameters
-
- Note
- Implemented as a function call.
- Warning
- Note that only conversion upon SC1A register (CHA) can be triggered by both software and hardware. The conversions upon SC1B (CHB),SC1C (CHC) and SC1D (CHD) registers can only be triggered by HW trigger source.
#define ADC_ExecCalib |
( |
|
cfg, |
|
|
|
calib |
|
) |
| |
This function runs calibration procedure and updates calibration registers of the ADC module.
- Parameters
-
- Returns
- true (non-zero) error occurred during calibration,
-
false calibration successful.
- Note
- Implemented as a function call.
- See also
- ADC_SaveCalib
#define ADC_SaveCalib |
( |
|
calib | ) |
|
This function updates register of the ADC by calibration values from the structure passed by pointer.
- Parameters
-
calib | Pointer to tADC_CALIB structure. |
- Note
- Implemented as a function call.
- See also
- ADC_ExecCalib