A31L12x F/W Packages  1.4.0
ABOV Cortex-M0+ Core based MCUs Integrated Driver
A31L12x_hal_timer5n.h
Go to the documentation of this file.
1 /***************************************************************************//****************************************************************************/
34 
35 #ifndef _TIMER5n_H_
36 #define _TIMER5n_H_
37 
38 #include "A31L12x.h"
39 #include "A31L12x_hal_aa_types.h"
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 //******************************************************************************
46 // Constant
47 //******************************************************************************
48 
50 #define TIMER5n_CR_MATCH_FLAG (1 << TIMER5n_CR_T5nMIFLAG_Pos)
51 #define TIMER5n_CR_CAPTURE_FLAG (1 << TIMER5n_CR_T5nCIFLAG_Pos)
52 
53 //******************************************************************************
54 // Type
55 //******************************************************************************
56 
57 //==============================================================================
58 // Enumeration
59 //==============================================================================
60 
61 typedef enum
62 {
66 
67 //==============================================================================
68 // Structure
69 //==============================================================================
70 
71 typedef struct
72 {
73  // TIMER5n.CR
74  TIMER5n_CR_T5nMS_Enum T5nMS; // TIMER5n Operation Mode Selection
75  TIMER5n_CR_T5nCLK_Enum T5nCLK; // TIMER5n Clock Selection
76  TIMER5n_CR_T5nECE_Enum T5nECE; // TIMER5n External Clock Edge Selection
77  TIMER5n_CR_T5nINSEL_Enum T5nINSEL; // TIMER5n Capture Signal Selection
78  TIMER5n_CR_T5nINPOL_Enum T5nINPOL; // TIMER5n Input Caputure/'Counter Clear Input' Polarity Selection
79  TIMER5n_CR_T5nOPOL_Enum T5nOPOL; // T5nOUT Polarity Selection
80 
81  // TIMER5n.ADR
82  uint16_t ADR;
83 
84  // TIMER5n.BDR
85  uint16_t BDR;
86 
87  // TIMER5n.PREDR
88  uint16_t Prescaler;
90 
91 //******************************************************************************
92 // Macro
93 //******************************************************************************
94 
95 /*-------------------------------------------------------------------------*//*-------------------------------------------------------------------------*/
101 #define TIMER5n_ClrCnt( TIMER5x ) (TIMER5x->CR_b.T4nCLR = 1)
102 
103 /*-------------------------------------------------------------------------*//*-------------------------------------------------------------------------*/
111 #define TIMER5n_SetAData( TIMER5x, u32AData ) (TIMER5x->ADR = u32AData)
112 
113 /*-------------------------------------------------------------------------*//*-------------------------------------------------------------------------*/
121 #define TIMER5n_SetBData( TIMER5x, u32BData ) (TIMER5x->BDR = u32BData)
122 
124 #define TIMER5n_CR_MIEN_SET( n ) (n << TIMER5n_CR_T5nMIEN_Pos)
125 
127 #define TIMER5n_CR_CIEN_SET( n ) (n << TIMER5n_CR_T5nCIEN_Pos)
128 
130 #define TIMER5n_CR_PAU_SET( n ) (n << TIMER5n_CR_T5nPAU_Pos)
131 
132 #define TIMER5n_PREDR_SET( n ) (n << 0)
133 
134 //******************************************************************************
135 // Function
136 //******************************************************************************
137 
138 HAL_Status_Type HAL_TIMER5n_Init( TIMER5n_Type* TIMER5x, TIMER5n_CFG_Type* TIMER5n_Config );
139 HAL_Status_Type HAL_TIMER5n_DeInit( TIMER5n_Type* TIMER5x );
140 
141 HAL_Status_Type HAL_TIMER5n_ConfigInterrupt( TIMER5n_Type* TIMER5x, TIMER5n_INT_Type TIMER5n_IntCfg, FunctionalState NewState );
142 HAL_Status_Type HAL_TIMER5n_Cmd( TIMER5n_Type* TIMER5x, FunctionalState NewState );
143 HAL_Status_Type HAL_TIMER5n_ClearCounter( TIMER5n_Type* TIMER5x );
144 HAL_Status_Type HAL_TIMER5n_UpdateCountValue( TIMER5n_Type* TIMER5x, uint8_t CountCh, uint16_t Value );
145 HAL_Status_Type HAL_TIMER5n_ClearStatus( TIMER5n_Type* TIMER5x, uint32_t value );
146 uint8_t HAL_TIMER5n_GetStatus( TIMER5n_Type* TIMER5x );
147 
148 uint16_t HAL_TIMER5n_GetCaptureData( TIMER5n_Type* TIMER5x );
149 
150 #ifdef __cplusplus
151 }
152 #endif
153 
154 #endif /* _TIMER5n_H_ */
155 
HAL_Status_Type HAL_TIMER5n_DeInit(TIMER5n_Type *TIMER5x)
Close Timer/Counter device.
TIMER5n_CR_T5nCLK_Enum T5nCLK
TIMER5n_CR_T5nINSEL_Enum T5nINSEL
HAL_Status_Type HAL_TIMER5n_ClearStatus(TIMER5n_Type *TIMER5x, uint32_t value)
Clear Timer Status.
Contains the ABOV typedefs for C standard types. It is intended to be used in ISO C conforming develo...
HAL_Status_Type
TIMER5n_INT_Type
HAL_Status_Type HAL_TIMER5n_UpdateCountValue(TIMER5n_Type *TIMER5x, uint8_t CountCh, uint16_t Value)
Update value.
HAL_Status_Type HAL_TIMER5n_Cmd(TIMER5n_Type *TIMER5x, FunctionalState NewState)
Start/Stop Timer/Counter device.
TIMER5n_CR_T5nECE_Enum T5nECE
TIMER5n_CR_T5nINPOL_Enum T5nINPOL
HAL_Status_Type HAL_TIMER5n_ClearCounter(TIMER5n_Type *TIMER5x)
Clear Counter and Prescaler.
TIMER5n_CR_T5nMS_Enum T5nMS
uint16_t HAL_TIMER5n_GetCaptureData(TIMER5n_Type *TIMER5x)
Read value of capture register in timer/counter device.
FunctionalState
uint8_t HAL_TIMER5n_GetStatus(TIMER5n_Type *TIMER5x)
Get Timer Status.
TIMER5n_CR_T5nOPOL_Enum T5nOPOL
HAL_Status_Type HAL_TIMER5n_ConfigInterrupt(TIMER5n_Type *TIMER5x, TIMER5n_INT_Type TIMER5n_IntCfg, FunctionalState NewState)
Configure the peripheral interrupt.
HAL_Status_Type HAL_TIMER5n_Init(TIMER5n_Type *TIMER5x, TIMER5n_CFG_Type *TIMER5n_Config)
Initialize the TIMER5n peripheral with the specified parameters.