EPC9143 300 W 16th Brick DC/DC Module Reference Design
p33c_ccp.h
1 /*
2  * File: p33c_ccp.h
3  * Author: I62419
4  *
5  * Created on October 12, 2020, 5:41 PM
6  */
7 
8 /*@@p33c_ccp.h
9  * ************************************************************************************************
10  * Summary:
11  * Generic Capture Compare Driver Module (header file)
12  *
13  * Description:
14  * This additional header file contains defines for all required bit-settings of all related
15  * special function registers of a peripheral module and/or instance.
16  * This file is an additional header file on top of the generic device header file.
17  *
18  * See Also:
19  * p33c_ccp.c
20  * ***********************************************************************************************/
21 
22 #ifndef P33C_CCP_SFR_ABSTRACTION_H
23 #define P33C_CCP_SFR_ABSTRACTION_H
24 
25 #include <xc.h> // include processor files - each processor file is guarded.
26 #include <stdint.h> // include standard integer data types
27 #include <stdbool.h> // include standard boolean data types
28 #include <stddef.h> // include standard definition data types
29 
30 
31 #ifndef P33C_CCP_INSTANCE_SFRSET_s
32 
33  typedef struct P33C_CCP_INSTANCE_SFRSET_s {
34 
35  union {
36  struct tagCCP1CON1LBITS bits; // Register bit-field
37  uint16_t value; // 16-bit wide register value
38  } CCPxCON1L; // CCPxCON1L: CCPx CONTROL 1 LOW REGISTERS
39 
40  union {
41  struct tagCCP1CON1HBITS bits; // Register bit-field
42  uint16_t value; // 16-bit wide register value
43  } CCPxCON1H; // CCPxCON1H: CCPx CONTROL 1 HIGH REGISTERS
44 
45  union {
46  struct tagCCP1CON2LBITS bits; // Register bit-field
47  uint16_t value; // 16-bit wide register value
48  } CCPxCON2L; // CCPxCON2L: CCPx CONTROL 2 LOW REGISTERS
49 
50  union {
51  struct tagCCP1CON2HBITS bits; // Register bit-field
52  uint16_t value; // 16-bit wide register value
53  } CCPxCON2H; // CCPxCON2H: CCPx CONTROL 2 HIGH REGISTERS
54 
55  #if defined (CCP9CON3L)
56  union {
57  struct tagCCP9CON3LBITS bits; // Register bit-field
58  uint16_t value; // 16-bit wide register value
59  } CCPxCON3L; // CCPxCON3L: CCPx CONTROL 3 LOW REGISTERS (implemented in MCCP9 module only)
60  #else
61  volatile unsigned :16; // (reserved) Memory gap between CCPxCON2H and CCPxCON3H
62  #endif
63 
64  union {
65  struct tagCCP1CON3HBITS bits; // Register bit-field
66  uint16_t value; // 16-bit wide register value
67  } CCPxCON3H; // CCPxCON3H: CCPx CONTROL 3 HIGH REGISTERS
68 
69  union {
70  struct tagCCP1STATLBITS bits; // Register bit-field
71  uint16_t value; // 16-bit wide register value
72  } CCPxSTATL; // CCPxSTATL: CCPx STATUS REGISTER
73 
74  volatile unsigned :16; // (reserved)
75 
76  union {
77  struct {
78  uint16_t CCPTMRL : 16; // Register bit-field
79  } bits; // Register bit-field
80  uint16_t value; // 16-bit wide register value
81  } CCPxTMRL; // CCPxTMRL: CCPx TIMER COUTER REGISTER LOW
82 
83  union {
84 
85  struct {
86  uint16_t CCPTMRH : 16; // Register bit-field
87  } bits; // Register bit-field
88  uint16_t value; // 16-bit wide register value
89  } CCPxTMRH; // CCPxTMRH: CCPx TIMER COUTER REGISTER HIGH
90 
91  union {
92  struct {
93  uint16_t CCPPRL : 16; // Register bit-field
94  } bits; // Register bit-field
95  uint16_t value; // 16-bit wide register value
96  } CCPxPRL; // CCPx TIMER PERIOD REGISTER LOW
97 
98  union {
99 
100  struct {
101  uint16_t CCPPRH : 16; // Register bit-field
102  } bits; // Register bit-field
103  uint16_t value; // 16-bit wide register value
104  } CCPxPRH; // CCPx TIMER PERIOD REGISTER HIGH
105 
106  union {
107  struct {
108  uint16_t CCPRAL : 16; // Register bit-field
109  } bits; // Register bit-field
110  uint16_t value; // 16-bit wide register value
111  } CCPxRAL; // CCPxRAL: CCPx PRIMARY OUTPUT COMPARE DATA BUFFER LOW
112 
113  volatile unsigned :16;
114 
115  union {
116  struct {
117  uint16_t CCPRBL : 16; // Register bit-field
118  } bits; // Register bit-field
119  uint16_t value; // 16-bit wide register value
120  } CCPxRBL; // CCPxRBL: CCPx SECONDARY OUTPUT COMPARE DATA BUFFER LOW
121 
122  volatile unsigned :16;
123 
124  union {
125 
126  struct {
127  uint16_t CCPBUFL : 16; // Register bit-field
128  } bits; // Register bit-field
129  uint16_t value; // 16-bit wide register value
130  } CCPxBUFL; // CCPxBUFL: CCPx INPUT CAPTURE BUFFER LOW
131 
132  union {
133  struct {
134  uint16_t CCPBUFH : 16; // Register bit-field
135  } bits; // Register bit-field
136  uint16_t value; // 16-bit wide register value
137  } CCPxBUFH; // CCPxBUFH: CCPx INPUT CAPTURE BUFFER HIGH
138 
139  } __attribute__((packed)) P33C_CCP_MODULE_SFRSET_t; // CCP INSTANCE SPECIAL FUNCTION REGISTER SET
140 
141  // CCPx SFR set instance offset
142  #define P33C_CCPGEN_SFR_OFFSET ((volatile uint16_t)&CCP2CON1L - (volatile uint16_t)&CCP1CON1L)
143 
144 #endif
145 
146 /* GLOBAL FUNCTION CALL PROTOTYPES */
147 
148 extern volatile struct P33C_CCP_INSTANCE_SFRSET_s* p33c_CcpInstance_GetHandle(volatile uint16_t ccpInstance);
149 extern volatile struct P33C_CCP_INSTANCE_SFRSET_s p33c_CcpInstance_ConfigRead(volatile uint16_t ccpInstance);
150 extern volatile uint16_t p33c_CcpInstance_ConfigWrite(
151  volatile uint16_t ccpInstance,
152  volatile struct P33C_CCP_INSTANCE_SFRSET_s ccpConfig
153  );
154 
155 
156 #endif /* P33C_CCP_SFR_ABSTRACTION_H */
157 // END OF FILE
P33C_CCP_INSTANCE_SFRSET_s::CCPxCON2H
union P33C_CCP_INSTANCE_SFRSET_s::@3 CCPxCON2H
P33C_CCP_INSTANCE_SFRSET_s::CCPRBL
uint16_t CCPRBL
Definition: p33c_ccp.h:117
P33C_CCP_INSTANCE_SFRSET_s::bits
struct tagCCP1CON1LBITS bits
Definition: p33c_ccp.h:36
P33C_CCP_INSTANCE_SFRSET_s::CCPTMRL
uint16_t CCPTMRL
Definition: p33c_ccp.h:78
P33C_CCP_INSTANCE_SFRSET_s::unsigned
volatile unsigned
Definition: p33c_ccp.h:61
P33C_CCP_INSTANCE_SFRSET_s::CCPxPRH
union P33C_CCP_INSTANCE_SFRSET_s::@9 CCPxPRH
P33C_CCP_INSTANCE_SFRSET_s::value
uint16_t value
Definition: p33c_ccp.h:37
P33C_CCP_INSTANCE_SFRSET_s::CCPxCON1H
union P33C_CCP_INSTANCE_SFRSET_s::@1 CCPxCON1H
P33C_CCP_INSTANCE_SFRSET_s::CCPBUFH
uint16_t CCPBUFH
Definition: p33c_ccp.h:134
P33C_CCP_INSTANCE_SFRSET_s::CCPBUFL
uint16_t CCPBUFL
Definition: p33c_ccp.h:127
P33C_CCP_INSTANCE_SFRSET_s::CCPxBUFL
union P33C_CCP_INSTANCE_SFRSET_s::@12 CCPxBUFL
P33C_CCP_INSTANCE_SFRSET_s::CCPxRBL
union P33C_CCP_INSTANCE_SFRSET_s::@11 CCPxRBL
p33c_CcpInstance_GetHandle
volatile struct P33C_CCP_INSTANCE_SFRSET_s * p33c_CcpInstance_GetHandle(volatile uint16_t ccpInstance)
Gets pointer to CCP instance SFR set.
Definition: p33c_ccp.c:60
P33C_CCP_INSTANCE_SFRSET_s::CCPxBUFH
union P33C_CCP_INSTANCE_SFRSET_s::@13 CCPxBUFH
P33C_CCP_INSTANCE_SFRSET_s::CCPxCON1L
union P33C_CCP_INSTANCE_SFRSET_s::@0 CCPxCON1L
P33C_CCP_INSTANCE_SFRSET_s::CCPPRL
uint16_t CCPPRL
Definition: p33c_ccp.h:93
P33C_CCP_INSTANCE_SFRSET_s::CCPxPRL
union P33C_CCP_INSTANCE_SFRSET_s::@8 CCPxPRL
P33C_CCP_INSTANCE_SFRSET_s::CCPxCON3H
union P33C_CCP_INSTANCE_SFRSET_s::@4 CCPxCON3H
P33C_CCP_INSTANCE_SFRSET_s::CCPxRAL
union P33C_CCP_INSTANCE_SFRSET_s::@10 CCPxRAL
P33C_CCP_INSTANCE_SFRSET_s::CCPPRH
uint16_t CCPPRH
Definition: p33c_ccp.h:101
P33C_CCP_INSTANCE_SFRSET_s
Definition: p33c_ccp.h:33
P33C_CCP_INSTANCE_SFRSET_s::CCPxTMRH
union P33C_CCP_INSTANCE_SFRSET_s::@7 CCPxTMRH
p33c_CcpInstance_ConfigWrite
volatile uint16_t p33c_CcpInstance_ConfigWrite(volatile uint16_t ccpInstance, volatile struct P33C_CCP_INSTANCE_SFRSET_s ccpConfig)
Writes a user-defined configuration to the CCP instance registers.
Definition: p33c_ccp.c:116
P33C_CCP_INSTANCE_SFRSET_s::CCPRAL
uint16_t CCPRAL
Definition: p33c_ccp.h:108
P33C_CCP_INSTANCE_SFRSET_s::CCPxCON2L
union P33C_CCP_INSTANCE_SFRSET_s::@2 CCPxCON2L
p33c_CcpInstance_ConfigRead
volatile struct P33C_CCP_INSTANCE_SFRSET_s p33c_CcpInstance_ConfigRead(volatile uint16_t ccpInstance)
Read the current configuration from the CCP instance registers.
Definition: p33c_ccp.c:86
P33C_CCP_INSTANCE_SFRSET_s::CCPxTMRL
union P33C_CCP_INSTANCE_SFRSET_s::@6 CCPxTMRL
P33C_CCP_INSTANCE_SFRSET_s::CCPTMRH
uint16_t CCPTMRH
Definition: p33c_ccp.h:86
P33C_CCP_INSTANCE_SFRSET_s::CCPxSTATL
union P33C_CCP_INSTANCE_SFRSET_s::@5 CCPxSTATL