24 #ifndef MCAL_P33SMPS_HSADC_H
25 #define MCAL_P33SMPS_HSADC_H
32 #include "p33smps_devices.h"
36 #if defined (__P33SMPS_CH__) || defined (__P33SMPS_CK__)
50 #if defined (__P33SMPS_CH202__) || defined (__P33SMPS_CH202S1__) || \
51 defined (__P33SMPS_CH502__) || defined (__P33SMPS_CH502S1__)
53 #if defined (__P33SMPS_CH_MSTR__)
55 #define ADC_CORE_COUNT 1 // Number of ADC Cores available
56 #define ADC_ANINPUT_COUNT 12 // Number of analog inputs
57 #define ADC_SHARED_CORE_INDEX (ADC_CORE_COUNT - 1) // Arteficially assigned index for shared ADC core
59 #define REG_ADC_CHANNEL_L_MSK 0b0000111111111111
60 #define REG_ADC_CHANNEL_H_MSK 0b0000000000000000
62 #elif defined (__P33SMPS_CH_SLV1__)
64 #define ADC_CORE_COUNT 3 // Number of ADC Cores available
65 #define ADC_ANINPUT_COUNT 11 // Number of analog inputs
66 #define ADC_SHARED_CORE_INDEX (ADC_CORE_COUNT - 1) // Arteficially assigned index for shared ADC core
68 #define REG_ADC_CHANNEL_L_MSK 0b0000011111111111
69 #define REG_ADC_CHANNEL_H_MSK 0b0000000000000000
73 #elif defined (__P33SMPS_CH203__) || defined (__P33SMPS_CH205__) || \
74 defined (__P33SMPS_CH203S1__) || defined (__P33SMPS_CH205S1__) || \
75 defined (__P33SMPS_CH503__) || defined (__P33SMPS_CH505__) || \
76 defined (__P33SMPS_CH503S1__) || defined (__P33SMPS_CH505S1__)
78 #if defined (__P33SMPS_CH_MSTR__)
80 #define ADC_CORE_COUNT 1 // Number of ADC Cores available
81 #define ADC_ANINPUT_COUNT 16 // Number of analog inputs
82 #define ADC_SHARED_CORE_INDEX (ADC_CORE_COUNT - 1) // Arteficially assigned index for shared ADC core
84 #define REG_ADC_CHANNEL_L_MSK 0b1111111111111111
85 #define REG_ADC_CHANNEL_H_MSK 0b0000000000000000
87 #elif defined (__P33SMPS_CH_SLV1__)
89 #define ADC_CORE_COUNT 3 // Number of ADC Cores available
90 #define ADC_ANINPUT_COUNT 15 // Number of analog inputs
91 #define ADC_SHARED_CORE_INDEX (ADC_CORE_COUNT - 1) // Arteficially assigned index for shared ADC core
93 #define REG_ADC_CHANNEL_L_MSK 0b0111111111111111
94 #define REG_ADC_CHANNEL_H_MSK 0b0000000000000000
98 #elif defined (__P33SMPS_CH206__) || defined (__P33SMPS_CH208__) || \
99 defined (__P33SMPS_CH206S1__) || defined (__P33SMPS_CH208S1__) || \
100 defined (__P33SMPS_CH506__) || defined (__P33SMPS_CH508__) || \
101 defined (__P33SMPS_CH506S1__) || defined (__P33SMPS_CH508S1__)
103 #if defined (__P33SMPS_CH_MSTR__)
105 #define ADC_CORE_COUNT 1 // Number of ADC Cores available
106 #define ADC_ANINPUT_COUNT 16 // Number of analog inputs
107 #define ADC_SHARED_CORE_INDEX (ADC_CORE_COUNT - 1) // Arteficially assigned index for shared ADC core
109 #define ADC_ADCMP_COUNT 4 // Number of ADC Digital Comparators
110 #define ADC_ADFL_COUNT 4 // Number of ADC Digital Filters
112 #define REG_ADC_CHANNEL_L_MSK 0b1111111111111111
113 #define REG_ADC_CHANNEL_H_MSK 0b0000000000000000
115 #elif defined (__P33SMPS_CH_SLV1__)
117 #define ADC_CORE_COUNT 3 // Number of ADC Cores available
118 #define ADC_ANINPUT_COUNT 18 // Number of analog inputs
119 #define ADC_SHARED_CORE_INDEX (ADC_CORE_COUNT - 1) // Arteficially assigned index for shared ADC core
121 #define ADC_ADCMP_COUNT 4 // Number of ADC Digital Comparators
122 #define ADC_ADFL_COUNT 4 // Number of ADC Digital Filters
124 #define REG_ADC_CHANNEL_L_MSK 0b1111111111111111
125 #define REG_ADC_CHANNEL_H_MSK 0b0000000000000011
129 #elif defined (__MA330048_dsPIC33CK_DPPIM__)
131 #define ADC_CORE_COUNT 3 // Number of ADC Cores available
132 #define ADC_SHARED_CORE_INDEX (uint16_t)(ADC_CORE_COUNT - 1) // Arteficially assigned index for shared ADC core
134 #define ADC_ADCMP_COUNT 4 // Number of ADC Digital Comparators
135 #define ADC_ADFL_COUNT 4 // Number of ADC Digital Filters
137 #if defined (__P33SMPS_CK202__) || defined (__P33SMPS_CK502__)
138 #define ADC_ANINPUT_COUNT 12 // Number of analog inputs without alternative or internal ports
139 #define REG_ADC_CHANNEL_L_MSK 0b0000111111111111
140 #define REG_ADC_CHANNEL_H_MSK 0b0000001100000000
141 #elif defined (__P33SMPS_CK203__) || defined (__P33SMPS_CK503__)
142 #define ADC_ANINPUT_COUNT 16 // Number of analog inputs without alternative or internal ports
143 #define REG_ADC_CHANNEL_L_MSK 0b1111111111111111
144 #define REG_ADC_CHANNEL_H_MSK 0b0000001100000000
145 #elif defined (__P33SMPS_CK205__) || defined (__P33SMPS_CK505__)
146 #define ADC_ANINPUT_COUNT 19 // Number of analog inputs without alternative or internal ports
147 #define REG_ADC_CHANNEL_L_MSK 0b1111111111111111
148 #define REG_ADC_CHANNEL_H_MSK 0b0000001100000111
149 #elif defined (__P33SMPS_CK206__) || defined (__P33SMPS_CK506__)
150 #define ADC_ANINPUT_COUNT 20 // Number of analog inputs without alternative or internal ports
151 #define REG_ADC_CHANNEL_L_MSK 0b1111111111111111
152 #define REG_ADC_CHANNEL_H_MSK 0b0000001100001111
153 #elif defined (__P33SMPS_CK208__) || defined (__P33SMPS_CK508__)
154 #define ADC_ANINPUT_COUNT 24 // Number of analog inputs without alternative or internal ports
155 #define REG_ADC_CHANNEL_L_MSK 0b1111111111111111
156 #define REG_ADC_CHANNEL_H_MSK 0b0000001111111111
162 #define ADC_CORE_ANA0 0 // ADC input is assigned to dedicated ADC core (#0) => Alternative input to ADC Core #0
163 #define ADC_CORE_ANA1 1 // ADC input is assigned to dedicated ADC core (#1) => Alternative input to ADC Core #1
165 #define ADC_CORE_AN24 2 // ADC input is assigned to shared ADC core (#2) => Temperature Sensor
166 #define ADC_CORE_AN25 2 // ADC input is assigned to shared ADC core (#2) => Bandgap Reference
168 #define ADC_CORE_AN0 0 // ADC input is assigned to dedicated ADC core (#0)
169 #define ADC_CORE_AN1 1 // ADC input is assigned to dedicated ADC core (#1)
170 #define ADC_CORE_AN2 2 // ADC input is assigned to shared ADC core (#2)
171 #define ADC_CORE_AN3 2 // ADC input is assigned to shared ADC core (#3)
172 #define ADC_CORE_AN4 2 // ADC input is assigned to shared ADC core (#4)
173 #define ADC_CORE_AN5 2 // ADC input is assigned to shared ADC core (#5)
174 #define ADC_CORE_AN6 2 // ADC input is assigned to shared ADC core (#6)
175 #define ADC_CORE_AN7 2 // ADC input is assigned to shared ADC core (#7)
176 #define ADC_CORE_AN8 2 // ADC input is assigned to shared ADC core (#8)
177 #define ADC_CORE_AN9 2 // ADC input is assigned to shared ADC core (#9)
178 #define ADC_CORE_AN10 2 // ADC input is assigned to shared ADC core (#10)
179 #define ADC_CORE_AN11 2 // ADC input is assigned to shared ADC core (#11)
182 #if defined (__P33SMPS_CK203__) || defined (__P33SMPS_CK503__) || \
183 defined (__P33SMPS_CK205__) || defined (__P33SMPS_CK505__) || \
184 defined (__P33SMPS_CK206__) || defined (__P33SMPS_CK506__) || \
185 defined (__P33SMPS_CK208__) || defined (__P33SMPS_CK508__)
187 #define ADC_CORE_AN12 2 // ADC input is assigned to shared ADC core (#12)
188 #define ADC_CORE_AN13 2 // ADC input is assigned to shared ADC core (#13)
189 #define ADC_CORE_AN14 2 // ADC input is assigned to shared ADC core (#14)
190 #define ADC_CORE_AN15 2 // ADC input is assigned to shared ADC core (#15)
193 #if defined (__P33SMPS_CK205__) || defined (__P33SMPS_CK505__) || \
194 defined (__P33SMPS_CK206__) || defined (__P33SMPS_CK506__) || \
195 defined (__P33SMPS_CK208__) || defined (__P33SMPS_CK508__)
197 #define ADC_CORE_AN16 2 // ADC input is assigned to shared ADC core (#16)
198 #define ADC_CORE_AN17 2 // ADC input is assigned to shared ADC core (#17)
199 #define ADC_CORE_AN18 2 // ADC input is assigned to shared ADC core (#19)
202 #if defined (__P33SMPS_CK206__) || defined (__P33SMPS_CK506__) || \
203 defined (__P33SMPS_CK208__) || defined (__P33SMPS_CK508__)
205 #define ADC_CORE_AN19 2 // ADC input is assigned to shared ADC core (#20)
208 #if defined (__P33SMPS_CK208__) || defined (__P33SMPS_CK508__)
210 #define ADC_CORE_AN20 2 // ADC input is assigned to shared ADC core (#21)
211 #define ADC_CORE_AN21 2 // ADC input is assigned to shared ADC core (#22)
212 #define ADC_CORE_AN22 2 // ADC input is assigned to shared ADC core (#23)
213 #define ADC_CORE_AN23 2 // ADC input is assigned to shared ADC core (#24)
231 #if defined (__P33SMPS_CK203__) || defined (__P33SMPS_CK503__) || \
232 defined (__P33SMPS_CK205__) || defined (__P33SMPS_CK505__) || \
233 defined (__P33SMPS_CK206__) || defined (__P33SMPS_CK506__) || \
234 defined (__P33SMPS_CK208__) || defined (__P33SMPS_CK508__)
241 #if defined (__P33SMPS_CK205__) || defined (__P33SMPS_CK505__) || \
242 defined (__P33SMPS_CK206__) || defined (__P33SMPS_CK506__) || \
243 defined (__P33SMPS_CK208__) || defined (__P33SMPS_CK508__)
249 #if defined (__P33SMPS_CK206__) || defined (__P33SMPS_CK506__) || \
250 defined (__P33SMPS_CK208__) || defined (__P33SMPS_CK508__)
254 #if defined (__P33SMPS_CK208__) || defined (__P33SMPS_CK508__)
267 #pragma message "=== selected device is not defined and may not be supported ==="
273 #define ADCON4_VALID_ADCORE_BIT_MSK (uint32_t)(ADCORE_REGISTER_BIT_MSK)
276 #if (ADC_CORE_COUNT > 1)
277 #define ADCORE_REGISTER_BIT_MSK ((uint32_t)(pow(2, (ADC_CORE_COUNT-1)) - 1) | 0x0080)
279 #define ADCORE_REGISTER_BIT_MSK ((uint32_t)0x0080) // only the shared core is present
283 #ifndef DEVICE_DEFAULT_AVDD
284 #define DEVICE_DEFAULT_AVDD 3.300 // if device VDD is not defined in this project, define it for standard value of 3.3V
287 #define ADC_VREF DEVICE_DEFAULT_AVDD // ADC reference voltage in [V]
288 #define ADC_RES_BIT 12.0 // ADC resolution in integer
289 #define ADC_RES (uint16_t)(pow(2, ADC_RES_BIT)-1) // ADC resolution in integer
290 #define ADC_SCALER (float)(((float)(ADC_RES))/((float)(ADC_VREF))) // ADC Scaling in ticks/V
291 #define ADC_GRANULARITY (float)(ADC_REF / pow(2.0, ADC_RES)) // ADC granularity in [V/tick]
293 #define ADC_ANx_INTERRUPT_ENABLE 1 // Bit setting for enabled interrupts of a dedicated analog input
294 #define ADC_ANx_INTERRUPT_DISABLE 0 // Bit setting for disabled interrupts of a dedicated analog input
296 #define ADC_ANx_EARLY_INTERRUPT_ENABLE 1 // Bit setting for enabled early interrupts of a dedicated analog input
297 #define ADC_ANx_EARLY_INTERRUPT_DISABLE 0 // Bit setting for disabled early interrupts of a dedicated analog input
300 #define ADC_OFF 0b0 // Flag is used to shut down the adc module
301 #define ADC_ON 0b1 // Flag is used to enable the adc module
305 #define REG_ADCON1_VALID_DATA_WRITE_MSK 0x00E0A000 // Bit mask used to set unimplemented bits to zero
306 #define REG_ADCON1_VALID_DATA_READ_MSK 0x00E0A000 // Bit mask used to read unimplemented bits as zero
307 #define REG_ADCON1_OFF_STATE_WRITE_MSK 0x00E02000 // Bit mask used to set unimplemented bits to zero
311 #define REG_ADCON1L_VALID_DATA_MSK 0b1010000000000000 // Bit mask used to set unimplemented bits to zero
312 #define REG_ADCON1L_DISABLED_MSK 0b0111111111111111
313 #define REG_ADCON1L_RESET 0b0000000000000000 // Reset ADCON 1 Low Register
317 #define REG_ADCON1H_RESET 0b0000000001100000 // Reset ADCON 1 High Register
318 #define REG_ADCON1H_VALID_DATA_MSK 0b0000000011100000 // Bit mask used to read unimplemented bits as zero
320 #define REG_ADCON1H_EXCLUDE_SHRADC_CFG_MSK 0b1111111110011111 // Bit mask used to read register settings without shared ADC core resolution
322 #define REG_ADCON1L_ADON_ENABLED 0b1000000000000000 // Turn ADC Module On
323 #define REG_ADCON1L_ADON_DISABLED 0b0000000000000000 // Turn ADC Module Off
326 ADCON1_ADON_ENABLED = 0b1,
327 ADCON1_ADON_DISABLED = 0b0
330 #define REG_ADCON1L_ADSIDL_STOP 0b0010000000000000 // Module Discontinues Operation in Idle Mode
331 #define REG_ADCON1L_ADSIDL_RUN 0b0000000000000000 // Module Continues Operation in Idle Mode
334 ADCON1_ADSIDL_STOP = 0b1,
335 ADCON1_ADSIDL_RUN = 0b0
341 #define REG_ADCON1H_FORM_FRACTIONAL 0b0000000010000000 // Result Number Format = Fractional
342 #define REG_ADCON1H_FORM_INTEGER 0b0000000000000000 // Result Number Format = Integer
345 ADCON1_FORM_FRACTIONAL = 0b1,
346 ADCON1_FORM_INTEGER = 0b0
349 #define REG_ADCON1H_SHRRES_12BIT 0b0000000001100000 // Set for 12-bit operation
350 #define REG_ADCON1H_SHRRES_10BIT 0b0000000001000000 // Set for 10-bit operation
351 #define REG_ADCON1H_SHRRES_8BIT 0b0000000000100000 // Set for 8-bit operation
352 #define REG_ADCON1H_SHRRES_6BIT 0b0000000000000000 // Set for 6-bit operation
355 ADCORE_RES_12BIT = 0b11,
356 ADCORE_RES_10BIT = 0b10,
357 ADCORE_RES_8BIT = 0b01,
358 ADCORE_RES_6BIT = 0b00
363 volatile unsigned : 13;
364 volatile ADCON1_ADSIDL_e adsidl : 1;
365 volatile unsigned : 1;
366 volatile ADCON1_ADON_e adon : 1;
367 } __attribute__((packed)) bits;
368 volatile uint16_t value;
374 volatile unsigned : 5;
375 volatile ADCOREx_RES_e shrres : 2;
376 volatile ADCON1_FORM_e form : 1;
377 volatile unsigned : 8;
378 } __attribute__((packed))bits;
379 volatile uint16_t value;
385 volatile ADCON1L_t adcon1l;
386 volatile ADCON1H_t adcon1h;
387 } __attribute__((packed))bits;
388 volatile uint32_t value;
393 #define REG_ADCON2_VALID_DATA_WRITE_MSK 0xC3FFDF7F // Bit mask used to set unimplemented bits to zero
394 #define REG_ADCON2_VALID_DATA_READ_MSK 0xC3FFDF7F // Bit mask used to set unimplemented bits to zero
399 #define REG_ADCON2L_RESET 0b0000000000000000 // Reset ADCON 2 Low Register
400 #define REG_ADCON2L_VALID_DATA_MSK 0b1101111101111111 // Bit mask used to set unimplemented bits to zero
402 #define REG_ADCON2L_SHRADC_CFG_MSK 0b0001011101111111 // Bit-Mask eliminating all bits not concerning the shared ADC core configuration
403 #define REG_ADCON2L_REF_CFG_MSK 0b1100000000000000 // Bit-Mask eliminating all bits not concerning the bandgap reference configuration
404 #define REG_ADCON2L_EXCLUDE_SHRADC_CFG_MSK 0b1111100010000000 // Bit-Mask eliminating all shared ADC core configuration bits
408 #define REG_ADCON2H_RESET 0b0000000000000000 // Reset ADCON 2 High Register
409 #define REG_ADCON2H_VALID_DATA_MSK 0b1100001111111111 // Bit mask used to set unimplemented bits to zero
411 #define REG_ADCON2H_SHRADC_CFG_MSK 0b0000001111111111 // Bit-Mask eliminating all bits not concerning the shared ADC core configuration
412 #define REG_ADCON2H_REF_CFG_MSK 0b1100000000000000 // Bit-Mask eliminating all bits not concerning the bandgap reference configuration
413 #define REG_ADCON2H_REF_STAT_READ_MSK 0b1100000000000000 // Bit-Mask for reading the bandgap reference status bits
414 #define REG_ADCON2H_EXCLUDE_SHRADC_CFG_MSK 0b1111110000000000 // Bit-Mask eliminating all shared ADC core configuration bits
417 #define REG_ADCON2L_REFCIE_ENABLED 0b1000000000000000 // Interrupt on Band Gap & Reference Voltage Ready
418 #define REG_ADCON2L_REFCIE_DISABLED 0b0000000000000000 // No Interrupt on Band Gap & Reference Voltage Ready
421 ADCON2_REFCIE_ENABLED = 0b1,
422 ADCON2_REFCIE_DISABLED = 0b0
425 #define REG_ADCON2L_REFERCIE_ENABLED 0b0100000000000000 // Interrupt on Band Gap or Reference Voltage Error
426 #define REG_ADCON2L_REFERCIE_DISABLED 0b0000000000000000 // No Interrupt on Band Gap or Reference Voltage Error
429 ADCON2_REFERCIE_ENABLED = 0b1,
430 ADCON2_REFERCIE_DISABLED = 0b0
433 #define REG_ADCON2L_EIEN_ENABLED 0b0001000000000000 // Early Interrupts Enabled
434 #define REG_ADCON2L_EIEN_DISABLED 0b0000000000000000 // Early Interrupts Disabled
437 ADCON2_EIEN_ENABLED = 0b1,
438 ADCON2_EIEN_DISABLED = 0b0
441 #define REG_ADCON2L_PTGEN_ENABLED 0b0001000000000000 // External Conversion Request Interface bit: PTG Access ON
442 #define REG_ADCON2L_PTGEN_DISABLED 0b0000000000000000 // External Conversion Request Interface bit: PTG Access OFF
445 ADCON2_PTGEN_ENABLED = 0b1,
446 ADCON2_PTGEN_DISABLED = 0b0
450 #define REG_ADCON2L_SHREISEL_8TAD 0b0000011100000000 // Early Interrupts 8 TADs before READY
451 #define REG_ADCON2L_SHREISEL_7TAD 0b0000011000000000 // Early Interrupts 7 TADs before READY
452 #define REG_ADCON2L_SHREISEL_6TAD 0b0000010100000000 // Early Interrupts 6 TADs before READY
453 #define REG_ADCON2L_SHREISEL_5TAD 0b0000010000000000 // Early Interrupts 5 TADs before READY
454 #define REG_ADCON2L_SHREISEL_4TAD 0b0000001100000000 // Early Interrupts 4 TADs before READY
455 #define REG_ADCON2L_SHREISEL_3TAD 0b0000001000000000 // Early Interrupts 3 TADs before READY
456 #define REG_ADCON2L_SHREISEL_2TAD 0b0000000100000000 // Early Interrupts 2 TADs before READY
457 #define REG_ADCON2L_SHREISEL_1TAD 0b0000000000000000 // Early Interrupts 1 TADs before READY
460 ADCORE_EISEL_8TAD = 0b111,
461 ADCORE_EISEL_7TAD = 0b110,
462 ADCORE_EISEL_6TAD = 0b101,
463 ADCORE_EISEL_5TAD = 0b100,
464 ADCORE_EISEL_4TAD = 0b011,
465 ADCORE_EISEL_3TAD = 0b010,
466 ADCORE_EISEL_2TAD = 0b001,
467 ADCORE_EISEL_1TAD = 0b000
470 #define REG_SHRADCS_MSK 0b0000000001111111 // Bit-Mask to filter on clock divider value bits
471 #define REG_SHRADCS(x) ((x >> 1) & REG_SHRADCS_MSK) // Shared ADC Core Input Clock Divider bits. (x indicates the effective divider ratio)
474 ADCORE_ADCS_DEFAULT = 0b0000000,
475 ADCORE_ADCS_DIV2 = 0b0000001,
476 ADCORE_ADCS_DIV4 = 0b0000010,
477 ADCORE_ADCS_DIV6 = 0b0000011,
478 ADCORE_ADCS_DIV8 = 0b0000100,
479 ADCORE_ADCS_DIV10 = 0b0000101,
480 ADCORE_ADCS_DIV12 = 0b0000110,
481 ADCORE_ADCS_DIV14 = 0b0000111,
482 ADCORE_ADCS_DIV16 = 0b0001000,
483 ADCORE_ADCS_DIV18 = 0b0001001,
484 ADCORE_ADCS_DIV20 = 0b0001010,
485 ADCORE_ADCS_DIV22 = 0b0001011,
486 ADCORE_ADCS_DIV24 = 0b0001100,
487 ADCORE_ADCS_DIV26 = 0b0001101,
488 ADCORE_ADCS_DIV28 = 0b0001110,
489 ADCORE_ADCS_DIV30 = 0b0001111,
490 ADCORE_ADCS_DIV32 = 0b0010000,
491 ADCORE_ADCS_DIV34 = 0b0010001,
492 ADCORE_ADCS_DIV36 = 0b0010010,
493 ADCORE_ADCS_DIV38 = 0b0010011,
494 ADCORE_ADCS_DIV40 = 0b0010100,
495 ADCORE_ADCS_DIV42 = 0b0010101,
496 ADCORE_ADCS_DIV44 = 0b0010110,
497 ADCORE_ADCS_DIV46 = 0b0010111,
498 ADCORE_ADCS_DIV48 = 0b0011000,
499 ADCORE_ADCS_DIV50 = 0b0011001,
500 ADCORE_ADCS_DIV52 = 0b0011010,
501 ADCORE_ADCS_DIV54 = 0b0011011,
502 ADCORE_ADCS_DIV56 = 0b0011100,
503 ADCORE_ADCS_DIV58 = 0b0011101,
504 ADCORE_ADCS_DIV60 = 0b0011110,
505 ADCORE_ADCS_DIV62 = 0b0011111,
506 ADCORE_ADCS_DIV64 = 0b0100000,
507 ADCORE_ADCS_DIV66 = 0b0100001,
508 ADCORE_ADCS_DIV68 = 0b0100010,
509 ADCORE_ADCS_DIV70 = 0b0100011,
510 ADCORE_ADCS_DIV72 = 0b0100100,
511 ADCORE_ADCS_DIV74 = 0b0100101,
512 ADCORE_ADCS_DIV76 = 0b0100110,
513 ADCORE_ADCS_DIV78 = 0b0100111,
514 ADCORE_ADCS_DIV80 = 0b0101000,
515 ADCORE_ADCS_DIV82 = 0b0101001,
516 ADCORE_ADCS_DIV84 = 0b0101010,
517 ADCORE_ADCS_DIV86 = 0b0101011,
518 ADCORE_ADCS_DIV88 = 0b0101100,
519 ADCORE_ADCS_DIV90 = 0b0101101,
520 ADCORE_ADCS_DIV92 = 0b0101110,
521 ADCORE_ADCS_DIV94 = 0b0101111,
522 ADCORE_ADCS_DIV96 = 0b0110000,
523 ADCORE_ADCS_DIV98 = 0b0110001,
524 ADCORE_ADCS_DIV100 = 0b0110010,
525 ADCORE_ADCS_DIV102 = 0b0110011,
526 ADCORE_ADCS_DIV104 = 0b0110100,
527 ADCORE_ADCS_DIV106 = 0b0110101,
528 ADCORE_ADCS_DIV108 = 0b0110110,
529 ADCORE_ADCS_DIV110 = 0b0110111,
530 ADCORE_ADCS_DIV112 = 0b0111000,
531 ADCORE_ADCS_DIV114 = 0b0111001,
532 ADCORE_ADCS_DIV116 = 0b0111010,
533 ADCORE_ADCS_DIV118 = 0b0111011,
534 ADCORE_ADCS_DIV120 = 0b0111100,
535 ADCORE_ADCS_DIV122 = 0b0111101,
536 ADCORE_ADCS_DIV124 = 0b0111110,
537 ADCORE_ADCS_DIV126 = 0b0111111,
538 ADCORE_ADCS_DIV128 = 0b1000000,
539 ADCORE_ADCS_DIV130 = 0b1000001,
540 ADCORE_ADCS_DIV132 = 0b1000010,
541 ADCORE_ADCS_DIV134 = 0b1000011,
542 ADCORE_ADCS_DIV136 = 0b1000100,
543 ADCORE_ADCS_DIV138 = 0b1000101,
544 ADCORE_ADCS_DIV140 = 0b1000110,
545 ADCORE_ADCS_DIV142 = 0b1000111,
546 ADCORE_ADCS_DIV144 = 0b1001000,
547 ADCORE_ADCS_DIV146 = 0b1001001,
548 ADCORE_ADCS_DIV148 = 0b1001010,
549 ADCORE_ADCS_DIV150 = 0b1001011,
550 ADCORE_ADCS_DIV152 = 0b1001100,
551 ADCORE_ADCS_DIV154 = 0b1001101,
552 ADCORE_ADCS_DIV156 = 0b1001110,
553 ADCORE_ADCS_DIV158 = 0b1001111,
554 ADCORE_ADCS_DIV160 = 0b1010000,
555 ADCORE_ADCS_DIV162 = 0b1010001,
556 ADCORE_ADCS_DIV164 = 0b1010010,
557 ADCORE_ADCS_DIV166 = 0b1010011,
558 ADCORE_ADCS_DIV168 = 0b1010100,
559 ADCORE_ADCS_DIV170 = 0b1010101,
560 ADCORE_ADCS_DIV172 = 0b1010110,
561 ADCORE_ADCS_DIV174 = 0b1010111,
562 ADCORE_ADCS_DIV176 = 0b1011000,
563 ADCORE_ADCS_DIV178 = 0b1011001,
564 ADCORE_ADCS_DIV180 = 0b1011010,
565 ADCORE_ADCS_DIV182 = 0b1011011,
566 ADCORE_ADCS_DIV184 = 0b1011100,
567 ADCORE_ADCS_DIV186 = 0b1011101,
568 ADCORE_ADCS_DIV188 = 0b1011110,
569 ADCORE_ADCS_DIV190 = 0b1011111,
570 ADCORE_ADCS_DIV192 = 0b1100000,
571 ADCORE_ADCS_DIV194 = 0b1100001,
572 ADCORE_ADCS_DIV196 = 0b1100010,
573 ADCORE_ADCS_DIV198 = 0b1100011,
574 ADCORE_ADCS_DIV200 = 0b1100100,
575 ADCORE_ADCS_DIV202 = 0b1100101,
576 ADCORE_ADCS_DIV204 = 0b1100110,
577 ADCORE_ADCS_DIV206 = 0b1100111,
578 ADCORE_ADCS_DIV208 = 0b1101000,
579 ADCORE_ADCS_DIV210 = 0b1101001,
580 ADCORE_ADCS_DIV212 = 0b1101010,
581 ADCORE_ADCS_DIV214 = 0b1101011,
582 ADCORE_ADCS_DIV216 = 0b1101100,
583 ADCORE_ADCS_DIV218 = 0b1101101,
584 ADCORE_ADCS_DIV220 = 0b1101110,
585 ADCORE_ADCS_DIV222 = 0b1101111,
586 ADCORE_ADCS_DIV224 = 0b1110000,
587 ADCORE_ADCS_DIV226 = 0b1110001,
588 ADCORE_ADCS_DIV228 = 0b1110010,
589 ADCORE_ADCS_DIV230 = 0b1110011,
590 ADCORE_ADCS_DIV232 = 0b1110100,
591 ADCORE_ADCS_DIV234 = 0b1110101,
592 ADCORE_ADCS_DIV236 = 0b1110110,
593 ADCORE_ADCS_DIV238 = 0b1110111,
594 ADCORE_ADCS_DIV240 = 0b1111000,
595 ADCORE_ADCS_DIV242 = 0b1111001,
596 ADCORE_ADCS_DIV244 = 0b1111010,
597 ADCORE_ADCS_DIV246 = 0b1111011,
598 ADCORE_ADCS_DIV248 = 0b1111100,
599 ADCORE_ADCS_DIV250 = 0b1111101,
600 ADCORE_ADCS_DIV252 = 0b1111110,
601 ADCORE_ADCS_DIV254 = 0b1111111
605 #define REG_ADCON2H_REFRDY_READY 0b1000000000000000 // Band gap is ready
606 #define REG_ADCON2H_REFRDY_NOT_READY 0b0000000000000000 // Band gap is not ready
609 ADCON2_REFRDY_READY = 0b1,
610 ADCON2_REFRDY_NOT_READY = 0b0
613 #define REG_ADCON2H_REFERR_FAIL 0b0100000000000000 // Band gap failure after ADC peripehral was enabled
614 #define REG_ADCON2H_REFERR_OK 0b0000000000000000 // No Band gap / reference voltage error was detected
617 ADCON2_REFERR_FAIL = 0b1,
618 ADCON2_REFERR_OK = 0b0
622 volatile unsigned : 14;
623 volatile ADCON2_REFERR_e referr : 1;
624 volatile ADCON2_REFRDY_e refrdy : 1;
625 } __attribute__((packed))ADCON2_REFSTAT_t;
628 #define REG_ADCON2H_SHRSAMC_MSK 0b0000001111111111 // Bit-Mask to filter on clock periods value bits
629 #define REG_ADCON2H_SHRSAMC(Tdaclk) ((Tdaclk-2) & REG_ADCON2H_SHRSAMC_MSK) // Shared ADC Core Sample Time Selection bits
632 ADCORE_SAMC_DEFAULT = 0b0000000000,
633 ADCORE_SAMC_0002 = 0b0000000000,
634 ADCORE_SAMC_0003 = 0b0000000001,
635 ADCORE_SAMC_0004 = 0b0000000010,
636 ADCORE_SAMC_0005 = 0b0000000011,
637 ADCORE_SAMC_0006 = 0b0000000100,
638 ADCORE_SAMC_0007 = 0b0000000101,
639 ADCORE_SAMC_0008 = 0b0000000110,
640 ADCORE_SAMC_0009 = 0b0000000111,
641 ADCORE_SAMC_0010 = 0b0000001000,
642 ADCORE_SAMC_0011 = 0b0000001001,
643 ADCORE_SAMC_0012 = 0b0000001010,
644 ADCORE_SAMC_0013 = 0b0000001011,
645 ADCORE_SAMC_0014 = 0b0000001100,
646 ADCORE_SAMC_0015 = 0b0000001101,
647 ADCORE_SAMC_0016 = 0b0000001110,
648 ADCORE_SAMC_0017 = 0b0000001111,
649 ADCORE_SAMC_0018 = 0b0000010000,
650 ADCORE_SAMC_0019 = 0b0000010001,
651 ADCORE_SAMC_0020 = 0b0000010010,
652 ADCORE_SAMC_0021 = 0b0000010011,
653 ADCORE_SAMC_0022 = 0b0000010100,
654 ADCORE_SAMC_0023 = 0b0000010101,
655 ADCORE_SAMC_0024 = 0b0000010110,
656 ADCORE_SAMC_0025 = 0b0000010111,
657 ADCORE_SAMC_0026 = 0b0000011000,
658 ADCORE_SAMC_0027 = 0b0000011001,
659 ADCORE_SAMC_0028 = 0b0000011010,
660 ADCORE_SAMC_0029 = 0b0000011011,
661 ADCORE_SAMC_0030 = 0b0000011100,
662 ADCORE_SAMC_0031 = 0b0000011101,
663 ADCORE_SAMC_0032 = 0b0000011110,
664 ADCORE_SAMC_0033 = 0b0000011111,
665 ADCORE_SAMC_0034 = 0b0000100000,
666 ADCORE_SAMC_0035 = 0b0000100001,
667 ADCORE_SAMC_0036 = 0b0000100010,
668 ADCORE_SAMC_0037 = 0b0000100011,
669 ADCORE_SAMC_0038 = 0b0000100100,
670 ADCORE_SAMC_0039 = 0b0000100101,
671 ADCORE_SAMC_0040 = 0b0000100110,
672 ADCORE_SAMC_0041 = 0b0000100111,
673 ADCORE_SAMC_0042 = 0b0000101000,
674 ADCORE_SAMC_0043 = 0b0000101001,
675 ADCORE_SAMC_0044 = 0b0000101010,
676 ADCORE_SAMC_0045 = 0b0000101011,
677 ADCORE_SAMC_0046 = 0b0000101100,
678 ADCORE_SAMC_0047 = 0b0000101101,
679 ADCORE_SAMC_0048 = 0b0000101110,
680 ADCORE_SAMC_0049 = 0b0000101111,
681 ADCORE_SAMC_0050 = 0b0000110000,
682 ADCORE_SAMC_0051 = 0b0000110001,
683 ADCORE_SAMC_0052 = 0b0000110010,
684 ADCORE_SAMC_0053 = 0b0000110011,
685 ADCORE_SAMC_0054 = 0b0000110100,
686 ADCORE_SAMC_0055 = 0b0000110101,
687 ADCORE_SAMC_0056 = 0b0000110110,
688 ADCORE_SAMC_0057 = 0b0000110111,
689 ADCORE_SAMC_0058 = 0b0000111000,
690 ADCORE_SAMC_0059 = 0b0000111001,
691 ADCORE_SAMC_0060 = 0b0000111010,
692 ADCORE_SAMC_0061 = 0b0000111011,
693 ADCORE_SAMC_0062 = 0b0000111100,
694 ADCORE_SAMC_0063 = 0b0000111101,
695 ADCORE_SAMC_0064 = 0b0000111110,
696 ADCORE_SAMC_0065 = 0b0000111111,
697 ADCORE_SAMC_0066 = 0b0001000000,
698 ADCORE_SAMC_0067 = 0b0001000001,
699 ADCORE_SAMC_0068 = 0b0001000010,
700 ADCORE_SAMC_0069 = 0b0001000011,
701 ADCORE_SAMC_0070 = 0b0001000100,
702 ADCORE_SAMC_0071 = 0b0001000101,
703 ADCORE_SAMC_0072 = 0b0001000110,
704 ADCORE_SAMC_0073 = 0b0001000111,
705 ADCORE_SAMC_0074 = 0b0001001000,
706 ADCORE_SAMC_0075 = 0b0001001001,
707 ADCORE_SAMC_0076 = 0b0001001010,
708 ADCORE_SAMC_0077 = 0b0001001011,
709 ADCORE_SAMC_0078 = 0b0001001100,
710 ADCORE_SAMC_0079 = 0b0001001101,
711 ADCORE_SAMC_0080 = 0b0001001110,
712 ADCORE_SAMC_0081 = 0b0001001111,
713 ADCORE_SAMC_0082 = 0b0001010000,
714 ADCORE_SAMC_0083 = 0b0001010001,
715 ADCORE_SAMC_0084 = 0b0001010010,
716 ADCORE_SAMC_0085 = 0b0001010011,
717 ADCORE_SAMC_0086 = 0b0001010100,
718 ADCORE_SAMC_0087 = 0b0001010101,
719 ADCORE_SAMC_0088 = 0b0001010110,
720 ADCORE_SAMC_0089 = 0b0001010111,
721 ADCORE_SAMC_0090 = 0b0001011000,
722 ADCORE_SAMC_0091 = 0b0001011001,
723 ADCORE_SAMC_0092 = 0b0001011010,
724 ADCORE_SAMC_0093 = 0b0001011011,
725 ADCORE_SAMC_0094 = 0b0001011100,
726 ADCORE_SAMC_0095 = 0b0001011101,
727 ADCORE_SAMC_0096 = 0b0001011110,
728 ADCORE_SAMC_0097 = 0b0001011111,
729 ADCORE_SAMC_0098 = 0b0001100000,
730 ADCORE_SAMC_0099 = 0b0001100001,
731 ADCORE_SAMC_0100 = 0b0001100010,
732 ADCORE_SAMC_0101 = 0b0001100011,
733 ADCORE_SAMC_0102 = 0b0001100100,
734 ADCORE_SAMC_0103 = 0b0001100101,
735 ADCORE_SAMC_0104 = 0b0001100110,
736 ADCORE_SAMC_0105 = 0b0001100111,
737 ADCORE_SAMC_0106 = 0b0001101000,
738 ADCORE_SAMC_0107 = 0b0001101001,
739 ADCORE_SAMC_0108 = 0b0001101010,
740 ADCORE_SAMC_0109 = 0b0001101011,
741 ADCORE_SAMC_0110 = 0b0001101100,
742 ADCORE_SAMC_0111 = 0b0001101101,
743 ADCORE_SAMC_0112 = 0b0001101110,
744 ADCORE_SAMC_0113 = 0b0001101111,
745 ADCORE_SAMC_0114 = 0b0001110000,
746 ADCORE_SAMC_0115 = 0b0001110001,
747 ADCORE_SAMC_0116 = 0b0001110010,
748 ADCORE_SAMC_0117 = 0b0001110011,
749 ADCORE_SAMC_0118 = 0b0001110100,
750 ADCORE_SAMC_0119 = 0b0001110101,
751 ADCORE_SAMC_0120 = 0b0001110110,
752 ADCORE_SAMC_0121 = 0b0001110111,
753 ADCORE_SAMC_0122 = 0b0001111000,
754 ADCORE_SAMC_0123 = 0b0001111001,
755 ADCORE_SAMC_0124 = 0b0001111010,
756 ADCORE_SAMC_0125 = 0b0001111011,
757 ADCORE_SAMC_0126 = 0b0001111100,
758 ADCORE_SAMC_0127 = 0b0001111101,
759 ADCORE_SAMC_0128 = 0b0001111110,
760 ADCORE_SAMC_0129 = 0b0001111111,
761 ADCORE_SAMC_0130 = 0b0010000000,
762 ADCORE_SAMC_0131 = 0b0010000001,
763 ADCORE_SAMC_0132 = 0b0010000010,
764 ADCORE_SAMC_0133 = 0b0010000011,
765 ADCORE_SAMC_0134 = 0b0010000100,
766 ADCORE_SAMC_0135 = 0b0010000101,
767 ADCORE_SAMC_0136 = 0b0010000110,
768 ADCORE_SAMC_0137 = 0b0010000111,
769 ADCORE_SAMC_0138 = 0b0010001000,
770 ADCORE_SAMC_0139 = 0b0010001001,
771 ADCORE_SAMC_0140 = 0b0010001010,
772 ADCORE_SAMC_0141 = 0b0010001011,
773 ADCORE_SAMC_0142 = 0b0010001100,
774 ADCORE_SAMC_0143 = 0b0010001101,
775 ADCORE_SAMC_0144 = 0b0010001110,
776 ADCORE_SAMC_0145 = 0b0010001111,
777 ADCORE_SAMC_0146 = 0b0010010000,
778 ADCORE_SAMC_0147 = 0b0010010001,
779 ADCORE_SAMC_0148 = 0b0010010010,
780 ADCORE_SAMC_0149 = 0b0010010011,
781 ADCORE_SAMC_0150 = 0b0010010100,
782 ADCORE_SAMC_0151 = 0b0010010101,
783 ADCORE_SAMC_0152 = 0b0010010110,
784 ADCORE_SAMC_0153 = 0b0010010111,
785 ADCORE_SAMC_0154 = 0b0010011000,
786 ADCORE_SAMC_0155 = 0b0010011001,
787 ADCORE_SAMC_0156 = 0b0010011010,
788 ADCORE_SAMC_0157 = 0b0010011011,
789 ADCORE_SAMC_0158 = 0b0010011100,
790 ADCORE_SAMC_0159 = 0b0010011101,
791 ADCORE_SAMC_0160 = 0b0010011110,
792 ADCORE_SAMC_0161 = 0b0010011111,
793 ADCORE_SAMC_0162 = 0b0010100000,
794 ADCORE_SAMC_0163 = 0b0010100001,
795 ADCORE_SAMC_0164 = 0b0010100010,
796 ADCORE_SAMC_0165 = 0b0010100011,
797 ADCORE_SAMC_0166 = 0b0010100100,
798 ADCORE_SAMC_0167 = 0b0010100101,
799 ADCORE_SAMC_0168 = 0b0010100110,
800 ADCORE_SAMC_0169 = 0b0010100111,
801 ADCORE_SAMC_0170 = 0b0010101000,
802 ADCORE_SAMC_0171 = 0b0010101001,
803 ADCORE_SAMC_0172 = 0b0010101010,
804 ADCORE_SAMC_0173 = 0b0010101011,
805 ADCORE_SAMC_0174 = 0b0010101100,
806 ADCORE_SAMC_0175 = 0b0010101101,
807 ADCORE_SAMC_0176 = 0b0010101110,
808 ADCORE_SAMC_0177 = 0b0010101111,
809 ADCORE_SAMC_0178 = 0b0010110000,
810 ADCORE_SAMC_0179 = 0b0010110001,
811 ADCORE_SAMC_0180 = 0b0010110010,
812 ADCORE_SAMC_0181 = 0b0010110011,
813 ADCORE_SAMC_0182 = 0b0010110100,
814 ADCORE_SAMC_0183 = 0b0010110101,
815 ADCORE_SAMC_0184 = 0b0010110110,
816 ADCORE_SAMC_0185 = 0b0010110111,
817 ADCORE_SAMC_0186 = 0b0010111000,
818 ADCORE_SAMC_0187 = 0b0010111001,
819 ADCORE_SAMC_0188 = 0b0010111010,
820 ADCORE_SAMC_0189 = 0b0010111011,
821 ADCORE_SAMC_0190 = 0b0010111100,
822 ADCORE_SAMC_0191 = 0b0010111101,
823 ADCORE_SAMC_0192 = 0b0010111110,
824 ADCORE_SAMC_0193 = 0b0010111111,
825 ADCORE_SAMC_0194 = 0b0011000000,
826 ADCORE_SAMC_0195 = 0b0011000001,
827 ADCORE_SAMC_0196 = 0b0011000010,
828 ADCORE_SAMC_0197 = 0b0011000011,
829 ADCORE_SAMC_0198 = 0b0011000100,
830 ADCORE_SAMC_0199 = 0b0011000101,
831 ADCORE_SAMC_0200 = 0b0011000110,
832 ADCORE_SAMC_0201 = 0b0011000111,
833 ADCORE_SAMC_0202 = 0b0011001000,
834 ADCORE_SAMC_0203 = 0b0011001001,
835 ADCORE_SAMC_0204 = 0b0011001010,
836 ADCORE_SAMC_0205 = 0b0011001011,
837 ADCORE_SAMC_0206 = 0b0011001100,
838 ADCORE_SAMC_0207 = 0b0011001101,
839 ADCORE_SAMC_0208 = 0b0011001110,
840 ADCORE_SAMC_0209 = 0b0011001111,
841 ADCORE_SAMC_0210 = 0b0011010000,
842 ADCORE_SAMC_0211 = 0b0011010001,
843 ADCORE_SAMC_0212 = 0b0011010010,
844 ADCORE_SAMC_0213 = 0b0011010011,
845 ADCORE_SAMC_0214 = 0b0011010100,
846 ADCORE_SAMC_0215 = 0b0011010101,
847 ADCORE_SAMC_0216 = 0b0011010110,
848 ADCORE_SAMC_0217 = 0b0011010111,
849 ADCORE_SAMC_0218 = 0b0011011000,
850 ADCORE_SAMC_0219 = 0b0011011001,
851 ADCORE_SAMC_0220 = 0b0011011010,
852 ADCORE_SAMC_0221 = 0b0011011011,
853 ADCORE_SAMC_0222 = 0b0011011100,
854 ADCORE_SAMC_0223 = 0b0011011101,
855 ADCORE_SAMC_0224 = 0b0011011110,
856 ADCORE_SAMC_0225 = 0b0011011111,
857 ADCORE_SAMC_0226 = 0b0011100000,
858 ADCORE_SAMC_0227 = 0b0011100001,
859 ADCORE_SAMC_0228 = 0b0011100010,
860 ADCORE_SAMC_0229 = 0b0011100011,
861 ADCORE_SAMC_0230 = 0b0011100100,
862 ADCORE_SAMC_0231 = 0b0011100101,
863 ADCORE_SAMC_0232 = 0b0011100110,
864 ADCORE_SAMC_0233 = 0b0011100111,
865 ADCORE_SAMC_0234 = 0b0011101000,
866 ADCORE_SAMC_0235 = 0b0011101001,
867 ADCORE_SAMC_0236 = 0b0011101010,
868 ADCORE_SAMC_0237 = 0b0011101011,
869 ADCORE_SAMC_0238 = 0b0011101100,
870 ADCORE_SAMC_0239 = 0b0011101101,
871 ADCORE_SAMC_0240 = 0b0011101110,
872 ADCORE_SAMC_0241 = 0b0011101111,
873 ADCORE_SAMC_0242 = 0b0011110000,
874 ADCORE_SAMC_0243 = 0b0011110001,
875 ADCORE_SAMC_0244 = 0b0011110010,
876 ADCORE_SAMC_0245 = 0b0011110011,
877 ADCORE_SAMC_0246 = 0b0011110100,
878 ADCORE_SAMC_0247 = 0b0011110101,
879 ADCORE_SAMC_0248 = 0b0011110110,
880 ADCORE_SAMC_0249 = 0b0011110111,
881 ADCORE_SAMC_0250 = 0b0011111000,
882 ADCORE_SAMC_0251 = 0b0011111001,
883 ADCORE_SAMC_0252 = 0b0011111010,
884 ADCORE_SAMC_0253 = 0b0011111011,
885 ADCORE_SAMC_0254 = 0b0011111100,
886 ADCORE_SAMC_0255 = 0b0011111101,
887 ADCORE_SAMC_0256 = 0b0011111110,
888 ADCORE_SAMC_0257 = 0b0011111111,
889 ADCORE_SAMC_0258 = 0b0100000000,
890 ADCORE_SAMC_0259 = 0b0100000001,
891 ADCORE_SAMC_0260 = 0b0100000010,
892 ADCORE_SAMC_0261 = 0b0100000011,
893 ADCORE_SAMC_0262 = 0b0100000100,
894 ADCORE_SAMC_0263 = 0b0100000101,
895 ADCORE_SAMC_0264 = 0b0100000110,
896 ADCORE_SAMC_0265 = 0b0100000111,
897 ADCORE_SAMC_0266 = 0b0100001000,
898 ADCORE_SAMC_0267 = 0b0100001001,
899 ADCORE_SAMC_0268 = 0b0100001010,
900 ADCORE_SAMC_0269 = 0b0100001011,
901 ADCORE_SAMC_0270 = 0b0100001100,
902 ADCORE_SAMC_0271 = 0b0100001101,
903 ADCORE_SAMC_0272 = 0b0100001110,
904 ADCORE_SAMC_0273 = 0b0100001111,
905 ADCORE_SAMC_0274 = 0b0100010000,
906 ADCORE_SAMC_0275 = 0b0100010001,
907 ADCORE_SAMC_0276 = 0b0100010010,
908 ADCORE_SAMC_0277 = 0b0100010011,
909 ADCORE_SAMC_0278 = 0b0100010100,
910 ADCORE_SAMC_0279 = 0b0100010101,
911 ADCORE_SAMC_0280 = 0b0100010110,
912 ADCORE_SAMC_0281 = 0b0100010111,
913 ADCORE_SAMC_0282 = 0b0100011000,
914 ADCORE_SAMC_0283 = 0b0100011001,
915 ADCORE_SAMC_0284 = 0b0100011010,
916 ADCORE_SAMC_0285 = 0b0100011011,
917 ADCORE_SAMC_0286 = 0b0100011100,
918 ADCORE_SAMC_0287 = 0b0100011101,
919 ADCORE_SAMC_0288 = 0b0100011110,
920 ADCORE_SAMC_0289 = 0b0100011111,
921 ADCORE_SAMC_0290 = 0b0100100000,
922 ADCORE_SAMC_0291 = 0b0100100001,
923 ADCORE_SAMC_0292 = 0b0100100010,
924 ADCORE_SAMC_0293 = 0b0100100011,
925 ADCORE_SAMC_0294 = 0b0100100100,
926 ADCORE_SAMC_0295 = 0b0100100101,
927 ADCORE_SAMC_0296 = 0b0100100110,
928 ADCORE_SAMC_0297 = 0b0100100111,
929 ADCORE_SAMC_0298 = 0b0100101000,
930 ADCORE_SAMC_0299 = 0b0100101001,
931 ADCORE_SAMC_0300 = 0b0100101010,
932 ADCORE_SAMC_0301 = 0b0100101011,
933 ADCORE_SAMC_0302 = 0b0100101100,
934 ADCORE_SAMC_0303 = 0b0100101101,
935 ADCORE_SAMC_0304 = 0b0100101110,
936 ADCORE_SAMC_0305 = 0b0100101111,
937 ADCORE_SAMC_0306 = 0b0100110000,
938 ADCORE_SAMC_0307 = 0b0100110001,
939 ADCORE_SAMC_0308 = 0b0100110010,
940 ADCORE_SAMC_0309 = 0b0100110011,
941 ADCORE_SAMC_0310 = 0b0100110100,
942 ADCORE_SAMC_0311 = 0b0100110101,
943 ADCORE_SAMC_0312 = 0b0100110110,
944 ADCORE_SAMC_0313 = 0b0100110111,
945 ADCORE_SAMC_0314 = 0b0100111000,
946 ADCORE_SAMC_0315 = 0b0100111001,
947 ADCORE_SAMC_0316 = 0b0100111010,
948 ADCORE_SAMC_0317 = 0b0100111011,
949 ADCORE_SAMC_0318 = 0b0100111100,
950 ADCORE_SAMC_0319 = 0b0100111101,
951 ADCORE_SAMC_0320 = 0b0100111110,
952 ADCORE_SAMC_0321 = 0b0100111111,
953 ADCORE_SAMC_0322 = 0b0101000000,
954 ADCORE_SAMC_0323 = 0b0101000001,
955 ADCORE_SAMC_0324 = 0b0101000010,
956 ADCORE_SAMC_0325 = 0b0101000011,
957 ADCORE_SAMC_0326 = 0b0101000100,
958 ADCORE_SAMC_0327 = 0b0101000101,
959 ADCORE_SAMC_0328 = 0b0101000110,
960 ADCORE_SAMC_0329 = 0b0101000111,
961 ADCORE_SAMC_0330 = 0b0101001000,
962 ADCORE_SAMC_0331 = 0b0101001001,
963 ADCORE_SAMC_0332 = 0b0101001010,
964 ADCORE_SAMC_0333 = 0b0101001011,
965 ADCORE_SAMC_0334 = 0b0101001100,
966 ADCORE_SAMC_0335 = 0b0101001101,
967 ADCORE_SAMC_0336 = 0b0101001110,
968 ADCORE_SAMC_0337 = 0b0101001111,
969 ADCORE_SAMC_0338 = 0b0101010000,
970 ADCORE_SAMC_0339 = 0b0101010001,
971 ADCORE_SAMC_0340 = 0b0101010010,
972 ADCORE_SAMC_0341 = 0b0101010011,
973 ADCORE_SAMC_0342 = 0b0101010100,
974 ADCORE_SAMC_0343 = 0b0101010101,
975 ADCORE_SAMC_0344 = 0b0101010110,
976 ADCORE_SAMC_0345 = 0b0101010111,
977 ADCORE_SAMC_0346 = 0b0101011000,
978 ADCORE_SAMC_0347 = 0b0101011001,
979 ADCORE_SAMC_0348 = 0b0101011010,
980 ADCORE_SAMC_0349 = 0b0101011011,
981 ADCORE_SAMC_0350 = 0b0101011100,
982 ADCORE_SAMC_0351 = 0b0101011101,
983 ADCORE_SAMC_0352 = 0b0101011110,
984 ADCORE_SAMC_0353 = 0b0101011111,
985 ADCORE_SAMC_0354 = 0b0101100000,
986 ADCORE_SAMC_0355 = 0b0101100001,
987 ADCORE_SAMC_0356 = 0b0101100010,
988 ADCORE_SAMC_0357 = 0b0101100011,
989 ADCORE_SAMC_0358 = 0b0101100100,
990 ADCORE_SAMC_0359 = 0b0101100101,
991 ADCORE_SAMC_0360 = 0b0101100110,
992 ADCORE_SAMC_0361 = 0b0101100111,
993 ADCORE_SAMC_0362 = 0b0101101000,
994 ADCORE_SAMC_0363 = 0b0101101001,
995 ADCORE_SAMC_0364 = 0b0101101010,
996 ADCORE_SAMC_0365 = 0b0101101011,
997 ADCORE_SAMC_0366 = 0b0101101100,
998 ADCORE_SAMC_0367 = 0b0101101101,
999 ADCORE_SAMC_0368 = 0b0101101110,
1000 ADCORE_SAMC_0369 = 0b0101101111,
1001 ADCORE_SAMC_0370 = 0b0101110000,
1002 ADCORE_SAMC_0371 = 0b0101110001,
1003 ADCORE_SAMC_0372 = 0b0101110010,
1004 ADCORE_SAMC_0373 = 0b0101110011,
1005 ADCORE_SAMC_0374 = 0b0101110100,
1006 ADCORE_SAMC_0375 = 0b0101110101,
1007 ADCORE_SAMC_0376 = 0b0101110110,
1008 ADCORE_SAMC_0377 = 0b0101110111,
1009 ADCORE_SAMC_0378 = 0b0101111000,
1010 ADCORE_SAMC_0379 = 0b0101111001,
1011 ADCORE_SAMC_0380 = 0b0101111010,
1012 ADCORE_SAMC_0381 = 0b0101111011,
1013 ADCORE_SAMC_0382 = 0b0101111100,
1014 ADCORE_SAMC_0383 = 0b0101111101,
1015 ADCORE_SAMC_0384 = 0b0101111110,
1016 ADCORE_SAMC_0385 = 0b0101111111,
1017 ADCORE_SAMC_0386 = 0b0110000000,
1018 ADCORE_SAMC_0387 = 0b0110000001,
1019 ADCORE_SAMC_0388 = 0b0110000010,
1020 ADCORE_SAMC_0389 = 0b0110000011,
1021 ADCORE_SAMC_0390 = 0b0110000100,
1022 ADCORE_SAMC_0391 = 0b0110000101,
1023 ADCORE_SAMC_0392 = 0b0110000110,
1024 ADCORE_SAMC_0393 = 0b0110000111,
1025 ADCORE_SAMC_0394 = 0b0110001000,
1026 ADCORE_SAMC_0395 = 0b0110001001,
1027 ADCORE_SAMC_0396 = 0b0110001010,
1028 ADCORE_SAMC_0397 = 0b0110001011,
1029 ADCORE_SAMC_0398 = 0b0110001100,
1030 ADCORE_SAMC_0399 = 0b0110001101,
1031 ADCORE_SAMC_0400 = 0b0110001110,
1032 ADCORE_SAMC_0401 = 0b0110001111,
1033 ADCORE_SAMC_0402 = 0b0110010000,
1034 ADCORE_SAMC_0403 = 0b0110010001,
1035 ADCORE_SAMC_0404 = 0b0110010010,
1036 ADCORE_SAMC_0405 = 0b0110010011,
1037 ADCORE_SAMC_0406 = 0b0110010100,
1038 ADCORE_SAMC_0407 = 0b0110010101,
1039 ADCORE_SAMC_0408 = 0b0110010110,
1040 ADCORE_SAMC_0409 = 0b0110010111,
1041 ADCORE_SAMC_0410 = 0b0110011000,
1042 ADCORE_SAMC_0411 = 0b0110011001,
1043 ADCORE_SAMC_0412 = 0b0110011010,
1044 ADCORE_SAMC_0413 = 0b0110011011,
1045 ADCORE_SAMC_0414 = 0b0110011100,
1046 ADCORE_SAMC_0415 = 0b0110011101,
1047 ADCORE_SAMC_0416 = 0b0110011110,
1048 ADCORE_SAMC_0417 = 0b0110011111,
1049 ADCORE_SAMC_0418 = 0b0110100000,
1050 ADCORE_SAMC_0419 = 0b0110100001,
1051 ADCORE_SAMC_0420 = 0b0110100010,
1052 ADCORE_SAMC_0421 = 0b0110100011,
1053 ADCORE_SAMC_0422 = 0b0110100100,
1054 ADCORE_SAMC_0423 = 0b0110100101,
1055 ADCORE_SAMC_0424 = 0b0110100110,
1056 ADCORE_SAMC_0425 = 0b0110100111,
1057 ADCORE_SAMC_0426 = 0b0110101000,
1058 ADCORE_SAMC_0427 = 0b0110101001,
1059 ADCORE_SAMC_0428 = 0b0110101010,
1060 ADCORE_SAMC_0429 = 0b0110101011,
1061 ADCORE_SAMC_0430 = 0b0110101100,
1062 ADCORE_SAMC_0431 = 0b0110101101,
1063 ADCORE_SAMC_0432 = 0b0110101110,
1064 ADCORE_SAMC_0433 = 0b0110101111,
1065 ADCORE_SAMC_0434 = 0b0110110000,
1066 ADCORE_SAMC_0435 = 0b0110110001,
1067 ADCORE_SAMC_0436 = 0b0110110010,
1068 ADCORE_SAMC_0437 = 0b0110110011,
1069 ADCORE_SAMC_0438 = 0b0110110100,
1070 ADCORE_SAMC_0439 = 0b0110110101,
1071 ADCORE_SAMC_0440 = 0b0110110110,
1072 ADCORE_SAMC_0441 = 0b0110110111,
1073 ADCORE_SAMC_0442 = 0b0110111000,
1074 ADCORE_SAMC_0443 = 0b0110111001,
1075 ADCORE_SAMC_0444 = 0b0110111010,
1076 ADCORE_SAMC_0445 = 0b0110111011,
1077 ADCORE_SAMC_0446 = 0b0110111100,
1078 ADCORE_SAMC_0447 = 0b0110111101,
1079 ADCORE_SAMC_0448 = 0b0110111110,
1080 ADCORE_SAMC_0449 = 0b0110111111,
1081 ADCORE_SAMC_0450 = 0b0111000000,
1082 ADCORE_SAMC_0451 = 0b0111000001,
1083 ADCORE_SAMC_0452 = 0b0111000010,
1084 ADCORE_SAMC_0453 = 0b0111000011,
1085 ADCORE_SAMC_0454 = 0b0111000100,
1086 ADCORE_SAMC_0455 = 0b0111000101,
1087 ADCORE_SAMC_0456 = 0b0111000110,
1088 ADCORE_SAMC_0457 = 0b0111000111,
1089 ADCORE_SAMC_0458 = 0b0111001000,
1090 ADCORE_SAMC_0459 = 0b0111001001,
1091 ADCORE_SAMC_0460 = 0b0111001010,
1092 ADCORE_SAMC_0461 = 0b0111001011,
1093 ADCORE_SAMC_0462 = 0b0111001100,
1094 ADCORE_SAMC_0463 = 0b0111001101,
1095 ADCORE_SAMC_0464 = 0b0111001110,
1096 ADCORE_SAMC_0465 = 0b0111001111,
1097 ADCORE_SAMC_0466 = 0b0111010000,
1098 ADCORE_SAMC_0467 = 0b0111010001,
1099 ADCORE_SAMC_0468 = 0b0111010010,
1100 ADCORE_SAMC_0469 = 0b0111010011,
1101 ADCORE_SAMC_0470 = 0b0111010100,
1102 ADCORE_SAMC_0471 = 0b0111010101,
1103 ADCORE_SAMC_0472 = 0b0111010110,
1104 ADCORE_SAMC_0473 = 0b0111010111,
1105 ADCORE_SAMC_0474 = 0b0111011000,
1106 ADCORE_SAMC_0475 = 0b0111011001,
1107 ADCORE_SAMC_0476 = 0b0111011010,
1108 ADCORE_SAMC_0477 = 0b0111011011,
1109 ADCORE_SAMC_0478 = 0b0111011100,
1110 ADCORE_SAMC_0479 = 0b0111011101,
1111 ADCORE_SAMC_0480 = 0b0111011110,
1112 ADCORE_SAMC_0481 = 0b0111011111,
1113 ADCORE_SAMC_0482 = 0b0111100000,
1114 ADCORE_SAMC_0483 = 0b0111100001,
1115 ADCORE_SAMC_0484 = 0b0111100010,
1116 ADCORE_SAMC_0485 = 0b0111100011,
1117 ADCORE_SAMC_0486 = 0b0111100100,
1118 ADCORE_SAMC_0487 = 0b0111100101,
1119 ADCORE_SAMC_0488 = 0b0111100110,
1120 ADCORE_SAMC_0489 = 0b0111100111,
1121 ADCORE_SAMC_0490 = 0b0111101000,
1122 ADCORE_SAMC_0491 = 0b0111101001,
1123 ADCORE_SAMC_0492 = 0b0111101010,
1124 ADCORE_SAMC_0493 = 0b0111101011,
1125 ADCORE_SAMC_0494 = 0b0111101100,
1126 ADCORE_SAMC_0495 = 0b0111101101,
1127 ADCORE_SAMC_0496 = 0b0111101110,
1128 ADCORE_SAMC_0497 = 0b0111101111,
1129 ADCORE_SAMC_0498 = 0b0111110000,
1130 ADCORE_SAMC_0499 = 0b0111110001,
1131 ADCORE_SAMC_0500 = 0b0111110010,
1132 ADCORE_SAMC_0501 = 0b0111110011,
1133 ADCORE_SAMC_0502 = 0b0111110100,
1134 ADCORE_SAMC_0503 = 0b0111110101,
1135 ADCORE_SAMC_0504 = 0b0111110110,
1136 ADCORE_SAMC_0505 = 0b0111110111,
1137 ADCORE_SAMC_0506 = 0b0111111000,
1138 ADCORE_SAMC_0507 = 0b0111111001,
1139 ADCORE_SAMC_0508 = 0b0111111010,
1140 ADCORE_SAMC_0509 = 0b0111111011,
1141 ADCORE_SAMC_0510 = 0b0111111100,
1142 ADCORE_SAMC_0511 = 0b0111111101,
1143 ADCORE_SAMC_0512 = 0b0111111110,
1144 ADCORE_SAMC_0513 = 0b0111111111,
1145 ADCORE_SAMC_0514 = 0b1000000000,
1146 ADCORE_SAMC_0515 = 0b1000000001,
1147 ADCORE_SAMC_0516 = 0b1000000010,
1148 ADCORE_SAMC_0517 = 0b1000000011,
1149 ADCORE_SAMC_0518 = 0b1000000100,
1150 ADCORE_SAMC_0519 = 0b1000000101,
1151 ADCORE_SAMC_0520 = 0b1000000110,
1152 ADCORE_SAMC_0521 = 0b1000000111,
1153 ADCORE_SAMC_0522 = 0b1000001000,
1154 ADCORE_SAMC_0523 = 0b1000001001,
1155 ADCORE_SAMC_0524 = 0b1000001010,
1156 ADCORE_SAMC_0525 = 0b1000001011,
1157 ADCORE_SAMC_0526 = 0b1000001100,
1158 ADCORE_SAMC_0527 = 0b1000001101,
1159 ADCORE_SAMC_0528 = 0b1000001110,
1160 ADCORE_SAMC_0529 = 0b1000001111,
1161 ADCORE_SAMC_0530 = 0b1000010000,
1162 ADCORE_SAMC_0531 = 0b1000010001,
1163 ADCORE_SAMC_0532 = 0b1000010010,
1164 ADCORE_SAMC_0533 = 0b1000010011,
1165 ADCORE_SAMC_0534 = 0b1000010100,
1166 ADCORE_SAMC_0535 = 0b1000010101,
1167 ADCORE_SAMC_0536 = 0b1000010110,
1168 ADCORE_SAMC_0537 = 0b1000010111,
1169 ADCORE_SAMC_0538 = 0b1000011000,
1170 ADCORE_SAMC_0539 = 0b1000011001,
1171 ADCORE_SAMC_0540 = 0b1000011010,
1172 ADCORE_SAMC_0541 = 0b1000011011,
1173 ADCORE_SAMC_0542 = 0b1000011100,
1174 ADCORE_SAMC_0543 = 0b1000011101,
1175 ADCORE_SAMC_0544 = 0b1000011110,
1176 ADCORE_SAMC_0545 = 0b1000011111,
1177 ADCORE_SAMC_0546 = 0b1000100000,
1178 ADCORE_SAMC_0547 = 0b1000100001,
1179 ADCORE_SAMC_0548 = 0b1000100010,
1180 ADCORE_SAMC_0549 = 0b1000100011,
1181 ADCORE_SAMC_0550 = 0b1000100100,
1182 ADCORE_SAMC_0551 = 0b1000100101,
1183 ADCORE_SAMC_0552 = 0b1000100110,
1184 ADCORE_SAMC_0553 = 0b1000100111,
1185 ADCORE_SAMC_0554 = 0b1000101000,
1186 ADCORE_SAMC_0555 = 0b1000101001,
1187 ADCORE_SAMC_0556 = 0b1000101010,
1188 ADCORE_SAMC_0557 = 0b1000101011,
1189 ADCORE_SAMC_0558 = 0b1000101100,
1190 ADCORE_SAMC_0559 = 0b1000101101,
1191 ADCORE_SAMC_0560 = 0b1000101110,
1192 ADCORE_SAMC_0561 = 0b1000101111,
1193 ADCORE_SAMC_0562 = 0b1000110000,
1194 ADCORE_SAMC_0563 = 0b1000110001,
1195 ADCORE_SAMC_0564 = 0b1000110010,
1196 ADCORE_SAMC_0565 = 0b1000110011,
1197 ADCORE_SAMC_0566 = 0b1000110100,
1198 ADCORE_SAMC_0567 = 0b1000110101,
1199 ADCORE_SAMC_0568 = 0b1000110110,
1200 ADCORE_SAMC_0569 = 0b1000110111,
1201 ADCORE_SAMC_0570 = 0b1000111000,
1202 ADCORE_SAMC_0571 = 0b1000111001,
1203 ADCORE_SAMC_0572 = 0b1000111010,
1204 ADCORE_SAMC_0573 = 0b1000111011,
1205 ADCORE_SAMC_0574 = 0b1000111100,
1206 ADCORE_SAMC_0575 = 0b1000111101,
1207 ADCORE_SAMC_0576 = 0b1000111110,
1208 ADCORE_SAMC_0577 = 0b1000111111,
1209 ADCORE_SAMC_0578 = 0b1001000000,
1210 ADCORE_SAMC_0579 = 0b1001000001,
1211 ADCORE_SAMC_0580 = 0b1001000010,
1212 ADCORE_SAMC_0581 = 0b1001000011,
1213 ADCORE_SAMC_0582 = 0b1001000100,
1214 ADCORE_SAMC_0583 = 0b1001000101,
1215 ADCORE_SAMC_0584 = 0b1001000110,
1216 ADCORE_SAMC_0585 = 0b1001000111,
1217 ADCORE_SAMC_0586 = 0b1001001000,
1218 ADCORE_SAMC_0587 = 0b1001001001,
1219 ADCORE_SAMC_0588 = 0b1001001010,
1220 ADCORE_SAMC_0589 = 0b1001001011,
1221 ADCORE_SAMC_0590 = 0b1001001100,
1222 ADCORE_SAMC_0591 = 0b1001001101,
1223 ADCORE_SAMC_0592 = 0b1001001110,
1224 ADCORE_SAMC_0593 = 0b1001001111,
1225 ADCORE_SAMC_0594 = 0b1001010000,
1226 ADCORE_SAMC_0595 = 0b1001010001,
1227 ADCORE_SAMC_0596 = 0b1001010010,
1228 ADCORE_SAMC_0597 = 0b1001010011,
1229 ADCORE_SAMC_0598 = 0b1001010100,
1230 ADCORE_SAMC_0599 = 0b1001010101,
1231 ADCORE_SAMC_0600 = 0b1001010110,
1232 ADCORE_SAMC_0601 = 0b1001010111,
1233 ADCORE_SAMC_0602 = 0b1001011000,
1234 ADCORE_SAMC_0603 = 0b1001011001,
1235 ADCORE_SAMC_0604 = 0b1001011010,
1236 ADCORE_SAMC_0605 = 0b1001011011,
1237 ADCORE_SAMC_0606 = 0b1001011100,
1238 ADCORE_SAMC_0607 = 0b1001011101,
1239 ADCORE_SAMC_0608 = 0b1001011110,
1240 ADCORE_SAMC_0609 = 0b1001011111,
1241 ADCORE_SAMC_0610 = 0b1001100000,
1242 ADCORE_SAMC_0611 = 0b1001100001,
1243 ADCORE_SAMC_0612 = 0b1001100010,
1244 ADCORE_SAMC_0613 = 0b1001100011,
1245 ADCORE_SAMC_0614 = 0b1001100100,
1246 ADCORE_SAMC_0615 = 0b1001100101,
1247 ADCORE_SAMC_0616 = 0b1001100110,
1248 ADCORE_SAMC_0617 = 0b1001100111,
1249 ADCORE_SAMC_0618 = 0b1001101000,
1250 ADCORE_SAMC_0619 = 0b1001101001,
1251 ADCORE_SAMC_0620 = 0b1001101010,
1252 ADCORE_SAMC_0621 = 0b1001101011,
1253 ADCORE_SAMC_0622 = 0b1001101100,
1254 ADCORE_SAMC_0623 = 0b1001101101,
1255 ADCORE_SAMC_0624 = 0b1001101110,
1256 ADCORE_SAMC_0625 = 0b1001101111,
1257 ADCORE_SAMC_0626 = 0b1001110000,
1258 ADCORE_SAMC_0627 = 0b1001110001,
1259 ADCORE_SAMC_0628 = 0b1001110010,
1260 ADCORE_SAMC_0629 = 0b1001110011,
1261 ADCORE_SAMC_0630 = 0b1001110100,
1262 ADCORE_SAMC_0631 = 0b1001110101,
1263 ADCORE_SAMC_0632 = 0b1001110110,
1264 ADCORE_SAMC_0633 = 0b1001110111,
1265 ADCORE_SAMC_0634 = 0b1001111000,
1266 ADCORE_SAMC_0635 = 0b1001111001,
1267 ADCORE_SAMC_0636 = 0b1001111010,
1268 ADCORE_SAMC_0637 = 0b1001111011,
1269 ADCORE_SAMC_0638 = 0b1001111100,
1270 ADCORE_SAMC_0639 = 0b1001111101,
1271 ADCORE_SAMC_0640 = 0b1001111110,
1272 ADCORE_SAMC_0641 = 0b1001111111,
1273 ADCORE_SAMC_0642 = 0b1010000000,
1274 ADCORE_SAMC_0643 = 0b1010000001,
1275 ADCORE_SAMC_0644 = 0b1010000010,
1276 ADCORE_SAMC_0645 = 0b1010000011,
1277 ADCORE_SAMC_0646 = 0b1010000100,
1278 ADCORE_SAMC_0647 = 0b1010000101,
1279 ADCORE_SAMC_0648 = 0b1010000110,
1280 ADCORE_SAMC_0649 = 0b1010000111,
1281 ADCORE_SAMC_0650 = 0b1010001000,
1282 ADCORE_SAMC_0651 = 0b1010001001,
1283 ADCORE_SAMC_0652 = 0b1010001010,
1284 ADCORE_SAMC_0653 = 0b1010001011,
1285 ADCORE_SAMC_0654 = 0b1010001100,
1286 ADCORE_SAMC_0655 = 0b1010001101,
1287 ADCORE_SAMC_0656 = 0b1010001110,
1288 ADCORE_SAMC_0657 = 0b1010001111,
1289 ADCORE_SAMC_0658 = 0b1010010000,
1290 ADCORE_SAMC_0659 = 0b1010010001,
1291 ADCORE_SAMC_0660 = 0b1010010010,
1292 ADCORE_SAMC_0661 = 0b1010010011,
1293 ADCORE_SAMC_0662 = 0b1010010100,
1294 ADCORE_SAMC_0663 = 0b1010010101,
1295 ADCORE_SAMC_0664 = 0b1010010110,
1296 ADCORE_SAMC_0665 = 0b1010010111,
1297 ADCORE_SAMC_0666 = 0b1010011000,
1298 ADCORE_SAMC_0667 = 0b1010011001,
1299 ADCORE_SAMC_0668 = 0b1010011010,
1300 ADCORE_SAMC_0669 = 0b1010011011,
1301 ADCORE_SAMC_0670 = 0b1010011100,
1302 ADCORE_SAMC_0671 = 0b1010011101,
1303 ADCORE_SAMC_0672 = 0b1010011110,
1304 ADCORE_SAMC_0673 = 0b1010011111,
1305 ADCORE_SAMC_0674 = 0b1010100000,
1306 ADCORE_SAMC_0675 = 0b1010100001,
1307 ADCORE_SAMC_0676 = 0b1010100010,
1308 ADCORE_SAMC_0677 = 0b1010100011,
1309 ADCORE_SAMC_0678 = 0b1010100100,
1310 ADCORE_SAMC_0679 = 0b1010100101,
1311 ADCORE_SAMC_0680 = 0b1010100110,
1312 ADCORE_SAMC_0681 = 0b1010100111,
1313 ADCORE_SAMC_0682 = 0b1010101000,
1314 ADCORE_SAMC_0683 = 0b1010101001,
1315 ADCORE_SAMC_0684 = 0b1010101010,
1316 ADCORE_SAMC_0685 = 0b1010101011,
1317 ADCORE_SAMC_0686 = 0b1010101100,
1318 ADCORE_SAMC_0687 = 0b1010101101,
1319 ADCORE_SAMC_0688 = 0b1010101110,
1320 ADCORE_SAMC_0689 = 0b1010101111,
1321 ADCORE_SAMC_0690 = 0b1010110000,
1322 ADCORE_SAMC_0691 = 0b1010110001,
1323 ADCORE_SAMC_0692 = 0b1010110010,
1324 ADCORE_SAMC_0693 = 0b1010110011,
1325 ADCORE_SAMC_0694 = 0b1010110100,
1326 ADCORE_SAMC_0695 = 0b1010110101,
1327 ADCORE_SAMC_0696 = 0b1010110110,
1328 ADCORE_SAMC_0697 = 0b1010110111,
1329 ADCORE_SAMC_0698 = 0b1010111000,
1330 ADCORE_SAMC_0699 = 0b1010111001,
1331 ADCORE_SAMC_0700 = 0b1010111010,
1332 ADCORE_SAMC_0701 = 0b1010111011,
1333 ADCORE_SAMC_0702 = 0b1010111100,
1334 ADCORE_SAMC_0703 = 0b1010111101,
1335 ADCORE_SAMC_0704 = 0b1010111110,
1336 ADCORE_SAMC_0705 = 0b1010111111,
1337 ADCORE_SAMC_0706 = 0b1011000000,
1338 ADCORE_SAMC_0707 = 0b1011000001,
1339 ADCORE_SAMC_0708 = 0b1011000010,
1340 ADCORE_SAMC_0709 = 0b1011000011,
1341 ADCORE_SAMC_0710 = 0b1011000100,
1342 ADCORE_SAMC_0711 = 0b1011000101,
1343 ADCORE_SAMC_0712 = 0b1011000110,
1344 ADCORE_SAMC_0713 = 0b1011000111,
1345 ADCORE_SAMC_0714 = 0b1011001000,
1346 ADCORE_SAMC_0715 = 0b1011001001,
1347 ADCORE_SAMC_0716 = 0b1011001010,
1348 ADCORE_SAMC_0717 = 0b1011001011,
1349 ADCORE_SAMC_0718 = 0b1011001100,
1350 ADCORE_SAMC_0719 = 0b1011001101,
1351 ADCORE_SAMC_0720 = 0b1011001110,
1352 ADCORE_SAMC_0721 = 0b1011001111,
1353 ADCORE_SAMC_0722 = 0b1011010000,
1354 ADCORE_SAMC_0723 = 0b1011010001,
1355 ADCORE_SAMC_0724 = 0b1011010010,
1356 ADCORE_SAMC_0725 = 0b1011010011,
1357 ADCORE_SAMC_0726 = 0b1011010100,
1358 ADCORE_SAMC_0727 = 0b1011010101,
1359 ADCORE_SAMC_0728 = 0b1011010110,
1360 ADCORE_SAMC_0729 = 0b1011010111,
1361 ADCORE_SAMC_0730 = 0b1011011000,
1362 ADCORE_SAMC_0731 = 0b1011011001,
1363 ADCORE_SAMC_0732 = 0b1011011010,
1364 ADCORE_SAMC_0733 = 0b1011011011,
1365 ADCORE_SAMC_0734 = 0b1011011100,
1366 ADCORE_SAMC_0735 = 0b1011011101,
1367 ADCORE_SAMC_0736 = 0b1011011110,
1368 ADCORE_SAMC_0737 = 0b1011011111,
1369 ADCORE_SAMC_0738 = 0b1011100000,
1370 ADCORE_SAMC_0739 = 0b1011100001,
1371 ADCORE_SAMC_0740 = 0b1011100010,
1372 ADCORE_SAMC_0741 = 0b1011100011,
1373 ADCORE_SAMC_0742 = 0b1011100100,
1374 ADCORE_SAMC_0743 = 0b1011100101,
1375 ADCORE_SAMC_0744 = 0b1011100110,
1376 ADCORE_SAMC_0745 = 0b1011100111,
1377 ADCORE_SAMC_0746 = 0b1011101000,
1378 ADCORE_SAMC_0747 = 0b1011101001,
1379 ADCORE_SAMC_0748 = 0b1011101010,
1380 ADCORE_SAMC_0749 = 0b1011101011,
1381 ADCORE_SAMC_0750 = 0b1011101100,
1382 ADCORE_SAMC_0751 = 0b1011101101,
1383 ADCORE_SAMC_0752 = 0b1011101110,
1384 ADCORE_SAMC_0753 = 0b1011101111,
1385 ADCORE_SAMC_0754 = 0b1011110000,
1386 ADCORE_SAMC_0755 = 0b1011110001,
1387 ADCORE_SAMC_0756 = 0b1011110010,
1388 ADCORE_SAMC_0757 = 0b1011110011,
1389 ADCORE_SAMC_0758 = 0b1011110100,
1390 ADCORE_SAMC_0759 = 0b1011110101,
1391 ADCORE_SAMC_0760 = 0b1011110110,
1392 ADCORE_SAMC_0761 = 0b1011110111,
1393 ADCORE_SAMC_0762 = 0b1011111000,
1394 ADCORE_SAMC_0763 = 0b1011111001,
1395 ADCORE_SAMC_0764 = 0b1011111010,
1396 ADCORE_SAMC_0765 = 0b1011111011,
1397 ADCORE_SAMC_0766 = 0b1011111100,
1398 ADCORE_SAMC_0767 = 0b1011111101,
1399 ADCORE_SAMC_0768 = 0b1011111110,
1400 ADCORE_SAMC_0769 = 0b1011111111,
1401 ADCORE_SAMC_0770 = 0b1100000000,
1402 ADCORE_SAMC_0771 = 0b1100000001,
1403 ADCORE_SAMC_0772 = 0b1100000010,
1404 ADCORE_SAMC_0773 = 0b1100000011,
1405 ADCORE_SAMC_0774 = 0b1100000100,
1406 ADCORE_SAMC_0775 = 0b1100000101,
1407 ADCORE_SAMC_0776 = 0b1100000110,
1408 ADCORE_SAMC_0777 = 0b1100000111,
1409 ADCORE_SAMC_0778 = 0b1100001000,
1410 ADCORE_SAMC_0779 = 0b1100001001,
1411 ADCORE_SAMC_0780 = 0b1100001010,
1412 ADCORE_SAMC_0781 = 0b1100001011,
1413 ADCORE_SAMC_0782 = 0b1100001100,
1414 ADCORE_SAMC_0783 = 0b1100001101,
1415 ADCORE_SAMC_0784 = 0b1100001110,
1416 ADCORE_SAMC_0785 = 0b1100001111,
1417 ADCORE_SAMC_0786 = 0b1100010000,
1418 ADCORE_SAMC_0787 = 0b1100010001,
1419 ADCORE_SAMC_0788 = 0b1100010010,
1420 ADCORE_SAMC_0789 = 0b1100010011,
1421 ADCORE_SAMC_0790 = 0b1100010100,
1422 ADCORE_SAMC_0791 = 0b1100010101,
1423 ADCORE_SAMC_0792 = 0b1100010110,
1424 ADCORE_SAMC_0793 = 0b1100010111,
1425 ADCORE_SAMC_0794 = 0b1100011000,
1426 ADCORE_SAMC_0795 = 0b1100011001,
1427 ADCORE_SAMC_0796 = 0b1100011010,
1428 ADCORE_SAMC_0797 = 0b1100011011,
1429 ADCORE_SAMC_0798 = 0b1100011100,
1430 ADCORE_SAMC_0799 = 0b1100011101,
1431 ADCORE_SAMC_0800 = 0b1100011110,
1432 ADCORE_SAMC_0801 = 0b1100011111,
1433 ADCORE_SAMC_0802 = 0b1100100000,
1434 ADCORE_SAMC_0803 = 0b1100100001,
1435 ADCORE_SAMC_0804 = 0b1100100010,
1436 ADCORE_SAMC_0805 = 0b1100100011,
1437 ADCORE_SAMC_0806 = 0b1100100100,
1438 ADCORE_SAMC_0807 = 0b1100100101,
1439 ADCORE_SAMC_0808 = 0b1100100110,
1440 ADCORE_SAMC_0809 = 0b1100100111,
1441 ADCORE_SAMC_0810 = 0b1100101000,
1442 ADCORE_SAMC_0811 = 0b1100101001,
1443 ADCORE_SAMC_0812 = 0b1100101010,
1444 ADCORE_SAMC_0813 = 0b1100101011,
1445 ADCORE_SAMC_0814 = 0b1100101100,
1446 ADCORE_SAMC_0815 = 0b1100101101,
1447 ADCORE_SAMC_0816 = 0b1100101110,
1448 ADCORE_SAMC_0817 = 0b1100101111,
1449 ADCORE_SAMC_0818 = 0b1100110000,
1450 ADCORE_SAMC_0819 = 0b1100110001,
1451 ADCORE_SAMC_0820 = 0b1100110010,
1452 ADCORE_SAMC_0821 = 0b1100110011,
1453 ADCORE_SAMC_0822 = 0b1100110100,
1454 ADCORE_SAMC_0823 = 0b1100110101,
1455 ADCORE_SAMC_0824 = 0b1100110110,
1456 ADCORE_SAMC_0825 = 0b1100110111,
1457 ADCORE_SAMC_0826 = 0b1100111000,
1458 ADCORE_SAMC_0827 = 0b1100111001,
1459 ADCORE_SAMC_0828 = 0b1100111010,
1460 ADCORE_SAMC_0829 = 0b1100111011,
1461 ADCORE_SAMC_0830 = 0b1100111100,
1462 ADCORE_SAMC_0831 = 0b1100111101,
1463 ADCORE_SAMC_0832 = 0b1100111110,
1464 ADCORE_SAMC_0833 = 0b1100111111,
1465 ADCORE_SAMC_0834 = 0b1101000000,
1466 ADCORE_SAMC_0835 = 0b1101000001,
1467 ADCORE_SAMC_0836 = 0b1101000010,
1468 ADCORE_SAMC_0837 = 0b1101000011,
1469 ADCORE_SAMC_0838 = 0b1101000100,
1470 ADCORE_SAMC_0839 = 0b1101000101,
1471 ADCORE_SAMC_0840 = 0b1101000110,
1472 ADCORE_SAMC_0841 = 0b1101000111,
1473 ADCORE_SAMC_0842 = 0b1101001000,
1474 ADCORE_SAMC_0843 = 0b1101001001,
1475 ADCORE_SAMC_0844 = 0b1101001010,
1476 ADCORE_SAMC_0845 = 0b1101001011,
1477 ADCORE_SAMC_0846 = 0b1101001100,
1478 ADCORE_SAMC_0847 = 0b1101001101,
1479 ADCORE_SAMC_0848 = 0b1101001110,
1480 ADCORE_SAMC_0849 = 0b1101001111,
1481 ADCORE_SAMC_0850 = 0b1101010000,
1482 ADCORE_SAMC_0851 = 0b1101010001,
1483 ADCORE_SAMC_0852 = 0b1101010010,
1484 ADCORE_SAMC_0853 = 0b1101010011,
1485 ADCORE_SAMC_0854 = 0b1101010100,
1486 ADCORE_SAMC_0855 = 0b1101010101,
1487 ADCORE_SAMC_0856 = 0b1101010110,
1488 ADCORE_SAMC_0857 = 0b1101010111,
1489 ADCORE_SAMC_0858 = 0b1101011000,
1490 ADCORE_SAMC_0859 = 0b1101011001,
1491 ADCORE_SAMC_0860 = 0b1101011010,
1492 ADCORE_SAMC_0861 = 0b1101011011,
1493 ADCORE_SAMC_0862 = 0b1101011100,
1494 ADCORE_SAMC_0863 = 0b1101011101,
1495 ADCORE_SAMC_0864 = 0b1101011110,
1496 ADCORE_SAMC_0865 = 0b1101011111,
1497 ADCORE_SAMC_0866 = 0b1101100000,
1498 ADCORE_SAMC_0867 = 0b1101100001,
1499 ADCORE_SAMC_0868 = 0b1101100010,
1500 ADCORE_SAMC_0869 = 0b1101100011,
1501 ADCORE_SAMC_0870 = 0b1101100100,
1502 ADCORE_SAMC_0871 = 0b1101100101,
1503 ADCORE_SAMC_0872 = 0b1101100110,
1504 ADCORE_SAMC_0873 = 0b1101100111,
1505 ADCORE_SAMC_0874 = 0b1101101000,
1506 ADCORE_SAMC_0875 = 0b1101101001,
1507 ADCORE_SAMC_0876 = 0b1101101010,
1508 ADCORE_SAMC_0877 = 0b1101101011,
1509 ADCORE_SAMC_0878 = 0b1101101100,
1510 ADCORE_SAMC_0879 = 0b1101101101,
1511 ADCORE_SAMC_0880 = 0b1101101110,
1512 ADCORE_SAMC_0881 = 0b1101101111,
1513 ADCORE_SAMC_0882 = 0b1101110000,
1514 ADCORE_SAMC_0883 = 0b1101110001,
1515 ADCORE_SAMC_0884 = 0b1101110010,
1516 ADCORE_SAMC_0885 = 0b1101110011,
1517 ADCORE_SAMC_0886 = 0b1101110100,
1518 ADCORE_SAMC_0887 = 0b1101110101,
1519 ADCORE_SAMC_0888 = 0b1101110110,
1520 ADCORE_SAMC_0889 = 0b1101110111,
1521 ADCORE_SAMC_0890 = 0b1101111000,
1522 ADCORE_SAMC_0891 = 0b1101111001,
1523 ADCORE_SAMC_0892 = 0b1101111010,
1524 ADCORE_SAMC_0893 = 0b1101111011,
1525 ADCORE_SAMC_0894 = 0b1101111100,
1526 ADCORE_SAMC_0895 = 0b1101111101,
1527 ADCORE_SAMC_0896 = 0b1101111110,
1528 ADCORE_SAMC_0897 = 0b1101111111,
1529 ADCORE_SAMC_0898 = 0b1110000000,
1530 ADCORE_SAMC_0899 = 0b1110000001,
1531 ADCORE_SAMC_0900 = 0b1110000010,
1532 ADCORE_SAMC_0901 = 0b1110000011,
1533 ADCORE_SAMC_0902 = 0b1110000100,
1534 ADCORE_SAMC_0903 = 0b1110000101,
1535 ADCORE_SAMC_0904 = 0b1110000110,
1536 ADCORE_SAMC_0905 = 0b1110000111,
1537 ADCORE_SAMC_0906 = 0b1110001000,
1538 ADCORE_SAMC_0907 = 0b1110001001,
1539 ADCORE_SAMC_0908 = 0b1110001010,
1540 ADCORE_SAMC_0909 = 0b1110001011,
1541 ADCORE_SAMC_0910 = 0b1110001100,
1542 ADCORE_SAMC_0911 = 0b1110001101,
1543 ADCORE_SAMC_0912 = 0b1110001110,
1544 ADCORE_SAMC_0913 = 0b1110001111,
1545 ADCORE_SAMC_0914 = 0b1110010000,
1546 ADCORE_SAMC_0915 = 0b1110010001,
1547 ADCORE_SAMC_0916 = 0b1110010010,
1548 ADCORE_SAMC_0917 = 0b1110010011,
1549 ADCORE_SAMC_0918 = 0b1110010100,
1550 ADCORE_SAMC_0919 = 0b1110010101,
1551 ADCORE_SAMC_0920 = 0b1110010110,
1552 ADCORE_SAMC_0921 = 0b1110010111,
1553 ADCORE_SAMC_0922 = 0b1110011000,
1554 ADCORE_SAMC_0923 = 0b1110011001,
1555 ADCORE_SAMC_0924 = 0b1110011010,
1556 ADCORE_SAMC_0925 = 0b1110011011,
1557 ADCORE_SAMC_0926 = 0b1110011100,
1558 ADCORE_SAMC_0927 = 0b1110011101,
1559 ADCORE_SAMC_0928 = 0b1110011110,
1560 ADCORE_SAMC_0929 = 0b1110011111,
1561 ADCORE_SAMC_0930 = 0b1110100000,
1562 ADCORE_SAMC_0931 = 0b1110100001,
1563 ADCORE_SAMC_0932 = 0b1110100010,
1564 ADCORE_SAMC_0933 = 0b1110100011,
1565 ADCORE_SAMC_0934 = 0b1110100100,
1566 ADCORE_SAMC_0935 = 0b1110100101,
1567 ADCORE_SAMC_0936 = 0b1110100110,
1568 ADCORE_SAMC_0937 = 0b1110100111,
1569 ADCORE_SAMC_0938 = 0b1110101000,
1570 ADCORE_SAMC_0939 = 0b1110101001,
1571 ADCORE_SAMC_0940 = 0b1110101010,
1572 ADCORE_SAMC_0941 = 0b1110101011,
1573 ADCORE_SAMC_0942 = 0b1110101100,
1574 ADCORE_SAMC_0943 = 0b1110101101,
1575 ADCORE_SAMC_0944 = 0b1110101110,
1576 ADCORE_SAMC_0945 = 0b1110101111,
1577 ADCORE_SAMC_0946 = 0b1110110000,
1578 ADCORE_SAMC_0947 = 0b1110110001,
1579 ADCORE_SAMC_0948 = 0b1110110010,
1580 ADCORE_SAMC_0949 = 0b1110110011,
1581 ADCORE_SAMC_0950 = 0b1110110100,
1582 ADCORE_SAMC_0951 = 0b1110110101,
1583 ADCORE_SAMC_0952 = 0b1110110110,
1584 ADCORE_SAMC_0953 = 0b1110110111,
1585 ADCORE_SAMC_0954 = 0b1110111000,
1586 ADCORE_SAMC_0955 = 0b1110111001,
1587 ADCORE_SAMC_0956 = 0b1110111010,
1588 ADCORE_SAMC_0957 = 0b1110111011,
1589 ADCORE_SAMC_0958 = 0b1110111100,
1590 ADCORE_SAMC_0959 = 0b1110111101,
1591 ADCORE_SAMC_0960 = 0b1110111110,
1592 ADCORE_SAMC_0961 = 0b1110111111,
1593 ADCORE_SAMC_0962 = 0b1111000000,
1594 ADCORE_SAMC_0963 = 0b1111000001,
1595 ADCORE_SAMC_0964 = 0b1111000010,
1596 ADCORE_SAMC_0965 = 0b1111000011,
1597 ADCORE_SAMC_0966 = 0b1111000100,
1598 ADCORE_SAMC_0967 = 0b1111000101,
1599 ADCORE_SAMC_0968 = 0b1111000110,
1600 ADCORE_SAMC_0969 = 0b1111000111,
1601 ADCORE_SAMC_0970 = 0b1111001000,
1602 ADCORE_SAMC_0971 = 0b1111001001,
1603 ADCORE_SAMC_0972 = 0b1111001010,
1604 ADCORE_SAMC_0973 = 0b1111001011,
1605 ADCORE_SAMC_0974 = 0b1111001100,
1606 ADCORE_SAMC_0975 = 0b1111001101,
1607 ADCORE_SAMC_0976 = 0b1111001110,
1608 ADCORE_SAMC_0977 = 0b1111001111,
1609 ADCORE_SAMC_0978 = 0b1111010000,
1610 ADCORE_SAMC_0979 = 0b1111010001,
1611 ADCORE_SAMC_0980 = 0b1111010010,
1612 ADCORE_SAMC_0981 = 0b1111010011,
1613 ADCORE_SAMC_0982 = 0b1111010100,
1614 ADCORE_SAMC_0983 = 0b1111010101,
1615 ADCORE_SAMC_0984 = 0b1111010110,
1616 ADCORE_SAMC_0985 = 0b1111010111,
1617 ADCORE_SAMC_0986 = 0b1111011000,
1618 ADCORE_SAMC_0987 = 0b1111011001,
1619 ADCORE_SAMC_0988 = 0b1111011010,
1620 ADCORE_SAMC_0989 = 0b1111011011,
1621 ADCORE_SAMC_0990 = 0b1111011100,
1622 ADCORE_SAMC_0991 = 0b1111011101,
1623 ADCORE_SAMC_0992 = 0b1111011110,
1624 ADCORE_SAMC_0993 = 0b1111011111,
1625 ADCORE_SAMC_0994 = 0b1111100000,
1626 ADCORE_SAMC_0995 = 0b1111100001,
1627 ADCORE_SAMC_0996 = 0b1111100010,
1628 ADCORE_SAMC_0997 = 0b1111100011,
1629 ADCORE_SAMC_0998 = 0b1111100100,
1630 ADCORE_SAMC_0999 = 0b1111100101,
1631 ADCORE_SAMC_1000 = 0b1111100110,
1632 ADCORE_SAMC_1001 = 0b1111100111,
1633 ADCORE_SAMC_1002 = 0b1111101000,
1634 ADCORE_SAMC_1003 = 0b1111101001,
1635 ADCORE_SAMC_1004 = 0b1111101010,
1636 ADCORE_SAMC_1005 = 0b1111101011,
1637 ADCORE_SAMC_1006 = 0b1111101100,
1638 ADCORE_SAMC_1007 = 0b1111101101,
1639 ADCORE_SAMC_1008 = 0b1111101110,
1640 ADCORE_SAMC_1009 = 0b1111101111,
1641 ADCORE_SAMC_1010 = 0b1111110000,
1642 ADCORE_SAMC_1011 = 0b1111110001,
1643 ADCORE_SAMC_1012 = 0b1111110010,
1644 ADCORE_SAMC_1013 = 0b1111110011,
1645 ADCORE_SAMC_1014 = 0b1111110100,
1646 ADCORE_SAMC_1015 = 0b1111110101,
1647 ADCORE_SAMC_1016 = 0b1111110110,
1648 ADCORE_SAMC_1017 = 0b1111110111,
1649 ADCORE_SAMC_1018 = 0b1111111000,
1650 ADCORE_SAMC_1019 = 0b1111111001,
1651 ADCORE_SAMC_1020 = 0b1111111010,
1652 ADCORE_SAMC_1021 = 0b1111111011,
1653 ADCORE_SAMC_1022 = 0b1111111100,
1654 ADCORE_SAMC_1023 = 0b1111111101,
1655 ADCORE_SAMC_1024 = 0b1111111110,
1656 ADCORE_SAMC_1025 = 0b1111111111
1661 volatile ADCOREx_ADCS_e shradcs : 7;
1662 volatile unsigned : 1;
1663 volatile ADCOREx_EISEL_e shreisel : 3;
1664 volatile ADCON2_PTGEN_e ptgen : 1;
1665 volatile ADCON2_EIEN_e eien : 1;
1666 volatile unsigned : 1;
1667 volatile ADCON2_REFERCIE_e refercie : 1;
1668 volatile ADCON2_REFCIE_e refcie : 1;
1669 } __attribute__((packed)) bits;
1670 volatile uint16_t value;
1676 volatile ADCOREx_SAMC_e shrsamc : 10;
1677 volatile unsigned : 4;
1678 volatile ADCON2_REFERR_e referr : 1;
1679 volatile ADCON2_REFRDY_e refrdy : 1;
1680 } __attribute__((packed)) bits;
1681 volatile uint16_t value;
1686 volatile ADCON2H_t adcon2l;
1687 volatile ADCON2H_t adcon2h;
1689 volatile uint32_t value;
1696 #define REG_ADCON3_VALID_DATA_WRITE_MSK ((0xFF80FABF) | (uint32_t)(ADCORE_REGISTER_BIT_MSK << 16))
1697 #define REG_ADCON3_VALID_DATA_READ_MSK ((0xFF80FABF) | (uint32_t)(ADCORE_REGISTER_BIT_MSK << 16))
1698 #define REG_ADCON3_DISABLE_ADC_CORES_MSK (0xFF00FFFF)
1700 #define REG_ADCON3L_RESET 0b0000010101000000 // Reset ADCON 3 Low Register
1701 #define REG_ADCON3L_VALID_DATA_WRITE_MSK 0b1111101010111111 // Bit mask used to set unimplemented bits to zero
1702 #define REG_ADCON3L_VALID_DATA_READ_MSK 0b1111111111111111 // Bit mask used to set unimplemented bits to zero
1704 #define REG_ADCON3H_RESET 0b1100000000000000 // Reset ADCON 3 High Register
1705 #define REG_ADCON3H_VALID_DATA_WRITE_MSK (0xFF80 | (uint16_t)ADCORE_REGISTER_BIT_MSK) // Bit mask used to set unimplemented bits to zero
1706 #define REG_ADCON3H_VALID_DATA_READ_MSK (0xFF80 | (uint16_t)ADCORE_REGISTER_BIT_MSK) // Bit mask used to set unimplemented bits to zero
1707 #define REG_ADCON3H_DISABLE_ADC_CORES_MSK (0xFF00) // Bit mask used to set unimplemented bits to zero
1709 #define REG_ADCON3L_REFSEL_AVDD_AVSS 0b0000000000000000 // Vref = AVDD to AVSS
1712 ADCON3_REFSEL_AVDD_AVSS = 0b000
1715 #define REG_ADCON3L_SUSPEND_HOLD 0b0001000000000000 // All ADC triggers are disabled
1716 #define REG_ADCON3L_SUSPEND_RUN 0b0000000000000000 // All ADC triggers are enabled
1719 ADCON3_SUSPEND_HOLD = 0b1,
1720 ADCON3_SUSPEND_RUN = 0b0
1723 #define REG_ADCON3L_SUSPCIE_ENABLED 0b0000100000000000 // Suspend Interrupt Enabled
1724 #define REG_ADCON3L_SUSPCIE_DISABLED 0b0000000000000000 // Suspend Interrupt Disabled
1727 ADCON3_SUSPCIE_ENABLED = 0b1,
1728 ADCON3_SUSPCIE_DISABLED = 0b0
1731 #define REG_ADCON3L_SUSPRDY_SUSPENDED 0b0000010000000000 // READ ONLY: Suspend Status ON
1732 #define REG_ADCON3L_SUSPRDY_RUNNING 0b0000000000000000 // READ ONLY: Suspend Status OFF
1735 ADCON3_SUSPRDY_SUSPENDED = 0b1,
1736 ADCON3_SUSPRDY_RUNNING = 0b0
1739 #define REG_ADCON3L_SHRSAMP_SWTRIG 0b0000001000000000 // Individual Software Trigger for shared Core
1740 #define REG_ADCON3L_SHRSAMP_HWTRIG 0b0000000000000000 // Individual Software Trigger for shared Core disabled
1743 ADCON3_SHRSAMP_SWTRIG = 0b1,
1744 ADCON3_SHRSAMP_HWTRIG = 0b0
1751 #define REG_ADCON3L_CNVRTCH_GO 0b0000000100000000 // Individual Software Trigger Status Bit ON (GO) =< will be cleared by hardware when executed
1752 #define REG_ADCON3L_CNVRTCH_READY 0b0000000000000000 // Individual Software Trigger Status Bit OFF (READY for next trigger)
1755 ADCON3_CNVRTCH_GO = 0b1,
1756 ADCON3_CNVRTCH_READY = 0b0
1760 #define REG_ADCON3L_SWLCTRG_LVLTRG_BY_SW 0b0000000010000000 // Software Level-Sensitive Common Trigger ON
1761 #define REG_ADCON3L_SWLCTRG_LVLTRG_BY_HW 0b0000000000000000 // Software Level-Sensitive Common Trigger OFF
1764 ADCON3_SWLCTRG_LVLTRG_BY_SW = 0b1,
1765 ADCON3_SWLCTRG_LVLTRG_BY_HW = 0b0
1768 #define REG_ADCON3L_SWCTRG_GO 0b0000000001000000 // Software Common Trigger ON
1769 #define REG_ADCON3L_SWCTRG_READY 0b0000000000000000 // Software Common Trigger OFF
1772 ADCON3_SWCTRG_GO = 0b1,
1773 ADCON3_SWCTRG_READY = 0b0
1776 #define REG_ADCON3L_CNVCHSEL_MSK 0b0000000000111111 // Channel Number Mask
1777 #define REG_ADCON3L_CNVCHSEL(channel) (channel & REG_ADCON3L_CNVCHSEL_MSK) // Channel Number
1780 ADCON3_CNVCHSEL_AN0 = 0b000000,
1781 ADCON3_CNVCHSEL_AN1 = 0b000001,
1782 ADCON3_CNVCHSEL_AN2 = 0b000010,
1783 ADCON3_CNVCHSEL_AN3 = 0b000011,
1784 ADCON3_CNVCHSEL_AN4 = 0b000100,
1785 ADCON3_CNVCHSEL_AN5 = 0b000101,
1786 ADCON3_CNVCHSEL_AN6 = 0b000110,
1787 ADCON3_CNVCHSEL_AN7 = 0b000111,
1788 ADCON3_CNVCHSEL_AN8 = 0b001000,
1789 ADCON3_CNVCHSEL_AN9 = 0b001001,
1790 ADCON3_CNVCHSEL_AN10 = 0b001010,
1791 ADCON3_CNVCHSEL_AN11 = 0b001011,
1792 ADCON3_CNVCHSEL_AN12 = 0b001100,
1793 ADCON3_CNVCHSEL_AN13 = 0b001101,
1794 ADCON3_CNVCHSEL_AN14 = 0b001110,
1795 ADCON3_CNVCHSEL_AN15 = 0b001111,
1796 ADCON3_CNVCHSEL_AN16 = 0b010000,
1797 ADCON3_CNVCHSEL_AN17 = 0b010001,
1798 ADCON3_CNVCHSEL_AN18 = 0b010010,
1799 ADCON3_CNVCHSEL_AN19 = 0b010011,
1800 ADCON3_CNVCHSEL_AN20 = 0b010100,
1801 ADCON3_CNVCHSEL_AN21 = 0b010101,
1802 ADCON3_CNVCHSEL_AN22 = 0b010110,
1803 ADCON3_CNVCHSEL_AN23 = 0b010111,
1804 ADCON3_CNVCHSEL_AN24 = 0b011000,
1805 ADCON3_CNVCHSEL_AN25 = 0b011001,
1806 ADCON3_CNVCHSEL_AN26 = 0b011010,
1807 ADCON3_CNVCHSEL_AN27 = 0b011011,
1808 ADCON3_CNVCHSEL_AN28 = 0b011100,
1809 ADCON3_CNVCHSEL_AN29 = 0b011101,
1810 ADCON3_CNVCHSEL_AN30 = 0b011110,
1811 ADCON3_CNVCHSEL_AN31 = 0b011111,
1812 ADCON3_CNVCHSEL_AN32 = 0b100000,
1813 ADCON3_CNVCHSEL_AN33 = 0b100001,
1814 ADCON3_CNVCHSEL_AN34 = 0b100010,
1815 ADCON3_CNVCHSEL_AN35 = 0b100011,
1816 ADCON3_CNVCHSEL_AN36 = 0b100100,
1817 ADCON3_CNVCHSEL_AN37 = 0b100101,
1818 ADCON3_CNVCHSEL_AN38 = 0b100110,
1819 ADCON3_CNVCHSEL_AN39 = 0b100111,
1820 ADCON3_CNVCHSEL_AN40 = 0b101000,
1821 ADCON3_CNVCHSEL_AN41 = 0b101001,
1822 ADCON3_CNVCHSEL_AN42 = 0b101010,
1823 ADCON3_CNVCHSEL_AN43 = 0b101011,
1824 ADCON3_CNVCHSEL_AN44 = 0b101100,
1825 ADCON3_CNVCHSEL_AN45 = 0b101101,
1826 ADCON3_CNVCHSEL_AN46 = 0b101110,
1827 ADCON3_CNVCHSEL_AN47 = 0b101111,
1828 ADCON3_CNVCHSEL_AN48 = 0b110000,
1829 ADCON3_CNVCHSEL_AN49 = 0b110001,
1830 ADCON3_CNVCHSEL_AN50 = 0b110010,
1831 ADCON3_CNVCHSEL_AN51 = 0b110011,
1832 ADCON3_CNVCHSEL_AN52 = 0b110100,
1833 ADCON3_CNVCHSEL_AN53 = 0b110101,
1834 ADCON3_CNVCHSEL_AN54 = 0b110110,
1835 ADCON3_CNVCHSEL_AN55 = 0b110111,
1836 ADCON3_CNVCHSEL_AN56 = 0b111000,
1837 ADCON3_CNVCHSEL_AN57 = 0b111001,
1838 ADCON3_CNVCHSEL_AN58 = 0b111010,
1839 ADCON3_CNVCHSEL_AN59 = 0b111011,
1840 ADCON3_CNVCHSEL_AN60 = 0b111100,
1841 ADCON3_CNVCHSEL_AN61 = 0b111101,
1842 ADCON3_CNVCHSEL_AN62 = 0b111110,
1843 ADCON3_CNVCHSEL_AN63 = 0b111111
1844 } ADCON3_CNVCHSEL_e;
1849 #define REG_ADCON3H_CLKSEL_FVCO_DIV_4 0b1100000000000000 // FVCO/4 PLL Feedback Click Output
1850 #define REG_ADCON3H_CLKSEL_AFVCODIV 0b1000000000000000 // AFVCODIV Auxiliary Clock (recommended)
1851 #define REG_ADCON3H_CLKSEL_FOSC 0b0100000000000000 // System Clock FOSC
1852 #define REG_ADCON3H_CLKSEL_FOSC_DIV_2 0b0000000000000000 // Peripheral Clock FP (FOSC/2)
1855 ADCON3_CLKSEL_FVCO_DIV_4 = 0b11,
1856 ADCON3_CLKSEL_AFVCODIV = 0b10,
1857 ADCON3_CLKSEL_FOSC = 0b01,
1858 ADCON3_CLKSEL_FOSC_DIV_2 = 0b00
1861 #define REG_ADCON3H_CLKDIV_MSK 0b0011111100000000 // Source Clock Divider Filter Mask
1862 #define REG_ADCON3H_CLKDIV(x) (((x-1) << 8) & REG_ADCON3H_CLKDIV_MSK) // Source Clock Divider Value
1865 ADCON3_CLKDIV_1 = 0b000000,
1866 ADCON3_CLKDIV_2 = 0b000001,
1867 ADCON3_CLKDIV_3 = 0b000010,
1868 ADCON3_CLKDIV_4 = 0b000011,
1869 ADCON3_CLKDIV_5 = 0b000100,
1870 ADCON3_CLKDIV_6 = 0b000101,
1871 ADCON3_CLKDIV_7 = 0b000110,
1872 ADCON3_CLKDIV_8 = 0b000111,
1873 ADCON3_CLKDIV_9 = 0b001000,
1874 ADCON3_CLKDIV_10 = 0b001001,
1875 ADCON3_CLKDIV_11 = 0b001010,
1876 ADCON3_CLKDIV_12 = 0b001011,
1877 ADCON3_CLKDIV_13 = 0b001100,
1878 ADCON3_CLKDIV_14 = 0b001101,
1879 ADCON3_CLKDIV_15 = 0b001110,
1880 ADCON3_CLKDIV_16 = 0b001111,
1881 ADCON3_CLKDIV_17 = 0b010000,
1882 ADCON3_CLKDIV_18 = 0b010001,
1883 ADCON3_CLKDIV_19 = 0b010010,
1884 ADCON3_CLKDIV_20 = 0b010011,
1885 ADCON3_CLKDIV_21 = 0b010100,
1886 ADCON3_CLKDIV_22 = 0b010101,
1887 ADCON3_CLKDIV_23 = 0b010110,
1888 ADCON3_CLKDIV_24 = 0b010111,
1889 ADCON3_CLKDIV_25 = 0b011000,
1890 ADCON3_CLKDIV_26 = 0b011001,
1891 ADCON3_CLKDIV_27 = 0b011010,
1892 ADCON3_CLKDIV_28 = 0b011011,
1893 ADCON3_CLKDIV_29 = 0b011100,
1894 ADCON3_CLKDIV_30 = 0b011101,
1895 ADCON3_CLKDIV_31 = 0b011110,
1896 ADCON3_CLKDIV_32 = 0b011111,
1897 ADCON3_CLKDIV_33 = 0b100000,
1898 ADCON3_CLKDIV_34 = 0b100001,
1899 ADCON3_CLKDIV_35 = 0b100010,
1900 ADCON3_CLKDIV_36 = 0b100011,
1901 ADCON3_CLKDIV_37 = 0b100100,
1902 ADCON3_CLKDIV_38 = 0b100101,
1903 ADCON3_CLKDIV_39 = 0b100110,
1904 ADCON3_CLKDIV_40 = 0b100111,
1905 ADCON3_CLKDIV_41 = 0b101000,
1906 ADCON3_CLKDIV_42 = 0b101001,
1907 ADCON3_CLKDIV_43 = 0b101010,
1908 ADCON3_CLKDIV_44 = 0b101011,
1909 ADCON3_CLKDIV_45 = 0b101100,
1910 ADCON3_CLKDIV_46 = 0b101101,
1911 ADCON3_CLKDIV_47 = 0b101110,
1912 ADCON3_CLKDIV_48 = 0b101111,
1913 ADCON3_CLKDIV_49 = 0b110000,
1914 ADCON3_CLKDIV_50 = 0b110001,
1915 ADCON3_CLKDIV_51 = 0b110010,
1916 ADCON3_CLKDIV_52 = 0b110011,
1917 ADCON3_CLKDIV_53 = 0b110100,
1918 ADCON3_CLKDIV_54 = 0b110101,
1919 ADCON3_CLKDIV_55 = 0b110110,
1920 ADCON3_CLKDIV_56 = 0b110111,
1921 ADCON3_CLKDIV_57 = 0b111000,
1922 ADCON3_CLKDIV_58 = 0b111001,
1923 ADCON3_CLKDIV_59 = 0b111010,
1924 ADCON3_CLKDIV_60 = 0b111011,
1925 ADCON3_CLKDIV_61 = 0b111100,
1926 ADCON3_CLKDIV_62 = 0b111101,
1927 ADCON3_CLKDIV_63 = 0b111110,
1928 ADCON3_CLKDIV_64 = 0b111111
1931 #define REG_ADCON3H_SHREN_ENABLED 0b0000000010000000 // Shared ADC Core Enabled
1932 #define REG_ADCON3H_SHREN_DISABLED 0b0000000000000000 // Shared ADC Core Disabled
1935 ADCON3_SHREN_ENABLED = 0b1,
1936 ADCON3_SHREN_DISABLED = 0b0
1939 #if (ADC_CORE_COUNT > 6)
1940 #define REG_ADCON3H_C3EN_ENABLED 0b0000000000001000 // Dedicated ADC Core #4 Enabled
1941 #define REG_ADCON3H_C3EN_DISABLED 0b0000000000000000 // Dedicated ADC Core #4 Disabled
1944 #if (ADC_CORE_COUNT > 5)
1945 #define REG_ADCON3H_C3EN_ENABLED 0b0000000000001000 // Dedicated ADC Core #3 Enabled
1946 #define REG_ADCON3H_C3EN_DISABLED 0b0000000000000000 // Dedicated ADC Core #3 Disabled
1949 #if (ADC_CORE_COUNT > 4)
1950 #define REG_ADCON3H_C2EN_ENABLED 0b0000000000000100 // Dedicated ADC Core #2 Enabled
1951 #define REG_ADCON3H_C2EN_DISABLED 0b0000000000000000 // Dedicated ADC Core #2 Disabled
1954 #if (ADC_CORE_COUNT > 3)
1955 #define REG_ADCON3H_C2EN_ENABLED 0b0000000000000100 // Dedicated ADC Core #2 Enabled
1956 #define REG_ADCON3H_C2EN_DISABLED 0b0000000000000000 // Dedicated ADC Core #2 Disabled
1959 #if (ADC_CORE_COUNT > 2)
1960 #define REG_ADCON3H_C1EN_ENABLED 0b0000000000000010 // Dedicated ADC Core #1 Enabled
1961 #define REG_ADCON3H_C1EN_DISABLED 0b0000000000000000 // Dedicated ADC Core #1 Disabled
1964 #if (ADC_CORE_COUNT > 1)
1965 #define REG_ADCON3H_C0EN_ENABLED 0b0000000000000001 // Dedicated ADC Core #0 Enabled
1966 #define REG_ADCON3H_C0EN_DISABLED 0b0000000000000000 // Dedicated ADC Core #0 Disabled
1970 ADCON3_CxEN_ENABLED = 0b1,
1971 ADCON3_CxEN_DISABLED = 0b0
1977 volatile ADCON3_CNVCHSEL_e cnvchsel : 6;
1978 volatile ADCON3_SWCTRG_e swctrg : 1;
1979 volatile ADCON3_SWLCTRG_e swlctrg : 1;
1980 volatile ADCON3_CNVRTCH_e cnvrtch : 1;
1981 volatile ADCON3_SHRSAMP_e shrsamp : 1;
1982 volatile ADCON3_SUSPRDY_e susprdy : 1;
1983 volatile ADCON3_SUSPCIE_e suspcie : 1;
1984 volatile ADCON3_SUSPEND_e suspend : 1;
1985 volatile ADCON3_REFSEL_e refsel : 3;
1986 }__attribute__((packed)) bits;
1987 volatile uint16_t value;
1993 #if (ADC_CORE_COUNT > 1)
1994 volatile ADCON3_CxEN_e c0en : 1;
1996 volatile unsigned : 1;
1998 #if (ADC_CORE_COUNT > 2)
1999 volatile ADCON3_CxEN_e c1en : 1;
2001 volatile unsigned : 1;
2003 #if (ADC_CORE_COUNT > 3)
2004 volatile ADCON3_CxEN_e c2en : 1;
2006 volatile unsigned : 1;
2008 #if (ADC_CORE_COUNT > 4)
2009 volatile ADCON3_CxEN_e c3en : 1;
2011 volatile unsigned : 1;
2013 #if (ADC_CORE_COUNT > 5)
2014 volatile ADCON3_CxEN_e c4en : 1;
2016 volatile unsigned : 1;
2018 #if (ADC_CORE_COUNT > 6)
2019 volatile ADCON3_CxEN_e c5en : 1;
2021 volatile unsigned : 1;
2023 #if (ADC_CORE_COUNT > 7)
2024 volatile ADCON3_CxEN_e c6en : 1;
2026 volatile unsigned : 1;
2028 volatile ADCON3_SHREN_e shren : 1;
2029 volatile ADCON3_CLKDIV_e clkdiv : 6;
2030 volatile ADCON3_CLKSEL_e clksel : 2;
2031 } __attribute__((packed)) bits;
2032 volatile uint16_t value;
2033 } __attribute__((packed))ADCON3H_t;
2037 volatile ADCON3L_t adcon3l;
2038 volatile ADCON3H_t adcon3h;
2040 volatile uint32_t value;
2044 #if (ADC_CORE_COUNT > 1)
2048 #define REG_ADCON4_VALID_DATA_WRITE_MSK (uint32_t)(0xFFFF0000 | ADCORE_REGISTER_BIT_MSK)
2049 #define REG_ADCON4_VALID_DATA_READ_MSK REG_ADCON4_VALID_DATA_WRITE_MSK
2051 #define REG_ADCON4L_RESET 0b0000000000000000 // Reset ADCON 4 Low Register
2052 #define REG_ADCON4L_VALID_DATA_WRITE_MSK 0b0000111100001111 // Bit mask used to set unimplemented bits to zero
2053 #define REG_ADCON4L_VALID_DATA_READ_MSK 0b0000111100001111 // Bit mask used to set unimplemented bits to zero
2055 #define REG_ADCON4H_RESET 0b0000000000000000 // Reset ADCON 4 High Register
2056 #define REG_ADCON4H_VALID_DATA_WRITE_MSK 0b0000000011111111 // Bit mask used to set unimplemented bits to zero
2057 #define REG_ADCON4H_VALID_DATA_READ_MSK 0b0000000011111111 // Bit mask used to set unimplemented bits to zero
2059 #define REG_SYNCTRGSHR_SYNC_TO_SOURCE 0b0100000000000000 // Shared Core synchronized to source clock
2060 #define REG_SYNCTRGSHR_INDEPENDENT 0b0000000000000000 // Shared Core not synchronized to source clock
2062 #if (ADC_CORE_COUNT > 7)
2063 #define REG_SYNCTRG6_SYNC_TO_SOURCE 0b0100000000000000 // Dedicated Core #6 synchronized to source clock
2064 #define REG_SYNCTRG6_INDEPENDENT 0b0000000000000000 // Dedicated Core #6 not synchronized to source clock
2066 #if (ADC_CORE_COUNT > 6)
2067 #define REG_SYNCTRG5_SYNC_TO_SOURCE 0b0010000000000000 // Dedicated Core #5 synchronized to source clock
2068 #define REG_SYNCTRG5_INDEPENDENT 0b0000000000000000 // Dedicated Core #5 not synchronized to source clock
2070 #if (ADC_CORE_COUNT > 5)
2071 #define REG_SYNCTRG4_SYNC_TO_SOURCE 0b0001000000000000 // Dedicated Core #4 synchronized to source clock
2072 #define REG_SYNCTRG4_INDEPENDENT 0b0000000000000000 // Dedicated Core #4 not synchronized to source clock
2074 #if (ADC_CORE_COUNT > 4)
2075 #define REG_SYNCTRG3_SYNC_TO_SOURCE 0b0000100000000000 // Dedicated Core #3 synchronized to source clock
2076 #define REG_SYNCTRG3_INDEPENDENT 0b0000000000000000 // Dedicated Core #3 not synchronized to source clock
2078 #if (ADC_CORE_COUNT > 3)
2079 #define REG_SYNCTRG2_SYNC_TO_SOURCE 0b0000010000000000 // Dedicated Core #2 synchronized to source clock
2080 #define REG_SYNCTRG2_INDEPENDENT 0b0000000000000000 // Dedicated Core #2 not synchronized to source clock
2082 #if (ADC_CORE_COUNT > 2)
2083 #define REG_SYNCTRG1_SYNC_TO_SOURCE 0b0000001000000000 // Dedicated Core #1 synchronized to source clock
2084 #define REG_SYNCTRG1_INDEPENDENT 0b0000000000000000 // Dedicated Core #1 not synchronized to source clock
2086 #if (ADC_CORE_COUNT > 1)
2087 #define REG_SYNCTRG0_SYNC_TO_SOURCE 0b0000000100000000 // Dedicated Core #0 synchronized to source clock
2088 #define REG_SYNCTRG0_INDEPENDENT 0b0000000000000000 // Dedicated Core #0 not synchronized to source clock
2092 ADCON4_SYNCTRGx_SYNC_TO_SOURCE = 0b1,
2093 ADCON4_SYNCTRGx_INDEPENDENT = 0b0
2094 } ADCON4_SYNCTRGx_e;
2096 #if (ADC_CORE_COUNT > 7)
2097 #define REG_SAMC6EN_ENABLED 0b0000100000000000 // Core #6 synchronized to source clock
2098 #define REG_SAMC6EN_DISABLED 0b0000000000000000 // Core #6 not synchronized to source clock
2100 #if (ADC_CORE_COUNT > 6)
2101 #define REG_SAMC5EN_ENABLED 0b0000100000000000 // Core #5 synchronized to source clock
2102 #define REG_SAMC5EN_DISABLED 0b0000000000000000 // Core #5 not synchronized to source clock
2104 #if (ADC_CORE_COUNT > 5)
2105 #define REG_SAMC4EN_ENABLED 0b0000100000000000 // Core #4 synchronized to source clock
2106 #define REG_SAMC4EN_DISABLED 0b0000000000000000 // Core #4 not synchronized to source clock
2108 #if (ADC_CORE_COUNT > 4)
2109 #define REG_SAMC3EN_ENABLED 0b0000100000000000 // Core #3 synchronized to source clock
2110 #define REG_SAMC3EN_DISABLED 0b0000000000000000 // Core #3 not synchronized to source clock
2112 #if (ADC_CORE_COUNT > 3)
2113 #define REG_SAMC2EN_ENABLED 0b0000010000000000 // Core #2 synchronized to source clock
2114 #define REG_SAMC2EN_DISABLED 0b0000000000000000 // Core #2 not synchronized to source clock
2116 #if (ADC_CORE_COUNT > 2)
2117 #define REG_SAMC1EN_ENABLED 0b0000001000000000 // Core #1 synchronized to source clock
2118 #define REG_SAMC1EN_DISABLED 0b0000000000000000 // Core #1 not synchronized to source clock
2120 #if (ADC_CORE_COUNT > 1)
2121 #define REG_SAMC0EN_ENABLED 0b0000000100000000 // Core #0 synchronized to source clock
2122 #define REG_SAMC0EN_DISABLED 0b0000000000000000 // Core #0 not synchronized to source clock
2126 ADCON4_SAMCxEN_ENABLED = 0b1,
2127 ADCON4_SAMCxEN_DISABLED = 0b0
2133 #if defined (__P33SMPS_CH_SLV__)
2136 ADCON4_C1CHS_S1ANC1 = 0b11,
2137 ADCON4_C1CHS_SPGA2 = 0b10,
2138 ADCON4_C1CHS_S1ANA1 = 0b01,
2139 ADCON4_C1CHS_S1AN1 = 0b00
2143 ADCON4_C0CHS_S1ANC0 = 0b11,
2144 ADCON4_C0CHS_SPGA1 = 0b10,
2145 ADCON4_C0CHS_S1ANA0 = 0b01,
2146 ADCON4_C0CHS_S1AN0 = 0b00
2149 #elif defined (__MA330048_dsPIC33CK_DPPIM__)
2151 #if (ADC_CORE_COUNT > 1)
2153 #define REG_ADCON4H_C0CHS_ANA0 0b0000000000000001
2154 #define REG_ADCON4H_C0CHS_AN0 0b0000000000000000
2157 ADCON4_C0CHS_ANA0 = 0b01,
2158 ADCON4_C0CHS_AN0 = 0b00
2163 #if (ADC_CORE_COUNT > 2)
2164 #define REG_ADCON4H_C1CHS_ANA1 0b0000000000000100
2165 #define REG_ADCON4H_C1CHS_AN1 0b0000000000000000
2168 ADCON4_C1CHS_ANA1 = 0b01,
2169 ADCON4_C1CHS_AN1 = 0b00
2174 #if (ADC_CORE_COUNT > 3)
2175 #define REG_ADCON4H_C2CHS_ANA2 0b0000000000010000
2176 #define REG_ADCON4H_C2CHS_AN2 0b0000000000000000
2179 ADCON4_C2CHS_ANA2 = 0b01,
2180 ADCON4_C2CHS_AN2 = 0b00
2185 #if (ADC_CORE_COUNT > 4)
2186 #define REG_ADCON4H_C3CHS_ANA3 0b0000000001000000
2187 #define REG_ADCON4H_C3CHS_AN3 0b0000000000000000
2190 ADCON4_C3CHS_ANA3 = 0b01,
2191 ADCON4_C3CHS_AN3 = 0b00
2196 #if (ADC_CORE_COUNT > 5)
2197 #define REG_ADCON4H_C4CHS_ANA4 0b0000000100000000
2198 #define REG_ADCON4H_C4CHS_AN4 0b0000000000000000
2201 ADCON4_C4CHS_ANA4 = 0b01,
2202 ADCON4_C4CHS_AN4 = 0b00
2207 #if (ADC_CORE_COUNT > 6)
2208 #define REG_ADCON4H_C5CHS_ANA5 0b0000010000000000
2209 #define REG_ADCON4H_C5CHS_AN5 0b0000000000000000
2212 ADCON4_C5CHS_ANA5 = 0b01,
2213 ADCON4_C5CHS_AN5 = 0b00
2218 #if (ADC_CORE_COUNT > 7)
2219 #define REG_ADCON4H_C6CHS_ANA5 0b0001000000000000
2220 #define REG_ADCON4H_C6CHS_AN5 0b0000000000000000
2223 ADCON4_C6CHS_ANA6 = 0b01,
2224 ADCON6_C4CHS_AN6 = 0b00
2233 #if (ADC_CORE_COUNT > 1)
2234 volatile ADCON4_SAMCxEN_e samc0en : 1;
2236 volatile unsigned : 1;
2238 #if (ADC_CORE_COUNT > 2)
2239 volatile ADCON4_SAMCxEN_e samc1en : 1;
2241 volatile unsigned : 1;
2243 #if (ADC_CORE_COUNT > 3)
2244 volatile ADCON4_SAMCxEN_e samc2en : 1;
2246 volatile unsigned : 1;
2248 #if (ADC_CORE_COUNT > 4)
2249 volatile ADCON4_SAMCxEN_e samc3en : 1;
2251 volatile unsigned : 1;
2253 #if (ADC_CORE_COUNT > 5)
2254 volatile ADCON4_SAMCxEN_e samc4en : 1;
2256 volatile unsigned : 1;
2258 #if (ADC_CORE_COUNT > 6)
2259 volatile ADCON4_SAMCxEN_e samc5en : 1;
2261 volatile unsigned : 1;
2263 #if (ADC_CORE_COUNT > 7)
2264 volatile ADCON4_SAMCxEN_e samc6en : 1;
2266 volatile unsigned : 1;
2268 volatile unsigned : 1;
2269 #if (ADC_CORE_COUNT > 1)
2270 volatile ADCON4_SYNCTRGx_e synctrg0 : 1;
2272 volatile unsigned : 1;
2274 #if (ADC_CORE_COUNT > 2)
2275 volatile ADCON4_SYNCTRGx_e synctrg1 : 1;
2277 volatile unsigned : 1;
2279 #if (ADC_CORE_COUNT > 3)
2280 volatile ADCON4_SYNCTRGx_e synctrg2 : 1;
2282 volatile unsigned : 1;
2284 #if (ADC_CORE_COUNT > 4)
2285 volatile ADCON4_SYNCTRGx_e synctrg3 : 1;
2287 volatile unsigned : 1;
2289 #if (ADC_CORE_COUNT > 5)
2290 volatile ADCON4_SYNCTRGx_e synctrg4 : 1;
2292 volatile unsigned : 1;
2294 #if (ADC_CORE_COUNT > 6)
2295 volatile ADCON4_SYNCTRGx_e synctrg5 : 1;
2297 volatile unsigned : 1;
2299 #if (ADC_CORE_COUNT > 7)
2300 volatile ADCON4_SYNCTRGx_e synctrg6 : 1;
2302 volatile unsigned : 1;
2304 volatile unsigned : 1;
2305 }__attribute__((packed)) bits;
2306 volatile uint16_t value;
2312 #if (ADC_CORE_COUNT > 1)
2313 volatile ADCON4_C0CHS_e c0chs : 2;
2315 volatile unsigned : 2;
2317 #if (ADC_CORE_COUNT > 2)
2318 volatile ADCON4_C1CHS_e c1chs : 2;
2320 volatile unsigned : 2;
2322 #if (ADC_CORE_COUNT > 3)
2323 volatile ADCON4_C2CHS_e c2chs : 2;
2325 volatile unsigned : 2;
2327 #if (ADC_CORE_COUNT > 4)
2328 volatile ADCON4_C3CHS_e c3chs : 2;
2330 volatile unsigned : 2;
2332 #if (ADC_CORE_COUNT > 5)
2333 volatile ADCON4_C3CHS_e c4chs : 2;
2335 volatile unsigned : 2;
2337 #if (ADC_CORE_COUNT > 6)
2338 volatile ADCON4_C3CHS_e c5chs : 2;
2340 volatile unsigned : 2;
2342 #if (ADC_CORE_COUNT > 7)
2343 volatile ADCON4_C3CHS_e c6chs : 2;
2345 volatile unsigned : 2;
2347 volatile unsigned : 2;
2348 } __attribute__((packed)) bits;
2349 volatile uint16_t value;
2354 volatile ADCON4L_t SAMC_EN;
2355 volatile ADCON4H_t CHS;
2357 volatile uint32_t value;
2365 volatile uint32_t : 32;
2366 } __attribute__((packed)) ADCON4_t;
2368 #endif // end of ADCON4 defines, whcih are only available if dedicated ADC cores are present
2372 #define REG_ADCON5_VALID_DATA_WRITE_MSK (uint32_t)(0x0F000000 | (ADCORE_REGISTER_BIT_MSK << 16) | (ADCORE_REGISTER_BIT_MSK << 8) | ADCORE_REGISTER_BIT_MSK)
2373 #define REG_ADCON5_VALID_DATA_READ_MSK (uint32_t)(0x0F000000 | (ADCORE_REGISTER_BIT_MSK << 16) | ADCORE_REGISTER_BIT_MSK)
2374 #define REG_ADCON5_DISABLE_ADC_CORES_MSK (uint32_t)(0xFFFFFF00)
2376 #define REG_ADCON5L_RESET 0b0000000000000000 // Reset ADCON 5 Low Register (all ADC cores turned off)
2377 #define REG_ADCON5L_VALID_DATA_WRITE_MSK (uint16_t)ADCORE_REGISTER_BIT_MSK // Bit mask used to set unimplemented bits to zero
2378 #define REG_ADCON5L_VALID_DATA_READ_MSK (uint16_t)((ADCORE_REGISTER_BIT_MSK << 8) | ADCORE_REGISTER_BIT_MSK) // Bit mask used to set unimplemented bits to zero
2379 #define REG_ADCON5L_DISABLE_ADC_CORES_MSK (uint16_t)(0xFF00)
2381 #define REG_ADCON5H_RESET (0x0F00) // Reset ADCON 5 High Register (maximum warm-up time, all ADC CORE READY ISRs off)
2382 #define REG_ADCON5H_VALID_DATA_WRITE_MSK (uint16_t)(0x0F00 | ADCORE_REGISTER_BIT_MSK) // Bit mask used to set unimplemented bits to zero
2383 #define REG_ADCON5H_VALID_DATA_READ_MSK (uint16_t)(0x0F00 | ADCORE_REGISTER_BIT_MSK) // Bit mask used to set unimplemented bits to zero
2385 #define REG_ADCON5L_SHRRDY_PWROK 0b1000000000000000 // Sharder ADC Core powered and ready
2386 #define REG_ADCON5L_SHRRDY_FF 0b0000000000000000 // Sharder ADC Core is not powered
2388 #if (ADC_CORE_COUNT > 1)
2389 #define REG_ADCON5L_C0RDY_PWROK 0b0000000100000000 // Dedicated ADC Core #0 powered and ready
2390 #define REG_ADCON5L_C0RDY_FF 0b0000000000000000 // Dedicated ADC Core #0 is not powered
2392 #if (ADC_CORE_COUNT > 2)
2393 #define REG_ADCON5L_C1RDY_PWROK 0b0000001000000000 // Dedicated ADC Core #1 powered and ready
2394 #define REG_ADCON5L_C1RDY_FF 0b0000000000000000 // Dedicated ADC Core #1 is not powered
2396 #if (ADC_CORE_COUNT > 3)
2397 #define REG_ADCON5L_C2RDY_PWROK 0b0000010000000000 // Dedicated ADC Core #2 powered and ready
2398 #define REG_ADCON5L_C2RDY_FF 0b0000000000000000 // Dedicated ADC Core #2 is not powered
2400 #if (ADC_CORE_COUNT > 4)
2401 #define REG_ADCON5L_C3RDY_PWROK 0b0000100000000000 // Dedicated ADC Core #3 powered and ready
2402 #define REG_ADCON5L_C3RDY_FF 0b0000000000000000 // Dedicated ADC Core #3 is not powered
2404 #if (ADC_CORE_COUNT > 5)
2405 #define REG_ADCON5L_C4RDY_PWROK 0b0001000000000000 // Dedicated ADC Core #4 powered and ready
2406 #define REG_ADCON5L_C4RDY_FF 0b0000000000000000 // Dedicated ADC Core #4 is not powered
2408 #if (ADC_CORE_COUNT > 6)
2409 #define REG_ADCON5L_C5RDY_PWROK 0b0010000000000000 // Dedicated ADC Core #5 powered and ready
2410 #define REG_ADCON5L_C5RDY_FF 0b0000000000000000 // Dedicated ADC Core #5 is not powered
2412 #if (ADC_CORE_COUNT > 7)
2413 #define REG_ADCON5L_C6RDY_PWROK 0b0100000000000000 // Dedicated ADC Core #6 powered and ready
2414 #define REG_ADCON5L_C6RDY_FF 0b0000000000000000 // Dedicated ADC Core #6 is not powered
2417 #define RES_ADCON5L_CxRDY(adc_core) (uint16_t)(pow(2, adc_core) << 8) // the shared core is always treated as "Core #7"
2420 ADCON5_CxRDY_STAT_PWROK = 0b1,
2421 ADCON5_CxRDY_OFF = 0b0
2425 #define REG_ADCON5L_SHRPWR_ON 0b0000000010000000 // Shared ADC Core switched on
2426 #define REG_ADCON5L_SHRPWR_OFF 0b0000000000000000 // Shared ADC Core switched off
2428 #if (ADC_CORE_COUNT > 1)
2429 #define REG_ADCON5L_C0PWR_ON 0b0000000000000001 // Dedicated ADC Core #0 powered
2430 #define REG_ADCON5L_C0PWR_OFF 0b0000000000000000 // Dedicated ADC Core #0 switched off
2432 #if (ADC_CORE_COUNT > 2)
2433 #define REG_ADCON5L_C1PWR_ON 0b0000000000000010 // Dedicated ADC Core #1 powered
2434 #define REG_ADCON5L_C1PWR_OFF 0b0000000000000000 // Dedicated ADC Core #1 switched off
2436 #if (ADC_CORE_COUNT > 3)
2437 #define REG_ADCON5L_C2PWR_ON 0b0000000000000100 // Dedicated ADC Core #2 powered
2438 #define REG_ADCON5L_C2PWR_OFF 0b0000000000000000 // Dedicated ADC Core #2 switched off
2440 #if (ADC_CORE_COUNT > 4)
2441 #define REG_ADCON5L_C3PWR_ON 0b0000000000001000 // Dedicated ADC Core #3 powered
2442 #define REG_ADCON5L_C3PWR_OFF 0b0000000000000000 // Dedicated ADC Core #3 switched off
2444 #if (ADC_CORE_COUNT > 5)
2445 #define REG_ADCON5L_C4PWR_ON 0b0000000000010000 // Dedicated ADC Core #4 powered
2446 #define REG_ADCON5L_C4PWR_OFF 0b0000000000000000 // Dedicated ADC Core #4 switched off
2448 #if (ADC_CORE_COUNT > 6)
2449 #define REG_ADCON5L_C5PWR_ON 0b0000000000100000 // Dedicated ADC Core #5 powered
2450 #define REG_ADCON5L_C5PWR_OFF 0b0000000000000000 // Dedicated ADC Core #5 switched off
2452 #if (ADC_CORE_COUNT > 7)
2453 #define REG_ADCON5L_C6PWR_ON 0b0000000001000000 // Dedicated ADC Core #6 powered
2454 #define REG_ADCON5L_C6PWR_OFF 0b0000000000000000 // Dedicated ADC Core #6 switched off
2457 #define REG_ADCON5L_CxPWR(adc_core) (uint16_t)(pow(2.0, adc_core)) // the shared core is always treated as "Core #7"
2460 ADCON5_CxPWR_ON = 0b1,
2461 ADCON5_CxPWR_OFF = 0b0
2466 #define REG_ADCON5H_WARMTIME_CLK_32768 0b0000111100000000 // ADC Power Up Delay 0f 32768 ATADCORE cycles
2467 #define REG_ADCON5H_WARMTIME_CLK_16384 0b0000111000000000 // ADC Power Up Delay 0f 16384 ATADCORE cycles
2468 #define REG_ADCON5H_WARMTIME_CLK_8192 0b0000110100000000 // ADC Power Up Delay 0f 8192 ATADCORE cycles
2469 #define REG_ADCON5H_WARMTIME_CLK_4096 0b0000110000000000 // ADC Power Up Delay 0f 4096 ATADCORE cycles
2470 #define REG_ADCON5H_WARMTIME_CLK_2048 0b0000101100000000 // ADC Power Up Delay 0f 2048 ATADCORE cycles
2471 #define REG_ADCON5H_WARMTIME_CLK_1024 0b0000101000000000 // ADC Power Up Delay 0f 1024 ATADCORE cycles
2472 #define REG_ADCON5H_WARMTIME_CLK_512 0b0000100100000000 // ADC Power Up Delay 0f 512 ATADCORE cycles
2473 #define REG_ADCON5H_WARMTIME_CLK_256 0b0000100000000000 // ADC Power Up Delay 0f 256 ATADCORE cycles
2474 #define REG_ADCON5H_WARMTIME_CLK_128 0b0000011100000000 // ADC Power Up Delay 0f 128 ATADCORE cycles
2475 #define REG_ADCON5H_WARMTIME_CLK_64 0b0000011000000000 // ADC Power Up Delay 0f 64 ATADCORE cycles
2476 #define REG_ADCON5H_WARMTIME_CLK_32 0b0000010100000000 // ADC Power Up Delay 0f 32 ATADCORE cycles
2477 #define REG_ADCON5H_WARMTIME_CLK_16 0b0000010000000000 // ADC Power Up Delay 0f 16 ATADCORE cycles
2478 #define REG_ADCON5H_WARMTIME_NONE 0b0000000000000000 // (used for bypass during configuraiton, valid WARMTIME must be set before powering on ADC module)
2481 ADCON5H_WARMTIME_CLK_32768 = 0b1111,
2482 ADCON5H_WARMTIME_CLK_16384 = 0b1110,
2483 ADCON5H_WARMTIME_CLK_8192 = 0b1101,
2484 ADCON5H_WARMTIME_CLK_4096 = 0b1100,
2485 ADCON5H_WARMTIME_CLK_2048 = 0b1011,
2486 ADCON5H_WARMTIME_CLK_1024 = 0b1010,
2487 ADCON5H_WARMTIME_CLK_512 = 0b1001,
2488 ADCON5H_WARMTIME_CLK_256 = 0b1000,
2489 ADCON5H_WARMTIME_CLK_128 = 0b0111,
2490 ADCON5H_WARMTIME_CLK_64 = 0b0110,
2491 ADCON5H_WARMTIME_CLK_32 = 0b0101,
2492 ADCON5H_WARMTIME_CLK_16 = 0b0100,
2493 ADCON5H_WARMTIME_NONE = 0b0000
2494 } ADCON5_WARMTIME_e;
2497 #define REG_ADCON5H_SHRCIE_ENABLED 0b0000000010000000 // Shared ADC Core Ready Interrupt enabled
2498 #define REG_ADCON5H_SHRCIE_DISABLED 0b0000000000000000 // Shared ADC Core Ready Interrupt disabled
2500 #if (ADC_CORE_COUNT > 1)
2501 #define REG_ADCON5H_C0CIE_ENABLED 0b0000000000000001 // Dedicated ADC Core #0 Ready Interrupt enabled
2502 #define REG_ADCON5H_C0CIE_DISABLED 0b0000000000000000 // Dedicated ADC Core #0 Ready Interrupt disabled
2504 #if (ADC_CORE_COUNT > 2)
2505 #define REG_ADCON5H_C1CIE_ENABLED 0b0000000000000010 // Dedicated ADC Core #1 Ready Interrupt enabled
2506 #define REG_ADCON5H_C1CIE_DISABLED 0b0000000000000000 // Dedicated ADC Core #1 Ready Interrupt disabled
2508 #if (ADC_CORE_COUNT > 3)
2509 #define REG_ADCON5H_C2CIE_ENABLED 0b0000000000000100 // Dedicated ADC Core #2 Ready Interrupt enabled
2510 #define REG_ADCON5H_C2CIE_DISABLED 0b0000000000000000 // Dedicated ADC Core #2 Ready Interrupt disabled
2512 #if (ADC_CORE_COUNT > 4)
2513 #define REG_ADCON5H_C3CIE_ENABLED 0b0000000000001000 // Dedicated ADC Core #3 Ready Interrupt enabled
2514 #define REG_ADCON5H_C3CIE_DISABLED 0b0000000000000000 // Dedicated ADC Core #3 Ready Interrupt disabled
2516 #if (ADC_CORE_COUNT > 5)
2517 #define REG_ADCON5H_C4CIE_ENABLED 0b0000000000010000 // Dedicated ADC Core #4 Ready Interrupt enabled
2518 #define REG_ADCON5H_C4CIE_DISABLED 0b0000000000000000 // Dedicated ADC Core #4 Ready Interrupt disabled
2520 #if (ADC_CORE_COUNT > 6)
2521 #define REG_ADCON5H_C5CIE_ENABLED 0b0000000000100000 // Dedicated ADC Core #5 Ready Interrupt enabled
2522 #define REG_ADCON5H_C5CIE_DISABLED 0b0000000000000000 // Dedicated ADC Core #5 Ready Interrupt disabled
2524 #if (ADC_CORE_COUNT > 7)
2525 #define REG_ADCON5H_C6CIE_ENABLED 0b0000000001000000 // Dedicated ADC Core #6 Ready Interrupt enabled
2526 #define REG_ADCON5H_C6CIE_DISABLED 0b0000000000000000 // Dedicated ADC Core #6 Ready Interrupt disabled
2529 #define RES_ADCON5H_CxCIE(adc_core) (uint16_t)(pow(2, adc_core)) // the shared core is always treated as "Core #7"
2532 ADCON5L_CxCIE_ENABLED = 0b1,
2533 ADCON5L_CxCIE_DISABLED = 0b0
2539 #if (ADC_CORE_COUNT > 1)
2540 volatile ADCON5_CxPWR_e C0PWR : 1;
2542 volatile unsigned : 1;
2544 #if (ADC_CORE_COUNT > 2)
2545 volatile ADCON5_CxPWR_e C1PWR : 1;
2547 volatile unsigned : 1;
2549 #if (ADC_CORE_COUNT > 3)
2550 volatile ADCON5_CxPWR_e C2PWR : 1;
2552 volatile unsigned : 1;
2554 #if (ADC_CORE_COUNT > 4)
2555 volatile ADCON5_CxPWR_e C3PWR : 1;
2557 volatile unsigned : 1;
2559 #if (ADC_CORE_COUNT > 5)
2560 volatile ADCON5_CxPWR_e C4PWR : 1;
2562 volatile unsigned : 1;
2564 #if (ADC_CORE_COUNT > 6)
2565 volatile ADCON5_CxPWR_e C5PWR : 1;
2567 volatile unsigned : 1;
2569 #if (ADC_CORE_COUNT > 7)
2570 volatile ADCON5_CxPWR_e C6PWR : 1;
2572 volatile unsigned : 1;
2575 volatile ADCON5_CxPWR_e SHRPWR : 1;
2577 #if (ADC_CORE_COUNT > 1)
2578 volatile ADCON5_CxRDY_e C0RDY : 1;
2580 volatile unsigned : 1;
2582 #if (ADC_CORE_COUNT > 2)
2583 volatile ADCON5_CxRDY_e C1RDY : 1;
2585 volatile unsigned : 1;
2587 #if (ADC_CORE_COUNT > 3)
2588 volatile ADCON5_CxRDY_e C2RDY : 1;
2590 volatile unsigned : 1;
2592 #if (ADC_CORE_COUNT > 4)
2593 volatile ADCON5_CxRDY_e C3RDY : 1;
2595 volatile unsigned : 1;
2597 #if (ADC_CORE_COUNT > 5)
2598 volatile ADCON5_CxRDY_e C4RDY : 1;
2600 volatile unsigned : 1;
2602 #if (ADC_CORE_COUNT > 6)
2603 volatile ADCON5_CxRDY_e C5RDY : 1;
2605 volatile unsigned : 1;
2607 #if (ADC_CORE_COUNT > 7)
2608 volatile ADCON5_CxRDY_e C6RDY : 1;
2610 volatile unsigned : 1;
2613 volatile ADCON5_CxRDY_e SHRRDY : 1;
2615 } __attribute__((packed)) bits;
2616 volatile uint16_t value;
2621 #if (ADC_CORE_COUNT > 1)
2622 volatile ADCON5_CxCIE_e C0CIE : 1;
2624 volatile unsigned : 1;
2626 #if (ADC_CORE_COUNT > 2)
2627 volatile ADCON5_CxCIE_e C1CIE : 1;
2629 volatile unsigned : 1;
2631 #if (ADC_CORE_COUNT > 3)
2632 volatile ADCON5_CxCIE_e C2CIE : 1;
2634 volatile unsigned : 1;
2636 #if (ADC_CORE_COUNT > 4)
2637 volatile ADCON5_CxCIE_e C3CIE : 1;
2639 volatile unsigned : 1;
2641 #if (ADC_CORE_COUNT > 5)
2642 volatile ADCON5_CxCIE_e C4CIE : 1;
2644 volatile unsigned : 1;
2646 #if (ADC_CORE_COUNT > 6)
2647 volatile ADCON5_CxCIE_e C5CIE : 1;
2649 volatile unsigned : 1;
2651 #if (ADC_CORE_COUNT > 7)
2652 volatile ADCON5_CxCIE_e C6CIE : 1;
2654 volatile unsigned : 1;
2657 volatile ADCON5_CxCIE_e shrcie : 1;
2658 volatile ADCON5_WARMTIME_e warmtime : 4;
2659 volatile unsigned : 4;
2661 } __attribute__((packed)) bits;
2662 volatile uint16_t value;
2667 volatile ADCON5L_t adcon5l;
2668 volatile ADCON5H_t adcon5h;
2670 volatile uint32_t value;
2675 #define REG_ADCORExL_RESET 0b0000001111111111 // Reset ADCOREx Low Register
2676 #define REG_ADCORExL_VALID_DATA_MSK 0b0000001111111111 // Bit mask used to set unimplemented bits to zero
2678 #define REG_SAMC_MSK 0b0000001111111111 // ADCOREx Conversion Delay Filter Mask
2679 #define REG_SAMC(x) ((x-2) & REG_SAMC_MSK) // ADCOREx Conversion Delay Value
2683 #define REG_ADCORExH_RESET 0b0000000000000000 // Reset ADCOREx High Register
2684 #define REG_ADCORExH_VALID_DATA_MSK 0b0001111101111111 // Bit mask used to set unimplemented bits to zero
2686 #define REG_EISEL_8TAD 0b0001110000000000 // ADCOREx Early Interrupt 8 TADs before ready
2687 #define REG_EISEL_7TAD 0b0001100000000000 // ADCOREx Early Interrupt 7 TADs before ready
2688 #define REG_EISEL_6TAD 0b0001010000000000 // ADCOREx Early Interrupt 6 TADs before ready
2689 #define REG_EISEL_5TAD 0b0001000000000000 // ADCOREx Early Interrupt 5 TADs before ready
2690 #define REG_EISEL_4TAD 0b0000110000000000 // ADCOREx Early Interrupt 4 TADs before ready
2691 #define REG_EISEL_3TAD 0b0000100000000000 // ADCOREx Early Interrupt 3 TADs before ready
2692 #define REG_EISEL_2TAD 0b0000010000000000 // ADCOREx Early Interrupt 2 TADs before ready
2693 #define REG_EISEL_1TAD 0b0000000000000000 // ADCOREx Early Interrupt 1 TADs before ready
2697 #define REG_ADC_RES_12BIT 0b0000001100000000 // ADC Core Resolution = 12bit
2698 #define REG_ADC_RES_10BIT 0b0000001000000000 // ADC Core Resolution = 10bit
2699 #define REG_ADC_RES_8BIT 0b0000000100000000 // ADC Core Resolution = 8bit
2700 #define REG_ADC_RES_6BIT 0b0000000000000000 // ADC Core Resolution = 6bit
2704 #define REG_ADCS_MSK 0b0000000001111111 // ADC Core Clock Divider Filter Mask
2705 #define REG_ADCS(x) (((volatile uint16_t)(x>>1)) & REG_ADCS_MSK) // ADC Core Clock Divider Value
2711 #define REG_ADLVLTRGL_RESET 0b0000000000000000 // Reset ADLVLTRGL Low Register
2712 #define REG_ADLVLTRGL_VALID_DATA_MSK 0b1111111111111111 // Bit mask used to set unimplemented bits to zero
2714 #define REG_ADLVLTRGL_ALL_LEVEL 0b1111111111111111 // All ANx inputs are Level-Triggered
2715 #define REG_ADLVLTRGL_ALL_EDGE 0b0000000000000000 // All ANx inputs are Edge-Triggered
2717 #define REG_ADLVLTRGL_AN0_LEVEL 0b0000000000000001 // AN0 is Level-Triggered
2718 #define REG_ADLVLTRGL_AN0_EDGE 0b0000000000000000 // AN0 is Edge-Triggered
2719 #define REG_ADLVLTRGL_AN1_LEVEL 0b0000000000000010 // AN1 is Level-Triggered
2720 #define REG_ADLVLTRGL_AN1_EDGE 0b0000000000000000 // AN1 is Edge-Triggered
2721 #define REG_ADLVLTRGL_AN2_LEVEL 0b0000000000000100 // AN2 is Level-Triggered
2722 #define REG_ADLVLTRGL_AN2_EDGE 0b0000000000000000 // AN2 is Edge-Triggered
2723 #define REG_ADLVLTRGL_AN3_LEVEL 0b0000000000001000 // AN3 is Level-Triggered
2724 #define REG_ADLVLTRGL_AN3_EDGE 0b0000000000000000 // AN3 is Edge-Triggered
2725 #define REG_ADLVLTRGL_AN4_LEVEL 0b0000000000010000 // AN4 is Level-Triggered
2726 #define REG_ADLVLTRGL_AN4_EDGE 0b0000000000000000 // AN4 is Edge-Triggered
2727 #define REG_ADLVLTRGL_AN5_LEVEL 0b0000000000100000 // AN5 is Level-Triggered
2728 #define REG_ADLVLTRGL_AN5_EDGE 0b0000000000000000 // AN5 is Edge-Triggered
2729 #define REG_ADLVLTRGL_AN6_LEVEL 0b0000000001000000 // AN6 is Level-Triggered
2730 #define REG_ADLVLTRGL_AN6_EDGE 0b0000000000000000 // AN6 is Edge-Triggered
2731 #define REG_ADLVLTRGL_AN7_LEVEL 0b0000000010000000 // AN7 is Level-Triggered
2732 #define REG_ADLVLTRGL_AN7_EDGE 0b0000000000000000 // AN7 is Edge-Triggered
2733 #define REG_ADLVLTRGL_AN8_LEVEL 0b0000000100000000 // AN8 is Level-Triggered
2734 #define REG_ADLVLTRGL_AN8_EDGE 0b0000000000000000 // AN8 is Edge-Triggered
2735 #define REG_ADLVLTRGL_AN9_LEVEL 0b0000001000000000 // AN9 is Level-Triggered
2736 #define REG_ADLVLTRGL_AN9_EDGE 0b0000000000000000 // AN9 is Edge-Triggered
2737 #define REG_ADLVLTRGL_AN10_LEVEL 0b0000010000000000 // AN10 is Level-Triggered
2738 #define REG_ADLVLTRGL_AN10_EDGE 0b0000000000000000 // AN10 is Edge-Triggered
2739 #define REG_ADLVLTRGL_AN11_LEVEL 0b0000100000000000 // AN11 is Level-Triggered
2740 #define REG_ADLVLTRGL_AN11_EDGE 0b0000000000000000 // AN11 is Edge-Triggered
2741 #define REG_ADLVLTRGL_AN12_LEVEL 0b0001000000000000 // AN12 is Level-Triggered
2742 #define REG_ADLVLTRGL_AN12_EDGE 0b0000000000000000 // AN12 is Edge-Triggered
2743 #define REG_ADLVLTRGL_AN13_LEVEL 0b0010000000000000 // AN13 is Level-Triggered
2744 #define REG_ADLVLTRGL_AN13_EDGE 0b0000000000000000 // AN13 is Edge-Triggered
2745 #define REG_ADLVLTRGL_AN14_LEVEL 0b0100000000000000 // AN14 is Level-Triggered
2746 #define REG_ADLVLTRGL_AN14_EDGE 0b0000000000000000 // AN14 is Edge-Triggered
2747 #define REG_ADLVLTRGL_AN15_LEVEL 0b1000000000000000 // AN15 is Level-Triggered
2748 #define REG_ADLVLTRGL_AN15_EDGE 0b0000000000000000 // AN15 is Edge-Triggered
2752 #define REG_ADLVLTRGH_RESET 0b0000000000000000 // Reset ADLVLTRGH High Register
2753 #define REG_ADLVLTRGH_VALID_DATA_MSK 0b0000000000111111 // Bit mask used to set unimplemented bits to zero
2755 #define REG_ADLVLTRGH_ALL_LEVEL 0b1111111111111111 // All ANx inputs are Level-Triggered
2756 #define REG_ADLVLTRGH_ALL_EDGE 0b0000000000000000 // All ANx inputs are Edge-Triggered
2758 #define REG_ADLVLTRGH_AN16_LEVEL 0b0000000000000001 // AN16 is Level-Triggered
2759 #define REG_ADLVLTRGH_AN16_EDGE 0b0000000000000000 // AN16 is Edge-Triggered
2760 #define REG_ADLVLTRGH_AN17_LEVEL 0b0000000000000010 // AN17 is Level-Triggered
2761 #define REG_ADLVLTRGH_AN17_EDGE 0b0000000000000000 // AN17 is Edge-Triggered
2762 #define REG_ADLVLTRGH_AN18_LEVEL 0b0000000000000100 // AN18 is Level-Triggered
2763 #define REG_ADLVLTRGH_AN18_EDGE 0b0000000000000000 // AN18 is Edge-Triggered
2764 #define REG_ADLVLTRGH_AN19_LEVEL 0b0000000000001000 // AN19 is Level-Triggered
2765 #define REG_ADLVLTRGH_AN19_EDGE 0b0000000000000000 // AN19 is Edge-Triggered
2766 #define REG_ADLVLTRGH_AN20_LEVEL 0b0000000000010000 // AN20 is Level-Triggered
2767 #define REG_ADLVLTRGH_AN20_EDGE 0b0000000000000000 // AN20 is Edge-Triggered
2768 #define REG_ADLVLTRGH_AN21_LEVEL 0b0000000000100000 // AN21 is Level-Triggered
2769 #define REG_ADLVLTRGH_AN21_EDGE 0b0000000000000000 // AN21 is Edge-Triggered
2770 #define REG_ADLVLTRGH_AN22_LEVEL 0b0000000001000000 // AN22 is Level-Triggered
2771 #define REG_ADLVLTRGH_AN22_EDGE 0b0000000000000000 // AN22 is Edge-Triggered
2772 #define REG_ADLVLTRGH_AN23_LEVEL 0b0000000010000000 // AN23 is Level-Triggered
2773 #define REG_ADLVLTRGH_AN23_EDGE 0b0000000000000000 // AN23 is Edge-Triggered
2774 #define REG_ADLVLTRGH_AN24_LEVEL 0b0000000100000000 // AN24 is Level-Triggered
2775 #define REG_ADLVLTRGH_AN24_EDGE 0b0000000000000000 // AN24 is Edge-Triggered
2776 #define REG_ADLVLTRGH_AN25_LEVEL 0b0000001000000000 // AN25 is Level-Triggered
2777 #define REG_ADLVLTRGH_AN25_EDGE 0b0000000000000000 // AN25 is Edge-Triggered
2778 #define REG_ADLVLTRGH_AN26_LEVEL 0b0000010000000000 // AN26 is Level-Triggered
2779 #define REG_ADLVLTRGH_AN26_EDGE 0b0000000000000000 // AN26 is Edge-Triggered
2780 #define REG_ADLVLTRGH_AN27_LEVEL 0b0000100000000000 // AN27 is Level-Triggered
2781 #define REG_ADLVLTRGH_AN27_EDGE 0b0000000000000000 // AN27 is Edge-Triggered
2782 #define REG_ADLVLTRGH_AN28_LEVEL 0b0001000000000000 // AN28 is Level-Triggered
2783 #define REG_ADLVLTRGH_AN28_EDGE 0b0000000000000000 // AN28 is Edge-Triggered
2784 #define REG_ADLVLTRGH_AN29_LEVEL 0b0010000000000000 // AN29 is Level-Triggered
2785 #define REG_ADLVLTRGH_AN29_EDGE 0b0000000000000000 // AN29 is Edge-Triggered
2786 #define REG_ADLVLTRGH_AN30_LEVEL 0b0100000000000000 // AN30 is Level-Triggered
2787 #define REG_ADLVLTRGH_AN30_EDGE 0b0000000000000000 // AN30 is Edge-Triggered
2788 #define REG_ADLVLTRGH_AN31_LEVEL 0b1000000000000000 // AN31 is Level-Triggered
2789 #define REG_ADLVLTRGH_AN31_EDGE 0b0000000000000000 // AN31 is Edge-Triggered
2792 ADLVLTRG_ANx_LEVEL = 0b1,
2793 ADLVLTRG_ANx_EDGE = 0b0
2799 #define REG_ADEIEL_RESET 0b0000000000000000 // Reset ADLVLTRGH High Register
2800 #define REG_ADEIEL_VALID_DATA_MSK 0b1111111111111111 // Bit mask used to set unimplemented bits to zero
2801 #define REG_ADEIEH_VALID_DATA_MSK 0b0000000000111111 // Bit mask used to set unimplemented bits to zero
2803 #define REG_ADEIEL_ALL_ENABLED 0b1111111111111111 // Early Interrupt Enabled for all ANx inputs
2804 #define REG_ADEIEL_ALL_DISABLED 0b0000000000000000 // Early Interrupt Disabled for all ANx inputs
2806 #define REG_ADEIEL_AN0_ENABLED 0b0000000000000001 // Early Interrupt Enabled for AN0
2807 #define REG_ADEIEL_AN0_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN0
2808 #define REG_ADEIEL_AN1_ENABLED 0b0000000000000010 // Early Interrupt Enabled for AN1
2809 #define REG_ADEIEL_AN1_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN1
2810 #define REG_ADEIEL_AN2_ENABLED 0b0000000000000100 // Early Interrupt Enabled for AN2
2811 #define REG_ADEIEL_AN2_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN2
2812 #define REG_ADEIEL_AN3_ENABLED 0b0000000000001000 // Early Interrupt Enabled for AN3
2813 #define REG_ADEIEL_AN3_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN3
2814 #define REG_ADEIEL_AN4_ENABLED 0b0000000000010000 // Early Interrupt Enabled for AN4
2815 #define REG_ADEIEL_AN4_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN4
2816 #define REG_ADEIEL_AN5_ENABLED 0b0000000000100000 // Early Interrupt Enabled for AN5
2817 #define REG_ADEIEL_AN5_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN5
2818 #define REG_ADEIEL_AN6_ENABLED 0b0000000001000000 // Early Interrupt Enabled for AN6
2819 #define REG_ADEIEL_AN6_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN6
2820 #define REG_ADEIEL_AN7_ENABLED 0b0000000010000000 // Early Interrupt Enabled for AN7
2821 #define REG_ADEIEL_AN7_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN7
2822 #define REG_ADEIEL_AN8_ENABLED 0b0000000100000000 // Early Interrupt Enabled for AN8
2823 #define REG_ADEIEL_AN8_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN8
2824 #define REG_ADEIEL_AN9_ENABLED 0b0000001000000000 // Early Interrupt Enabled for AN9
2825 #define REG_ADEIEL_AN9_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN9
2826 #define REG_ADEIEL_AN10_ENABLED 0b0000010000000000 // Early Interrupt Enabled for AN10
2827 #define REG_ADEIEL_AN10_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN10
2828 #define REG_ADEIEL_AN11_ENABLED 0b0000100000000000 // Early Interrupt Enabled for AN11
2829 #define REG_ADEIEL_AN11_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN11
2830 #define REG_ADEIEL_AN12_ENABLED 0b0001000000000000 // Early Interrupt Enabled for AN12
2831 #define REG_ADEIEL_AN12_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN12
2832 #define REG_ADEIEL_AN13_ENABLED 0b0010000000000000 // Early Interrupt Enabled for AN13
2833 #define REG_ADEIEL_AN13_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN13
2834 #define REG_ADEIEL_AN14_ENABLED 0b0100000000000000 // Early Interrupt Enabled for AN14
2835 #define REG_ADEIEL_AN14_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN14
2836 #define REG_ADEIEL_AN15_ENABLED 0b1000000000000000 // Early Interrupt Enabled for AN15
2837 #define REG_ADEIEL_AN15_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN15
2841 #define REG_ADEIEH_RESET 0b0000000000000000 // Reset ADLVLTRGH High Register
2842 #define REG_ADEIEH_VALID_DATA_MSK 0b0000000000111111 // Bit mask used to set unimplemented bits to zero
2844 #define REG_ADEIEH_ALL_ENABLED 0b1111111111111111 // Early Interrupt Enabled for all ANx inputs
2845 #define REG_ADEIEH_ALL_DISABLED 0b0000000000000000 // Early Interrupt Disabled for all ANx inputs
2847 #define REG_ADEIEH_AN16_ENABLED 0b0000000000000001 // Early Interrupt Enabled for AN16
2848 #define REG_ADEIEH_AN16_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN16
2849 #define REG_ADEIEH_AN17_ENABLED 0b0000000000000010 // Early Interrupt Enabled for AN17
2850 #define REG_ADEIEH_AN17_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN17
2851 #define REG_ADEIEH_AN18_ENABLED 0b0000000000000100 // Early Interrupt Enabled for AN18
2852 #define REG_ADEIEH_AN18_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN18
2853 #define REG_ADEIEH_AN19_ENABLED 0b0000000000001000 // Early Interrupt Enabled for AN19
2854 #define REG_ADEIEH_AN19_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN19
2855 #define REG_ADEIEH_AN20_ENABLED 0b0000000000010000 // Early Interrupt Enabled for AN20
2856 #define REG_ADEIEH_AN20_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN20
2857 #define REG_ADEIEH_AN21_ENABLED 0b0000000000100000 // Early Interrupt Enabled for AN21
2858 #define REG_ADEIEH_AN21_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN21
2859 #define REG_ADEIEH_AN22_ENABLED 0b0000000001000000 // Early Interrupt Enabled for AN22
2860 #define REG_ADEIEH_AN22_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN22
2861 #define REG_ADEIEH_AN23_ENABLED 0b0000000010000000 // Early Interrupt Enabled for AN23
2862 #define REG_ADEIEH_AN23_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN23
2863 #define REG_ADEIEH_AN24_ENABLED 0b0000000100000000 // Early Interrupt Enabled for AN24
2864 #define REG_ADEIEH_AN24_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN24
2865 #define REG_ADEIEH_AN25_ENABLED 0b0000001000000000 // Early Interrupt Enabled for AN25
2866 #define REG_ADEIEH_AN25_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN25
2867 #define REG_ADEIEH_AN26_ENABLED 0b0000010000000000 // Early Interrupt Enabled for AN26
2868 #define REG_ADEIEH_AN26_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN26
2869 #define REG_ADEIEH_AN27_ENABLED 0b0000100000000000 // Early Interrupt Enabled for AN27
2870 #define REG_ADEIEH_AN27_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN27
2871 #define REG_ADEIEH_AN28_ENABLED 0b0001000000000000 // Early Interrupt Enabled for AN28
2872 #define REG_ADEIEH_AN28_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN28
2873 #define REG_ADEIEH_AN29_ENABLED 0b0010000000000000 // Early Interrupt Enabled for AN29
2874 #define REG_ADEIEH_AN29_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN29
2875 #define REG_ADEIEH_AN30_ENABLED 0b0100000000000000 // Early Interrupt Enabled for AN30
2876 #define REG_ADEIEH_AN30_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN30
2877 #define REG_ADEIEH_AN31_ENABLED 0b1000000000000000 // Early Interrupt Enabled for AN31
2878 #define REG_ADEIEH_AN31_DISABLED 0b0000000000000000 // Early Interrupt Disabled for AN31
2881 ADEIE_ANx_ENABLED = 0b1,
2882 ADEIE_ANx_DISABLED = 0b0
2888 volatile ADEIE_EIEN_e AN0EIE : 1;
2889 volatile ADEIE_EIEN_e AN1EIE : 1;
2890 volatile ADEIE_EIEN_e AN2EIE : 1;
2891 volatile ADEIE_EIEN_e AN3EIE : 1;
2892 volatile ADEIE_EIEN_e AN4EIE : 1;
2893 volatile ADEIE_EIEN_e AN5EIE : 1;
2894 volatile ADEIE_EIEN_e AN6EIE : 1;
2895 volatile ADEIE_EIEN_e AN7EIE : 1;
2896 #if (ADC_ANINPUT_COUNT > 7)
2897 volatile ADEIE_EIEN_e AN8EIE : 1;
2899 volatile unsigned : 1;
2901 #if (ADC_ANINPUT_COUNT > 8)
2902 volatile ADEIE_EIEN_e AN9EIE : 1;
2904 volatile unsigned : 1;
2906 #if (ADC_ANINPUT_COUNT > 9)
2907 volatile ADEIE_EIEN_e AN10EIE : 1;
2909 volatile unsigned : 1;
2911 #if (ADC_ANINPUT_COUNT > 10)
2912 volatile ADEIE_EIEN_e AN11EIE : 1;
2914 volatile unsigned : 1;
2916 #if (ADC_ANINPUT_COUNT > 11)
2917 volatile ADEIE_EIEN_e AN12EIE : 1;
2919 volatile unsigned : 1;
2921 #if (ADC_ANINPUT_COUNT > 12)
2922 volatile ADEIE_EIEN_e AN13EIE : 1;
2924 volatile unsigned : 1;
2926 #if (ADC_ANINPUT_COUNT > 13)
2927 volatile ADEIE_EIEN_e AN14EIE : 1;
2929 volatile unsigned : 1;
2931 #if (ADC_ANINPUT_COUNT > 14)
2932 volatile ADEIE_EIEN_e AN15EIE : 1;
2934 volatile unsigned : 1;
2938 #if (ADC_ANINPUT_COUNT > 15)
2939 volatile ADEIE_EIEN_e AN16EIE : 1;
2941 volatile unsigned : 1;
2943 #if (ADC_ANINPUT_COUNT > 16)
2944 volatile ADEIE_EIEN_e AN17EIE : 1;
2946 volatile unsigned : 1;
2948 #if (ADC_ANINPUT_COUNT > 17)
2949 volatile ADEIE_EIEN_e AN18EIE : 1;
2951 volatile unsigned : 1;
2953 #if (ADC_ANINPUT_COUNT > 18)
2954 volatile ADEIE_EIEN_e AN19EIE : 1;
2956 volatile unsigned : 1;
2958 #if (ADC_ANINPUT_COUNT > 19)
2959 volatile ADEIE_EIEN_e AN20EIE : 1;
2961 volatile unsigned : 1;
2963 #if (ADC_ANINPUT_COUNT > 20)
2964 volatile ADEIE_EIEN_e AN21EIE : 1;
2966 volatile unsigned : 1;
2968 #if (ADC_ANINPUT_COUNT > 21)
2969 volatile ADEIE_EIEN_e AN22EIE : 1;
2971 volatile unsigned : 1;
2973 #if (ADC_ANINPUT_COUNT > 22)
2974 volatile ADEIE_EIEN_e AN23EIE : 1;
2976 volatile unsigned : 1;
2978 #if (ADC_ANINPUT_COUNT > 23)
2979 volatile ADEIE_EIEN_e AN24EIE : 1;
2981 volatile unsigned : 1;
2983 #if (ADC_ANINPUT_COUNT > 24)
2984 volatile ADEIE_EIEN_e AN25EIE : 1;
2986 volatile unsigned : 1;
2988 #if (ADC_ANINPUT_COUNT > 25)
2989 volatile ADEIE_EIEN_e AN26EIE : 1;
2991 volatile unsigned : 1;
2993 #if (ADC_ANINPUT_COUNT > 26)
2994 volatile ADEIE_EIEN_e AN27EIE : 1;
2996 volatile unsigned : 1;
2998 #if (ADC_ANINPUT_COUNT > 27)
2999 volatile ADEIE_EIEN_e AN28EIE : 1;
3001 volatile unsigned : 1;
3003 #if (ADC_ANINPUT_COUNT > 28)
3004 volatile ADEIE_EIEN_e AN29EIE : 1;
3006 volatile unsigned : 1;
3008 #if (ADC_ANINPUT_COUNT > 29)
3009 volatile ADEIE_EIEN_e AN30EIE : 1;
3011 volatile unsigned : 1;
3013 #if (ADC_ANINPUT_COUNT > 30)
3014 volatile ADEIE_EIEN_e AN31EIE : 1;
3016 volatile unsigned : 1;
3019 }__attribute__((packed)) bits;
3020 volatile uint32_t value;
3026 #define REG_ADEISTATL_RESET 0b0000000000000000 // Reset ADLVLTRGH High Register
3027 #define REG_ADEISTATL_VALID_DATA_MSK 0b1111111111111111 // Bit mask used to set unimplemented bits to zero
3029 #define REG_ADEISTATL_AN0_SET 0b0000000000000001 // Early Interrupt Status SET for AN0
3030 #define REG_ADEISTATL_AN0_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN0
3031 #define REG_ADEISTATL_AN1_SET 0b0000000000000010 // Early Interrupt Status SET for AN1
3032 #define REG_ADEISTATL_AN1_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN1
3033 #define REG_ADEISTATL_AN2_SET 0b0000000000000100 // Early Interrupt Status SET for AN2
3034 #define REG_ADEISTATL_AN2_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN2
3035 #define REG_ADEISTATL_AN3_SET 0b0000000000001000 // Early Interrupt Status SET for AN3
3036 #define REG_ADEISTATL_AN3_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN3
3037 #define REG_ADEISTATL_AN4_SET 0b0000000000010000 // Early Interrupt Status SET for AN4
3038 #define REG_ADEISTATL_AN4_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN4
3039 #define REG_ADEISTATL_AN5_SET 0b0000000000100000 // Early Interrupt Status SET for AN5
3040 #define REG_ADEISTATL_AN5_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN5
3041 #define REG_ADEISTATL_AN6_SET 0b0000000001000000 // Early Interrupt Status SET for AN6
3042 #define REG_ADEISTATL_AN6_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN6
3043 #define REG_ADEISTATL_AN7_SET 0b0000000010000000 // Early Interrupt Status SET for AN7
3044 #define REG_ADEISTATL_AN7_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN7
3045 #define REG_ADEISTATL_AN8_SET 0b0000000100000000 // Early Interrupt Status SET for AN8
3046 #define REG_ADEISTATL_AN8_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN8
3047 #define REG_ADEISTATL_AN9_SET 0b0000001000000000 // Early Interrupt Status SET for AN9
3048 #define REG_ADEISTATL_AN9_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN9
3049 #define REG_ADEISTATL_AN10_SET 0b0000010000000000 // Early Interrupt Status SET for AN10
3050 #define REG_ADEISTATL_AN10_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN10
3051 #define REG_ADEISTATL_AN11_SET 0b0000100000000000 // Early Interrupt Status SET for AN11
3052 #define REG_ADEISTATL_AN11_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN11
3053 #define REG_ADEISTATL_AN12_SET 0b0001000000000000 // Early Interrupt Status SET for AN12
3054 #define REG_ADEISTATL_AN12_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN12
3055 #define REG_ADEISTATL_AN13_SET 0b0010000000000000 // Early Interrupt Status SET for AN13
3056 #define REG_ADEISTATL_AN13_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN13
3057 #define REG_ADEISTATL_AN14_SET 0b0100000000000000 // Early Interrupt Status SET for AN14
3058 #define REG_ADEISTATL_AN14_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN14
3059 #define REG_ADEISTATL_AN15_SET 0b1000000000000000 // Early Interrupt Status SET for AN15
3060 #define REG_ADEISTATL_AN15_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN15
3065 #define REG_ADEISTATH_RESET 0b0000000000000000 // Reset ADLVLTRGH High Register
3066 #define REG_ADEISTATH_VALID_DATA_MSK 0b0000000000111111 // Bit mask used to set unimplemented bits to zero
3068 #define REG_ADEISTATH_AN16_SET 0b0000000000000001 // Early Interrupt Status SET for AN16
3069 #define REG_ADEISTATH_AN16_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN16
3070 #define REG_ADEISTATH_AN17_SET 0b0000000000000010 // Early Interrupt Status SET for AN17
3071 #define REG_ADEISTATH_AN17_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN17
3072 #define REG_ADEISTATH_AN18_SET 0b0000000000000100 // Early Interrupt Status SET for AN18
3073 #define REG_ADEISTATH_AN18_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN18
3074 #define REG_ADEISTATH_AN19_SET 0b0000000000001000 // Early Interrupt Status SET for AN19
3075 #define REG_ADEISTATH_AN19_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN19
3076 #define REG_ADEISTATH_AN20_SET 0b0000000000010000 // Early Interrupt Status SET for AN20
3077 #define REG_ADEISTATH_AN20_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN20
3078 #define REG_ADEISTATH_AN21_SET 0b0000000000100000 // Early Interrupt Status SET for AN21
3079 #define REG_ADEISTATH_AN21_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN21
3080 #define REG_ADEISTATH_AN22_SET 0b0000000001000000 // Early Interrupt Status SET for AN22
3081 #define REG_ADEISTATH_AN22_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN22
3082 #define REG_ADEISTATH_AN23_SET 0b0000000010000000 // Early Interrupt Status SET for AN23
3083 #define REG_ADEISTATH_AN23_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN23
3084 #define REG_ADEISTATH_AN24_SET 0b0000000100000000 // Early Interrupt Status SET for AN24
3085 #define REG_ADEISTATH_AN24_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN24
3086 #define REG_ADEISTATH_AN25_SET 0b0000001000000000 // Early Interrupt Status SET for AN25
3087 #define REG_ADEISTATH_AN25_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN25
3088 #define REG_ADEISTATH_AN26_SET 0b0000010000000000 // Early Interrupt Status SET for AN26
3089 #define REG_ADEISTATH_AN26_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN26
3090 #define REG_ADEISTATH_AN27_SET 0b0000100000000000 // Early Interrupt Status SET for AN27
3091 #define REG_ADEISTATH_AN27_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN27
3092 #define REG_ADEISTATH_AN28_SET 0b0001000000000000 // Early Interrupt Status SET for AN28
3093 #define REG_ADEISTATH_AN28_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN28
3094 #define REG_ADEISTATH_AN29_SET 0b0010000000000000 // Early Interrupt Status SET for AN29
3095 #define REG_ADEISTATH_AN29_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN29
3096 #define REG_ADEISTATH_AN30_SET 0b0100000000000000 // Early Interrupt Status SET for AN30
3097 #define REG_ADEISTATH_AN30_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN30
3098 #define REG_ADEISTATH_AN31_SET 0b1000000000000000 // Early Interrupt Status SET for AN31
3099 #define REG_ADEISTATH_AN31_CLR 0b0000000000000000 // Early Interrupt Status CLEARED for AN31
3104 #define REG_ADMOD0L_RESET 0b0000000000000000 // Reset ADLVLTRGH High Register
3105 #define REG_ADMOD0L_VALID_DATA_MSK 0b1111111111111111 // Bit mask used to set unimplemented bits to zero
3107 #define REG_ADMOD0L_AN0_DIFF 0b0000000000000010 // AN0 operates in Differential mode
3108 #define REG_ADMOD0L_AN0_SNGE 0b0000000000000000 // AN0 operates in single ended mode
3109 #define REG_ADMOD0L_AN1_DIFF 0b0000000000001000 // AN1 operates in Differential mode
3110 #define REG_ADMOD0L_AN1_SNGE 0b0000000000000000 // AN1 operates in single ended mode
3111 #define REG_ADMOD0L_AN2_DIFF 0b0000000000100000 // AN2 operates in Differential mode
3112 #define REG_ADMOD0L_AN2_SNGE 0b0000000000000000 // AN2 operates in single ended mode
3113 #define REG_ADMOD0L_AN3_DIFF 0b0000000010000000 // AN3 operates in Differential mode
3114 #define REG_ADMOD0L_AN3_SNGE 0b0000000000000000 // AN3 operates in single ended mode
3115 #define REG_ADMOD0L_AN4_DIFF 0b0000001000000000 // AN4 operates in Differential mode
3116 #define REG_ADMOD0L_AN4_SNGE 0b0000000000000000 // AN4 operates in single ended mode
3117 #define REG_ADMOD0L_AN5_DIFF 0b0000100000000000 // AN5 operates in Differential mode
3118 #define REG_ADMOD0L_AN5_SNGE 0b0000000000000000 // AN5 operates in single ended mode
3119 #define REG_ADMOD0L_AN6_DIFF 0b0010000000000000 // AN6 operates in Differential mode
3120 #define REG_ADMOD0L_AN6_SNGE 0b0000000000000000 // AN6 operates in single ended mode
3121 #define REG_ADMOD0L_AN7_DIFF 0b1000000000000000 // AN7 operates in Differential mode
3122 #define REG_ADMOD0L_AN7_SNGE 0b0000000000000000 // AN7 operates in single ended mode
3124 #define REG_ADMOD0L_AN0_SIGNED 0b0000000000000001 // In differential mode AN0 output will be signed
3125 #define REG_ADMOD0L_AN0_UNSIGNED 0b0000000000000000 // In differential mode AN0 output will be unsigned
3126 #define REG_ADMOD0L_AN1_SIGNED 0b0000000000000100 // In differential mode AN1 output will be signed
3127 #define REG_ADMOD0L_AN1_UNSIGNED 0b0000000000000000 // In differential mode AN1 output will be unsigned
3128 #define REG_ADMOD0L_AN2_SIGNED 0b0000000000010000 // In differential mode AN2 output will be signed
3129 #define REG_ADMOD0L_AN2_UNSIGNED 0b0000000000000000 // In differential mode AN2 output will be unsigned
3130 #define REG_ADMOD0L_AN3_SIGNED 0b0000000001000000 // In differential mode AN3 output will be signed
3131 #define REG_ADMOD0L_AN3_UNSIGNED 0b0000000000000000 // In differential mode AN3 output will be unsigned
3132 #define REG_ADMOD0L_AN4_SIGNED 0b0000000100000000 // In differential mode AN4 output will be signed
3133 #define REG_ADMOD0L_AN4_UNSIGNED 0b0000000000000000 // In differential mode AN4 output will be unsigned
3134 #define REG_ADMOD0L_AN5_SIGNED 0b0000010000000000 // In differential mode AN5 output will be signed
3135 #define REG_ADMOD0L_AN5_UNSIGNED 0b0000000000000000 // In differential mode AN5 output will be unsigned
3136 #define REG_ADMOD0L_AN6_SIGNED 0b0001000000000000 // In differential mode AN6 output will be signed
3137 #define REG_ADMOD0L_AN6_UNSIGNED 0b0000000000000000 // In differential mode AN6 output will be unsigned
3138 #define REG_ADMOD0L_AN7_SIGNED 0b0100000000000000 // In differential mode AN7 output will be signed
3139 #define REG_ADMOD0L_AN7_UNSIGNED 0b0000000000000000 // In differential mode AN7 output will be unsigned
3144 #define REG_ADMOD0H_RESET 0b0000000000000000 // Reset ADMOD0H High Register
3145 #define REG_ADMOD0H_VALID_DATA_MSK 0b1111111111111111 // Bit mask used to set unimplemented bits to zero
3147 #define REG_ADMOD0H_AN8_DIFF 0b0000000000000010 // AN8 operates in Differential mode
3148 #define REG_ADMOD0H_AN8_SNGE 0b0000000000000000 // AN8 operates in single ended mode
3149 #define REG_ADMOD0H_AN9_DIFF 0b0000000000001000 // AN9 operates in Differential mode
3150 #define REG_ADMOD0H_AN9_SNGE 0b0000000000000000 // AN9 operates in single ended mode
3151 #define REG_ADMOD0H_AN10_DIFF 0b0000000000100000 // AN10 operates in Differential mode
3152 #define REG_ADMOD0H_AN10_SNGE 0b0000000000000000 // AN10 operates in single ended mode
3153 #define REG_ADMOD0H_AN11_DIFF 0b0000000010000000 // AN11 operates in Differential mode
3154 #define REG_ADMOD0H_AN11_SNGE 0b0000000000000000 // AN11 operates in single ended mode
3155 #define REG_ADMOD0H_AN12_DIFF 0b0000001000000000 // AN12 operates in Differential mode
3156 #define REG_ADMOD0H_AN12_SNGE 0b0000000000000000 // AN12 operates in single ended mode
3157 #define REG_ADMOD0H_AN13_DIFF 0b0000100000000000 // AN13 operates in Differential mode
3158 #define REG_ADMOD0H_AN13_SNGE 0b0000000000000000 // AN13 operates in single ended mode
3159 #define REG_ADMOD0H_AN14_DIFF 0b0010000000000000 // AN14 operates in Differential mode
3160 #define REG_ADMOD0H_AN14_SNGE 0b0000000000000000 // AN14 operates in single ended mode
3161 #define REG_ADMOD0H_AN15_DIFF 0b1000000000000000 // AN15 operates in Differential mode
3162 #define REG_ADMOD0H_AN15_SNGE 0b0000000000000000 // AN15 operates in single ended mode
3164 #define REG_ADMOD0H_AN8_SIGNED 0b0000000000000001 // In differential mode AN8 output will be signed
3165 #define REG_ADMOD0H_AN8_UNSIGNED 0b0000000000000000 // In differential mode AN8 output will be unsigned
3166 #define REG_ADMOD0H_AN9_SIGNED 0b0000000000000100 // In differential mode AN9 output will be signed
3167 #define REG_ADMOD0H_AN9_UNSIGNED 0b0000000000000000 // In differential mode AN9 output will be unsigned
3168 #define REG_ADMOD0H_AN10_SIGNED 0b0000000000010000 // In differential mode AN10 output will be signed
3169 #define REG_ADMOD0H_AN10_UNSIGNED 0b0000000000000000 // In differential mode AN10 output will be unsigned
3170 #define REG_ADMOD0H_AN11_SIGNED 0b0000000001000000 // In differential mode AN11 output will be signed
3171 #define REG_ADMOD0H_AN11_UNSIGNED 0b0000000000000000 // In differential mode AN11 output will be unsigned
3172 #define REG_ADMOD0H_AN12_SIGNED 0b0000000100000000 // In differential mode AN12 output will be signed
3173 #define REG_ADMOD0H_AN12_UNSIGNED 0b0000000000000000 // In differential mode AN12 output will be unsigned
3174 #define REG_ADMOD0H_AN13_SIGNED 0b0000010000000000 // In differential mode AN13 output will be signed
3175 #define REG_ADMOD0H_AN13_UNSIGNED 0b0000000000000000 // In differential mode AN13 output will be unsigned
3176 #define REG_ADMOD0H_AN14_SIGNED 0b0001000000000000 // In differential mode AN14 output will be signed
3177 #define REG_ADMOD0H_AN14_UNSIGNED 0b0000000000000000 // In differential mode AN14 output will be unsigned
3178 #define REG_ADMOD0H_AN15_SIGNED 0b0100000000000000 // In differential mode AN15 output will be signed
3179 #define REG_ADMOD0H_AN15_UNSIGNED 0b0000000000000000 // In differential mode AN15 output will be unsigned
3182 #define REG_ADMOD0_AN_SET(x) ((uint32_t)(pow(2, x))) // Macro to set register bit based on ANx input number
3185 ADMOD0H_DIFF_DIFF = 0b1,
3186 ADMOD0H_DIFF_SNGE = 0b0
3190 ADMOD0_SIGN_SIGNED = 0b1,
3191 ADMOD0_SIGN_UNSIGNED = 0b0
3197 volatile ADMOD0_DIFF_e AN0DIFF : 1;
3198 volatile ADMOD0_SIGN_e AN0SIGN : 1;
3199 volatile ADMOD0_DIFF_e AN1DIFF : 1;
3200 volatile ADMOD0_SIGN_e AN1SIGN : 1;
3201 volatile ADMOD0_DIFF_e AN2DIFF : 1;
3202 volatile ADMOD0_SIGN_e AN2SIGN : 1;
3203 volatile ADMOD0_DIFF_e AN3DIFF : 1;
3204 volatile ADMOD0_SIGN_e AN3SIGN : 1;
3206 volatile ADMOD0_DIFF_e AN4DIFF : 1;
3207 volatile ADMOD0_SIGN_e AN4SIGN : 1;
3208 volatile ADMOD0_DIFF_e AN5DIFF : 1;
3209 volatile ADMOD0_SIGN_e AN5SIGN : 1;
3210 volatile ADMOD0_DIFF_e AN6DIFF : 1;
3211 volatile ADMOD0_SIGN_e AN6SIGN : 1;
3212 volatile ADMOD0_DIFF_e AN7DIFF : 1;
3213 volatile ADMOD0_SIGN_e AN7SIGN : 1;
3215 volatile ADMOD0_DIFF_e AN8DIFF : 1;
3216 volatile ADMOD0_SIGN_e AN8SIGN : 1;
3217 volatile ADMOD0_DIFF_e AN9DIFF : 1;
3218 volatile ADMOD0_SIGN_e AN9SIGN : 1;
3219 volatile ADMOD0_DIFF_e AN10DIFF : 1;
3220 volatile ADMOD0_SIGN_e AN10SIGN : 1;
3221 volatile ADMOD0_DIFF_e AN11DIFF : 1;
3222 volatile ADMOD0_SIGN_e AN11SIGN : 1;
3224 volatile ADMOD0_DIFF_e AN12DIFF : 1;
3225 volatile ADMOD0_SIGN_e AN12SIGN : 1;
3226 volatile ADMOD0_DIFF_e AN13DIFF : 1;
3227 volatile ADMOD0_SIGN_e AN13SIGN : 1;
3228 volatile ADMOD0_DIFF_e AN14DIFF : 1;
3229 volatile ADMOD0_SIGN_e AN14SIGN : 1;
3230 volatile ADMOD0_DIFF_e AN15DIFF : 1;
3231 volatile ADMOD0_SIGN_e AN15SIGN : 1;
3233 }__attribute__((packed))bits;
3234 volatile uint32_t value;
3240 #define REG_ADMOD1L_RESET 0b0000000000000000 // Reset ADLVLTRGH High Register
3241 #define REG_ADMOD1L_VALID_DATA_MSK 0b0000111111111111 // Bit mask used to set unimplemented bits to zero
3243 #define REG_ADMOD1L_AN16_DIFF 0b0000000000000010 // AN16 operates in Differential mode
3244 #define REG_ADMOD1L_AN16_SNGE 0b0000000000000000 // AN16 operates in single ended mode
3245 #define REG_ADMOD1L_AN17_DIFF 0b0000000000001000 // AN17 operates in Differential mode
3246 #define REG_ADMOD1L_AN17_SNGE 0b0000000000000000 // AN17 operates in single ended mode
3247 #define REG_ADMOD1L_AN18_DIFF 0b0000000000100000 // AN18 operates in Differential mode
3248 #define REG_ADMOD1L_AN18_SNGE 0b0000000000000000 // AN18 operates in single ended mode
3249 #define REG_ADMOD1L_AN19_DIFF 0b0000000010000000 // AN19 operates in Differential mode
3250 #define REG_ADMOD1L_AN19_SNGE 0b0000000000000000 // AN19 operates in single ended mode
3251 #define REG_ADMOD1L_AN20_DIFF 0b0000001000000000 // AN20 operates in Differential mode
3252 #define REG_ADMOD1L_AN20_SNGE 0b0000000000000000 // AN20 operates in single ended mode
3253 #define REG_ADMOD1L_AN21_DIFF 0b0000100000000000 // AN21 operates in Differential mode
3254 #define REG_ADMOD1L_AN21_SNGE 0b0000000000000000 // AN21 operates in single ended mode
3255 #define REG_ADMOD1L_AN22_DIFF 0b0010000000000000 // AN22 operates in Differential mode
3256 #define REG_ADMOD1L_AN22_SNGE 0b0000000000000000 // AN22 operates in single ended mode
3257 #define REG_ADMOD1L_AN23_DIFF 0b1000000000000000 // AN23 operates in Differential mode
3258 #define REG_ADMOD1L_AN23_SNGE 0b0000000000000000 // AN23 operates in single ended mode
3260 #define REG_ADMOD1L_AN16_SIGNED 0b0000000000000001 // In differential mode AN8 output will be signed
3261 #define REG_ADMOD1L_AN16_UNSIGNED 0b0000000000000000 // In differential mode AN8 output will be unsigned
3262 #define REG_ADMOD1L_AN17_SIGNED 0b0000000000000100 // In differential mode AN9 output will be signed
3263 #define REG_ADMOD1L_AN17_UNSIGNED 0b0000000000000000 // In differential mode AN9 output will be unsigned
3264 #define REG_ADMOD1L_AN18_SIGNED 0b0000000000010000 // In differential mode AN10 output will be signed
3265 #define REG_ADMOD1L_AN18_UNSIGNED 0b0000000000000000 // In differential mode AN10 output will be unsigned
3266 #define REG_ADMOD1L_AN19_SIGNED 0b0000000001000000 // In differential mode AN11 output will be signed
3267 #define REG_ADMOD1L_AN19_UNSIGNED 0b0000000000000000 // In differential mode AN11 output will be unsigned
3268 #define REG_ADMOD1L_AN20_SIGNED 0b0000000100000000 // In differential mode AN12 output will be signed
3269 #define REG_ADMOD1L_AN20_UNSIGNED 0b0000000000000000 // In differential mode AN12 output will be unsigned
3270 #define REG_ADMOD1L_AN21_SIGNED 0b0000010000000000 // In differential mode AN13 output will be signed
3271 #define REG_ADMOD1L_AN21_UNSIGNED 0b0000000000000000 // In differential mode AN13 output will be unsigned
3272 #define REG_ADMOD1L_AN22_SIGNED 0b0001000000000000 // In differential mode AN14 output will be signed
3273 #define REG_ADMOD1L_AN22_UNSIGNED 0b0000000000000000 // In differential mode AN14 output will be unsigned
3274 #define REG_ADMOD1L_AN23_SIGNED 0b0100000000000000 // In differential mode AN15 output will be signed
3275 #define REG_ADMOD1L_AN23_UNSIGNED 0b0000000000000000 // In differential mode AN15 output will be unsigned
3281 #define REG_ADMOD1H_RESET 0b0000000000000000 // Reset ADMOD0H High Register
3282 #define REG_ADMOD1H_VALID_DATA_MSK 0b1111111111111111 // Bit mask used to set unimplemented bits to zero
3284 #define REG_ADMOD1H_AN24_DIFF 0b0000000000000010 // AN24 operates in Differential mode
3285 #define REG_ADMOD1H_AN24_SNGE 0b0000000000000000 // AN24 operates in single ended mode
3286 #define REG_ADMOD1H_AN25_DIFF 0b0000000000001000 // AN25 operates in Differential mode
3287 #define REG_ADMOD1H_AN25_SNGE 0b0000000000000000 // AN25 operates in single ended mode
3288 #define REG_ADMOD1H_AN26_DIFF 0b0000000000100000 // AN26 operates in Differential mode
3289 #define REG_ADMOD1H_AN26_SNGE 0b0000000000000000 // AN26 operates in single ended mode
3290 #define REG_ADMOD1H_AN27_DIFF 0b0000000010000000 // AN27 operates in Differential mode
3291 #define REG_ADMOD1H_AN27_SNGE 0b0000000000000000 // AN27 operates in single ended mode
3292 #define REG_ADMOD1H_AN28_DIFF 0b0000001000000000 // AN28 operates in Differential mode
3293 #define REG_ADMOD1H_AN28_SNGE 0b0000000000000000 // AN28 operates in single ended mode
3294 #define REG_ADMOD1H_AN29_DIFF 0b0000100000000000 // AN29 operates in Differential mode
3295 #define REG_ADMOD1H_AN29_SNGE 0b0000000000000000 // AN29 operates in single ended mode
3296 #define REG_ADMOD1H_AN30_DIFF 0b0010000000000000 // AN30 operates in Differential mode
3297 #define REG_ADMOD1H_AN30_SNGE 0b0000000000000000 // AN30 operates in single ended mode
3298 #define REG_ADMOD1H_AN31_DIFF 0b1000000000000000 // AN31 operates in Differential mode
3299 #define REG_ADMOD1H_AN31_SNGE 0b0000000000000000 // AN31 operates in single ended mode
3301 #define REG_ADMOD1H_AN24_SIGNED 0b0000000000000001 // In differential mode AN24 output will be signed
3302 #define REG_ADMOD1H_AN24_UNSIGNED 0b0000000000000000 // In differential mode AN24 output will be unsigned
3303 #define REG_ADMOD1H_AN25_SIGNED 0b0000000000000100 // In differential mode AN25 output will be signed
3304 #define REG_ADMOD1H_AN25_UNSIGNED 0b0000000000000000 // In differential mode AN25 output will be unsigned
3305 #define REG_ADMOD1H_AN26_SIGNED 0b0000000000010000 // In differential mode AN26 output will be signed
3306 #define REG_ADMOD1H_AN26_UNSIGNED 0b0000000000000000 // In differential mode AN26 output will be unsigned
3307 #define REG_ADMOD1H_AN27_SIGNED 0b0000000001000000 // In differential mode AN27 output will be signed
3308 #define REG_ADMOD1H_AN27_UNSIGNED 0b0000000000000000 // In differential mode AN27 output will be unsigned
3309 #define REG_ADMOD1H_AN28_SIGNED 0b0000000100000000 // In differential mode AN28 output will be signed
3310 #define REG_ADMOD1H_AN28_UNSIGNED 0b0000000000000000 // In differential mode AN28 output will be unsigned
3311 #define REG_ADMOD1H_AN29_SIGNED 0b0000010000000000 // In differential mode AN29 output will be signed
3312 #define REG_ADMOD1H_AN29_UNSIGNED 0b0000000000000000 // In differential mode AN29 output will be unsigned
3313 #define REG_ADMOD1H_AN30_SIGNED 0b0001000000000000 // In differential mode AN30 output will be signed
3314 #define REG_ADMOD1H_AN30_UNSIGNED 0b0000000000000000 // In differential mode AN30 output will be unsigned
3315 #define REG_ADMOD1H_AN31_SIGNED 0b0100000000000000 // In differential mode AN31 output will be signed
3316 #define REG_ADMOD1H_AN31_UNSIGNED 0b0000000000000000 // In differential mode AN31 output will be unsigned
3322 #define REG_ADIEL_RESET 0b0000000000000000 // Reset ADIEL Low Register
3323 #define REG_ADIEL_VALID_DATA_MSK 0b1111111111111111 // Bit mask used to set unimplemented bits to zero
3325 #define REG_ADIEL_ALL_ENABLED 0b1111111111111111 // Interrupt enabled for all ANx inputs
3326 #define REG_ADIEL_ALL_DISABLED 0b0000000000000000 // Interrupt disabled for all ANx inputs
3328 #define REG_ADIEL_AN0_ENABLED 0b0000000000000001 // Interrupt enabled for AN0
3329 #define REG_ADIEL_AN0_DISABLED 0b0000000000000000 // Interrupt disabled for AN0
3330 #define REG_ADIEL_AN1_ENABLED 0b0000000000000010 // Interrupt enabled for AN1
3331 #define REG_ADIEL_AN1_DISABLED 0b0000000000000000 // Interrupt disabled for AN1
3332 #define REG_ADIEL_AN2_ENABLED 0b0000000000000100 // Interrupt enabled for AN2
3333 #define REG_ADIEL_AN2_DISABLED 0b0000000000000000 // Interrupt disabled for AN2
3334 #define REG_ADIEL_AN3_ENABLED 0b0000000000001000 // Interrupt enabled for AN3
3335 #define REG_ADIEL_AN3_DISABLED 0b0000000000000000 // Interrupt disabled for AN3
3336 #define REG_ADIEL_AN4_ENABLED 0b0000000000010000 // Interrupt enabled for AN4
3337 #define REG_ADIEL_AN4_DISABLED 0b0000000000000000 // Interrupt disabled for AN4
3338 #define REG_ADIEL_AN5_ENABLED 0b0000000000100000 // Interrupt enabled for AN5
3339 #define REG_ADIEL_AN5_DISABLED 0b0000000000000000 // Interrupt disabled for AN5
3340 #define REG_ADIEL_AN6_ENABLED 0b0000000001000000 // Interrupt enabled for AN6
3341 #define REG_ADIEL_AN6_DISABLED 0b0000000000000000 // Interrupt disabled for AN6
3342 #define REG_ADIEL_AN7_ENABLED 0b0000000010000000 // Interrupt enabled for AN7
3343 #define REG_ADIEL_AN7_DISABLED 0b0000000000000000 // Interrupt disabled for AN7
3344 #define REG_ADIEL_AN8_ENABLED 0b0000000100000000 // Interrupt enabled for AN8
3345 #define REG_ADIEL_AN8_DISABLED 0b0000000000000000 // Interrupt disabled for AN8
3346 #define REG_ADIEL_AN9_ENABLED 0b0000001000000000 // Interrupt enabled for AN9
3347 #define REG_ADIEL_AN9_DISABLED 0b0000000000000000 // Interrupt disabled for AN9
3348 #define REG_ADIEL_AN10_ENABLED 0b0000010000000000 // Interrupt enabled for AN10
3349 #define REG_ADIEL_AN10_DISABLED 0b0000000000000000 // Interrupt disabled for AN10
3350 #define REG_ADIEL_AN11_ENABLED 0b0000100000000000 // Interrupt enabled for AN11
3351 #define REG_ADIEL_AN11_DISABLED 0b0000000000000000 // Interrupt disabled for AN11
3352 #define REG_ADIEL_AN12_ENABLED 0b0001000000000000 // Interrupt enabled for AN12
3353 #define REG_ADIEL_AN12_DISABLED 0b0000000000000000 // Interrupt disabled for AN12
3354 #define REG_ADIEL_AN13_ENABLED 0b0010000000000000 // Interrupt enabled for AN13
3355 #define REG_ADIEL_AN13_DISABLED 0b0000000000000000 // Interrupt disabled for AN13
3356 #define REG_ADIEL_AN14_ENABLED 0b0100000000000000 // Interrupt enabled for AN14
3357 #define REG_ADIEL_AN14_DISABLED 0b0000000000000000 // Interrupt disabled for AN14
3358 #define REG_ADIEL_AN15_ENABLED 0b1000000000000000 // Interrupt enabled for AN15
3359 #define REG_ADIEL_AN15_DISABLED 0b0000000000000000 // Interrupt disabled for AN15
3364 #define REG_ADIEH_RESET 0b0000000000000000 // Reset ADIEH High Register
3365 #define REG_ADIEH_VALID_DATA_MSK 0b0000000000111111 // Bit mask used to set unimplemented bits to zero
3367 #define REG_ADIEH_ALL_DISABLED 0b0000000000000000 // Interrupt disabled for all ANx inputs
3368 #define REG_ADIEH_ALL_ENABLED 0b1111111111111111 // Interrupt enabled for all ANx inputs
3370 #define REG_ADIEH_AN16_ENABLED 0b0000000000000001 // Interrupt enabled for AN16
3371 #define REG_ADIEH_AN16_DISABLED 0b0000000000000000 // Interrupt disabled for AN16
3372 #define REG_ADIEH_AN17_ENABLED 0b0000000000000010 // Interrupt enabled for AN17
3373 #define REG_ADIEH_AN17_DISABLED 0b0000000000000000 // Interrupt disabled for AN17
3374 #define REG_ADIEH_AN18_ENABLED 0b0000000000000100 // Interrupt enabled for AN18
3375 #define REG_ADIEH_AN18_DISABLED 0b0000000000000000 // Interrupt disabled for AN18
3376 #define REG_ADIEH_AN19_ENABLED 0b0000000000001000 // Interrupt enabled for AN19
3377 #define REG_ADIEH_AN19_DISABLED 0b0000000000000000 // Interrupt disabled for AN19
3378 #define REG_ADIEH_AN20_ENABLED 0b0000000000010000 // Interrupt enabled for AN20
3379 #define REG_ADIEH_AN20_DISABLED 0b0000000000000000 // Interrupt disabled for AN20
3380 #define REG_ADIEH_AN21_ENABLED 0b0000000000100000 // Interrupt enabled for AN21
3381 #define REG_ADIEH_AN21_DISABLED 0b0000000000000000 // Interrupt disabled for AN21
3382 #define REG_ADIEH_AN22_ENABLED 0b0000000001000000 // Interrupt enabled for AN22
3383 #define REG_ADIEH_AN22_DISABLED 0b0000000000000000 // Interrupt disabled for AN22
3384 #define REG_ADIEH_AN23_ENABLED 0b0000000010000000 // Interrupt enabled for AN23
3385 #define REG_ADIEH_AN23_DISABLED 0b0000000000000000 // Interrupt disabled for AN23
3386 #define REG_ADIEH_AN24_ENABLED 0b0000000100000000 // Interrupt enabled for AN24
3387 #define REG_ADIEH_AN24_DISABLED 0b0000000000000000 // Interrupt disabled for AN24
3388 #define REG_ADIEH_AN25_ENABLED 0b0000001000000000 // Interrupt enabled for AN25
3389 #define REG_ADIEH_AN25_DISABLED 0b0000000000000000 // Interrupt disabled for AN25
3390 #define REG_ADIEH_AN26_ENABLED 0b0000010000000000 // Interrupt enabled for AN26
3391 #define REG_ADIEH_AN26_DISABLED 0b0000000000000000 // Interrupt disabled for AN26
3392 #define REG_ADIEH_AN27_ENABLED 0b0000100000000000 // Interrupt enabled for AN27
3393 #define REG_ADIEH_AN27_DISABLED 0b0000000000000000 // Interrupt disabled for AN27
3394 #define REG_ADIEH_AN28_ENABLED 0b0001000000000000 // Interrupt enabled for AN28
3395 #define REG_ADIEH_AN28_DISABLED 0b0000000000000000 // Interrupt disabled for AN28
3396 #define REG_ADIEH_AN29_ENABLED 0b0010000000000000 // Interrupt enabled for AN29
3397 #define REG_ADIEH_AN29_DISABLED 0b0000000000000000 // Interrupt disabled for AN29
3398 #define REG_ADIEH_AN30_ENABLED 0b0100000000000000 // Interrupt enabled for AN30
3399 #define REG_ADIEH_AN30_DISABLED 0b0000000000000000 // Interrupt disabled for AN30
3400 #define REG_ADIEH_AN31_ENABLED 0b1000000000000000 // Interrupt enabled for AN31
3401 #define REG_ADIEH_AN31_DISABLED 0b0000000000000000 // Interrupt disabled for AN31
3405 ADIE_ANx_ENABLED = 0b1,
3406 ADIE_ANx_DISABLED = 0b0
3411 volatile ADIE_IE_e an0ie : 1;
3412 volatile ADIE_IE_e an1ie : 1;
3413 volatile ADIE_IE_e an2ie : 1;
3414 volatile ADIE_IE_e an3ie : 1;
3415 volatile ADIE_IE_e an4ie : 1;
3416 volatile ADIE_IE_e an5ie : 1;
3417 volatile ADIE_IE_e an6ie : 1;
3418 volatile ADIE_IE_e an7ie : 1;
3419 #if (ADC_ANINPUT_COUNT > 7)
3420 volatile ADIE_IE_e an8ie : 1;
3422 volatile unsigned : 1;
3424 #if (ADC_ANINPUT_COUNT > 8)
3425 volatile ADIE_IE_e an9ie : 1;
3427 volatile unsigned : 1;
3429 #if (ADC_ANINPUT_COUNT > 9)
3430 volatile ADIE_IE_e an10ie : 1;
3432 volatile unsigned : 1;
3434 #if (ADC_ANINPUT_COUNT > 10)
3435 volatile ADIE_IE_e an11ie : 1;
3437 volatile unsigned : 1;
3439 #if (ADC_ANINPUT_COUNT > 11)
3440 volatile ADIE_IE_e an12ie : 1;
3442 volatile unsigned : 1;
3444 #if (ADC_ANINPUT_COUNT > 12)
3445 volatile ADIE_IE_e an13ie : 1;
3447 volatile unsigned : 1;
3449 #if (ADC_ANINPUT_COUNT > 13)
3450 volatile ADIE_IE_e an14ie : 1;
3452 volatile unsigned : 1;
3455 #if (ADC_ANINPUT_COUNT > 14)
3456 volatile ADIE_IE_e an15ie : 1;
3458 volatile unsigned : 1;
3461 #if (ADC_ANINPUT_COUNT > 15)
3462 volatile ADIE_IE_e an16ie : 1;
3464 volatile unsigned : 1;
3467 #if (ADC_ANINPUT_COUNT > 16)
3468 volatile ADIE_IE_e an17ie : 1;
3470 volatile unsigned : 1;
3472 #if (ADC_ANINPUT_COUNT > 17)
3473 volatile ADIE_IE_e an18ie : 1;
3475 volatile unsigned : 1;
3477 #if (ADC_ANINPUT_COUNT > 18)
3478 volatile ADIE_IE_e an19ie : 1;
3480 volatile unsigned : 1;
3482 #if (ADC_ANINPUT_COUNT > 19)
3483 volatile ADIE_IE_e an20ie : 1;
3485 volatile unsigned : 1;
3487 #if (ADC_ANINPUT_COUNT > 20)
3488 volatile ADIE_IE_e an21ie : 1;
3490 volatile unsigned : 1;
3492 #if (ADC_ANINPUT_COUNT > 21)
3493 volatile ADIE_IE_e an22ie : 1;
3495 volatile unsigned : 1;
3497 #if (ADC_ANINPUT_COUNT > 22)
3498 volatile ADIE_IE_e an23ie : 1;
3500 volatile unsigned : 1;
3502 #if (ADC_ANINPUT_COUNT > 23)
3503 volatile ADIE_IE_e an24ie : 1;
3505 volatile unsigned : 1;
3507 #if (ADC_ANINPUT_COUNT > 24)
3508 volatile ADIE_IE_e an25ie : 1;
3510 volatile unsigned : 1;
3512 #if (ADC_ANINPUT_COUNT > 25)
3513 volatile ADIE_IE_e an26ie : 1;
3515 volatile unsigned : 1;
3517 #if (ADC_ANINPUT_COUNT > 26)
3518 volatile ADIE_IE_e an27ie : 1;
3520 volatile unsigned : 1;
3522 #if (ADC_ANINPUT_COUNT > 27)
3523 volatile ADIE_IE_e an28ie : 1;
3525 volatile unsigned : 1;
3527 #if (ADC_ANINPUT_COUNT > 28)
3528 volatile ADIE_IE_e an29ie : 1;
3530 volatile unsigned : 1;
3532 #if (ADC_ANINPUT_COUNT > 29)
3533 volatile ADIE_IE_e an30ie : 1;
3535 volatile unsigned : 1;
3537 #if (ADC_ANINPUT_COUNT > 30)
3538 volatile ADIE_IE_e an31ie : 1;
3540 volatile unsigned : 1;
3543 }__attribute__((packed))bits;
3544 volatile uint32_t value;
3550 #define REG_ADSTATL_RESET 0b0000000000000000 // Reset ADSTATL Low Register
3551 #define REG_ADSTATL_VALID_DATA_MSK 0b1111111111111111 // Bit mask used to set unimplemented bits to zero
3553 #define REG_ADSTATL_AN0_SET 0b0000000000000001 // DATA READY bit is set for AN0
3554 #define REG_ADSTATL_AN0_CLR 0b0000000000000000 // DATA READY bit is cleared for AN0
3555 #define REG_ADSTATL_AN1_SET 0b0000000000000010 // DATA READY bit is set AN1
3556 #define REG_ADSTATL_AN1_CLR 0b0000000000000000 // DATA READY bit is cleared for AN1
3557 #define REG_ADSTATL_AN2_SET 0b0000000000000100 // DATA READY bit is set for AN2
3558 #define REG_ADSTATL_AN2_CLR 0b0000000000000000 // DATA READY bit is cleared for AN2
3559 #define REG_ADSTATL_AN3_SET 0b0000000000001000 // DATA READY bit is set for AN3
3560 #define REG_ADSTATL_AN3_CLR 0b0000000000000000 // DATA READY bit is cleared for AN3
3561 #define REG_ADSTATL_AN4_SET 0b0000000000010000 // DATA READY bit is set for AN4
3562 #define REG_ADSTATL_AN4_CLR 0b0000000000000000 // DATA READY bit is cleared for AN4
3563 #define REG_ADSTATL_AN5_SET 0b0000000000100000 // DATA READY bit is set for AN5
3564 #define REG_ADSTATL_AN5_CLR 0b0000000000000000 // DATA READY bit is cleared for AN5
3565 #define REG_ADSTATL_AN6_SET 0b0000000001000000 // DATA READY bit is set for AN6
3566 #define REG_ADSTATL_AN6_CLR 0b0000000000000000 // DATA READY bit is cleared for AN6
3567 #define REG_ADSTATL_AN7_SET 0b0000000010000000 // DATA READY bit is set for AN7
3568 #define REG_ADSTATL_AN7_CLR 0b0000000000000000 // DATA READY bit is cleared for AN7
3569 #define REG_ADSTATL_AN8_SET 0b0000000100000000 // DATA READY bit is set for AN8
3570 #define REG_ADSTATL_AN8_CLR 0b0000000000000000 // DATA READY bit is cleared for AN8
3571 #define REG_ADSTATL_AN9_SET 0b0000001000000000 // DATA READY bit is set for AN9
3572 #define REG_ADSTATL_AN9_CLR 0b0000000000000000 // DATA READY bit is cleared for AN9
3573 #define REG_ADSTATL_AN10_SET 0b0000010000000000 // DATA READY bit is set for AN10
3574 #define REG_ADSTATL_AN10_CLR 0b0000000000000000 // DATA READY bit is cleared for AN10
3575 #define REG_ADSTATL_AN11_SET 0b0000100000000000 // DATA READY bit is set for AN11
3576 #define REG_ADSTATL_AN11_CLR 0b0000000000000000 // DATA READY bit is cleared for AN11
3577 #define REG_ADSTATL_AN12_SET 0b0001000000000000 // DATA READY bit is set for AN12
3578 #define REG_ADSTATL_AN12_CLR 0b0000000000000000 // DATA READY bit is cleared for AN12
3579 #define REG_ADSTATL_AN13_SET 0b0010000000000000 // DATA READY bit is set for AN13
3580 #define REG_ADSTATL_AN13_CLR 0b0000000000000000 // DATA READY bit is cleared for AN13
3581 #define REG_ADSTATL_AN14_SET 0b0100000000000000 // DATA READY bit is set for AN14
3582 #define REG_ADSTATL_AN14_CLR 0b0000000000000000 // DATA READY bit is cleared for AN14
3583 #define REG_ADSTATL_AN15_SET 0b1000000000000000 // DATA READY bit is set for AN15
3584 #define REG_ADSTATL_AN15_CLR 0b0000000000000000 // DATA READY bit is cleared for AN15
3589 #define REG_ADSTATH_RESET 0b0000000000000000 // Reset ADLVLTRGH High Register
3590 #define REG_ADSTATH_VALID_DATA_MSK 0b0000000000111111 // Bit mask used to set unimplemented bits to zero
3592 #define REG_ADSTATH_AN16_SET 0b0000000000000001 // DATA READY bit is set for AN16
3593 #define REG_ADSTATH_AN16_CLR 0b0000000000000000 // DATA READY bit is cleared for AN16
3594 #define REG_ADSTATH_AN17_SET 0b0000000000000010 // DATA READY bit is set for AN17
3595 #define REG_ADSTATH_AN17_CLR 0b0000000000000000 // DATA READY bit is cleared for AN17
3596 #define REG_ADSTATH_AN18_SET 0b0000000000000100 // DATA READY bit is set for AN18
3597 #define REG_ADSTATH_AN18_CLR 0b0000000000000000 // DATA READY bit is cleared for AN18
3598 #define REG_ADSTATH_AN19_SET 0b0000000000001000 // DATA READY bit is set for AN19
3599 #define REG_ADSTATH_AN19_CLR 0b0000000000000000 // DATA READY bit is cleared for AN19
3600 #define REG_ADSTATH_AN20_SET 0b0000000000010000 // DATA READY bit is set for AN20
3601 #define REG_ADSTATH_AN20_CLR 0b0000000000000000 // DATA READY bit is cleared for AN20
3602 #define REG_ADSTATH_AN21_SET 0b0000000000100000 // DATA READY bit is set for AN21
3603 #define REG_ADSTATH_AN21_CLR 0b0000000000000000 // DATA READY bit is cleared for AN21
3604 #define REG_ADSTATH_AN22_SET 0b0000000001000000 // DATA READY bit is set for AN22
3605 #define REG_ADSTATH_AN22_CLR 0b0000000000000000 // DATA READY bit is cleared for AN22
3606 #define REG_ADSTATH_AN23_SET 0b0000000010000000 // DATA READY bit is set for AN23
3607 #define REG_ADSTATH_AN23_CLR 0b0000000000000000 // DATA READY bit is cleared for AN23
3608 #define REG_ADSTATH_AN24_SET 0b0000000100000000 // DATA READY bit is set for AN24
3609 #define REG_ADSTATH_AN24_CLR 0b0000000000000000 // DATA READY bit is cleared for AN24
3610 #define REG_ADSTATH_AN25_SET 0b0000001000000000 // DATA READY bit is set for AN25
3611 #define REG_ADSTATH_AN25_CLR 0b0000000000000000 // DATA READY bit is cleared for AN25
3612 #define REG_ADSTATH_AN26_SET 0b0000010000000000 // DATA READY bit is set for AN26
3613 #define REG_ADSTATH_AN26_CLR 0b0000000000000000 // DATA READY bit is cleared for AN26
3614 #define REG_ADSTATH_AN27_SET 0b0000100000000000 // DATA READY bit is set for AN27
3615 #define REG_ADSTATH_AN27_CLR 0b0000000000000000 // DATA READY bit is cleared for AN27
3616 #define REG_ADSTATH_AN28_SET 0b0001000000000000 // DATA READY bit is set for AN28
3617 #define REG_ADSTATH_AN28_CLR 0b0000000000000000 // DATA READY bit is cleared for AN28
3618 #define REG_ADSTATH_AN29_SET 0b0010000000000000 // DATA READY bit is set for AN29
3619 #define REG_ADSTATH_AN29_CLR 0b0000000000000000 // DATA READY bit is cleared for AN29
3620 #define REG_ADSTATH_AN30_SET 0b0100000000000000 // DATA READY bit is set for AN30
3621 #define REG_ADSTATH_AN30_CLR 0b0000000000000000 // DATA READY bit is cleared for AN30
3622 #define REG_ADSTATH_AN31_SET 0b1000000000000000 // DATA READY bit is set for AN31
3623 #define REG_ADSTATH_AN31_CLR 0b0000000000000000 // DATA READY bit is cleared for AN31
3626 #define REG_ADSTAT_AN_SET(x) ((uint32_t)(pow(2, x))) // Macro to set register bit based on ANx input number
3629 ADSTAT_ANx_SET = 0b1,
3630 ADSTAT_ANx_CLR = 0b0
3635 volatile ADSTAT_e an0rdy : 1;
3636 volatile ADSTAT_e an1rdy : 1;
3637 volatile ADSTAT_e an2rdy : 1;
3638 volatile ADSTAT_e an3rdy : 1;
3639 volatile ADSTAT_e an4rdy : 1;
3640 volatile ADSTAT_e an5rdy : 1;
3641 volatile ADSTAT_e an6rdy : 1;
3642 volatile ADSTAT_e an7rdy : 1;
3643 volatile ADSTAT_e an8rdy : 1;
3644 volatile ADSTAT_e an9rdy : 1;
3645 volatile ADSTAT_e an10rdy : 1;
3646 volatile ADSTAT_e an11rdy : 1;
3647 volatile ADSTAT_e an12rdy : 1;
3648 volatile ADSTAT_e an13rdy : 1;
3649 volatile ADSTAT_e an14rdy : 1;
3650 volatile ADSTAT_e an15rdy : 1;
3652 volatile ADSTAT_e an16rdy : 1;
3653 volatile ADSTAT_e an17rdy : 1;
3654 volatile ADSTAT_e an18rdy : 1;
3655 volatile ADSTAT_e an19rdy : 1;
3656 volatile ADSTAT_e an20rdy : 1;
3657 volatile ADSTAT_e an21rdy : 1;
3658 volatile ADSTAT_e an22rdy : 1;
3659 volatile ADSTAT_e an23rdy : 1;
3660 volatile ADSTAT_e an24rdy : 1;
3661 volatile ADSTAT_e an25rdy : 1;
3662 volatile ADSTAT_e an26rdy : 1;
3663 volatile ADSTAT_e an27rdy : 1;
3664 volatile ADSTAT_e an28rdy : 1;
3665 volatile ADSTAT_e an29rdy : 1;
3666 volatile ADSTAT_e an30rdy : 1;
3667 volatile ADSTAT_e an31rdy : 1;
3668 }__attribute__((packed)) bits;
3669 volatile uint32_t value;
3675 #define REG_ADTRIGx_VALID_DATA_MSK 0b0001111100011111 // =0x1F1F
3676 #define REG_ADTRIGxH_VALID_DATA_MSK 0b0001111100000000 // =0x1F00
3678 #define REG_ADTRIGx_VALID_DATA_LOW_MSK 0b0000000000011111 // =0x001F
3679 #define REG_ADTRIGx_VALID_DATA_HIGH_MSK 0b0001111100000000 // =0x1F00
3682 #if defined (__MA330049_dsPIC33CH_DPPIM__)
3684 #define REG_ADTRIGxH_TRGSRC_MSTR_PTG 0b0001111000000000 // Master PTG
3685 #define REG_ADTRIGxH_TRGSRC_SLV_CLC1 0b0001110100000000 // Slave CLC1
3686 #define REG_ADTRIGxH_TRGSRC_MSTR_CLC1 0b0001110000000000 // Master CLC1
3687 #define REG_ADTRIGxH_TRGSRC_SLV_PWM8_TRIG2 0b0001101100000000 // Slave PWM8 Trigger 2
3688 #define REG_ADTRIGxH_TRGSRC_SLV_PWM5_TRIG2 0b0001101000000000 // Slave PWM5 Trigger 2
3689 #define REG_ADTRIGxH_TRGSRC_SLV_PWM3_TRIG2 0b0001100100000000 // Slave PWM3 Trigger 2
3690 #define REG_ADTRIGxH_TRGSRC_SLV_PWM1_TRIG2 0b0001100000000000 // Slave PWM1 Trigger 2
3691 #define REG_ADTRIGxH_TRGSRC_SCCP4_PWM 0b0001011100000000 // Master SCCP4 PWM interrupt
3692 #define REG_ADTRIGxH_TRGSRC_SCCP3_PWM 0b0001011000000000 // Master SCCP3 PWM interrupt
3693 #define REG_ADTRIGxH_TRGSRC_SCCP2_PWM 0b0001010100000000 // Master SCCP2 PWM interrupt
3694 #define REG_ADTRIGxH_TRGSRC_SCCP1_PWM 0b0001010000000000 // Master SCCP1 PWM interrupt
3696 #define REG_ADTRIGxH_TRGSRC_MSTR_PWM4_TRIG2 0b0000101100000000 // Master PWM4 Trigger 2
3697 #define REG_ADTRIGxH_TRGSRC_MSTR_PWM4_TRIG1 0b0000101000000000 // Master PWM4 Trigger 1
3698 #define REG_ADTRIGxH_TRGSRC_MSTR_PWM3_TRIG2 0b0000100100000000 // Master PWM3 Trigger 2
3699 #define REG_ADTRIGxH_TRGSRC_MSTR_PWM3_TRIG1 0b0000100000000000 // Master PWM3 Trigger 1
3700 #define REG_ADTRIGxH_TRGSRC_MSTR_PWM2_TRIG2 0b0000011100000000 // Master PWM2 Trigger 2
3701 #define REG_ADTRIGxH_TRGSRC_MSTR_PWM2_TRIG1 0b0000011000000000 // Master PWM2 Trigger 1
3702 #define REG_ADTRIGxH_TRGSRC_MSTR_PWM1_TRIG2 0b0000010100000000 // Master PWM1 Trigger 2
3703 #define REG_ADTRIGxH_TRGSRC_MSTR_PWM1_TRIG1 0b0000010000000000 // Master PWM1 Trigger 1
3705 #elif defined (__MA330048_dsPIC33CK_DPPIM__)
3707 #define REG_ADTRIGxH_TRGSRC_PTG 0b0001111000000000 // PTG
3708 #define REG_ADTRIGxH_TRGSRC_CLC2 0b0001110100000000 // CLC2
3709 #define REG_ADTRIGxH_TRGSRC_CLC1 0b0001110000000000 // CLC1
3710 #define REG_ADTRIGxH_TRGSRC_MCCP9 0b0001101100000000 // MCCP9
3711 #define REG_ADTRIGxH_TRGSRC_SCCP7 0b0001101000000000 // SCCP7
3712 #define REG_ADTRIGxH_TRGSRC_SCCP6 0b0001100100000000 // SCCP6
3713 #define REG_ADTRIGxH_TRGSRC_SCCP5 0b0001100000000000 // SCCP5
3714 #define REG_ADTRIGxH_TRGSRC_SCCP4 0b0001011100000000 // SCCP4
3715 #define REG_ADTRIGxH_TRGSRC_SCCP3 0b0001011000000000 // SCCP3
3716 #define REG_ADTRIGxH_TRGSRC_SCCP2 0b0001010100000000 // SCCP2
3717 #define REG_ADTRIGxH_TRGSRC_SCCP1 0b0001010000000000 // SCCP1
3718 #define REG_ADTRIGxH_TRGSRC_PWM8_TRIG2 0b0001001100000000 // PWM8 Trigger 2
3719 #define REG_ADTRIGxH_TRGSRC_PWM8_TRIG1 0b0001001000000000 // PWM8 Trigger 1
3720 #define REG_ADTRIGxH_TRGSRC_PWM7_TRIG2 0b0001000100000000 // PWM7 Trigger 2
3721 #define REG_ADTRIGxH_TRGSRC_PWM7_TRIG1 0b0001000000000000 // PWM7 Trigger 1
3722 #define REG_ADTRIGxH_TRGSRC_PWM6_TRIG2 0b0000111100000000 // PWM6 Trigger 2
3723 #define REG_ADTRIGxH_TRGSRC_PWM6_TRIG1 0b0000111000000000 // PWM6 Trigger 1
3724 #define REG_ADTRIGxH_TRGSRC_PWM5_TRIG2 0b0000110100000000 // PWM5 Trigger 2
3725 #define REG_ADTRIGxH_TRGSRC_PWM5_TRIG1 0b0000110000000000 // PWM5 Trigger 1
3726 #define REG_ADTRIGxH_TRGSRC_PWM4_TRIG2 0b0000101100000000 // PWM4 Trigger 2
3727 #define REG_ADTRIGxH_TRGSRC_PWM4_TRIG1 0b0000101000000000 // PWM4 Trigger 1
3728 #define REG_ADTRIGxH_TRGSRC_PWM3_TRIG2 0b0000100100000000 // PWM3 Trigger 2
3729 #define REG_ADTRIGxH_TRGSRC_PWM3_TRIG1 0b0000100000000000 // PWM3 Trigger 1
3730 #define REG_ADTRIGxH_TRGSRC_PWM2_TRIG2 0b0000011100000000 // PWM2 Trigger 2
3731 #define REG_ADTRIGxH_TRGSRC_PWM2_TRIG1 0b0000011000000000 // PWM2 Trigger 1
3732 #define REG_ADTRIGxH_TRGSRC_PWM1_TRIG2 0b0000010100000000 // PWM1 Trigger 2
3733 #define REG_ADTRIGxH_TRGSRC_PWM1_TRIG1 0b0000010000000000 // PWM1 Trigger 1
3737 #define REG_ADTRIGxH_TRGSRC_LSWTRG 0b0000001000000000 // Level software trigger
3738 #define REG_ADTRIGxH_TRGSRC_CSWTRG 0b0000000100000000 // Common Software Trigger
3739 #define REG_ADTRIGxH_TRGSRC_NONE 0b0000000000000000 // No trigger is selected
3745 #define REG_ADTRIGxL_RESET 0b0000000000000000 // =0x0000
3746 #define REG_ADTRIGxL_VALID_DATA_MSK 0b0000000000011111 // =0x001F
3749 #define REG_ADTRIGxL_TRGSRC_ADTRG31 0b0000000000011111 // ADC Trigger #31 (PPS input))
3751 #if defined (__MA330049_dsPIC33CH_DPPIM__)
3753 #define REG_ADTRIGxL_TRGSRC_MSTR_PTG 0b0000000000011110 // Master PTG
3754 #define REG_ADTRIGxL_TRGSRC_SLV_CLC1 0b0000000000011101 // Slave CLC1
3755 #define REG_ADTRIGxL_TRGSRC_MSTR_CLC1 0b0000000000011100 // Master CLC1
3756 #define REG_ADTRIGxL_TRGSRC_SLV_PWM8_TRIG2 0b0000000000011011 // Slave PWM8 Trigger 2
3757 #define REG_ADTRIGxL_TRGSRC_SLV_PWM5_TRIG2 0b0000000000011010 // Slave PWM5 Trigger 2
3758 #define REG_ADTRIGxL_TRGSRC_SLV_PWM3_TRIG2 0b0000000000011001 // Slave PWM3 Trigger 2
3759 #define REG_ADTRIGxL_TRGSRC_SLV_PWM1_TRIG2 0b0000000000011000 // Slave PWM1 Trigger 2
3760 #define REG_ADTRIGxL_TRGSRC_SCCP4_PWM 0b0000000000010111 // Master SCCP4 PWM interrupt
3761 #define REG_ADTRIGxL_TRGSRC_SCCP3_PWM 0b0000000000010110 // Master SCCP3 PWM interrupt
3762 #define REG_ADTRIGxL_TRGSRC_SCCP2_PWM 0b0000000000010101 // Master SCCP2 PWM interrupt
3763 #define REG_ADTRIGxL_TRGSRC_SCCP1_PWM 0b0000000000010100 // Master SCCP1 PWM interrupt
3765 #define REG_ADTRIGxL_TRGSRC_MSTR_PWM4_TRIG2 0b0000000000001011 // Master PWM4 Trigger 2
3766 #define REG_ADTRIGxL_TRGSRC_MSTR_PWM4_TRIG1 0b0000000000001010 // Master PWM4 Trigger 1
3767 #define REG_ADTRIGxL_TRGSRC_MSTR_PWM3_TRIG2 0b0000000000001001 // Master PWM3 Trigger 2
3768 #define REG_ADTRIGxL_TRGSRC_MSTR_PWM3_TRIG1 0b0000000000001000 // Master PWM3 Trigger 1
3769 #define REG_ADTRIGxL_TRGSRC_MSTR_PWM2_TRIG2 0b0000000000000111 // Master PWM2 Trigger 2
3770 #define REG_ADTRIGxL_TRGSRC_MSTR_PWM2_TRIG1 0b0000000000000110 // Master PWM2 Trigger 1
3771 #define REG_ADTRIGxL_TRGSRC_MSTR_PWM1_TRIG2 0b0000000000000101 // Master PWM1 Trigger 2
3772 #define REG_ADTRIGxL_TRGSRC_MSTR_PWM1_TRIG1 0b0000000000000100 // Master PWM1 Trigger 1
3774 #elif defined (__MA330048_dsPIC33CK_DPPIM__)
3776 #define REG_ADTRIGxL_TRGSRC_PTG 0b0000000000011110 // PTG
3777 #define REG_ADTRIGxL_TRGSRC_CLC2 0b0000000000011101 // CLC2
3778 #define REG_ADTRIGxL_TRGSRC_CLC1 0b0000000000011100 // CLC1
3779 #define REG_ADTRIGxL_TRGSRC_MCCP9 0b0000000000011011 // MCCP9
3780 #define REG_ADTRIGxL_TRGSRC_SCCP7 0b0000000000011010 // SCCP7
3781 #define REG_ADTRIGxL_TRGSRC_SCCP6 0b0000000000011001 // SCCP6
3782 #define REG_ADTRIGxL_TRGSRC_SCCP5 0b0000000000011000 // SCCP5
3783 #define REG_ADTRIGxL_TRGSRC_SCCP4 0b0000000000010111 // SCCP4
3784 #define REG_ADTRIGxL_TRGSRC_SCCP3 0b0000000000010110 // SCCP3
3785 #define REG_ADTRIGxL_TRGSRC_SCCP2 0b0000000000010101 // SCCP2
3786 #define REG_ADTRIGxL_TRGSRC_SCCP1 0b0000000000010100 // SCCP1
3787 #define REG_ADTRIGxL_TRGSRC_PWM8_TRIG2 0b0000000000010011 // PWM8 Trigger 2
3788 #define REG_ADTRIGxL_TRGSRC_PWM8_TRIG1 0b0000000000010010 // PWM8 Trigger 1
3789 #define REG_ADTRIGxL_TRGSRC_PWM7_TRIG2 0b0000000000010001 // PWM7 Trigger 2
3790 #define REG_ADTRIGxL_TRGSRC_PWM7_TRIG1 0b0000000000010000 // PWM7 Trigger 1
3791 #define REG_ADTRIGxL_TRGSRC_PWM6_TRIG2 0b0000000000001111 // PWM6 Trigger 2
3792 #define REG_ADTRIGxL_TRGSRC_PWM6_TRIG1 0b0000000000001110 // PWM6 Trigger 1
3793 #define REG_ADTRIGxL_TRGSRC_PWM5_TRIG2 0b0000000000001101 // PWM5 Trigger 2
3794 #define REG_ADTRIGxL_TRGSRC_PWM5_TRIG1 0b0000000000001100 // PWM5 Trigger 1
3795 #define REG_ADTRIGxL_TRGSRC_PWM4_TRIG2 0b0000000000001011 // PWM4 Trigger 2
3796 #define REG_ADTRIGxL_TRGSRC_PWM4_TRIG1 0b0000000000001010 // PWM4 Trigger 1
3797 #define REG_ADTRIGxL_TRGSRC_PWM3_TRIG2 0b0000000000001001 // PWM3 Trigger 2
3798 #define REG_ADTRIGxL_TRGSRC_PWM3_TRIG1 0b0000000000001000 // PWM3 Trigger 1
3799 #define REG_ADTRIGxL_TRGSRC_PWM2_TRIG2 0b0000000000000111 // PWM2 Trigger 2
3800 #define REG_ADTRIGxL_TRGSRC_PWM2_TRIG1 0b0000000000000110 // PWM2 Trigger 1
3801 #define REG_ADTRIGxL_TRGSRC_PWM1_TRIG2 0b0000000000000101 // PWM1 Trigger 2
3802 #define REG_ADTRIGxL_TRGSRC_PWM1_TRIG1 0b0000000000000100 // PWM1 Trigger 1
3806 #define REG_ADTRIGxL_TRGSRC_LSWTRG 0b0000000000000010 // Level software trigger
3807 #define REG_ADTRIGxL_TRGSRC_CSWTRG 0b0000000000000001 // Common Software Trigger
3808 #define REG_ADTRIGxL_TRGSRC_NONE 0b0000000000000000 // No trigger is selected
3812 ADTRIGx_TRGSRC_ADTRG31 = 0b11111,
3813 ADTRIGx_TRGSRC_LSWTRG = 0b00010,
3814 ADTRIGx_TRGSRC_CSWTRG = 0b00001,
3816 #if defined (__MA330049_dsPIC33CH_DPPIM__)
3818 ADTRIGx_TRGSRC_MSTR_PTG = 0b11110,
3819 ADTRIGx_TRGSRC_SLV_CLC1 = 0b11101,
3820 ADTRIGx_TRGSRC_MSTR_CLC1 = 0b11100,
3821 ADTRIGx_TRGSRC_SLV_PWM8_TRIG2 = 0b11011,
3822 ADTRIGx_TRGSRC_SLV_PWM5_TRIG2 = 0b11010,
3823 ADTRIGx_TRGSRC_SLV_PWM3_TRIG2 = 0b11001,
3824 ADTRIGx_TRGSRC_SLV_PWM1_TRIG2 = 0b11000,
3825 ADTRIGx_TRGSRC_SCCP4_PWM = 0b10111,
3826 ADTRIGx_TRGSRC_SCCP3_PWM = 0b10110,
3827 ADTRIGx_TRGSRC_SCCP2_PWM = 0b10101,
3828 ADTRIGx_TRGSRC_SCCP1_PWM = 0b10100,
3830 ADTRIGx_TRGSRC_MSTR_PWM4_TRIG2 = 0b01011,
3831 ADTRIGx_TRGSRC_MSTR_PWM4_TRIG1 = 0b01010,
3832 ADTRIGx_TRGSRC_MSTR_PWM3_TRIG2 = 0b01001,
3833 ADTRIGx_TRGSRC_MSTR_PWM3_TRIG1 = 0b01000,
3834 ADTRIGx_TRGSRC_MSTR_PWM2_TRIG2 = 0b00111,
3835 ADTRIGx_TRGSRC_MSTR_PWM2_TRIG1 = 0b00110,
3836 ADTRIGx_TRGSRC_MSTR_PWM1_TRIG2 = 0b00101,
3837 ADTRIGx_TRGSRC_MSTR_PWM1_TRIG1 = 0b00100,
3839 #elif defined (__MA330048_dsPIC33CK_DPPIM__)
3841 ADTRIGx_TRGSRC_PTG = 0b11110,
3842 ADTRIGx_TRGSRC_CLC2 = 0b11101,
3843 ADTRIGx_TRGSRC_CLC1 = 0b11100,
3844 ADTRIGx_TRGSRC_MCCP9 = 0b11011,
3845 ADTRIGx_TRGSRC_SCCP7 = 0b11010,
3846 ADTRIGx_TRGSRC_SCCP6 = 0b11001,
3847 ADTRIGx_TRGSRC_SCCP5 = 0b11000,
3848 ADTRIGx_TRGSRC_SCCP4 = 0b10111,
3849 ADTRIGx_TRGSRC_SCCP3 = 0b10110,
3850 ADTRIGx_TRGSRC_SCCP2 = 0b10101,
3851 ADTRIGx_TRGSRC_SCCP1 = 0b10100,
3852 ADTRIGx_TRGSRC_PWM8_TRIG2 = 0b10011,
3853 ADTRIGx_TRGSRC_PWM8_TRIG1 = 0b10010,
3854 ADTRIGx_TRGSRC_PWM7_TRIG2 = 0b10001,
3855 ADTRIGx_TRGSRC_PWM7_TRIG1 = 0b10000,
3856 ADTRIGx_TRGSRC_PWM6_TRIG2 = 0b01111,
3857 ADTRIGx_TRGSRC_PWM6_TRIG1 = 0b01110,
3858 ADTRIGx_TRGSRC_PWM5_TRIG2 = 0b01101,
3859 ADTRIGx_TRGSRC_PWM5_TRIG1 = 0b01100,
3860 ADTRIGx_TRGSRC_PWM4_TRIG2 = 0b01011,
3861 ADTRIGx_TRGSRC_PWM4_TRIG1 = 0b01010,
3862 ADTRIGx_TRGSRC_PWM3_TRIG2 = 0b01001,
3863 ADTRIGx_TRGSRC_PWM3_TRIG1 = 0b01000,
3864 ADTRIGx_TRGSRC_PWM2_TRIG2 = 0b00111,
3865 ADTRIGx_TRGSRC_PWM2_TRIG1 = 0b00110,
3866 ADTRIGx_TRGSRC_PWM1_TRIG2 = 0b00101,
3867 ADTRIGx_TRGSRC_PWM1_TRIG1 = 0b00100,
3871 ADTRIGx_TRGSRC_NONE = 0b00000
3878 #define REG_ADCAL0L_RESET 0b0000000000000000 // ADC core #0 & #1 calibration reset
3879 #define REG_ADCAL0L_VALID_DATA_MSK 0b1000111110001111 // Bit mask used to set unimplemented bits to zero
3881 #define REG_ADCAL0L_CAL1RDY_DONE 0b1000000000000000 // ADC core #1 calibration completed
3882 #define REG_ADCAL0L_CAL1RDY_PEND 0b0000000000000000 // ADC core #1 calibration pending
3884 #define REG_ADCAL0L_CAL1SKIP_BYPASS 0b0000100000000000 // ADC core #1 calibration will be skipped
3885 #define REG_ADCAL0L_CAL1SKIP_CALIB 0b0000000000000000 // ADC core #1 calibration will be performed
3887 #define REG_ADCAL0L_CAL1DIFF_DIFF 0b0000010000000000 // ADC core #1 differential input calibration
3888 #define REG_ADCAL0L_CAL1DIFF_SNGM 0b0000000000000000 // ADC core #1 single ended input calibration
3890 #define REG_ADCAL0L_CAL1EN_UNLOCKED 0b0000001000000000 // ADC core #1 calibration bits accessable
3891 #define REG_ADCAL0L_CAL1EN_LOCKED 0b0000000000000000 // ADC core #1 calibration bits blocked
3893 #define REG_ADCAL0L_CAL1RUN_EXECUTE 0b0000000100000000 // ADC core #1 execute calibration
3894 #define REG_ADCAL0L_CAL1RUN_READY 0b0000000000000000 // ADC core #1 ready for calibration
3896 #define REG_ADCAL0L_CAL0RDY_DONE 0b0000000010000000 // ADC core #0 calibration completed
3897 #define REG_ADCAL0L_CAL0RDY_PEND 0b0000000000000000 // ADC core #0 calibration pending
3899 #define REG_ADCAL0L_CAL0SKIP_BYPASS 0b0000000000001000 // ADC core #0 calibration will be skipped
3900 #define REG_ADCAL0L_CAL0SKIP_CALIB 0b0000000000000000 // ADC core #0 calibration will be performed
3902 #define REG_ADCAL0L_CAL0DIFF_DIFF 0b0000000000000100 // ADC core #0 differential input calibration
3903 #define REG_ADCAL0L_CAL0DIFF_SNGM 0b0000000000000000 // ADC core #0 single ended input calibration
3905 #define REG_ADCAL0L_CAL0EN_UNLOCKED 0b0000000000000010 // ADC core #0 calibration bits accessable
3906 #define REG_ADCAL0L_CAL0EN_LOCKED 0b0000000000000000 // ADC core #0 calibration bits blocked
3908 #define REG_ADCAL0L_CAL0RUN_EXECUTE 0b0000000000000001 // ADC core #0 execute calibration
3909 #define REG_ADCAL0L_CAL0RUN_READY 0b0000000000000000 // ADC core #0 ready for calibration
3913 #define REG_ADCAL0H_RESET 0b0000000000000000 // ADC core #2 & #3 calibration reset
3914 #define REG_ADCAL0H_VALID_DATA_MSK 0b1000111110001111 // Bit mask used to set unimplemented bits to zero
3916 #define REG_ADCAL0H_CAL3RDY_DONE 0b1000000000000000 // ADC core #3 calibration completed
3917 #define REG_ADCAL0H_CAL3RDY_PEND 0b0000000000000000 // ADC core #3 calibration pending
3919 #define REG_ADCAL0H_CAL3SKIP_BYPASS 0b0000100000000000 // ADC core #3 calibration will be skipped
3920 #define REG_ADCAL0H_CAL3SKIP_CALIB 0b0000000000000000 // ADC core #3 calibration will be performed
3922 #define REG_ADCAL0H_CAL3DIFF_DIFF 0b0000010000000000 // ADC core #3 differential input calibration
3923 #define REG_ADCAL0H_CAL3DIFF_SNGM 0b0000000000000000 // ADC core #3 single ended input calibration
3925 #define REG_ADCAL0H_CAL3EN_UNLOCKED 0b0000001000000000 // ADC core #3 calibration bits accessable
3926 #define REG_ADCAL0H_CAL3EN_LOCKED 0b0000000000000000 // ADC core #3 calibration bits blocked
3928 #define REG_ADCAL0H_CAL3RUN_EXECUTE 0b0000000100000000 // ADC core #3 execute calibration
3929 #define REG_ADCAL0H_CAL3RUN_READY 0b0000000000000000 // ADC core #3 ready for calibration
3931 #define REG_ADCAL0H_CAL2RDY_DONE 0b0000000010000000 // ADC core #2 calibration completed
3932 #define REG_ADCAL0H_CAL2RDY_PEND 0b0000000000000000 // ADC core #2 calibration pending
3934 #define REG_ADCAL0H_CAL2SKIP_BYPASS 0b0000000000001000 // ADC core #2 calibration will be skipped
3935 #define REG_ADCAL0H_CAL2SKIP_CALIB 0b0000000000000000 // ADC core #2 calibration will be performed
3937 #define REG_ADCAL0H_CAL2DIFF_DIFF 0b0000000000000100 // ADC core #2 differential input calibration
3938 #define REG_ADCAL0H_CAL2DIFF_SNGM 0b0000000000000000 // ADC core #2 single ended input calibration
3940 #define REG_ADCAL0H_CAL2EN_UNLOCKED 0b0000000000000010 // ADC core #2 calibration bits accessable
3941 #define REG_ADCAL0H_CAL2EN_LOCKED 0b0000000000000000 // ADC core #2 calibration bits blocked
3943 #define REG_ADCAL0H_CAL2RUN_EXECUTE 0b0000000000000001 // ADC core #2 execute calibration
3944 #define REG_ADCAL0H_CAL2RUN_READY 0b0000000000000000 // ADC core #2 ready for calibration
3948 #define REG_ADCAL1H_RESET 0b0000000000000000 // ADC shared core calibration reset
3949 #define REG_ADCAL1H_VALID_DATA_MSK 0b1000111100000000 // Bit mask used to set unimplemented bits to zero
3951 #define REG_ADCAL1H_CSHRRDY_DONE 0b1000000000000000 // ADC shared core calibration completed
3952 #define REG_ADCAL1H_CSHRRDY_PEND 0b0000000000000000 // ADC shared core calibration pending
3954 #define REG_ADCAL1H_CSHRSKIP_BYPASS 0b0000100000000000 // ADC shared core calibration will be skipped
3955 #define REG_ADCAL1H_CSHRSKIP_CALIB 0b0000000000000000 // ADC shared core calibration will be performed
3957 #define REG_ADCAL1H_CSHRDIFF_DIFF 0b0000010000000000 // ADC shared core differential input calibration
3958 #define REG_ADCAL1H_CSHRDIFF_SNGM 0b0000000000000000 // ADC shared core single ended input calibration
3960 #define REG_ADCAL1H_CSHREN_UNLOCKED 0b0000001000000000 // ADC shared core calibration bits accessable
3961 #define REG_ADCAL1H_CSHREN_LOCKED 0b0000000000000000 // ADC shared core calibration bits blocked
3963 #define REG_ADCAL1H_CSHRRUN_EXECUTE 0b0000000100000000 // ADC shared core execute calibration
3964 #define REG_ADCAL1H_CSHRRUN_READY 0b0000000000000000 // ADC shared core ready for calibration
3968 #define REG_ADCALx_LB_VALID_DATA_MSK 0b0000000010001111 // Low Byte Bit mask used to set unimplemented bits to zero
3969 #define REG_ADCALx_VALID_DATA_MSK 0b1000111110001111 // Word Bit mask used to set unimplemented bits to zero
3971 #define REG_ADC_CALIB_MODE_SINGLE_ENDED 0b1000101110001011 // Single Ended Mode Calibration
3972 #define REG_ADC_CALIB_MODE_DIFFERENTIAL 0b1000111110001111 // Differenial Mode Calibration
3974 #define REG_ADCALx_LB_CALxRDY_SET_MSK 0b0000000010000000
3975 #define REG_ADCALx_LB_CALxRDY_CLR_MSK (0b1111111101111111 & REG_ADCALx_VALID_DATA_MSK)
3977 #define REG_ADCALx_LB_CALxSKIP_SET_MSK 0b0000000000001000
3978 #define REG_ADCALx_LB_CALxSKIP_CLR_MSK (0b1111111111110111 & REG_ADCALx_VALID_DATA_MSK)
3980 #define REG_ADCALx_LB_CALxDIFF_SET_MSK 0b0000000000000100
3981 #define REG_ADCALx_LB_CALxDIFF_CLR_MSK (0b1111111111111011 & REG_ADCALx_VALID_DATA_MSK)
3983 #define REG_ADCALx_LB_CALxEN_SET_MSK 0b0000000000000010
3984 #define REG_ADCALx_LB_CALxEN_CLR_MSK (0b1111111111111101 & REG_ADCALx_VALID_DATA_MSK)
3986 #define REG_ADCALx_LB_CALxRUN_SET_MSK 0b0000000000000001
3987 #define REG_ADCALx_LB_CALxRUN_CLR_MSK (0b1111111111111110 & REG_ADCALx_VALID_DATA_MSK)
3989 #define REG_ADCALx_HB_VALID_DATA_MSK 0b1000111100000000 // High Byte Bit mask used to set unimplemented bits to zero
3991 #define REG_ADCALx_HB_CALxRDY_SET_MSK 0b1000000000000000
3992 #define REG_ADCALx_HB_CALxRDY_CLR_MSK (0b0111111111111111 & REG_ADCALx_VALID_DATA_MSK)
3994 #define REG_ADCALx_HB_CALxSKIP_SET_MSK 0b0000100000000000
3995 #define REG_ADCALx_HB_CALxSKIP_CLR_MSK (0b1111011111111111 & REG_ADCALx_VALID_DATA_MSK)
3997 #define REG_ADCALx_HB_CALxDIFF_SET_MSK 0b0000010000000000
3998 #define REG_ADCALx_HB_CALxDIFF_CLR_MSK (0b1111101111111111 & REG_ADCALx_VALID_DATA_MSK)
4000 #define REG_ADCALx_HB_CALxEN_SET_MSK 0b0000001000000000
4001 #define REG_ADCALx_HB_CALxEN_CLR_MSK (0b1111110111111111 & REG_ADCALx_VALID_DATA_MSK)
4003 #define REG_ADCALx_HB_CALxRUN_SET_MSK 0b0000000100000000
4004 #define REG_ADCALx_HB_CALxRUN_CLR_MSK (0b1111111011111111 & REG_ADCALx_VALID_DATA_MSK)
4009 #define REG_ADCMPxCON_RESET 0b0000000000000000 // ADC Digital Comparator Configuration Reset
4010 #define REG_ADCMPxCON_VALID_DATA_RD_MSK 0b0001111111111111 // Bit mask used to set unimplemented bits to zero
4011 #define REG_ADCMPxCON_VALID_DATA_WR_MSK 0b0000000011011111 // Bit mask used to set unimplemented bits to zero
4013 #define REG_ADCMPxLO_RESET 0b0000000000000000 // ADC Digital Comparator Lower Compare Value Reset
4014 #define REG_ADCMPxLO_VALID_DATA_MSK 0b1111111111111111 // Bit mask used to set unimplemented bits to zero
4016 #define REG_ADCMPxHI_RESET 0b0000000000000000 // ADC Digital Comparator Upper Compare Value Reset
4017 #define REG_ADCMPxHI_VALID_DATA_MSK 0b1111111111111111 // Bit mask used to set unimplemented bits to zero
4019 #define REG_ADCMPxCON_CHNL_MSK 0b0001111100000000 // ADC Input Number used for comparison
4020 #define REG_ADCMPxCON_CHNL(x) ((x << 8) & REG_ADCMPxCON_CHNL_MSK) // ADC Input Number used for comparison
4021 #define REG_ADCMPxCON_CHNL_NO(x) ((x & REG_ADCMPxCON_CHNL_MSK) >> 8) // Macro to extract the active ANx input channel no
4023 #define REG_ADCMPxCON_CHNL_AN31 0b0001111100000000 // ADC Input Number used for comparison
4024 #define REG_ADCMPxCON_CHNL_AN30 0b0001111000000000 // ADC Input Number used for comparison
4025 #define REG_ADCMPxCON_CHNL_AN29 0b0001110100000000 // ADC Input Number used for comparison
4026 #define REG_ADCMPxCON_CHNL_AN28 0b0001110000000000 // ADC Input Number used for comparison
4027 #define REG_ADCMPxCON_CHNL_AN27 0b0001101100000000 // ADC Input Number used for comparison
4028 #define REG_ADCMPxCON_CHNL_AN26 0b0001101000000000 // ADC Input Number used for comparison
4029 #define REG_ADCMPxCON_CHNL_AN25 0b0001100100000000 // ADC Input Number used for comparison
4030 #define REG_ADCMPxCON_CHNL_AN24 0b0001100000000000 // ADC Input Number used for comparison
4031 #define REG_ADCMPxCON_CHNL_AN23 0b0001011100000000 // ADC Input Number used for comparison
4032 #define REG_ADCMPxCON_CHNL_AN22 0b0001011000000000 // ADC Input Number used for comparison
4033 #define REG_ADCMPxCON_CHNL_AN21 0b0001010100000000 // ADC Input Number used for comparison
4034 #define REG_ADCMPxCON_CHNL_AN20 0b0001010000000000 // ADC Input Number used for comparison
4035 #define REG_ADCMPxCON_CHNL_AN19 0b0001001100000000 // ADC Input Number used for comparison
4036 #define REG_ADCMPxCON_CHNL_AN18 0b0001001000000000 // ADC Input Number used for comparison
4037 #define REG_ADCMPxCON_CHNL_AN17 0b0001000100000000 // ADC Input Number used for comparison
4038 #define REG_ADCMPxCON_CHNL_AN16 0b0001000000000000 // ADC Input Number used for comparison
4039 #define REG_ADCMPxCON_CHNL_AN15 0b0000111100000000 // ADC Input Number used for comparison
4040 #define REG_ADCMPxCON_CHNL_AN14 0b0000111000000000 // ADC Input Number used for comparison
4041 #define REG_ADCMPxCON_CHNL_AN13 0b0000110100000000 // ADC Input Number used for comparison
4042 #define REG_ADCMPxCON_CHNL_AN12 0b0000110000000000 // ADC Input Number used for comparison
4043 #define REG_ADCMPxCON_CHNL_AN11 0b0000101100000000 // ADC Input Number used for comparison
4044 #define REG_ADCMPxCON_CHNL_AN10 0b0000101000000000 // ADC Input Number used for comparison
4045 #define REG_ADCMPxCON_CHNL_AN9 0b0000100100000000 // ADC Input Number used for comparison
4046 #define REG_ADCMPxCON_CHNL_AN8 0b0000100000000000 // ADC Input Number used for comparison
4047 #define REG_ADCMPxCON_CHNL_AN7 0b0000011100000000 // ADC Input Number used for comparison
4048 #define REG_ADCMPxCON_CHNL_AN6 0b0000011000000000 // ADC Input Number used for comparison
4049 #define REG_ADCMPxCON_CHNL_AN5 0b0000010100000000 // ADC Input Number used for comparison
4050 #define REG_ADCMPxCON_CHNL_AN4 0b0000010000000000 // ADC Input Number used for comparison
4051 #define REG_ADCMPxCON_CHNL_AN3 0b0000001100000000 // ADC Input Number used for comparison
4052 #define REG_ADCMPxCON_CHNL_AN2 0b0000001000000000 // ADC Input Number used for comparison
4053 #define REG_ADCMPxCON_CHNL_AN1 0b0000000100000000 // ADC Input Number used for comparison
4054 #define REG_ADCMPxCON_CHNL_AN0 0b0000000000000000 // ADC Input Number used for comparison
4057 ADCMPxCON_CHNL_AN31 = 0b11111,
4058 ADCMPxCON_CHNL_AN30 = 0b11110,
4059 ADCMPxCON_CHNL_AN29 = 0b11101,
4060 ADCMPxCON_CHNL_AN28 = 0b11100,
4061 ADCMPxCON_CHNL_AN27 = 0b11011,
4062 ADCMPxCON_CHNL_AN26 = 0b11010,
4063 ADCMPxCON_CHNL_AN25 = 0b11001,
4064 ADCMPxCON_CHNL_AN24 = 0b11000,
4065 ADCMPxCON_CHNL_AN23 = 0b10111,
4066 ADCMPxCON_CHNL_AN22 = 0b10110,
4067 ADCMPxCON_CHNL_AN21 = 0b10101,
4068 ADCMPxCON_CHNL_AN20 = 0b10100,
4069 ADCMPxCON_CHNL_AN19 = 0b10011,
4070 ADCMPxCON_CHNL_AN18 = 0b10010,
4071 ADCMPxCON_CHNL_AN17 = 0b10001,
4072 ADCMPxCON_CHNL_AN16 = 0b10000,
4073 ADCMPxCON_CHNL_AN15 = 0b01111,
4074 ADCMPxCON_CHNL_AN14 = 0b01110,
4075 ADCMPxCON_CHNL_AN13 = 0b01101,
4076 ADCMPxCON_CHNL_AN12 = 0b01100,
4077 ADCMPxCON_CHNL_AN11 = 0b01011,
4078 ADCMPxCON_CHNL_AN10 = 0b01010,
4079 ADCMPxCON_CHNL_AN9 = 0b01001,
4080 ADCMPxCON_CHNL_AN8 = 0b01000,
4081 ADCMPxCON_CHNL_AN7 = 0b00111,
4082 ADCMPxCON_CHNL_AN6 = 0b00110,
4083 ADCMPxCON_CHNL_AN5 = 0b00101,
4084 ADCMPxCON_CHNL_AN4 = 0b00100,
4085 ADCMPxCON_CHNL_AN3 = 0b00011,
4086 ADCMPxCON_CHNL_AN2 = 0b00010,
4087 ADCMPxCON_CHNL_AN1 = 0b00001,
4088 ADCMPxCON_CHNL_AN0 = 0b00000
4091 #define REG_ADCMPxCON_CMPEN_ENABLED 0b0000000010000000 // ADC Digital Comparator Enabled
4092 #define REG_ADCMPxCON_CMPEN_DISABLED 0b0000000000000000 // ADC Digital Comparator Disabled
4095 ADCMPxCON_CMPEN_ENABLED = 0b1,
4096 ADCMPxCON_CMPEN_DISABLED = 0b0
4099 #define REG_ADCMPxCON_IE_ENABLED 0b0000000001000000 // ADC Digital Comparator Common Interrupt Enabled
4100 #define REG_ADCMPxCON_IE_DISABLED 0b0000000000000000 // ADC Digital Comparator Common Interrupt Disabled
4103 ADCMPxCON_IE_ENABLED = 0b1,
4104 ADCMPxCON_IE_DISABLED = 0b0
4107 #define REG_ADCMPxCON_STAT_ACTIVE 0b0000000000100000 // ADC Digital Comparator Common Interrupt Active
4108 #define REG_ADCMPxCON_STAT_READY 0b0000000000000000 // ADC Digital Comparator Common Interrupt Pending
4111 ADCMPxCON_STAT_ACTIVE = 0b1,
4112 ADCMPxCON_STAT_READY = 0b0
4115 #define REG_ADCMPxCON_BTWN_ENABLED 0b0000000000010000 // Generate Interrupt when ADC buffer between min & max
4116 #define REG_ADCMPxCON_BTWN_DISABLED 0b0000000000000000 // No Interrupt when ADC buffer between min & max
4119 ADCMPxCON_BTWN_ACTIVE = 0b1,
4120 ADCMPxCON_BTWN_READY = 0b0
4123 #define REG_ADCMPxCON_HIHI_ENABLED 0b0000000000001000 // Generate Interrupt when ADC buffer >= max
4124 #define REG_ADCMPxCON_HIHI_DISABLED 0b0000000000000000 // No Interrupt when ADC buffer >= max
4127 ADCMPxCON_HIHI_ACTIVE = 0b1,
4128 ADCMPxCON_HIHI_READY = 0b0
4131 #define REG_ADCMPxCON_HILO_ENABLED 0b0000000000000100 // Generate Interrupt when ADC buffer < max
4132 #define REG_ADCMPxCON_HILO_DISABLED 0b0000000000000000 // No Interrupt when ADC buffer < max
4135 ADCMPxCON_HILO_ACTIVE = 0b1,
4136 ADCMPxCON_HILO_READY = 0b0
4139 #define REG_ADCMPxCON_LOHI_ENABLED 0b0000000000000010 // Generate Interrupt when ADC buffer ? min
4140 #define REG_ADCMPxCON_LOHI_DISABLED 0b0000000000000000 // No Interrupt when ADC buffer ? min
4143 ADCMPxCON_LOHI_ACTIVE = 0b1,
4144 ADCMPxCON_LOHI_READY = 0b0
4147 #define REG_ADCMPxCON_LOLO_ENABLED 0b0000000000000001 // Generate Interrupt when ADC buffer < min
4148 #define REG_ADCMPxCON_LOLO_DISABLED 0b0000000000000000 // No Interrupt when ADC buffer < min
4151 ADCMPxCON_LOLO_ACTIVE = 0b1,
4152 ADCMPxCON_LOLO_READY = 0b0
4157 volatile ADCMPxCON_LOLO_e lolo : 1;
4158 volatile ADCMPxCON_LOHI_e lohi : 1;
4159 volatile ADCMPxCON_HILO_e hilo : 1;
4160 volatile ADCMPxCON_HIHI_e hihi : 1;
4161 volatile ADCMPxCON_BTWN_e btwn : 1;
4162 volatile ADCMPxCON_STAT_e stat : 1;
4163 volatile ADCMPxCON_IE_e ie : 1;
4164 volatile ADCMPxCON_CMPEN_e cmpen : 1;
4165 volatile ADCMPxCON_CHNL_e chnl : 5;
4166 volatile unsigned : 3;
4167 }__attribute__((packed)) bits;
4168 volatile uint16_t value;
4174 #define REG_ADCMPxENL_RESET 0b0000000000000000 // Reset ADCMPxENL Register
4175 #define REG_ADCMPxENL_VALID_DATA_MSK 0b1111111111111111 // Bit mask used to set unimplemented bits to zero
4177 #define REG_ADCMPxENL_ALL_ENABLED 0b1111111111111111 // Interrupt enabled for AN0
4178 #define REG_ADCMPxENL_ALL_DISABLED 0b0000000000000000 // Interrupt disabled for AN0
4180 #define REG_ADCMPxENL_AN0_ENABLED 0b0000000000000001 // Interrupt enabled for AN0
4181 #define REG_ADCMPxENL_AN0_DISABLED 0b0000000000000000 // Interrupt disabled for AN0
4182 #define REG_ADCMPxENL_AN1_ENABLED 0b0000000000000010 // Interrupt enabled for AN1
4183 #define REG_ADCMPxENL_AN1_DISABLED 0b0000000000000000 // Interrupt disabled for AN1
4184 #define REG_ADCMPxENL_AN2_ENABLED 0b0000000000000100 // Interrupt enabled for AN2
4185 #define REG_ADCMPxENL_AN2_DISABLED 0b0000000000000000 // Interrupt disabled for AN2
4186 #define REG_ADCMPxENL_AN3_ENABLED 0b0000000000001000 // Interrupt enabled for AN3
4187 #define REG_ADCMPxENL_AN3_DISABLED 0b0000000000000000 // Interrupt disabled for AN3
4188 #define REG_ADCMPxENL_AN4_ENABLED 0b0000000000010000 // Interrupt enabled for AN4
4189 #define REG_ADCMPxENL_AN4_DISABLED 0b0000000000000000 // Interrupt disabled for AN4
4190 #define REG_ADCMPxENL_AN5_ENABLED 0b0000000000100000 // Interrupt enabled for AN5
4191 #define REG_ADCMPxENL_AN5_DISABLED 0b0000000000000000 // Interrupt disabled for AN5
4192 #define REG_ADCMPxENL_AN6_ENABLED 0b0000000001000000 // Interrupt enabled for AN6
4193 #define REG_ADCMPxENL_AN6_DISABLED 0b0000000000000000 // Interrupt disabled for AN6
4194 #define REG_ADCMPxENL_AN7_ENABLED 0b0000000010000000 // Interrupt enabled for AN7
4195 #define REG_ADCMPxENL_AN7_DISABLED 0b0000000000000000 // Interrupt disabled for AN7
4196 #define REG_ADCMPxENL_AN8_ENABLED 0b0000000100000000 // Interrupt enabled for AN8
4197 #define REG_ADCMPxENL_AN8_DISABLED 0b0000000000000000 // Interrupt disabled for AN8
4198 #define REG_ADCMPxENL_AN9_ENABLED 0b0000001000000000 // Interrupt enabled for AN9
4199 #define REG_ADCMPxENL_AN9_DISABLED 0b0000000000000000 // Interrupt disabled for AN9
4200 #define REG_ADCMPxENL_AN10_ENABLED 0b0000010000000000 // Interrupt enabled for AN10
4201 #define REG_ADCMPxENL_AN10_DISABLED 0b0000000000000000 // Interrupt disabled for AN10
4202 #define REG_ADCMPxENL_AN11_ENABLED 0b0000100000000000 // Interrupt enabled for AN11
4203 #define REG_ADCMPxENL_AN11_DISABLED 0b0000000000000000 // Interrupt disabled for AN11
4204 #define REG_ADCMPxENL_AN12_ENABLED 0b0001000000000000 // Interrupt enabled for AN12
4205 #define REG_ADCMPxENL_AN12_DISABLED 0b0000000000000000 // Interrupt disabled for AN12
4206 #define REG_ADCMPxENL_AN13_ENABLED 0b0010000000000000 // Interrupt enabled for AN13
4207 #define REG_ADCMPxENL_AN13_DISABLED 0b0000000000000000 // Interrupt disabled for AN13
4208 #define REG_ADCMPxENL_AN14_ENABLED 0b0100000000000000 // Interrupt enabled for AN14
4209 #define REG_ADCMPxENL_AN14_DISABLED 0b0000000000000000 // Interrupt disabled for AN14
4210 #define REG_ADCMPxENL_AN15_ENABLED 0b1000000000000000 // Interrupt enabled for AN15
4211 #define REG_ADCMPxENL_AN15_DISABLED 0b0000000000000000 // Interrupt disabled for AN15
4214 ADCMPxENL_ANx_ENABLED = 0b1,
4215 ADCMPxENL_ANx_DISABLED = 0b0
4220 #define REG_ADCMPxENH_RESET 0b0000000000000000 // Reset ADCMPxENH High Register
4221 #define REG_ADCMPxENH_VALID_DATA_MSK 0b0000000000111111 // Bit mask used to set unimplemented bits to zero
4223 #define REG_ADCMPxENH_ALL_ENABLED 0b1111111111111111 // Interrupt enabled for all ANx inputs
4224 #define REG_ADCMPxENH_ALL_DISABLED 0b0000000000000000 // Interrupt disabled for all ANx inputs
4226 #define REG_ADCMPxENH_AN16_ENABLED 0b0000000000000001 // Interrupt enabled for AN16
4227 #define REG_ADCMPxENH_AN16_DISABLED 0b0000000000000000 // Interrupt disabled for AN16
4228 #define REG_ADCMPxENH_AN17_ENABLED 0b0000000000000010 // Interrupt enabled for AN17
4229 #define REG_ADCMPxENH_AN17_DISABLED 0b0000000000000000 // Interrupt disabled for AN17
4230 #define REG_ADCMPxENH_AN18_ENABLED 0b0000000000000100 // Interrupt enabled for AN18
4231 #define REG_ADCMPxENH_AN18_DISABLED 0b0000000000000000 // Interrupt disabled for AN18
4232 #define REG_ADCMPxENH_AN19_ENABLED 0b0000000000001000 // Interrupt enabled for AN19
4233 #define REG_ADCMPxENH_AN19_DISABLED 0b0000000000000000 // Interrupt disabled for AN19
4234 #define REG_ADCMPxENH_AN20_ENABLED 0b0000000000010000 // Interrupt enabled for AN20
4235 #define REG_ADCMPxENH_AN20_DISABLED 0b0000000000000000 // Interrupt disabled for AN20
4236 #define REG_ADCMPxENH_AN21_ENABLED 0b0000000000100000 // Interrupt enabled for AN21
4237 #define REG_ADCMPxENH_AN21_DISABLED 0b0000000000000000 // Interrupt disabled for AN21
4238 #define REG_ADCMPxENH_AN22_ENABLED 0b0000000001000000 // Interrupt enabled for AN22
4239 #define REG_ADCMPxENH_AN22_DISABLED 0b0000000000000000 // Interrupt disabled for AN22
4240 #define REG_ADCMPxENH_AN23_ENABLED 0b0000000010000000 // Interrupt enabled for AN23
4241 #define REG_ADCMPxENH_AN23_DISABLED 0b0000000000000000 // Interrupt disabled for AN23
4242 #define REG_ADCMPxENH_AN24_ENABLED 0b0000000100000000 // Interrupt enabled for AN24
4243 #define REG_ADCMPxENH_AN24_DISABLED 0b0000000000000000 // Interrupt disabled for AN24
4244 #define REG_ADCMPxENH_AN25_ENABLED 0b0000001000000000 // Interrupt enabled for AN25
4245 #define REG_ADCMPxENH_AN25_DISABLED 0b0000000000000000 // Interrupt disabled for AN25
4246 #define REG_ADCMPxENH_AN26_ENABLED 0b0000010000000000 // Interrupt enabled for AN26
4247 #define REG_ADCMPxENH_AN26_DISABLED 0b0000000000000000 // Interrupt disabled for AN26
4248 #define REG_ADCMPxENH_AN27_ENABLED 0b0000100000000000 // Interrupt enabled for AN27
4249 #define REG_ADCMPxENH_AN27_DISABLED 0b0000000000000000 // Interrupt disabled for AN27
4250 #define REG_ADCMPxENH_AN28_ENABLED 0b0001000000000000 // Interrupt enabled for AN28
4251 #define REG_ADCMPxENH_AN28_DISABLED 0b0000000000000000 // Interrupt disabled for AN28
4252 #define REG_ADCMPxENH_AN29_ENABLED 0b0010000000000000 // Interrupt enabled for AN29
4253 #define REG_ADCMPxENH_AN29_DISABLED 0b0000000000000000 // Interrupt disabled for AN29
4254 #define REG_ADCMPxENH_AN30_ENABLED 0b0100000000000000 // Interrupt enabled for AN30
4255 #define REG_ADCMPxENH_AN30_DISABLED 0b0000000000000000 // Interrupt disabled for AN30
4256 #define REG_ADCMPxENH_AN31_ENABLED 0b1000000000000000 // Interrupt enabled for AN31
4257 #define REG_ADCMPxENH_AN31_DISABLED 0b0000000000000000 // Interrupt disabled for AN31
4260 ADCMPxEN_ANx_ENABLED = 0b1,
4261 ADCMPxEN_ANx_DISABLED = 0b0
4267 volatile ADCMPxEN_e an0cmpen : 1;
4268 volatile ADCMPxEN_e an1cmpen : 1;
4269 volatile ADCMPxEN_e an2cmpen : 1;
4270 volatile ADCMPxEN_e an3cmpen : 1;
4271 volatile ADCMPxEN_e an4cmpen : 1;
4272 volatile ADCMPxEN_e an5cmpen : 1;
4273 volatile ADCMPxEN_e an6cmpen : 1;
4274 volatile ADCMPxEN_e an7cmpen : 1;
4275 volatile ADCMPxEN_e an8cmpen : 1;
4276 volatile ADCMPxEN_e an9cmpen : 1;
4277 volatile ADCMPxEN_e an10cmpen : 1;
4278 volatile ADCMPxEN_e an11cmpen : 1;
4279 volatile ADCMPxEN_e an12cmpen : 1;
4280 volatile ADCMPxEN_e an13cmpen : 1;
4281 volatile ADCMPxEN_e an14cmpen : 1;
4282 volatile ADCMPxEN_e an15cmpen : 1;
4284 volatile ADCMPxEN_e an16cmpen : 1;
4285 volatile ADCMPxEN_e an17cmpen : 1;
4286 volatile ADCMPxEN_e an18cmpen : 1;
4287 volatile ADCMPxEN_e an19cmpen : 1;
4288 volatile ADCMPxEN_e an20cmpen : 1;
4289 volatile ADCMPxEN_e an21cmpen : 1;
4290 volatile ADCMPxEN_e an22cmpen : 1;
4291 volatile ADCMPxEN_e an23cmpen : 1;
4292 volatile ADCMPxEN_e an24cmpen : 1;
4293 volatile ADCMPxEN_e an25cmpen : 1;
4294 volatile ADCMPxEN_e an26cmpen : 1;
4295 volatile ADCMPxEN_e an27cmpen : 1;
4296 volatile ADCMPxEN_e an28cmpen : 1;
4297 volatile ADCMPxEN_e an29cmpen : 1;
4298 volatile ADCMPxEN_e an30cmpen : 1;
4299 volatile ADCMPxEN_e an31cmpen : 1;
4301 }__attribute__((packed)) bits;
4302 volatile uint32_t value;
4307 #define REG_ADFLxDAT_RESET 0b0000000000000000 // Reset ADFLxDAT Register
4308 #define REG_ADFLxCON_RESET 0b0000000000000000 // Reset ADFLxCON Register
4309 #define REG_ADFLxCON_VALID_DATA_WR_MSK 0b1111111100011111 // Bit mask used to set unimplemented bits to zero
4310 #define REG_ADFLxCON_VALID_DATA_RD_MSK 0b1111111100011111 // Bit mask used to set unimplemented bits to zero
4311 #define REG_ADFLxDAT_VALID_DATA_MSK 0b1111111111111111 // Bit mask used to set unimplemented bits to zero
4314 #define REG_ADFLxCON_FLEN_ENABLED 0b1000000000000000 // Digital filter enabled
4315 #define REG_ADFLxCON_FLEN_DISABLED 0b0000000000000000 // Digital filter disabled
4318 ADFLxCON_FLEN_ENABLED = 0b1,
4319 ADFLxCON_FLEN_DISABLED = 0b0
4322 #define REG_ADFLxCON_MODE_AVERAGE 0b0110000000000000 // Digital filter operates in Averaging mode
4323 #define REG_ADFLxCON_MODE_OVERSAMPLE 0b0000000000000000 // Digital filter operates in Oversampling mode
4326 ADFLxCON_MODE_AVERAGE = 0b11,
4327 ADFLxCON_MODE_OVERSAMPLE = 0b00
4331 #define REG_ADFLxCON_OVRSAM_LEFT_ALIGN_256X 0b0000110000000000 // Digital filter result alignment left
4332 #define REG_ADFLxCON_OVRSAM_LEFT_ALIGN_128X 0b0001110000000000 // Digital filter result alignment left
4333 #define REG_ADFLxCON_OVRSAM_LEFT_ALIGN_64X 0b0000100000000000 // Digital filter result alignment left
4334 #define REG_ADFLxCON_OVRSAM_LEFT_ALIGN_32X 0b0001100000000000 // Digital filter result alignment left
4335 #define REG_ADFLxCON_OVRSAM_LEFT_ALIGN_16 0b0000010000000000 // Digital filter result alignment left
4336 #define REG_ADFLxCON_OVRSAM_LEFT_ALIGN_8X 0b0001010000000000 // Digital filter result alignment left
4337 #define REG_ADFLxCON_OVRSAM_LEFT_ALIGN_4X 0b0000000000000000 // Digital filter result alignment left
4338 #define REG_ADFLxCON_OVRSAM_LEFT_ALIGN_2X 0b0001000000000000 // Digital filter result alignment left
4340 #define REG_ADFLxCON_AVERAGE_RIGHT_ALIGN_256X 0b0111110000000000 // Digital filter result alignment right
4341 #define REG_ADFLxCON_AVERAGE_RIGHT_ALIGN_128X 0b0111100000000000 // Digital filter result alignment right
4342 #define REG_ADFLxCON_AVERAGE_RIGHT_ALIGN_64X 0b0111010000000000 // Digital filter result alignment right
4343 #define REG_ADFLxCON_AVERAGE_RIGHT_ALIGN_32X 0b0111000000000000 // Digital filter result alignment right
4344 #define REG_ADFLxCON_AVERAGE_RIGHT_ALIGN_16X 0b0110110000000000 // Digital filter result alignment right
4345 #define REG_ADFLxCON_AVERAGE_RIGHT_ALIGN_8X 0b0111100000000000 // Digital filter result alignment right
4346 #define REG_ADFLxCON_AVERAGE_RIGHT_ALIGN_4X 0b0110010000000000 // Digital filter result alignment right
4347 #define REG_ADFLxCON_AVERAGE_RIGHT_ALIGN_2X 0b0110000000000000 // Digital filter result alignment right
4350 ADFLxCON_AVERAGE_RIGHT_ALIGN_256X = 0b11111,
4351 ADFLxCON_AVERAGE_RIGHT_ALIGN_128X = 0b11110,
4352 ADFLxCON_AVERAGE_RIGHT_ALIGN_64X = 0b11101,
4353 ADFLxCON_AVERAGE_RIGHT_ALIGN_32X = 0b11100,
4354 ADFLxCON_AVERAGE_RIGHT_ALIGN_16X = 0b11011,
4355 ADFLxCON_AVERAGE_RIGHT_ALIGN_8X = 0b11110,
4356 ADFLxCON_AVERAGE_RIGHT_ALIGN_4X = 0b11001,
4357 ADFLxCON_AVERAGE_RIGHT_ALIGN_2X = 0b11000,
4359 ADFLxCON_OVRSAM_LEFT_ALIGN_256X = 0b00011,
4360 ADFLxCON_OVRSAM_LEFT_ALIGN_128X = 0b00111,
4361 ADFLxCON_OVRSAM_LEFT_ALIGN_64X = 0b00010,
4362 ADFLxCON_OVRSAM_LEFT_ALIGN_32X = 0b00110,
4363 ADFLxCON_OVRSAM_LEFT_ALIGN_16 = 0b00001,
4364 ADFLxCON_OVRSAM_LEFT_ALIGN_8X = 0b00101,
4365 ADFLxCON_OVRSAM_LEFT_ALIGN_4X = 0b00000,
4366 ADFLxCON_OVRSAM_LEFT_ALIGN_2X = 0b00100
4369 #define REG_ADFLxCON_IE_ENABLED 0b0000001000000000 // Digital filter result ready interrupt enabled
4370 #define REG_ADFLxCON_IE_DISABLED 0b0000000000000000 // Digital filter result ready interrupt disabled
4373 ADFLxCON_IE_ENABLED = 0b1,
4374 ADFLxCON_IE_DISABLED = 0b0
4377 #define REG_ADFLxCON_RDY_READY 0b0000000100000000 // Digital filter result ready
4378 #define REG_ADFLxCON_RDY_PEND 0b0000000000000000 // Digital filter result pending
4381 ADFLxCON_RDY_READY = 0b1,
4382 ADFLxCON_RDY_PEND = 0b0
4385 #define REG_ADFLxCON_INPUT_MSK 0b0000000001111111 // ADC Core Clock Divider Filter Mask
4386 #define REG_ADFLxCON_INPUT(x) (x & REG_ADFLxCON_INPUT_MSK) // Digital Filter ADC Input Number
4388 #define REG_ADFLxCON_INPUT_AN31 0b0000000000011111 // Digital Filter ADC Input Number
4389 #define REG_ADFLxCON_INPUT_AN30 0b0000000000011110 // Digital Filter ADC Input Number
4390 #define REG_ADFLxCON_INPUT_AN29 0b0000000000011101 // Digital Filter ADC Input Number
4391 #define REG_ADFLxCON_INPUT_AN28 0b0000000000011100 // Digital Filter ADC Input Number
4392 #define REG_ADFLxCON_INPUT_AN27 0b0000000000011011 // Digital Filter ADC Input Number
4393 #define REG_ADFLxCON_INPUT_AN26 0b0000000000011010 // Digital Filter ADC Input Number
4394 #define REG_ADFLxCON_INPUT_AN25 0b0000000000011001 // Digital Filter ADC Input Number
4395 #define REG_ADFLxCON_INPUT_AN24 0b0000000000011000 // Digital Filter ADC Input Number
4396 #define REG_ADFLxCON_INPUT_AN23 0b0000000000010111 // Digital Filter ADC Input Number
4397 #define REG_ADFLxCON_INPUT_AN22 0b0000000000010110 // Digital Filter ADC Input Number
4398 #define REG_ADFLxCON_INPUT_AN21 0b0000000000010101 // Digital Filter ADC Input Number
4399 #define REG_ADFLxCON_INPUT_AN20 0b0000000000010100 // Digital Filter ADC Input Number
4400 #define REG_ADFLxCON_INPUT_AN19 0b0000000000010011 // Digital Filter ADC Input Number
4401 #define REG_ADFLxCON_INPUT_AN18 0b0000000000010010 // Digital Filter ADC Input Number
4402 #define REG_ADFLxCON_INPUT_AN17 0b0000000000010001 // Digital Filter ADC Input Number
4403 #define REG_ADFLxCON_INPUT_AN16 0b0000000000010000 // Digital Filter ADC Input Number
4404 #define REG_ADFLxCON_INPUT_AN15 0b0000000000001111 // Digital Filter ADC Input Number
4405 #define REG_ADFLxCON_INPUT_AN14 0b0000000000001110 // Digital Filter ADC Input Number
4406 #define REG_ADFLxCON_INPUT_AN13 0b0000000000001101 // Digital Filter ADC Input Number
4407 #define REG_ADFLxCON_INPUT_AN12 0b0000000000001100 // Digital Filter ADC Input Number
4408 #define REG_ADFLxCON_INPUT_AN11 0b0000000000001011 // Digital Filter ADC Input Number
4409 #define REG_ADFLxCON_INPUT_AN10 0b0000000000001010 // Digital Filter ADC Input Number
4410 #define REG_ADFLxCON_INPUT_AN9 0b0000000000001001 // Digital Filter ADC Input Number
4411 #define REG_ADFLxCON_INPUT_AN8 0b0000000000001000 // Digital Filter ADC Input Number
4412 #define REG_ADFLxCON_INPUT_AN7 0b0000000000000111 // Digital Filter ADC Input Number
4413 #define REG_ADFLxCON_INPUT_AN6 0b0000000000000110 // Digital Filter ADC Input Number
4414 #define REG_ADFLxCON_INPUT_AN5 0b0000000000000101 // Digital Filter ADC Input Number
4415 #define REG_ADFLxCON_INPUT_AN4 0b0000000000000100 // Digital Filter ADC Input Number
4416 #define REG_ADFLxCON_INPUT_AN3 0b0000000000000011 // Digital Filter ADC Input Number
4417 #define REG_ADFLxCON_INPUT_AN2 0b0000000000000010 // Digital Filter ADC Input Number
4418 #define REG_ADFLxCON_INPUT_AN1 0b0000000000000001 // Digital Filter ADC Input Number
4419 #define REG_ADFLxCON_INPUT_AN0 0b0000000000000000 // Digital Filter ADC Input Number
4422 ADFLxCON_INPUT_AN25 = 0b11001,
4423 ADFLxCON_INPUT_AN24 = 0b11000,
4424 ADFLxCON_INPUT_AN23 = 0b10111,
4425 ADFLxCON_INPUT_AN22 = 0b10110,
4426 ADFLxCON_INPUT_AN21 = 0b10101,
4427 ADFLxCON_INPUT_AN20 = 0b10100,
4428 ADFLxCON_INPUT_AN19 = 0b10011,
4429 ADFLxCON_INPUT_AN18 = 0b10010,
4430 ADFLxCON_INPUT_AN17 = 0b10001,
4431 ADFLxCON_INPUT_AN16 = 0b10000,
4432 ADFLxCON_INPUT_AN15 = 0b01111,
4433 ADFLxCON_INPUT_AN14 = 0b01110,
4434 ADFLxCON_INPUT_AN13 = 0b01101,
4435 ADFLxCON_INPUT_AN12 = 0b01100,
4436 ADFLxCON_INPUT_AN11 = 0b01011,
4437 ADFLxCON_INPUT_AN10 = 0b01010,
4438 ADFLxCON_INPUT_AN9 = 0b01001,
4439 ADFLxCON_INPUT_AN8 = 0b01000,
4440 ADFLxCON_INPUT_AN7 = 0b00111,
4441 ADFLxCON_INPUT_AN6 = 0b00110,
4442 ADFLxCON_INPUT_AN5 = 0b00101,
4443 ADFLxCON_INPUT_AN4 = 0b00100,
4444 ADFLxCON_INPUT_AN3 = 0b00011,
4445 ADFLxCON_INPUT_AN2 = 0b00010,
4446 ADFLxCON_INPUT_AN1 = 0b00001,
4447 ADFLxCON_INPUT_AN0 = 0b00000
4453 volatile ADFLxCON_INPUT_e flchsel : 5;
4454 volatile unsigned : 3;
4455 volatile ADFLxCON_RDY_e rdy : 1;
4456 volatile ADFLxCON_IE_e ie : 1;
4457 volatile ADFLxCON_OVRSAM_e ovrsam : 5;
4458 volatile ADFLxCON_FLEN_e flen : 1;
4459 }__attribute__((packed)) bits;
4460 volatile uint16_t value;
4467 #define ADCBUFx_ADDR(x) ((x) * ((volatile uint16_t)&ADCBUF1 - (volatile uint16_t)&ADCBUF0))
4476 volatile ADCOREx_SAMC_e samc : 10;
4477 volatile unsigned : 6;
4478 } __attribute__((packed)) bits;
4479 volatile uint16_t value;
4484 volatile ADCOREx_ADCS_e adcs : 7;
4485 volatile unsigned : 1;
4486 volatile ADCOREx_RES_e res : 2;
4487 volatile ADCOREx_EISEL_e eisel : 3;
4488 volatile unsigned : 3;
4489 }__attribute__((packed)) bits;
4490 volatile uint16_t value;
4496 volatile ADCOREx_SAMC_e samc : 10;
4497 volatile unsigned : 6;
4499 volatile ADCOREx_ADCS_e adcs : 7;
4500 volatile unsigned : 1;
4501 volatile ADCOREx_RES_e res : 2;
4502 volatile ADCOREx_EISEL_e eisel : 3;
4503 volatile unsigned : 3;
4504 }__attribute__((packed)) bits;
4505 volatile uint32_t value;
4574 volatile ADCOREx_SAMC_e samc;
4575 #if ADC_CORE_COUNT > 1
4576 volatile ADCON4_SAMCxEN_e samc_en;
4578 volatile ADCOREx_EISEL_e eisel;
4579 volatile ADCOREx_ADCS_e adcs;
4580 volatile ADCOREx_RES_e res;
4581 } HSADC_CORE_CONFIG_t;
4584 #if defined (ADCORE0L)
4585 volatile HSADC_CORE_CONFIG_t core0;
4587 #if defined (ADCORE1L)
4588 volatile HSADC_CORE_CONFIG_t core1;
4590 volatile HSADC_CORE_CONFIG_t shared_core;
4591 volatile ADCON3_CLKDIV_e clkdiv;
4592 volatile ADCON3_CLKSEL_e clksel;
4593 } HSADC_CLOCK_CONFIG_t;
4596 volatile ADCON2_REFERCIE_e refercie;
4597 volatile ADCON2_REFCIE_e refcie;
4598 volatile ADCON3_REFSEL_e refsel;
4599 } HSADC_REFERENCE_CONFIG_t;
4602 volatile ADCON3_CNVCHSEL_e cnvchsel;
4603 volatile ADCON3_SUSPCIE_e suspcie;
4604 volatile ADCON3_SUSPEND_e suspend;
4605 } HSADC_SWTRIG_CONFIG_t;
4608 volatile ADCON5_WARMTIME_e warmtime;
4609 volatile ADCON2_PTGEN_e ptgen;
4610 volatile ADCON2_EIEN_e eien;
4611 volatile ADCON1_FORM_e form;
4612 volatile ADCON1_ADSIDL_e adsidl;
4613 volatile ADCON1_ADON_e adon;
4614 } HSADC_CONTROL_CONFIG_t;
4617 volatile HSADC_CLOCK_CONFIG_t cores;
4618 volatile HSADC_REFERENCE_CONFIG_t refcfg;
4619 volatile HSADC_SWTRIG_CONFIG_t swtrig;
4620 volatile HSADC_CONTROL_CONFIG_t config;
4629 ANx_CORE_ASSIGNMENT_DEDICATED = 0b1,
4630 ANx_CORE_ASSIGNMENT_SHARED = 0b1
4631 }ADCORE_ASSIGNMENT_e;
4634 ANx_DIFFERENTIAL = 0b1,
4635 ANx_SINGLE_ENDED = 0b0
4636 }ADMOD_INPUT_MODE_e;
4639 ANx_DATA_SIGNED = 0b1,
4640 ANx_DATA_UNSIGNED = 0b0
4641 }ADMOD_OUTPUT_DATA_MODE_e;
4644 volatile uint16_t core_index;
4645 volatile ADCORE_ASSIGNMENT_e core_assigmnment;
4646 volatile ADMOD_INPUT_MODE_e input_mode;
4647 volatile ADMOD_OUTPUT_DATA_MODE_e data_mode;
4648 volatile ADLVLTRG_e trigger_mode;
4649 volatile ADIE_IE_e interrupt_enable;
4650 volatile ADEIE_EIEN_e early_interrupt_enable;
4651 volatile ADTRIG_TRGSRC_e trigger_source;
4655 volatile ADCAN_CONFIG_t config;
4656 volatile uint16_t ad_input;
4664 volatile ADCMPxCON_t ADCMPxCON;
4665 volatile ADCMPxEN_t ADCMPxEN;
4666 volatile uint16_t ADCMPxLO;
4667 volatile uint16_t ADCMPxHI;
4668 }HSADC_ADCMP_CONFIG_t;
4675 volatile ADFLxCON_t ADFLxCON;
4676 volatile uint16_t ADFLxDAT;
4677 }HSADC_ADFLT_CONFIG_t;
4682 extern volatile uint16_t ADC_Module_Initialize(
volatile HSADC_ADMODCFG_t adc_cfg );
4683 extern volatile uint16_t ADC_ADInput_Initialize(
volatile HSADC_ADCANCFG_t adin_cfg );
4686 extern volatile uint16_t ADC_Module_PowerUp(
void);
4687 extern volatile uint16_t ADC_Module_PowerDown(
void);
4688 extern volatile uint16_t ADC_Module_Enable(
void);
4689 extern volatile uint16_t ADC_Module_Disable(
void);
4690 extern volatile uint16_t ADC_Module_Reset(
void);
4692 extern volatile uint16_t ADC_Core_PowerUp(
volatile uint16_t index);
4693 extern volatile uint16_t ADC_Core_CheckReady(
void);
4695 extern volatile uint16_t ADC_ADInput_SetMode(
volatile HSADC_ADCANCFG_t adin_cfg);
4696 extern volatile uint16_t ADC_ADInput_SetTriggerSource(
volatile HSADC_ADCANCFG_t adin_cfg);
4697 extern volatile uint16_t ADC_ADInput_SetTriggerMode(
volatile HSADC_ADCANCFG_t adin_cfg);
4698 extern volatile uint16_t ADC_ADInput_SetInterrupt(
volatile HSADC_ADCANCFG_t adin_cfg);
4700 extern volatile uint16_t ADC_ADComp_Initialize(
volatile uint16_t index,
volatile HSADC_ADCMP_CONFIG_t adcmp_cfg);
4701 extern volatile uint16_t ADC_ADFilter_Initialize(
volatile uint16_t index,
volatile HSADC_ADFLT_CONFIG_t adflt_cfg);