STM32G0 MCAL 0.0.1
Tiny MCAL for educational purpose.
Loading...
Searching...
No Matches
Gpt_Arch.h
Go to the documentation of this file.
1
11#ifndef GPT_ARCH_H__
12#define GPT_ARCH_H__
13
14#include "Gpt_Types.h"
15
22/* cppcheck-suppress misra-c2012-2.5 ; This reference number is meant to be used as an input in the config file/structure. */
23#define GPT_TIM6 0
24/* cppcheck-suppress misra-c2012-2.5 ; This reference number is meant to be used as an input in the config file/structure. */
25#define GPT_TIM7 1
28
35#define GPT_ARR_MAX 0X0000FFFF
38
44#define GPT_INTERRUPT_FLAG_BIT 0
45#define GPT_ONE_PULSE_MODE_BIT 3u
46#define GPT_PRESCALER_LSB 0
47#define GPT_PRESCALER_MSB 16u
48#define GPT_AUTO_RELOAD_LSB 0
49#define GPT_AUTO_RELOAD_MSB 16u
50#define GPT_COUNTER_ENABLE_BIT 0
51#define GPT_UPDATE_DISABLE_BIT 1u
54
55void Gpt_Arch_Init( const Gpt_ConfigType *ConfigPtr, uint32 ChannelsToInit );
56void Gpt_Arch_DeInit( const Gpt_ConfigType *ConfigPtr, uint32 ChannelsToDeinit );
59void Gpt_Arch_StartTimer( const Gpt_ConfigType *ConfigPtr, Gpt_ChannelType Channel, Gpt_ValueType Value );
60void Gpt_Arch_StopTimer( const Gpt_ConfigType *ConfigPtr, Gpt_ChannelType Channel );
61void Gpt_Arch_EnableNotification( const Gpt_ConfigType *ConfigPtr, Gpt_ChannelType Channel );
62void Gpt_Arch_DisableNotification( const Gpt_ConfigType *ConfigPtr, Gpt_ChannelType Channel );
63void Gpt_Arch_Notification_Channel0( const Gpt_ConfigType *ConfigPtr );
64void Gpt_Arch_Notification_Channel1( const Gpt_ConfigType *ConfigPtr );
65
66#endif
void Gpt_Arch_Notification_Channel0(const Gpt_ConfigType *ConfigPtr)
Executes the callback function defined by the user on the GPT_CHANNEL_0, validating the interrupt fla...
Definition Gpt_Arch.c:212
Gpt_ValueType Gpt_Arch_GetTimeElapsed(const Gpt_ConfigType *ConfigPtr, Gpt_ChannelType Channel)
Returns the time already elapsed
Definition Gpt_Arch.c:88
void Gpt_Arch_StartTimer(const Gpt_ConfigType *ConfigPtr, Gpt_ChannelType Channel, Gpt_ValueType Value)
Starts a timer channel
Definition Gpt_Arch.c:131
void Gpt_Arch_Init(const Gpt_ConfigType *ConfigPtr, uint32 ChannelsToInit)
Gpt low level Initialization
Definition Gpt_Arch.c:35
void Gpt_Arch_EnableNotification(const Gpt_ConfigType *ConfigPtr, Gpt_ChannelType Channel)
Enables the interrupt notification for a channel
Definition Gpt_Arch.c:173
void Gpt_Arch_DeInit(const Gpt_ConfigType *ConfigPtr, uint32 ChannelsToDeinit)
Gpt low level Deinitialization
Definition Gpt_Arch.c:60
void Gpt_Arch_Notification_Channel1(const Gpt_ConfigType *ConfigPtr)
Executes the callback function defined by the user on the GPT_CHANNEL_1, validating the interrupt fla...
Definition Gpt_Arch.c:240
void Gpt_Arch_DisableNotification(const Gpt_ConfigType *ConfigPtr, Gpt_ChannelType Channel)
Disables the interrupt notification for a channel
Definition Gpt_Arch.c:192
Gpt_ValueType Gpt_Arch_GetTimeRemaining(const Gpt_ConfigType *ConfigPtr, Gpt_ChannelType Channel)
Returns the time remaining until the target time is reached
Definition Gpt_Arch.c:110
void Gpt_Arch_StopTimer(const Gpt_ConfigType *ConfigPtr, Gpt_ChannelType Channel)
Stops a timer channel
Definition Gpt_Arch.c:154
Gpt Driver Types
Gpt_ChannelType
Numeric ID of a GPT channel
Definition Gpt_Types.h:96
struct _Gpt_ConfigType Gpt_ConfigType
Definition of the external data structure containing the initialization data
uint32 Gpt_ValueType
Type for reading and setting the timer values (in number of ticks).
Definition Gpt_Types.h:106
unsigned int uint32
Definition Platform_Types.h:98