ll_adc.h File Reference

Header file containing functions prototypes of ADC LL library. More...

#include "gr5x.h"

Go to the source code of this file.

Classes

struct  _ll_adc_init
 LL ADC init Structure definition. More...
 

Macros

#define LL_ADC_CLK_16M   (4UL << MCU_SUB_SNSADC_CLK_WR_Pos)
 
#define LL_ADC_CLK_8M   (5UL << MCU_SUB_SNSADC_CLK_WR_Pos)
 
#define LL_ADC_CLK_4M   (6UL << MCU_SUB_SNSADC_CLK_WR_Pos)
 
#define LL_ADC_CLK_1M   (7UL << MCU_SUB_SNSADC_CLK_WR_Pos)
 
#define LL_ADC_CLK_16K   (1UL << MCU_SUB_SNSADC_CLK_WR_Pos)
 
#define LL_ADC_CLK_8K   (2UL << MCU_SUB_SNSADC_CLK_WR_Pos)
 
#define LL_ADC_CLK_4K   (3UL << MCU_SUB_SNSADC_CLK_WR_Pos)
 
#define LL_ADC_CLK_NONE   (0UL << MCU_SUB_SNSADC_CLK_WR_Pos)
 
#define LL_ADC_REF_VALUE_0P8   (0x3UL << AON_PMU_SNSADC_CFG_REF_VALUE_Pos)
 
#define LL_ADC_REF_VALUE_1P2   (0x7UL << AON_PMU_SNSADC_CFG_REF_VALUE_Pos)
 
#define LL_ADC_REF_VALUE_1P6   (0xAUL << AON_PMU_SNSADC_CFG_REF_VALUE_Pos)
 
#define LL_ADC_REF_VALUE_2P0   (0xFUL << AON_PMU_SNSADC_CFG_REF_VALUE_Pos)
 
#define LL_ADC_INPUT_SINGLE   (1UL << AON_PMU_SNSADC_CFG_SINGLE_EN_Pos)
 
#define LL_ADC_INPUT_DIFFERENTIAL   (0x00000000UL)
 
#define LL_ADC_INPUT_SRC_IO0   (0UL)
 
#define LL_ADC_INPUT_SRC_IO1   (1UL)
 
#define LL_ADC_INPUT_SRC_IO2   (2UL)
 
#define LL_ADC_INPUT_SRC_IO3   (3UL)
 
#define LL_ADC_INPUT_SRC_IO4   (4UL)
 
#define LL_ADC_INPUT_SRC_IO5   (5UL)
 
#define LL_ADC_INPUT_SRC_IO6   (6UL)
 
#define LL_ADC_INPUT_SRC_IO7   (7UL)
 
#define LL_ADC_INPUT_SRC_TMP   (13UL)
 
#define LL_ADC_INPUT_SRC_BAT   (14UL)
 
#define LL_ADC_INPUT_SRC_REF   (15UL)
 
#define LL_ADC_REF_SRC_BUF_INT   (0x00000000UL)
 
#define LL_ADC_REF_SRC_IO0   (3UL << AON_PMU_SNSADC_CFG_REF_SEL_Pos)
 
#define LL_ADC_REF_SRC_IO1   (4UL << AON_PMU_SNSADC_CFG_REF_SEL_Pos)
 
#define LL_ADC_REF_SRC_IO2   (5UL << AON_PMU_SNSADC_CFG_REF_SEL_Pos)
 
#define LL_ADC_REF_SRC_IO3   (6UL << AON_PMU_SNSADC_CFG_REF_SEL_Pos)
 
#define LL_ADC_WriteReg(__instance__, __REG__, __VALUE__)   WRITE_REG((__instance__)->__REG__, (__VALUE__))
 Write a value in ADC register. More...
 
#define LL_ADC_ReadReg(__instance__, __REG__)   READ_REG((__instance__)->__REG__)
 Read a value in ADC register. More...
 
#define LL_ADC_DEFAULT_CONFIG
 LL ADC InitStrcut default configuartion. More...
 

Typedefs

typedef struct _ll_adc_init ll_adc_init_t
 LL ADC init Structure definition. More...
 

Functions

__STATIC_INLINE void ll_adc_enable (void)
 Enable ADC module. More...
 
__STATIC_INLINE void ll_adc_disable (void)
 Disable ADC module. More...
 
__STATIC_INLINE uint32_t ll_adc_is_enabled (void)
 Check if ADC module is enabled. More...
 
__STATIC_INLINE void ll_adc_disable_clock (void)
 Disable ADC clock. More...
 
__STATIC_INLINE uint32_t ll_adc_is_enabled_clock (void)
 Check if ADC clock is enabled. More...
 
__STATIC_INLINE void ll_adc_set_clock (uint32_t clk)
 Set ADC clock source. More...
 
__STATIC_INLINE uint32_t ll_adc_get_clock (void)
 Return source for ADC clock. More...
 
__STATIC_INLINE void ll_adc_set_ref_value (uint32_t value)
 Set ADC bias reference. More...
 
__STATIC_INLINE uint32_t ll_adc_get_ref_value (void)
 Return ADC bias reference. More...
 
__STATIC_INLINE void ll_adc_enable_temp (void)
 Enable temperature sensor. More...
 
__STATIC_INLINE void ll_adc_disable_temp (void)
 Disable temperature sensor. More...
 
__STATIC_INLINE uint32_t ll_adc_is_enabled_temp (void)
 Check if temperature sensor is enabled. More...
 
__STATIC_INLINE void ll_adc_enable_vbat (void)
 Enable Vbattery sensor. More...
 
__STATIC_INLINE void ll_adc_disable_vbat (void)
 Disable Vbattery sensor. More...
 
__STATIC_INLINE uint32_t ll_adc_is_enabled_vbat (void)
 Check if Vbattery sensor is enabled. More...
 
__STATIC_INLINE void ll_adc_set_input_mode (uint32_t mode)
 Set ADC input mode. More...
 
__STATIC_INLINE uint32_t ll_adc_get_input_mode (void)
 Return ADC input mode. More...
 
__STATIC_INLINE void ll_adc_enable_ofs_cal (void)
 Enable offset calibration. More...
 
__STATIC_INLINE void ll_adc_disable_ofs_cal (void)
 Disable offset calibration. More...
 
__STATIC_INLINE uint32_t ll_adc_is_enabled_ofs_cal (void)
 Check if offset calibration is enabled. More...
 
__STATIC_INLINE void ll_adc_set_dynamic_rang (uint32_t rang)
 Set dynamic rang of ADC. More...
 
__STATIC_INLINE uint32_t ll_adc_get_dynamic_rang (void)
 Return ADC dynamic rang. More...
 
__STATIC_INLINE void ll_adc_set_channelp (uint32_t source)
 Set source of ADC input channelP. More...
 
__STATIC_INLINE uint32_t ll_adc_get_channelp (void)
 Return source of ADC input channelP. More...
 
__STATIC_INLINE void ll_adc_set_channeln (uint32_t source)
 Set source of ADC input channelN. More...
 
__STATIC_INLINE uint32_t ll_adc_get_channeln (void)
 Return source of ADC input channelN. More...
 
__STATIC_INLINE void ll_adc_enable_mas_rst (void)
 Enable ADC MAS_RST. More...
 
__STATIC_INLINE void ll_adc_disable_mas_rst (void)
 Disable ADC MAS_RST. More...
 
__STATIC_INLINE uint32_t ll_adc_is_enabled_mas_rst (void)
 Check if ADC MAS_RST is enabled. More...
 
__STATIC_INLINE void ll_adc_set_ref (uint32_t source)
 Set source of ADC reference. More...
 
__STATIC_INLINE uint32_t ll_adc_get_ref (void)
 Return source of ADC reference. More...
 
__STATIC_INLINE void ll_adc_set_ref_current (uint32_t source)
 Set current of ADC reference circuit. More...
 
__STATIC_INLINE uint32_t ll_adc_get_ref_current (void)
 Return current of ADC reference circuit. More...
 
__STATIC_INLINE uint32_t ll_adc_read_fifo (void)
 Return samples value of ADC by reading FIFO. More...
 
__STATIC_INLINE void ll_adc_set_thresh (uint32_t thresh)
 Set threshold of ADC FIFO. More...
 
__STATIC_INLINE uint32_t ll_adc_get_thresh (void)
 Return threshold of ADC FIFO. More...
 
__STATIC_INLINE void ll_adc_enable_dma_req (void)
 Enable ADC dma_req. More...
 
__STATIC_INLINE void ll_adc_disable_dma_req (void)
 Disable ADC dma_req. More...
 
__STATIC_INLINE uint32_t ll_adc_is_enabled_dma_req (void)
 Check if dma_req is enabled. More...
 
__STATIC_INLINE uint32_t ll_adc_is_fifo_notempty (void)
 Check if ADC FIFO is not empty. More...
 
__STATIC_INLINE uint32_t ll_adc_get_fifo_count (void)
 Return count of ADC FIFO. More...
 
__STATIC_INLINE void ll_adc_flush_fifo (void)
 Flush ADC FIFO. More...
 
__STATIC_INLINE uint32_t ll_adc_try_lock_hw_token (void)
 Try to lock hw token. More...
 
__STATIC_INLINE void ll_adc_release_hw_token (void)
 Release hw token. More...
 
__STATIC_INLINE uint32_t ll_adc_try_lock_sw_token (void)
 Try to lock sw token. More...
 
__STATIC_INLINE void ll_adc_release_sw_token (void)
 Release sw token. More...
 
__STATIC_INLINE uint32_t ll_adc_get_token_state (void)
 get adc token state. More...
 
void ll_adc_deinit (void)
 De-initialize ADC registers (Registers restored to their default values). More...
 
void ll_adc_init (ll_adc_init_t *p_adc_init)
 Initialize ADC registers according to the specified. parameters in p_adc_init. More...
 
void ll_adc_struct_init (ll_adc_init_t *p_adc_init)
 Set each field of a ll_adc_init_t type structure to default value. More...
 

Detailed Description

Header file containing functions prototypes of ADC LL library.

Author
BLE Driver Team
Attention
#####Copyright (c) 2019 GOODIX All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file ll_adc.h.