gr55xx_hal_comp.h File Reference

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

#include "gr55xx_ll_comp.h"
#include "gr55xx_hal_def.h"
+ Include dependency graph for gr55xx_hal_comp.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _comp_handle
 COMP handle Structure definition. More...
 
struct  _hal_comp_callback
 HAL COMP Callback function definition. More...
 

Macros

#define HAL_COMP_ERROR_NONE   ((uint32_t)0x00000000)
 No error
More...
 
#define HAL_COMP_ERROR_TIMEOUT   ((uint32_t)0x00000001)
 Timeout error
More...
 
#define HAL_COMP_ERROR_INVALID_PARAM   ((uint32_t)0x00000002)
 Invalid parameters error. More...
 
#define COMP_INPUT_SRC_IO0   LL_COMP_INPUT_SRC_IO0
 Set MSIO_0 as inputs for the comparator. More...
 
#define COMP_INPUT_SRC_IO1   LL_COMP_INPUT_SRC_IO1
 Set MSIO_1 as inputs for the comparator. More...
 
#define COMP_INPUT_SRC_IO2   LL_COMP_INPUT_SRC_IO2
 Set MSIO_2 as inputs for the comparator. More...
 
#define COMP_INPUT_SRC_IO3   LL_COMP_INPUT_SRC_IO3
 Set MSIO_3 as inputs for the comparator. More...
 
#define COMP_INPUT_SRC_IO4   LL_COMP_INPUT_SRC_IO4
 Set MSIO_4 as inputs for the comparator. More...
 
#define COMP_REF_SRC_IO0   LL_COMP_REF_SRC_IO0
 Set MSIO_0 as references for the comparator. More...
 
#define COMP_REF_SRC_IO1   LL_COMP_REF_SRC_IO1
 Set MSIO_1 as references for the comparator. More...
 
#define COMP_REF_SRC_IO2   LL_COMP_REF_SRC_IO2
 Set MSIO_2 as references for the comparator. More...
 
#define COMP_REF_SRC_IO3   LL_COMP_REF_SRC_IO3
 Set MSIO_3 as references for the comparator. More...
 
#define COMP_REF_SRC_IO4   LL_COMP_REF_SRC_IO4
 Set MSIO_4 as references for the comparator. More...
 
#define COMP_REF_SRC_VBAT   LL_COMP_REF_SRC_VBAT
 Set VBATT as references for the comparator
More...
 
#define COMP_REF_SRC_VREF   LL_COMP_REF_SRC_VREF
 Set VREF as references for the comparator
More...
 
#define COMP_DEFAULT_CONFIG   LL_COMP_DEFAULT_CONFIG
 Default configuartion for initializing structure. More...
 
#define IS_COMP_INPUT(__INPUT__)
 Check if COMP input source is valid. More...
 
#define IS_COMP_REF(__INPUT__)
 Check if COMP reference source is valid. More...
 

Typedefs

typedef ll_comp_init_t comp_init_t
 COMP init structure definition. More...
 
typedef struct _comp_handle comp_handle_t
 COMP handle Structure definition. More...
 
typedef struct _hal_comp_callback hal_comp_callback_t
 HAL COMP Callback function definition. More...
 

Enumerations

enum  hal_comp_state_t { HAL_COMP_STATE_RESET = 0x00, HAL_COMP_STATE_READY = 0x01, HAL_COMP_STATE_BUSY = 0x02, HAL_COMP_STATE_ERROR = 0x04 }
 HAL COMP State Enumerations definition. More...
 

Functions

hal_status_t hal_comp_init (comp_handle_t *p_comp)
 Initialize the COMP according to the specified parameters in the comp_init_t and initialize the associated handle. More...
 
hal_status_t hal_comp_deinit (comp_handle_t *p_comp)
 De-initialize the COMP peripheral. More...
 
void hal_comp_msp_init (comp_handle_t *p_comp)
 Initialize the COMP MSP. More...
 
void hal_comp_msp_deinit (comp_handle_t *p_comp)
 De-initialize the COMP MSP. More...
 
hal_status_t hal_comp_start (comp_handle_t *p_comp)
 Start the comparator. More...
 
hal_status_t hal_comp_stop (comp_handle_t *p_comp)
 Stop the comparator. More...
 
void hal_comp_irq_handler (comp_handle_t *p_comp)
 Handle COMP interrupt request. More...
 
void hal_comp_trigger_callback (comp_handle_t *p_comp)
 comparator callback. More...
 
hal_comp_state_t hal_comp_get_state (comp_handle_t *p_comp)
 Return the COMP handle state. More...
 
uint32_t hal_comp_get_error (comp_handle_t *p_comp)
 Return the COMP error code. More...
 
hal_status_t hal_comp_suspend_reg (comp_handle_t *p_comp)
 Suspend some registers related to COMP configuration before sleep. More...
 
hal_status_t hal_comp_resume_reg (comp_handle_t *p_comp)
 Restore some registers related to COMP configuration after sleep. More...
 

Detailed Description

Header file containing functions prototypes of COMP 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_comp.h.