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