Classes | Macros | Typedefs | Enumerations | Functions
gr55xx_hal_adc.h File Reference

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

`#include "gr55xx_ll_adc.h"`
`#include "gr55xx_hal_def.h"`
`#include "gr55xx_hal_dma.h"`
Include dependency graph for gr55xx_hal_adc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
struct | adc_trim_info_t
| ADC trim parameter information definition. More...
struct | _adc_handle
| ADC handle Structure definition. More...
struct | _hal_adc_callback
| HAL ADC Callback function definition. More...

## Macros
#define | HAL_ADC_ERROR_NONE ((uint32_t)0x00000000)
| No error More...
#define | HAL_ADC_ERROR_TIMEOUT ((uint32_t)0x00000001)
| Timeout error More...
#define | HAL_ADC_ERROR_DMA ((uint32_t)0x00000004)
| DMA transfer error. More...
#define | HAL_ADC_ERROR_INVALID_PARAM ((uint32_t)0x00000008)
| Invalid parameter error. More...
#define | ADC_REF_VALUE_0P8 LL_ADC_REF_VALUE_0P8
| Reference = 0.85 V More...
#define | ADC_REF_VALUE_1P2 LL_ADC_REF_VALUE_1P2
| Reference = 1.28 V More...
#define | ADC_REF_VALUE_1P6 LL_ADC_REF_VALUE_1P6
| Reference = 1.60 V More...
#define | ADC_REF_VALUE_2P0 LL_ADC_REF_VALUE_2P0
| Reference = 2.00 V More...
#define | ADC_INPUT_SINGLE LL_ADC_INPUT_SINGLE
| Single ended mode. More...
#define | ADC_INPUT_DIFFERENTIAL LL_ADC_INPUT_DIFFERENTIAL
| Differential mode. More...
#define | ADC_INPUT_SRC_IO0 LL_ADC_INPUT_SRC_IO0
| Select MSIO0 as input More...
#define | ADC_INPUT_SRC_IO1 LL_ADC_INPUT_SRC_IO1
| Select MSIO1 as input More...
#define | ADC_INPUT_SRC_IO2 LL_ADC_INPUT_SRC_IO2
| Select MSIO2 as input More...
#define | ADC_INPUT_SRC_IO3 LL_ADC_INPUT_SRC_IO3
| Select MSIO3 as input More...
#define | ADC_INPUT_SRC_IO4 LL_ADC_INPUT_SRC_IO4
| Select MSIO4 as input More...
#define | ADC_INPUT_SRC_IO5 LL_ADC_INPUT_SRC_IO5
| Select MSIO5 as input More...
#define | ADC_INPUT_SRC_IO6 LL_ADC_INPUT_SRC_IO6
| Select MSIO6 as input More...
#define | ADC_INPUT_SRC_IO7 LL_ADC_INPUT_SRC_IO7
| Select MSIO7 as input More...
#define | ADC_INPUT_SRC_TMP LL_ADC_INPUT_SRC_TMP
| Select temperature as input. More...
#define | ADC_INPUT_SRC_BAT LL_ADC_INPUT_SRC_BAT
| Select Vbattery as input More...
#define | ADC_INPUT_SRC_REF LL_ADC_INPUT_SRC_REF
| Select reference as input More...
#define | ADC_REF_SRC_BUF_INT LL_ADC_REF_SRC_BUF_INT
| Select buffered internal reference as reference More...
#define | ADC_REF_SRC_IO0 LL_ADC_REF_SRC_IO0
| Select MSIO0 as reference More...
#define | ADC_REF_SRC_IO1 LL_ADC_REF_SRC_IO1
| Select MSIO1 as reference More...
#define | ADC_REF_SRC_IO2 LL_ADC_REF_SRC_IO2
| Select MSIO2 as reference More...
#define | ADC_REF_SRC_IO3 LL_ADC_REF_SRC_IO3
| Select MSIO3 as reference More...
#define | ADC_DEFAULT_CONFIG LL_ADC_DEFAULT_CONFIG
| ADC_default_config initStruct default configuartion. More...
#define | __HAL_ADC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->state = HAL_ADC_STATE_RESET)
| Reset ADC handle states. More...
#define | __HAL_ADC_ENABLE(__HANDLE__) ll_adc_enable()
| Enable the specified ADC peripheral. More...
#define | __HAL_ADC_DISABLE(__HANDLE__) ll_adc_disable()
| Disable the specified ADC peripheral. More...
#define | __HAL_ADC_GET_FLAG_NOTEMPTY(__HANDLE__) ll_adc_is_fifo_notempty()
| Check the FIFO is not empty. More...
#define | __HAL_ADC_TRY_SWTOKEN_LOCK(__HANDLE__) ll_adc_try_lock_sw_token()
| Try to lock ADC token by SW. More...
#define | __HAL_ADC_FLUSH_FIFO(__HANDLE__)
| Flush the FIFO. More...
#define | IS_ADC_INPUT(__INPUT__)
| Check if ADC input source is valid. More...
#define | IS_ADC_INPUT_MODE(__MODE__)
| Check if ADC input mode is valid. More...
#define | IS_ADC_REF(__INPUT__)
| Check if ADC reference source is valid. More...
#define | IS_ADC_REF_VALUE(__VALUE__)
| Check if ADC reference value is valid. More...
#define | IS_ADC_CLOCK(__CLOCK__)
| Check if ADC clock is valid. More...

## Typedefs
typedef ll_adc_init_t | adc_init_t
| ADC init structure definition. More...
typedef struct _adc_handle | adc_handle_t
| ADC handle Structure definition. More...
typedef struct _hal_adc_callback | hal_adc_callback_t
| HAL ADC Callback function definition. More...

## Enumerations
enum | hal_adc_state_t { HAL_ADC_STATE_RESET = 0x00, HAL_ADC_STATE_READY = 0x01, HAL_ADC_STATE_BUSY = 0x02, HAL_ADC_STATE_ERROR = 0x04 }
| HAL ADC State Enumerations definition. More...

## Functions
hal_status_t | hal_adc_init (adc_handle_t *p_adc)
| Initialize the ADC according to the specified parameters in the adc_init_t and initialize the associated handle. More...
hal_status_t | hal_adc_deinit (adc_handle_t *p_adc)
| De-initialize the ADC peripheral. More...
void | hal_adc_msp_init (adc_handle_t *p_adc)
| Initialize the ADC MSP. More...
void | hal_adc_msp_deinit (adc_handle_t *p_adc)
| De-initialize the ADC MSP. More...
uint16_t | adc_get_trim_func (adc_trim_info_t *p_adc_trim)
| adc_get_trim_func. More...
hal_status_t | hal_adc_poll_for_conversion (adc_handle_t *p_adc, uint16_t *p_data, uint32_t length)
| Polling for conversion. More...
hal_status_t | hal_adc_start_dma (adc_handle_t *p_adc, uint16_t *p_data, uint32_t length)
| DMA for conversion. More...
hal_status_t | hal_adc_start_dma_sg_llp (adc_handle_t *p_adc, uint16_t *p_data, uint32_t length, dma_sg_llp_config_t *sg_llp_config)
| DMA for conversion. More...
hal_status_t | hal_adc_stop_dma (adc_handle_t *p_adc)
| Abort ongoing conversion (blocking mode). More...
void | hal_adc_conv_cplt_callback (adc_handle_t *p_adc)
| Conversion completed callback. More...
hal_adc_state_t | hal_adc_get_state (adc_handle_t *p_adc)
| Return the ADC handle state. More...
uint32_t | hal_adc_get_error (adc_handle_t *p_adc)
| Return the ADC error code. More...
hal_status_t | hal_adc_suspend_reg (adc_handle_t *p_adc)
| Suspend some registers related to ADC configuration before sleep. More...
hal_status_t | hal_adc_resume_reg (adc_handle_t *p_adc)
| Restore some registers related to ADC configuration after sleep. More...
hal_status_t | hal_adc_change_channels (adc_handle_t *p_adc)
| Set the new channels parameter to ADC. More...
hal_status_t | hal_adc_clock_start (adc_handle_t *p_adc)
| Start the ADC clock. More...
hal_status_t | hal_adc_get_avg_voltage (adc_handle_t *p_adc, float *p_data, uint32_t length)
| Get the ADC sampling code by polling, and convert sampling code of the specified length to the average voltage. More...

## Detailed Description

Header file containing functions prototypes of ADC HAL 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 gr55xx_hal_adc.h.