hal_tim.h File Reference

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

#include "hal_def.h"
#include "ll_tim.h"

Go to the source code of this file.

Classes

struct  _hal_timer_capture_channel_init
 TIMER capture channel Structure definition. More...
 
struct  _timer_init
 TIMER init Structure definition. More...
 
struct  _timer_handle
 TIMER handle Structure definition. More...
 
struct  _hal_timer_base_callback
 HAL_TIMER Callback function definition. More...
 

Macros

#define __HAL_TIMER_RESET_HANDLE_STATE(__HANDLE__)   ((__HANDLE__)->state = HAL_TIMER_STATE_RESET)
 Reset TIMER handle states. More...
 
#define __HAL_TIMER_ENABLE(__HANDLE__)   SET_BITS((__HANDLE__)->p_instance->CTRL, TIMER_CTRL_EN)
 Enable the specified TIMER peripheral. More...
 
#define __HAL_TIMER_DISABLE(__HANDLE__)   CLEAR_BITS((__HANDLE__)->p_instance->CTRL, TIMER_CTRL_EN)
 Disable the specified TIMER peripheral. More...
 
#define __HAL_TIMER_ENABLE_ALL_IT(__HANDLE__)   ll_timer_enable_all_it((__HANDLE__)->p_instance)
 Enable the TIMER all interrupt. More...
 
#define __HAL_TIMER_DISABLE_ALL_IT(__HANDLE__)   ll_timer_disable_all_it((__HANDLE__)->p_instance)
 Disable the TIMER all interrupt. More...
 
#define __HAL_TIMER_GET_FLAG_IT(__HANDLE__)   ll_timer_is_active_flag_it(__HANDLE__->p_instance)
 Check whether the TIMER interrupt has occurred or not. More...
 

Typedefs

typedef struct _hal_timer_capture_channel_init hal_timer_capture_channel_init_t
 TIMER capture channel Structure definition. More...
 
typedef struct _timer_init timer_init_t
 TIMER init Structure definition. More...
 
typedef struct _timer_handle timer_handle_t
 TIMER handle Structure definition. More...
 
typedef struct _hal_timer_base_callback hal_timer_base_callback_t
 HAL_TIMER Callback function definition. More...
 

Enumerations

enum  hal_timer_state_t {
  HAL_TIMER_STATE_RESET = 0x00,
  HAL_TIMER_STATE_READY = 0x01,
  HAL_TIMER_STATE_BUSY = 0x02,
  HAL_TIMER_STATE_ERROR = 0x04
}
 HAL TIMER State Enumerations definition. More...
 
enum  hal_timer_capture_type_t {
  HAL_TIMER_CAPTURE_NONE = 0x00,
  HAL_TIMER_CAPTURE_FALLING = 0x01,
  HAL_TIMER_CAPTURE_RISING = 0x02,
  HAL_TIMER_CAPTURE_BOTH = 0x03
}
 HAL TIMER capture type Enumerations definition. More...
 
enum  hal_timer_capture_pin_t {
  HAL_TIMER_CAPTURE_GPIO_PIN_0 = 0x00,
  HAL_TIMER_CAPTURE_GPIO_PIN_1 = 0x01,
  HAL_TIMER_CAPTURE_GPIO_PIN_2 = 0x02,
  HAL_TIMER_CAPTURE_GPIO_PIN_3 = 0x03,
  HAL_TIMER_CAPTURE_GPIO_PIN_4 = 0x04,
  HAL_TIMER_CAPTURE_GPIO_PIN_5 = 0x05,
  HAL_TIMER_CAPTURE_GPIO_PIN_6 = 0x06,
  HAL_TIMER_CAPTURE_GPIO_PIN_7 = 0x07,
  HAL_TIMER_CAPTURE_GPIO_PIN_8 = 0x08,
  HAL_TIMER_CAPTURE_GPIO_PIN_9 = 0x09,
  HAL_TIMER_CAPTURE_GPIO_PIN_10 = 0x0A,
  HAL_TIMER_CAPTURE_GPIO_PIN_11 = 0x0B,
  HAL_TIMER_CAPTURE_GPIO_PIN_12 = 0x0C,
  HAL_TIMER_CAPTURE_GPIO_PIN_13 = 0x0D,
  HAL_TIMER_CAPTURE_AON_GPIO_PIN_0 = 0x0E,
  HAL_TIMER_CAPTURE_AON_GPIO_PIN_1 = 0x0F,
  HAL_TIMER_CAPTURE_AON_GPIO_PIN_2 = 0x10,
  HAL_TIMER_CAPTURE_AON_GPIO_PIN_3 = 0x11,
  HAL_TIMER_CAPTURE_AON_GPIO_PIN_4 = 0x12,
  HAL_TIMER_CAPTURE_AON_GPIO_PIN_5 = 0x13,
  HAL_TIMER_CAPTURE_AON_GPIO_PIN_6 = 0x14,
  HAL_TIMER_CAPTURE_AON_GPIO_PIN_7 = 0x15,
  HAL_TIMER_CAPTURE_MSIO_PIN_0 = 0x16,
  HAL_TIMER_CAPTURE_MSIO_PIN_1 = 0x17,
  HAL_TIMER_CAPTURE_MSIO_PIN_2 = 0x18,
  HAL_TIMER_CAPTURE_MSIO_PIN_3 = 0x19,
  HAL_TIMER_CAPTURE_MSIO_PIN_4 = 0x1A,
  HAL_TIMER_CAPTURE_MSIO_PIN_5 = 0x1B,
  HAL_TIMER_CAPTURE_MSIO_PIN_6 = 0x1C,
  HAL_TIMER_CAPTURE_MSIO_PIN_7 = 0x1D,
  HAL_TIMER_CAPTURE_MSIO_PIN_8 = 0x1E,
  HAL_TIMER_CAPTURE_MSIO_PIN_9 = 0x1F
}
 HAL TIMER capture pin Enumerations definition. More...
 

Functions

hal_status_t hal_timer_init (timer_handle_t *p_timer)
 Initialize the TIMER according to the specified parameters in the timer_init_t and initialize the associated handle. More...
 
hal_status_t hal_timer_deinit (timer_handle_t *p_timer)
 De-initialize the TIMER peripheral. More...
 
void hal_timer_msp_init (timer_handle_t *p_timer)
 Initialize the TIMER MSP. More...
 
void hal_timer_msp_deinit (timer_handle_t *p_timer)
 De-initialize the TIMER MSP. More...
 
hal_status_t hal_timer_start (timer_handle_t *p_timer)
 Starts the TIMER counter. More...
 
hal_status_t hal_timer_stop (timer_handle_t *p_timer)
 Stops the TIMER counter. More...
 
hal_status_t hal_timer_start_it (timer_handle_t *p_timer)
 Starts the TIMER counter in interrupt mode. More...
 
hal_status_t hal_timer_stop_it (timer_handle_t *p_timer)
 Stops the TIMER counter in interrupt mode. More...
 
void hal_timer_irq_handler (timer_handle_t *p_timer)
 Handle TIMER interrupt request. More...
 
void hal_timer_period_elapsed_callback (timer_handle_t *p_timer)
 Period elapsed callback in non-blocking mode. More...
 
void hal_timer_channel0_event_callback (timer_handle_t *p_timer)
 channel0 event callback in non-blocking mode. More...
 
void hal_timer_channel1_event_callback (timer_handle_t *p_timer)
 channel1 event callback in non-blocking mode. More...
 
void hal_timer_channel2_event_callback (timer_handle_t *p_timer)
 channel2 event callback in non-blocking mode. More...
 
void hal_timer_channel3_event_callback (timer_handle_t *p_timer)
 channel3 event callback in non-blocking mode. More...
 
void hal_timer_blepulse1_event_callback (timer_handle_t *p_timer)
 ble pulse 1 event callback in non-blocking mode. More...
 
void hal_timer_blepulse2_event_callback (timer_handle_t *p_timer)
 ble pulse 2 event callback in non-blocking mode. More...
 
hal_timer_state_t hal_timer_get_state (const timer_handle_t *p_timer)
 Return the TIMER handle state. More...
 
hal_status_t hal_timer_set_config (const timer_handle_t *p_timer, const timer_init_t *p_structure)
 TIMER configuration. More...
 
uint32_t hal_timer_get_channel0_val (const timer_handle_t *p_timer)
 Get current value of channel0. More...
 
uint32_t hal_timer_get_channel1_val (const timer_handle_t *p_timer)
 Get current value of channel1. More...
 
uint32_t hal_timer_get_channel2_val (const timer_handle_t *p_timer)
 Get current value of channel2. More...
 
uint32_t hal_timer_get_channel3_val (const timer_handle_t *p_timer)
 Get current value of channel3. More...
 

Detailed Description

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