Bar Logo 3.8/7.6 kw Totem pole Demonstration Application (Part-No. (not specified))
 
Content
     
Loading...
Searching...
No Matches
tmr1.h
Go to the documentation of this file.
1
17/*
18© [2024] Microchip Technology Inc. and its subsidiaries.
19
20 Subject to your compliance with these terms, you may use Microchip
21 software and any derivatives exclusively with Microchip products.
22 You are responsible for complying with 3rd party license terms
23 applicable to your use of 3rd party software (including open source
24 software) that may accompany Microchip software. SOFTWARE IS ?AS IS.?
25 NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS
26 SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT,
27 MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
28 WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
29 INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY
30 KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
31 MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
32 FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S
33 TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT
34 EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR
35 THIS SOFTWARE.
36*/
37
38#ifndef TMR1_H
39#define TMR1_H
40
41// Section: Included Files
42
43#include <stddef.h>
44#include <stdint.h>
45#include <xc.h>
46#include "timer_interface.h"
47// Section: Data Type Definitions
48
49
58extern const struct TIMER_INTERFACE Timer1;
59
64#define Timer1_Initialize TMR1_Initialize
69#define Timer1_Deinitialize TMR1_Deinitialize
74#define Timer1_Tasks TMR1_Tasks
79#define Timer1_Start TMR1_Start
84#define Timer1_Stop TMR1_Stop
85
86#if TIMER_PERIODCOUNTSET_API_SUPPORT
91#define Timer1_PeriodCountSet TMR1_PeriodCountSet
92#endif
93
98#define Timer1_PeriodSet TMR1_PeriodSet
103#define Timer1_PeriodGet TMR1_PeriodGet
108#define Timer1_CounterGet TMR1_CounterGet
113#define Timer1_Counter16BitGet TMR1_Counter16BitGet
118#define Timer1_InterruptPrioritySet TMR1_InterruptPrioritySet
123#define Timer1_TimeoutCallbackRegister TMR1_TimeoutCallbackRegister
124
125// Section: TMR1 Module APIs
132void TMR1_Initialize ( void );
133
140void TMR1_Deinitialize(void);
141
149void TMR1_Tasks( void );
150
158void TMR1_Start( void );
159
167void TMR1_Stop( void );
168
175void TMR1_PeriodSet( uint32_t count );
176
183inline static uint32_t TMR1_PeriodGet( void )
184{
185 return (uint32_t) PR1;
186}
187
194inline static uint32_t TMR1_CounterGet( void )
195{
196 return (uint32_t)TMR1;
197}
198
205inline static uint16_t TMR1_Counter16BitGet( void )
206{
207 return TMR1;
208}
209
216void TMR1_InterruptPrioritySet(enum INTERRUPT_PRIORITY priority);
217
225void TMR1_TimeoutCallbackRegister(void (*handler)(void));
226
235void TMR1_TimeoutCallback(void);
236
237
238#if TIMER_PERIODCOUNTSET_API_SUPPORT
245void TMR1_PeriodCountSet(size_t count) __attribute__((deprecated ("\nThis will be removed in future MCC releases. \nUse TMR1_PeriodSet instead. ")));
246#endif
247
248#endif //TMR1_H
249
static uint32_t TMR1_PeriodGet(void)
This inline function gets the TMR1 period count value.
Definition tmr1.h:183
void TMR1_Tasks(void)
This function is used to implement the tasks for polled implementations.
Definition tmr1.c:129
void TMR1_Stop(void)
Stops the timer.
Definition tmr1.c:100
void TMR1_Deinitialize(void)
Deinitializes the TMR1 to POR values.
Definition tmr1.c:85
const struct TIMER_INTERFACE Timer1
Structure object of type TIMER_INTERFACE with the custom name given by the user in the Melody Driver ...
Definition tmr1.c:53
static uint32_t TMR1_CounterGet(void)
This inline function gets the TMR1 elapsed time value.
Definition tmr1.h:194
void TMR1_TimeoutCallback(void)
This is the default callback with weak attribute. The user can override and implement the default cal...
Definition tmr1.c:124
static uint16_t TMR1_Counter16BitGet(void)
This inline function gets the 16 bit TMR1 elapsed time value.
Definition tmr1.h:205
void TMR1_TimeoutCallbackRegister(void(*handler)(void))
This function can be used to override default callback and to define custom callback for TMR1 Timeout...
Definition tmr1.c:116
void TMR1_InterruptPrioritySet(enum INTERRUPT_PRIORITY priority)
Sets the TMR1 interrupt priority value.
Definition tmr1.c:111
void TMR1_Initialize(void)
Initializes the TMR1 module.
Definition tmr1.c:71
void TMR1_PeriodSet(uint32_t count)
Sets the TMR1 period count value.
Definition tmr1.c:106
void TMR1_Start(void)
Starts the timer.
Definition tmr1.c:94
Structure containing the function pointers of TIMER driver.
void TMR1_PeriodCountSet(size_t count)
Definition tmr1.c:138