Bar Logo 3.8/7.6 kw Totem pole Demonstration Application (Part-No. (not specified))
 
Content
     
Loading...
Searching...
No Matches
sccp1.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 SCCP1_H
39#define SCCP1_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
48// Section: Data Type Definitions
49
50
59extern const struct TIMER_INTERFACE SPI_BusIdle_1us_Timer;
60
65#define SPI_BusIdle_1us_Timer_Initialize SCCP1_Timer_Initialize
70#define SPI_BusIdle_1us_Timer_Deinitialize SCCP1_Timer_Deinitialize
75#define SPI_BusIdle_1us_Timer_Tasks SCCP1_Timer_Tasks
80#define SPI_BusIdle_1us_Timer_Start SCCP1_Timer_Start
85#define SPI_BusIdle_1us_Timer_Stop SCCP1_Timer_Stop
86
87#if TIMER_PERIODCOUNTSET_API_SUPPORT
92#define SPI_BusIdle_1us_Timer_PeriodCountSet SCCP1_Timer_PeriodCountSet
93#endif
94
99#define SPI_BusIdle_1us_Timer_PeriodSet SCCP1_Timer_PeriodSet
104#define SPI_BusIdle_1us_Timer_PeriodGet SCCP1_Timer_PeriodGet
109#define SPI_BusIdle_1us_Timer_CounterGet SCCP1_Timer_CounterGet
114#define SPI_BusIdle_1us_Timer_Counter16BitGet SCCP1_Timer_Counter16BitGet
119#define SPI_BusIdle_1us_Timer_InterruptPrioritySet SCCP1_Timer_InterruptPrioritySet
120
125#define SPI_BusIdle_1us_Timer_TimeoutCallbackRegister SCCP1_Timer_TimeoutCallbackRegister
126
127// Section: Driver Interface Functions
128
135void SCCP1_Timer_Initialize (void);
136
143void SCCP1_Timer_Deinitialize(void);
144
152void SCCP1_Timer_Start(void);
153
161void SCCP1_Timer_Stop(void);
162
170void SCCP1_Timer_PeriodSet(uint32_t count);
171
179inline static uint32_t SCCP1_Timer_PeriodGet(void)
180{
181 if(CCP1CON1Lbits.T32 == 1)
182 {
183 return (((uint32_t)CCP1PRH << 16U) | (CCP1PRL) );
184 }
185 else
186 {
187 return (uint32_t) CCP1PRL;
188 }
189}
190
197inline static uint32_t SCCP1_Timer_CounterGet(void)
198{
199 if(CCP1CON1Lbits.T32 == 1)
200 {
201 return (((uint32_t)CCP1TMRH << 16U) | CCP1TMRL);
202 }
203 else
204 {
205 return (uint32_t)CCP1TMRL;
206 }
207}
208
215inline static uint16_t SCCP1_Timer_Counter16BitGet(void)
216{
217 return CCP1TMRL;
218}
219
226void SCCP1_Timer_InterruptPrioritySet(enum INTERRUPT_PRIORITY priority);
234void SCCP1_Timer_Tasks(void);
235
236
244void SCCP1_Timer_TimeoutCallbackRegister(void (*handler)(void));
245
253void SCCP1_TimeoutCallbackRegister(void* handler)__attribute__((deprecated("\nThis will be removed in future MCC releases. \nUse SCCP1_Timer_TimeoutCallbackRegister instead. ")));
254
263void SCCP1_TimeoutCallback(void);
264
265
266#if TIMER_PERIODCOUNTSET_API_SUPPORT
274void SCCP1_Timer_PeriodCountSet(size_t count)__attribute__((deprecated ("\nThis will be removed in future MCC releases. \nUse SCCP1_Timer_PeriodSet instead. ")));
275#endif
276#endif //SCCP1_H
277
void SCCP1_Timer_PeriodCountSet(size_t count)
Definition sccp1.c:194
void SCCP1_Timer_Stop(void)
Stops the timer.
Definition sccp1.c:136
void SCCP1_Timer_PeriodSet(uint32_t count)
Sets the SCCP1-Timer period count value.
Definition sccp1.c:141
void SCCP1_TimeoutCallback(void)
This is the default callback with weak attribute. The user can override and implement the default cal...
Definition sccp1.c:177
const struct TIMER_INTERFACE SPI_BusIdle_1us_Timer
Structure object of type TIMER_INTERFACE with the custom name given by the user in the Melody Driver ...
Definition sccp1.c:57
static uint32_t SCCP1_Timer_PeriodGet(void)
This inline function gets the SCCP1-Timer period count value.
Definition sccp1.h:179
void SCCP1_Timer_Deinitialize(void)
Deinitializes the SCCP1 to POR values.
Definition sccp1.c:111
void SCCP1_Timer_TimeoutCallbackRegister(void(*handler)(void))
This function can be used to override default callback and to define custom callback for SCCP1 Timeou...
Definition sccp1.c:161
void SCCP1_Timer_Tasks(void)
Used in polling method of timeout event.
Definition sccp1.c:182
void SCCP1_Timer_Start(void)
Starts the timer.
Definition sccp1.c:131
static uint16_t SCCP1_Timer_Counter16BitGet(void)
This inline function gets the SCCP1-Timer least significant 16 bit elapsed count value.
Definition sccp1.h:215
static uint32_t SCCP1_Timer_CounterGet(void)
This inline function gets the SCCP1-Timer elapsed count value.
Definition sccp1.h:197
void SCCP1_Timer_Initialize(void)
Initializes the SCCP1 module.
Definition sccp1.c:75
void SCCP1_Timer_InterruptPrioritySet(enum INTERRUPT_PRIORITY priority)
Sets the Interrupt Priority Value.
Definition sccp1.c:156
void SCCP1_TimeoutCallbackRegister(void *handler)
This function can be used to override default callback and to define custom callback for SCCP1 Timeou...
Definition sccp1.c:169
Structure containing the function pointers of TIMER driver.