OpenBIC
OpenSource Bridge-IC
ast_adc.c File Reference
#include <stdio.h>
#include "sensor.h"
#include "plat_gpio.h"
#include "plat_def.h"
#include <zephyr.h>
#include <drivers/adc.h>
#include <logging/log.h>
Include dependency graph for ast_adc.c:

Macros

#define ADC_CHANNEL_COUNT   8
 
#define BUFFER_SIZE   1
 
#define ADC_RESOLUTION   10
 
#define ADC_CALIBRATION   0
 
#define ADC_GAIN   ADC_GAIN_1
 
#define ADC_REFERENCE   ADC_REF_INTERNAL
 
#define ADC_ACQUISITION_TIME   ADC_ACQ_TIME_DEFAULT
 
#define ADC_AVERAGE_DELAY_MSEC   1
 

Enumerations

enum  adc_device_idx { adc0 , adc1 , ADC_NUM }
 

Functions

 LOG_MODULE_REGISTER (dev_ast_adc)
 
uint8_t ast_adc_read (sensor_cfg *cfg, int *reading)
 
uint8_t ast_adc_init (sensor_cfg *cfg)
 

Macro Definition Documentation

◆ ADC_ACQUISITION_TIME

#define ADC_ACQUISITION_TIME   ADC_ACQ_TIME_DEFAULT

◆ ADC_AVERAGE_DELAY_MSEC

#define ADC_AVERAGE_DELAY_MSEC   1

◆ ADC_CALIBRATION

#define ADC_CALIBRATION   0

◆ ADC_CHANNEL_COUNT

#define ADC_CHANNEL_COUNT   8

◆ ADC_GAIN

#define ADC_GAIN   ADC_GAIN_1

◆ ADC_REFERENCE

#define ADC_REFERENCE   ADC_REF_INTERNAL

◆ ADC_RESOLUTION

#define ADC_RESOLUTION   10

◆ BUFFER_SIZE

#define BUFFER_SIZE   1

Enumeration Type Documentation

◆ adc_device_idx

Enumerator
adc0 
adc1 
ADC_NUM 

Function Documentation

◆ ast_adc_init()

uint8_t ast_adc_init ( sensor_cfg cfg)

◆ ast_adc_read()

uint8_t ast_adc_read ( sensor_cfg cfg,
int *  reading 
)

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( dev_ast_adc  )