Kamcho Library 02.00.03  lib.kamcho.02.00.03.287
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 *) (0x50000058))
 The starting address of ADC block. More...
 
#define E_ADC_CLK_DIV8   0
 
#define E_ADC_CLK_DIV16   1
 
#define E_ADC_CLK_DIV32   2
 
#define E_ADC_CLK_DIV64   3
 
#define E_ADC_CHANNEL_GPIOA0   0
 
#define E_ADC_CHANNEL_GPIOA1   1
 
#define E_ADC_CHANNEL_GPIOA2   1
 
#define E_ADC_CHANNEL_GPIOA3   3
 
#define E_ADC_CHANNEL_GPIOA4   4
 
#define E_ADC_CHANNEL_GPIOA5   5
 
#define E_ADC_CHANNEL_GPIOA6   6
 
#define E_ADC_CHANNEL_GPIOA7   7
 
#define E_ADC_CHANNEL_GPIOB0   8
 
#define E_ADC_CHANNEL_GPIOB1   9
 
#define E_ADC_CHANNEL_GPIOB2   10
 
#define E_ADC_CHANNEL_GPIOB3   11
 
#define E_ADC_CHANNEL_GPIOB4   12
 
#define E_ADC_CHANNEL_GPIOB5   13
 
#define E_ADC_CHANNEL_GPIOB6   14
 
#define E_ADC_CHANNEL_GPIOB7   15
 
#define E_ADC_CHANNEL_GPIOC0   16
 
#define E_ADC_CHANNEL_GPIOC1   17
 
#define E_ADC_CHANNEL_GPIOC2   18
 
#define E_ADC_CHANNEL_GPIOC3   19
 
#define E_ADC_CHANNEL_GPIOC4   20
 
#define E_ADC_CHANNEL_GPIOC5   21
 
#define E_ADC_CHANNEL_GPIOC6   22
 
#define E_ADC_CHANNEL_GPIOC7   23
 
#define E_ADC_CHANNEL_GPIOD0   24
 
#define E_ADC_CHANNEL_GPIOD1   25
 
#define E_ADC_CHANNEL_GPIOD2   26
 
#define E_ADC_CHANNEL_GPIOD3   27
 
#define E_ADC_CHANNEL_GPIOD4   28
 
#define E_ADC_CHANNEL_GPIOD5   29
 
#define E_ADC_CHANNEL_GPIOD6   30
 
#define E_ADC_CHANNEL_GPIOD7   31
 
#define E_ADC_CHANNEL_GPIOE0   32
 
#define E_ADC_CHANNEL_GPIOE1   33
 
#define E_ADC_CHANNEL_GPIOE2   34
 
#define E_ADC_CHANNEL_GPIOE3   35
 
#define E_ADC_CHANNEL_GPIOE4   36
 
#define E_ADC_CHANNEL_GPIOE5   37
 
#define E_ADC_CHANNEL_GPIOE6   38
 
#define E_ADC_CHANNEL_GPIOE7   39
 
#define E_ADC_CHANNEL_PTAT   47
 

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 *) (0x50000058))

The starting address of ADC block.

#define E_ADC_CHANNEL_GPIOA0   0
#define E_ADC_CHANNEL_GPIOA1   1
#define E_ADC_CHANNEL_GPIOA2   1
#define E_ADC_CHANNEL_GPIOA3   3
#define E_ADC_CHANNEL_GPIOA4   4
#define E_ADC_CHANNEL_GPIOA5   5
#define E_ADC_CHANNEL_GPIOA6   6
#define E_ADC_CHANNEL_GPIOA7   7
#define E_ADC_CHANNEL_GPIOB0   8
#define E_ADC_CHANNEL_GPIOB1   9
#define E_ADC_CHANNEL_GPIOB2   10
#define E_ADC_CHANNEL_GPIOB3   11
#define E_ADC_CHANNEL_GPIOB4   12
#define E_ADC_CHANNEL_GPIOB5   13
#define E_ADC_CHANNEL_GPIOB6   14
#define E_ADC_CHANNEL_GPIOB7   15
#define E_ADC_CHANNEL_GPIOC0   16
#define E_ADC_CHANNEL_GPIOC1   17
#define E_ADC_CHANNEL_GPIOC2   18
#define E_ADC_CHANNEL_GPIOC3   19
#define E_ADC_CHANNEL_GPIOC4   20
#define E_ADC_CHANNEL_GPIOC5   21
#define E_ADC_CHANNEL_GPIOC6   22
#define E_ADC_CHANNEL_GPIOC7   23
#define E_ADC_CHANNEL_GPIOD0   24
#define E_ADC_CHANNEL_GPIOD1   25
#define E_ADC_CHANNEL_GPIOD2   26
#define E_ADC_CHANNEL_GPIOD3   27
#define E_ADC_CHANNEL_GPIOD4   28
#define E_ADC_CHANNEL_GPIOD5   29
#define E_ADC_CHANNEL_GPIOD6   30
#define E_ADC_CHANNEL_GPIOD7   31
#define E_ADC_CHANNEL_GPIOE0   32
#define E_ADC_CHANNEL_GPIOE1   33
#define E_ADC_CHANNEL_GPIOE2   34
#define E_ADC_CHANNEL_GPIOE3   35
#define E_ADC_CHANNEL_GPIOE4   36
#define E_ADC_CHANNEL_GPIOE5   37
#define E_ADC_CHANNEL_GPIOE6   38
#define E_ADC_CHANNEL_GPIOE7   39
#define E_ADC_CHANNEL_PTAT   47
#define E_ADC_CLK_DIV16   1
#define E_ADC_CLK_DIV32   2
#define E_ADC_CLK_DIV64   3
#define E_ADC_CLK_DIV8   0

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.