| Digital Power Starter Kit 3 Firmware dsPIC33C Boost Converter Voltage Mode Control Example |

p33c_pmd.h
1 /*************************************************************************************************
2 * @file p33c_pmd.h
3 * @author I62419
4 * @date Created on October 12, 2020, 5:41 PM
5 ************************************************************************************************/
6
7 /*************************************************************************************************
8 * @brief Generic Peripheral Module Disable Module Access (header file)
9 * @details
10 * This additional header file contains defines for all required bit-settings of all related
11 * special function registers of a peripheral module and/or instance.
12 * This file is an additional header file on top of the generic device header file.
13 ************************************************************************************************/
14
15 #ifndef P33C_PMD_SFR_ABSTRACTION_H
16 #define P33C_PMD_SFR_ABSTRACTION_H
17
18 #include <xc.h> // include processor files - each processor file is guarded.
19 #include <stdint.h> // include standard integer data types
20 #include <stdbool.h> // include standard boolean data types
21 #include <stddef.h> // include standard definition data types
22
23 #ifndef P33C_PMD_MODULE_s
24
25 /***********************************************************************************
26 * @ingroup lib-layer-pral-properties-public-pmd
27 * @struct P33C_PMD_INSTANCE_SFRSET_s
28 * @brief Abstracted set of Peripheral Module Disable Special Function Registers
29 * @details
30 * This structure defines an abstracted set of Special Function Registers of the
31 * Peripheral Module Disable module. Users can use this abstracted set of registers
32 * to capture register settings from or write generic register settings to the PMD
33 * module.
34 *
35 **********************************************************************************/
36
37 struct P33C_PMD_MODULE_s {
38
39 #ifdef PMDCON
40 union {
41 struct tagPMDCONBITS bits; // Register bit-field
42 uint16_t value; // 16-bit wide register value
43 } pmdcon; // PMDCON: PERIPHERAL MODULE DISABLE CONTROL REGISTER
44 #else
45 unsigned : 16; // reserved/unused memory space
46 #endif
47
48 unsigned : 16; // reserved/unused memory space
49
50 #ifdef PMD1
51 union {
52 struct tagPMD1BITS bits; // Register bit-field
53 uint16_t value; // 16-bit wide register value
54 } pmd1; // PMD1: PERIPHERAL MODULE DISABLE 1 CONTROL REGISTER LOW
55 #else
56 unsigned : 16; // reserved/unused memory space
57 #endif
58
59 #ifdef PMD2
60 union {
61 struct tagPMD2BITS bits; // Register bit-field
62 uint16_t value; // 16-bit wide register value
63 } pmd2; // PMD2: PERIPHERAL MODULE DISABLE 2 CONTROL REGISTER LOW
64 #else
65 unsigned : 16; // reserved/unused memory space
66 #endif
67
68 #ifdef PMD3
69 union {
70 struct tagPMD3BITS bits; // Register bit-field
71 uint16_t value; // 16-bit wide register value
72 } pmd3; // PMD2: PERIPHERAL MODULE DISABLE 3 CONTROL REGISTER LOW
73 #else
74 unsigned : 16; // reserved/unused memory space
75 #endif
76
77 #ifdef PMD4
78 union {
79 struct tagPMD4BITS bits; // Register bit-field
80 uint16_t value; // 16-bit wide register value
81 } pmd4; // PMD4: PERIPHERAL MODULE DISABLE 4 CONTROL REGISTER LOW
82 #else
83 unsigned : 16; // reserved/unused memory space
84 #endif
85
86 #ifdef PMD5
87 union {
88 struct tagPMD5BITS bits; // Register bit-field
89 uint16_t value; // 16-bit wide register value
90 } pmd5; // PMD2: PERIPHERAL MODULE DISABLE 5 CONTROL REGISTER LOW
91 #else
92 unsigned : 16; // reserved/unused memory space
93 #endif
94
95 #ifdef PMD6
96 union {
97 struct tagPMD6BITS bits; // Register bit-field
98 uint16_t value; // 16-bit wide register value
99 } pmd6; // PMD2: PERIPHERAL MODULE DISABLE 6 CONTROL REGISTER LOW
100 #else
101 unsigned : 16; // reserved/unused memory space
102 #endif
103
104 #ifdef PMD7
105 union {
106 struct tagPMD7BITS bits; // Register bit-field
107 uint16_t value; // 16-bit wide register value
108 } pmd7; // PMD2: PERIPHERAL MODULE DISABLE 7 CONTROL REGISTER LOW
109 #else
110 unsigned : 16; // reserved/unused memory space
111 #endif
112
113 #ifdef PMD8
114 union {
115 struct tagPMD8BITS bits; // Register bit-field
116 uint16_t value; // 16-bit wide register value
117 } pmd8; // PMD2: PERIPHERAL MODULE DISABLE 8 CONTROL REGISTER LOW
118 #else
119 unsigned : 16; // reserved/unused memory space
120 #endif
121
122 #ifdef PMD9
123 union {
124 struct tagPMD9BITS bits; // Register bit-field
125 uint16_t value; // 16-bit wide register value
126 } pmd9; // PMD2: PERIPHERAL MODULE DISABLE 9 CONTROL REGISTER LOW
127 #else
128 unsigned : 16; // reserved/unused memory space
129 #endif
130
131 } __attribute__((packed));
132
133 typedef struct P33C_PMD_MODULE_s P33C_PMD_MODULE_t;
134
135
136 /*********************************************************************************
137 * @def p33c_Pmd_GetHandle()
138 * @ingroup lib-layer-pral-functions-public-pmd
139 * @brief Gets pointer to Peripheral Module Disable SFR set
140 * @return Pointer to Peripheral Module Disable special function register data object of type struct P33C_PMD_INSTANCE_s
141 *
142 * @details
143 * This macro returns the pointer to the Peripheral Module Disable
144 * Special Function Register memory space. This pointer can be used to
145 * directly write to/read from the Special Function Registers of the
146 * Peripheral Module Disable configuration.
147 *
148 *********************************************************************************/
149 #define p33c_Pmd_GetHandle() (struct P33C_PMD_MODULE_s*)&PMD1
150
151
152 #endif /* P33C_PMD_MODULE_s */
153
154 /* GLOBAL DATA OBJECTS */
155 extern volatile struct P33C_PMD_MODULE_s pmdConfigDefault;
156
157 /* GLOBAL FUNCTION CALL PROTOTYPES */
158 extern volatile struct P33C_PMD_MODULE_s p33c_Pmd_ConfigRead(void);
159 extern volatile uint16_t p33c_Pmd_ConfigWrite(volatile struct P33C_PMD_MODULE_s ccpConfig);
160
161 #endif /* P33C_PMD_SFR_ABSTRACTION_H */
162
163 // end of file
P33C_PMD_MODULE_s
Definition: p33c_pmd.h:37