G32R430 Device Driver Layer v1.0.4
G32R4xx Device Driver Layer API Reference
g32r4xx_ddl_lptmr.c
Go to the documentation of this file.
1
43#if defined(USE_FULL_DDL_DRIVER)
44
45/* Includes ------------------------------------------------------------------*/
46#include "g32r4xx_ddl_lptmr.h"
47#include "g32r4xx_ddl_rcm.h"
48
49#ifdef USE_FULL_ASSERT
50#include "g32_assert.h"
51#else
52#define ASSERT_PARAM(_PARAM_) ((void)0U)
53#endif /* USE_FULL_ASSERT */
54
58
59#if defined (LPTMR)
60
64
65/* Private types -------------------------------------------------------------*/
66/* Private variables ---------------------------------------------------------*/
67/* Private constants ---------------------------------------------------------*/
68/* Private macros ------------------------------------------------------------*/
69/* Private function prototypes -----------------------------------------------*/
70/* Exported functions --------------------------------------------------------*/
74
78
86{
87 /* Set the default configuration */
88 LPTMR_InitStruct->Prescaler = (uint16_t)0x0000;
89 LPTMR_InitStruct->WakeUpValue = (uint16_t)0x0000;
90}
91
99ErrorStatus DDL_LPTMR_DeInit(LPTMR_TypeDef *LPTMRx)
100{
101 ErrorStatus result = SUCCESS;
102
103 DDL_LPTMR_InitTypeDef deInitStruct;
104 DDL_LPTMR_StructInit(&deInitStruct);
105 DDL_LPTMR_Init(LPTMRx, &deInitStruct);
106
107 return result;
108}
109
119ErrorStatus DDL_LPTMR_Init(LPTMR_TypeDef *LPTMRx, DDL_LPTMR_InitTypeDef *LPTMR_InitStruct)
120{
121 /* Set the Autoreload value */
122 DDL_LPTMR_SetWakeUpValue(LPTMRx, LPTMR_InitStruct->WakeUpValue);
123
124 /* Set the Prescaler value */
125 DDL_LPTMR_SetPrescaler(LPTMRx, LPTMR_InitStruct->Prescaler);
126
127 return SUCCESS;
128}
129
133
137
141
142#endif /* LPTMR1 */
143
147
148#endif /* USE_FULL_DDL_DRIVER */
149
G32 assert template file. This file should be copied to the application folder and renamed to g32_ass...
Header file of LPTMR DDL module.
Header file of RCM DDL module.
void DDL_LPTMR_StructInit(DDL_LPTMR_InitTypeDef *LPTMR_InitStruct)
Set the fields of the time base unit configuration data structure to their default values.
ErrorStatus DDL_LPTMR_DeInit(LPTMR_TypeDef *LPTMRx)
Set LPTMRx registers to their reset values.
ErrorStatus DDL_LPTMR_Init(LPTMR_TypeDef *LPTMRx, DDL_LPTMR_InitTypeDef *LPTMR_InitStruct)
Configure the LPTMRx time base unit.
__STATIC_INLINE void DDL_LPTMR_SetPrescaler(LPTMR_TypeDef *LPTMRx, uint32_t Prescaler)
Set the prescaler value.
__STATIC_INLINE void DDL_LPTMR_SetWakeUpValue(LPTMR_TypeDef *LPTMRx, uint32_t Value)
Set the wake up value.
LPTMR Time Base configuration structure definition.