@mchp-mcc/scf-pic8-opamp-v2 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,353 @@
1
+ /**
2
+ * ${moduleNameUpperCase} Generated Driver API Header File
3
+ *
4
+ * @file ${moduleNameLowerCase}.h
5
+ *
6
+ * @defgroup ${moduleNameLowerCase} ${moduleNameUpperCase}
7
+ *
8
+ * @brief This is the generated header file for the ${moduleNameUpperCase} driver.
9
+ *
10
+ * @version ${moduleNameUpperCase} Driver Version 1.0.0
11
+ */
12
+ ${disclaimer}
13
+
14
+ #ifndef ${moduleNameUpperCase}_H
15
+ #define ${moduleNameUpperCase}_H
16
+
17
+ /**
18
+ Section: Included Files
19
+ */
20
+ #include <stdint.h>
21
+ #include <stdbool.h>
22
+
23
+ /**
24
+ * @ingroup ${moduleNameLowerCase}
25
+ * @brief This macro defines the Custom Name for \ref ${moduleNameUpperCase}_Initialize API
26
+ */
27
+ #define ${componentName}_Initialize ${moduleNameUpperCase}_Initialize
28
+
29
+ /**
30
+ * @ingroup ${moduleNameLowerCase}
31
+ * @brief This macro defines the Custom Name for \ref ${moduleNameUpperCase}_EnableChargePump API
32
+ */
33
+ #define ${componentName}_EnableChargePump ${moduleNameUpperCase}_EnableChargePump
34
+
35
+ /**
36
+ * @ingroup ${moduleNameLowerCase}
37
+ * @brief This macro defines the Custom Name for \ref ${moduleNameUpperCase}_DisableChargePump API
38
+ */
39
+ #define ${componentName}_DisableChargePump ${moduleNameUpperCase}_DisableChargePump
40
+
41
+ /**
42
+ * @ingroup ${moduleNameLowerCase}
43
+ * @brief This macro defines the Custom Name for \ref ${moduleNameUpperCase}_EnableSoftwareUnityGain API
44
+ */
45
+ #define ${componentName}_EnableSoftwareUnityGain ${moduleNameUpperCase}_EnableSoftwareUnityGain
46
+
47
+ /**
48
+ * @ingroup ${moduleNameLowerCase}
49
+ * @brief This macro defines the Custom Name for \ref ${moduleNameUpperCase}_DisableSoftwareUnityGain API
50
+ */
51
+ #define ${componentName}_DisableSoftwareUnityGain ${moduleNameUpperCase}_DisableSoftwareUnityGain
52
+
53
+ /**
54
+ * @ingroup ${moduleNameLowerCase}
55
+ * @brief This macro defines the Custom Name for \ref ${moduleNameUpperCase}_SetPositiveChannel API
56
+ */
57
+ #define ${componentName}_SetPositiveChannel ${moduleNameUpperCase}_SetPositiveChannel
58
+
59
+ /**
60
+ * @ingroup ${moduleNameLowerCase}
61
+ * @brief This macro defines the Custom Name for \ref ${moduleNameUpperCase}_SetPositiveSource API
62
+ */
63
+ #define ${componentName}_SetPositiveSource ${moduleNameUpperCase}_SetPositiveSource
64
+
65
+ /**
66
+ * @ingroup ${moduleNameLowerCase}
67
+ * @brief This macro defines the Custom Name for \ref ${moduleNameUpperCase}_SetNegativeChannel API
68
+ */
69
+ #define ${componentName}_SetNegativeChannel ${moduleNameUpperCase}_SetNegativeChannel
70
+
71
+ /**
72
+ * @ingroup ${moduleNameLowerCase}
73
+ * @brief This macro defines the Custom Name for \ref ${moduleNameUpperCase}_SetNegativeSource API
74
+ */
75
+ #define ${componentName}_SetNegativeSource ${moduleNameUpperCase}_SetNegativeSource
76
+
77
+ /**
78
+ * @ingroup ${moduleNameLowerCase}
79
+ * @brief This macro defines the Custom Name for \ref ${moduleNameUpperCase}_SetResistorLadder API
80
+ */
81
+ #define ${componentName}_SetResistorLadder ${moduleNameUpperCase}_SetResistorLadder
82
+
83
+ /**
84
+ * @ingroup ${moduleNameLowerCase}
85
+ * @brief This macro defines the Custom Name for \ref ${moduleNameUpperCase}_EnableHardwareOverride API
86
+ */
87
+ #define ${componentName}_EnableHardwareOverride ${moduleNameUpperCase}_EnableHardwareOverride
88
+
89
+ /**
90
+ * @ingroup ${moduleNameLowerCase}
91
+ * @brief This macro defines the Custom Name for \ref ${moduleNameUpperCase}_SetHardwareOverrideSource API
92
+ */
93
+ #define ${componentName}_SetHardwareOverrideSource ${moduleNameUpperCase}_SetHardwareOverrideSource
94
+
95
+ /**
96
+ * @ingroup ${moduleNameLowerCase}
97
+ * @brief This macro defines the Custom Name for \ref ${moduleNameUpperCase}_DisableHardwareOverride API
98
+ */
99
+ #define ${componentName}_DisableHardwareOverride ${moduleNameUpperCase}_DisableHardwareOverride
100
+
101
+ /**
102
+ * @ingroup ${moduleNameLowerCase}
103
+ * @brief This macro defines the Custom Name for \ref ${moduleNameUpperCase}_ManualInputOffsetCalibration API
104
+ */
105
+ #define ${componentName}_ManualInputOffsetCalibration ${moduleNameUpperCase}_ManualInputOffsetCalibration
106
+
107
+ /**
108
+ * @ingroup ${moduleNameLowerCase}
109
+ * @brief This macro defines the Custom Name for \ref ${moduleNameUpperCase}_StartAutomaticOffsetCalibration API
110
+ */
111
+ #define ${componentName}_StartAutomaticOffsetCalibration ${moduleNameUpperCase}_StartAutomaticOffsetCalibration
112
+
113
+ /**
114
+ * @ingroup ${moduleNameLowerCase}
115
+ * @brief This macro defines the Custom Name for \ref ${moduleNameUpperCase}_isAutomaticOffsetCalibrationDone API
116
+ */
117
+ #define ${componentName}_isAutomaticOffsetCalibrationDone ${moduleNameUpperCase}_isAutomaticOffsetCalibrationDone
118
+
119
+ /**
120
+ * @ingroup ${moduleNameLowerCase}
121
+ * @brief This macro defines the Custom Name for \ref ${moduleNameUpperCase}_StartPeakTroughReset API
122
+ */
123
+ #define ${componentName}_StartPeakTroughReset ${moduleNameUpperCase}_StartPeakTroughReset
124
+
125
+ /**
126
+ * @ingroup ${moduleNameLowerCase}
127
+ * @brief This macro defines the Custom Name for \ref ${moduleNameUpperCase}_StopPeakTroughReset API
128
+ */
129
+ #define ${componentName}_StopPeakTroughReset ${moduleNameUpperCase}_StopPeakTroughReset
130
+
131
+ /**
132
+ * @ingroup ${moduleNameLowerCase}
133
+ * @enum ${moduleNameUpperCase}_resistor_select
134
+ * @brief Enumeration of R2/R1 resistor ratio
135
+ */
136
+ typedef enum
137
+ {
138
+ ${moduleNameUpperCase}_R2byR1_is_0dp07, /**<R2/R1 = 0.07*/
139
+ ${moduleNameUpperCase}_R2byR1_is_0dp14, /**<R2/R1 = 0.14*/
140
+ ${moduleNameUpperCase}_R2byR1_is_0dp33, /**<R2/R1 = 0.33*/
141
+ ${moduleNameUpperCase}_R2byR1_is_1, /**<R2/R1 = 1*/
142
+ ${moduleNameUpperCase}_R2byR1_is_1dp67, /**<R2/R1 = 1.67*/
143
+ ${moduleNameUpperCase}_R2byR1_is_3, /**<R2/R1 = 3*/
144
+ ${moduleNameUpperCase}_R2byR1_is_7, /**<R2/R1 = 7*/
145
+ ${moduleNameUpperCase}_R2byR1_is_15 /**<R2/R1 = 15*/
146
+ } ${moduleNameUpperCase}_resistor_select;
147
+
148
+ /**
149
+ * @ingroup ${moduleNameLowerCase}
150
+ * @enum ${moduleNameUpperCase}_posChannel_select
151
+ * @brief Enumeration of available Positive Channels
152
+ */
153
+ typedef enum
154
+ {
155
+ ${moduleNameUpperCase}_posChannel_Vss = 0x0,
156
+ ${moduleNameUpperCase}_posChannel_GSEL = 0x1,
157
+ ${moduleNameUpperCase}_posChannel_${moduleInstance}IN = 0x2,
158
+ ${moduleNameUpperCase}_posChannel_Vdd_by_2 = 0x3,
159
+ ${moduleNameUpperCase}_posChannel_DAC1 = 0x4,
160
+ ${moduleNameUpperCase}_posChannel_DAC2 = 0x5,
161
+ ${moduleNameUpperCase}_posChannel_DAC3 = 0x6
162
+ } ${moduleNameUpperCase}_posChannel_select;
163
+
164
+ /**
165
+ * @ingroup ${moduleNameLowerCase}
166
+ * @enum ${moduleNameUpperCase}_posSource_select
167
+ * @brief Enumeration of available Positive Sources
168
+ */
169
+ typedef enum
170
+ {
171
+ <#list posSources as source>
172
+ ${moduleNameUpperCase}_${source.name} = ${source.value}<#if source_has_next>,</#if>
173
+ </#list>
174
+ } ${moduleNameUpperCase}_posSource_select;
175
+
176
+ /**
177
+ * @ingroup ${moduleNameLowerCase}
178
+ * @enum ${moduleNameUpperCase}_negChannel_select
179
+ * @brief Enumeration of available Negative Channels
180
+ */
181
+ typedef enum
182
+ {
183
+ ${moduleNameUpperCase}_negChannel_No_Connection = 0x0,
184
+ ${moduleNameUpperCase}_negChannel_GSEL = 0x1,
185
+ ${moduleNameUpperCase}_negChannel_${moduleInstance}IN = 0x2,
186
+ ${moduleNameUpperCase}_negChannel_DAC1 = 0x4,
187
+ ${moduleNameUpperCase}_negChannel_DAC2 = 0x5,
188
+ ${moduleNameUpperCase}_negChannel_DAC3 = 0x6
189
+ } ${moduleNameUpperCase}_negChannel_select;
190
+
191
+ /**
192
+ * @ingroup ${moduleNameLowerCase}
193
+ * @enum ${moduleNameUpperCase}_negSource_select
194
+ * @brief Enumeration of available Negative Sources
195
+ */
196
+ typedef enum
197
+ {
198
+ <#list negSources as source>
199
+ ${moduleNameUpperCase}_${source.name} = ${source.value}<#if source_has_next>,</#if>
200
+ </#list>
201
+ } ${moduleNameUpperCase}_negSource_select;
202
+
203
+ /**
204
+ * @ingroup ${moduleNameLowerCase}
205
+ * @brief This routine initializes the ${moduleNameUpperCase} and must be called before any other ${moduleNameUpperCase} routine is called.
206
+ * This routine should only be called once during system initialization.
207
+ * @param None
208
+ * @return None
209
+ */
210
+ void ${moduleNameUpperCase}_Initialize(void);
211
+
212
+ /**
213
+ * @ingroup ${moduleNameLowerCase}
214
+ * @brief Enables the ${moduleNameUpperCase} Charge Pump
215
+ * @pre ${moduleNameLowerCase} should be initialized with ${moduleNameUpperCase}_Initialize() before calling this API.
216
+ * @param None
217
+ * @return None
218
+ */
219
+ inline void ${moduleNameUpperCase}_EnableChargePump(void);
220
+
221
+ /**
222
+ * @ingroup ${moduleNameLowerCase}
223
+ * @brief Disables the ${moduleNameUpperCase} Charge Pump
224
+ * @param None
225
+ * @return None
226
+ */
227
+ inline void ${moduleNameUpperCase}_DisableChargePump(void);
228
+
229
+ /**
230
+ * @ingroup ${moduleNameLowerCase}
231
+ * @brief Enables ${moduleNameUpperCase} to operate with unity gain
232
+ * @param None
233
+ * @return None
234
+ */
235
+ inline void ${moduleNameUpperCase}_EnableSoftwareUnityGain(void);
236
+
237
+ /**
238
+ * @ingroup ${moduleNameLowerCase}
239
+ * @brief Disables unity gain in ${moduleNameUpperCase}
240
+ * @param None
241
+ * @return None
242
+ */
243
+ inline void ${moduleNameUpperCase}_DisableSoftwareUnityGain(void);
244
+
245
+ /**
246
+ * @ingroup ${moduleNameLowerCase}
247
+ * @brief Sets the positive channel as per user selection
248
+ * @param Desired positive channel. For available positive channels refer ${moduleNameUpperCase}_posChannel_select enum from ${moduleNameLowerCase}.h file
249
+ * @return None
250
+ */
251
+ inline void ${moduleNameUpperCase}_SetPositiveChannel(${moduleNameUpperCase}_posChannel_select posChannel);
252
+
253
+ /**
254
+ * @ingroup ${moduleNameLowerCase}
255
+ * @brief Sets the positive source as per user selection
256
+ * @param Desired positive source. For available positive sources refer ${moduleNameUpperCase}_posSource_select enum from ${moduleNameLowerCase}.h file
257
+ * @return None
258
+ */
259
+ inline void ${moduleNameUpperCase}_SetPositiveSource(${moduleNameUpperCase}_posSource_select posSource);
260
+
261
+ /**
262
+ * @ingroup ${moduleNameLowerCase}
263
+ * @brief Sets the negative channel as per user selection
264
+ * @param Desired negative channel. For available negative channels refer ${moduleNameUpperCase}_negChannel_select enum from ${moduleNameLowerCase}.h file
265
+ * @return None
266
+ */
267
+ inline void ${moduleNameUpperCase}_SetNegativeChannel(${moduleNameUpperCase}_negChannel_select negChannel);
268
+
269
+ /**
270
+ * @ingroup ${moduleNameLowerCase}
271
+ * @brief Sets the negative source as per user selection
272
+ * @param Desired negative source. For available negative sources refer ${moduleNameUpperCase}_negSource_select enum from ${moduleNameLowerCase}.h file
273
+ * @return None
274
+ */
275
+ inline void ${moduleNameUpperCase}_SetNegativeSource(${moduleNameUpperCase}_negSource_select negSource);
276
+
277
+ /**
278
+ * @ingroup ${moduleNameLowerCase}
279
+ * @brief Sets the R1 and R2 values of internal resistor ladder as per user selection
280
+ * @param Desired resistor selection. For available resistor values refer ${moduleNameUpperCase}_resistor_sel enum from ${moduleNameLowerCase}.h file
281
+ * @return None
282
+ */
283
+ void ${moduleNameUpperCase}_SetResistorLadder(${moduleNameUpperCase}_resistor_select resistorSelection);
284
+
285
+ /**
286
+ * @ingroup ${moduleNameLowerCase}
287
+ * @brief Enables hardware override by setting the override enable bit
288
+ * @param None
289
+ * @return None
290
+ */
291
+ inline void ${moduleNameUpperCase}_EnableHardwareOverride(void);
292
+
293
+ /**
294
+ * @ingroup ${moduleNameLowerCase}
295
+ * @brief Selects the Hardware Override Source and polarity
296
+ * @pre The ${moduleNameUpperCase}_EnableHardwareOverride() routine must be called before this routine
297
+ * @param Desired hardware override source and source polarity
298
+ * @return None
299
+ */
300
+ void ${moduleNameUpperCase}_SetHardwareOverrideSource(uint8_t overrideSource, uint8_t polarity);
301
+
302
+ /**
303
+ * @ingroup ${moduleNameLowerCase}
304
+ * @brief Disables the hardware override by clearing the override enable bit
305
+ * @param None
306
+ * @return None
307
+ */
308
+ inline void ${moduleNameUpperCase}_DisableHardwareOverride(void);
309
+
310
+ /**
311
+ * @ingroup ${moduleNameLowerCase}
312
+ * @brief Sets the input offset calibration
313
+ * @param Desired input offset based on calibration
314
+ * @return None
315
+ */
316
+ inline void ${moduleNameUpperCase}_ManualInputOffsetCalibration(uint8_t offset);
317
+
318
+ /**
319
+ * @ingroup ${moduleNameLowerCase}
320
+ * @brief Starts the automatic input offset calibration
321
+ * @param None
322
+ * @return None
323
+ */
324
+ void ${moduleNameUpperCase}_StartAutomaticOffsetCalibration(void);
325
+
326
+ /**
327
+ * @ingroup ${moduleNameLowerCase}
328
+ * @brief Checks if the automatic input offset calibration has been completed
329
+ * @pre The ${moduleNameUpperCase}_StartAutomaticOffsetCalibration() routine must be called before this routine
330
+ * @param None
331
+ * @return true or false
332
+ */
333
+ inline bool ${moduleNameUpperCase}_isAutomaticOffsetCalibrationDone(void);
334
+
335
+ /**
336
+ * @ingroup ${moduleNameLowerCase}
337
+ * @brief Initiate peak or trough reset
338
+ * @pre The hardware control configuration registers must be set appropriately
339
+ * @param None
340
+ * @return None
341
+ */
342
+ inline void ${moduleNameUpperCase}_StartPeakTroughReset(void);
343
+
344
+ /**
345
+ * @ingroup ${moduleNameLowerCase}
346
+ * @brief Stop peak or trough reset
347
+ * @pre The hardware control configuration registers must be set appropriately
348
+ * @param None
349
+ * @return None
350
+ */
351
+ inline void ${moduleNameUpperCase}_StopPeakTroughReset(void);
352
+
353
+ #endif //${moduleNameUpperCase}_H
@@ -0,0 +1,43 @@
1
+ {
2
+ "payload": null,
3
+ "imports": {
4
+ "scf_pic8_opamp_v2": {
5
+ "interfaceId": {
6
+ "name": "scf-pic8-opamp-v2",
7
+ "version": "1.0.0"
8
+ },
9
+ "isRequired": true
10
+ },
11
+ "initializer_system": {
12
+ "interfaceId": {
13
+ "name": "initializer-system",
14
+ "version": "^0"
15
+ }
16
+ },
17
+ "pin_standard": {
18
+ "interfaceId": {
19
+ "name": "pin-standard",
20
+ "version": "^0"
21
+ }
22
+ },
23
+ "device_meta": {
24
+ "interfaceId": {
25
+ "name": "device-meta",
26
+ "version": "^1.0.0"
27
+ }
28
+ }
29
+ },
30
+ "exports": {
31
+ "opa": {
32
+ "interfaces": [
33
+ {
34
+ "interfaceId": {
35
+ "name": "opa-output-parameters",
36
+ "version": "1.0.0"
37
+ }
38
+ }
39
+ ]
40
+ }
41
+ },
42
+ "isEntryPoint": true
43
+ }