Herzog Library 00.00.01  rel_libdev.herzog.00.00.01.10606
Data Structures | Macros | Functions
adc_sfrs.h File Reference

Go to the source code of this file.

Data Structures

struct  ADC_SFRS_t
 A structure to represent Special Function Registers for ADC block. More...
 

Macros

#define ADC_SFRS   ((__IO ADC_SFRS_t *) (0x5000000B))
 The starting address of ADC block. More...
 
#define E_ADC_CLK_DIV2   0
 
#define E_ADC_CLK_DIV4   1
 
#define E_ADC_CLK_DIV64   0x1F
 
#define E_ADC_CHANNEL_GPIOD0   0
 
#define E_ADC_CHANNEL_GPIOD1   1
 
#define E_ADC_CHANNEL_GPIOD2   2
 
#define E_ADC_CHANNEL_GPIOD3   3
 
#define E_ADC_CHANNEL_GPIOD4   4
 
#define E_ADC_CHANNEL_GPIOD5   5
 
#define E_ADC_CHANNEL_GPIOD6   6
 
#define E_ADC_CHANNEL_GPIOD7   7
 
#define E_ADC_CHANNEL_GPIOE0   8
 
#define E_ADC_CHANNEL_GPIOE1   9
 
#define E_ADC_CHANNEL_GPIOE2   10
 
#define E_ADC_CHANNEL_GPIOE3   11
 
#define E_ADC_CHANNEL_GPIOE4   12
 
#define E_ADC_CHANNEL_GPIOE5   13
 
#define E_ADC_CHANNEL_GPIOE6   14
 
#define E_ADC_CHANNEL_GPIOE7   15
 
#define E_ADC_CHANNEL_GPIOF0   16
 
#define E_ADC_CHANNEL_GPIOF1   17
 
#define E_ADC_CHANNEL_GPIOF2   18
 
#define E_ADC_CHANNEL_VSUPPLY   19
 

Functions

static __INLINE void f_ADC_SelectChannel (uint8_t channel)
 Select ADC channel. More...
 
static __INLINE void f_ADC_ClkDiv (uint8_t div)
 Set ADC clock divider. More...
 
static __INLINE void f_ADC_SampleCycle (uint8_t cycle)
 Set ADC sample cycle. More...
 
static __INLINE uint8_t f_ADC_Read (void)
 Read ADC result. More...
 
static __INLINE void f_ADC_Start (void)
 Start ADC conversion. More...
 
static __INLINE uint8_t f_ADC_ConversionInProgress ()
 Check ADC progress. More...
 
static __INLINE void f_ADC_ReferenceHigh (uint8_t val)
 Set ADC high reference level. More...
 
static __INLINE void f_ADC_ReferenceLow (uint8_t val)
 Set ADC low reference level. More...
 
static __INLINE void f_ADC_ReferenceGain (uint8_t val)
 Set ADC reference gain. More...
 
static __INLINE void f_ADC_SetRefSourceVDD (void)
 Select VDD as ADC reference source. More...
 
static __INLINE void f_ADC_SetRefSourceBandGap (void)
 Select band gap as ADC reference source. More...
 
static __INLINE void f_ADC_EnableStreamingMode (void)
 Enable ADC streaming mode. More...
 
static __INLINE void f_ADC_DisableStreamingMode (void)
 Disable ADC streaming mode. More...
 
static __INLINE void f_ADC_EnableCalibrationMode (void)
 Enable ADC calibration mode. More...
 
static __INLINE void f_ADC_DisableCalibrationMode (void)
 Disable ADC calibration mode. More...
 
static __INLINE void f_ADC_EnableOffsetCalMode (void)
 Enable ADC offset calibration mode. More...
 
static __INLINE void f_ADC_EnableDoubleSample (void)
 Enable ADC double sample mode. More...
 
static __INLINE void f_ADC_DisableDoubleSample (void)
 Disable ADC double sample mode. More...
 

Detailed Description

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.

Macro Definition Documentation

#define ADC_SFRS   ((__IO ADC_SFRS_t *) (0x5000000B))

The starting address of ADC block.

#define E_ADC_CHANNEL_GPIOD0   0
#define E_ADC_CHANNEL_GPIOD1   1
#define E_ADC_CHANNEL_GPIOD2   2
#define E_ADC_CHANNEL_GPIOD3   3
#define E_ADC_CHANNEL_GPIOD4   4
#define E_ADC_CHANNEL_GPIOD5   5
#define E_ADC_CHANNEL_GPIOD6   6
#define E_ADC_CHANNEL_GPIOD7   7
#define E_ADC_CHANNEL_GPIOE0   8
#define E_ADC_CHANNEL_GPIOE1   9
#define E_ADC_CHANNEL_GPIOE2   10
#define E_ADC_CHANNEL_GPIOE3   11
#define E_ADC_CHANNEL_GPIOE4   12
#define E_ADC_CHANNEL_GPIOE5   13
#define E_ADC_CHANNEL_GPIOE6   14
#define E_ADC_CHANNEL_GPIOE7   15
#define E_ADC_CHANNEL_GPIOF0   16
#define E_ADC_CHANNEL_GPIOF1   17
#define E_ADC_CHANNEL_GPIOF2   18
#define E_ADC_CHANNEL_VSUPPLY   19
#define E_ADC_CLK_DIV2   0
#define E_ADC_CLK_DIV4   1
#define E_ADC_CLK_DIV64   0x1F

Function Documentation

static __INLINE void f_ADC_ClkDiv ( uint8_t  div)
static

Set ADC clock divider.

Parameters
divThe enumeration for ADC clock divider.
static __INLINE uint8_t f_ADC_ConversionInProgress ( )
static

Check ADC progress.

Returns
The status of a ADC conversion.
static __INLINE void f_ADC_DisableCalibrationMode ( void  )
static

Disable ADC calibration mode.

static __INLINE void f_ADC_DisableDoubleSample ( void  )
static

Disable ADC double sample mode.

static __INLINE void f_ADC_DisableStreamingMode ( void  )
static

Disable ADC streaming mode.

static __INLINE void f_ADC_EnableCalibrationMode ( void  )
static

Enable ADC calibration mode.

static __INLINE void f_ADC_EnableDoubleSample ( void  )
static

Enable ADC double sample mode.

static __INLINE void f_ADC_EnableOffsetCalMode ( void  )
static

Enable ADC offset calibration mode.

static __INLINE void f_ADC_EnableStreamingMode ( void  )
static

Enable ADC streaming mode.

static __INLINE uint8_t f_ADC_Read ( void  )
static

Read ADC result.

Returns
The result of last ADC conversion.
static __INLINE void f_ADC_ReferenceGain ( uint8_t  val)
static

Set ADC reference gain.

Parameters
valThe setting for reference gain.
static __INLINE void f_ADC_ReferenceHigh ( uint8_t  val)
static

Set ADC high reference level.

Parameters
valThe setting for high reference.
static __INLINE void f_ADC_ReferenceLow ( uint8_t  val)
static

Set ADC low reference level.

Parameters
valThe setting for low reference.
static __INLINE void f_ADC_SampleCycle ( uint8_t  cycle)
static

Set ADC sample cycle.

Parameters
cycleThe enumeration for sample cycle.
static __INLINE void f_ADC_SelectChannel ( uint8_t  channel)
static

Select ADC channel.

Parameters
channelThe enumeration of ADC channel.
static __INLINE void f_ADC_SetRefSourceBandGap ( void  )
static

Select band gap as ADC reference source.

static __INLINE void f_ADC_SetRefSourceVDD ( void  )
static

Select VDD as ADC reference source.

static __INLINE void f_ADC_Start ( void  )
static

Start ADC conversion.