Kamcho Library 02.00.03
lib.kamcho.02.00.03.287
|
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <string.h>
#include "adc_device.h"
#include "errno.h"
Functions | |
int32_t | ADC_devSelectChannel (ADC_Device_t *dev, uint8_t channel) |
Select ADC channel for a ADC device. More... | |
int32_t | ADC_devRead (ADC_Device_t *dev, uint8_t *val) |
Read ADC result from a ADC device. More... | |
int32_t | ADC_devStart (ADC_Device_t *dev) |
Start a ADC conversion. More... | |
int32_t | ADC_devConversionInProgress (ADC_Device_t *dev) |
Check status of a ADC conversion. More... | |
int32_t | ADC_devTake (ADC_Device_t *dev, uint8_t channel, uint8_t *val) |
Start a ADC conversion, wait for its completion and read result back. More... | |
int32_t | ADC_devInit (ADC_Device_t *dev, uint8_t div, uint8_t cycle, uint32_t mode) |
Initialize ADC device. More... | |
int32_t | ADC_devConfigReference (ADC_Device_t *dev, uint8_t refh, uint8_t refl, uint8_t refg) |
Initialize ADC reference settings. It sets the dynamic range and the gain. More... | |
ADC_Device_t * | ADC_devRequest (const char *name) |
ADC Request Device. More... | |
Variables | |
static const ADC_Device_t * | ADC_DeviceTable [] |
The instance of ADC device. More... | |
This file is proprietary to Indie Semiconductor. All rights reserved. Reproduction or distribution, in whole or in part, is forbidden except by express written permission of Indie Semiconductor.
int32_t ADC_devConfigReference | ( | ADC_Device_t * | dev, |
uint8_t | refh, | ||
uint8_t | refl, | ||
uint8_t | refg | ||
) |
Initialize ADC reference settings. It sets the dynamic range and the gain.
dev | The pointer to ADC device |
refh | The high watermark to the reference voltage. |
refl | The low watermark to the reference voltage. |
refg | The gain of the reference voltage. |
int32_t ADC_devConversionInProgress | ( | ADC_Device_t * | dev | ) |
Check status of a ADC conversion.
dev | The pointer to ADC device |
int32_t ADC_devInit | ( | ADC_Device_t * | dev, |
uint8_t | div, | ||
uint8_t | cycle, | ||
uint32_t | mode | ||
) |
Initialize ADC device.
dev | The pointer to ADC device |
div | The clock divider. |
cycle | The ADC cycle. |
mode | The ADC mode. |
int32_t ADC_devRead | ( | ADC_Device_t * | dev, |
uint8_t * | val | ||
) |
Read ADC result from a ADC device.
dev | The pointer to ADC device |
val | The pointer to the result. |
ADC_Device_t* ADC_devRequest | ( | const char * | name | ) |
ADC Request Device.
name | The name string of ADC device. |
int32_t ADC_devSelectChannel | ( | ADC_Device_t * | dev, |
uint8_t | channel | ||
) |
Select ADC channel for a ADC device.
dev | The pointer to ADC device |
channel | The enumeration of ADC channel. return 0 for success or error code upon a failure. |
int32_t ADC_devStart | ( | ADC_Device_t * | dev | ) |
Start a ADC conversion.
dev | The pointer to ADC device |
int32_t ADC_devTake | ( | ADC_Device_t * | dev, |
uint8_t | channel, | ||
uint8_t * | val | ||
) |
Start a ADC conversion, wait for its completion and read result back.
dev | The pointer to ADC device |
channel | The enumeration of ADC channel. |
val | The pointer to the result. |
|
static |
The instance of ADC device.
The table of ADC device instances supported by the platform.