adc.h 5.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /**
  2. * \file
  3. *
  4. * \brief Instance description for ADC
  5. *
  6. * Copyright (c) 2018 Microchip Technology Inc.
  7. *
  8. * \license_start
  9. *
  10. * \page License
  11. *
  12. * SPDX-License-Identifier: Apache-2.0
  13. *
  14. * Licensed under the Apache License, Version 2.0 (the "License");
  15. * you may not use this file except in compliance with the License.
  16. * You may obtain a copy of the License at
  17. *
  18. * http://www.apache.org/licenses/LICENSE-2.0
  19. *
  20. * Unless required by applicable law or agreed to in writing, software
  21. * distributed under the License is distributed on an "AS IS" BASIS,
  22. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23. * See the License for the specific language governing permissions and
  24. * limitations under the License.
  25. *
  26. * \license_stop
  27. *
  28. */
  29. /* file generated from device description version 2018-05-30T11:07:17Z */
  30. #ifndef _SAML11_ADC_INSTANCE_H_
  31. #define _SAML11_ADC_INSTANCE_H_
  32. /* ========== Register definition for ADC peripheral ========== */
  33. #if (defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  34. #define REG_ADC_CTRLA (0x42001C00) /**< (ADC) Control A */
  35. #define REG_ADC_CTRLB (0x42001C01) /**< (ADC) Control B */
  36. #define REG_ADC_REFCTRL (0x42001C02) /**< (ADC) Reference Control */
  37. #define REG_ADC_EVCTRL (0x42001C03) /**< (ADC) Event Control */
  38. #define REG_ADC_INTENCLR (0x42001C04) /**< (ADC) Interrupt Enable Clear */
  39. #define REG_ADC_INTENSET (0x42001C05) /**< (ADC) Interrupt Enable Set */
  40. #define REG_ADC_INTFLAG (0x42001C06) /**< (ADC) Interrupt Flag Status and Clear */
  41. #define REG_ADC_SEQSTATUS (0x42001C07) /**< (ADC) Sequence Status */
  42. #define REG_ADC_INPUTCTRL (0x42001C08) /**< (ADC) Input Control */
  43. #define REG_ADC_CTRLC (0x42001C0A) /**< (ADC) Control C */
  44. #define REG_ADC_AVGCTRL (0x42001C0C) /**< (ADC) Average Control */
  45. #define REG_ADC_SAMPCTRL (0x42001C0D) /**< (ADC) Sample Time Control */
  46. #define REG_ADC_WINLT (0x42001C0E) /**< (ADC) Window Monitor Lower Threshold */
  47. #define REG_ADC_WINUT (0x42001C10) /**< (ADC) Window Monitor Upper Threshold */
  48. #define REG_ADC_GAINCORR (0x42001C12) /**< (ADC) Gain Correction */
  49. #define REG_ADC_OFFSETCORR (0x42001C14) /**< (ADC) Offset Correction */
  50. #define REG_ADC_SWTRIG (0x42001C18) /**< (ADC) Software Trigger */
  51. #define REG_ADC_DBGCTRL (0x42001C1C) /**< (ADC) Debug Control */
  52. #define REG_ADC_SYNCBUSY (0x42001C20) /**< (ADC) Synchronization Busy */
  53. #define REG_ADC_RESULT (0x42001C24) /**< (ADC) Result */
  54. #define REG_ADC_SEQCTRL (0x42001C28) /**< (ADC) Sequence Control */
  55. #define REG_ADC_CALIB (0x42001C2C) /**< (ADC) Calibration */
  56. #else
  57. #define REG_ADC_CTRLA (*(__IO uint8_t*)0x42001C00U) /**< (ADC) Control A */
  58. #define REG_ADC_CTRLB (*(__IO uint8_t*)0x42001C01U) /**< (ADC) Control B */
  59. #define REG_ADC_REFCTRL (*(__IO uint8_t*)0x42001C02U) /**< (ADC) Reference Control */
  60. #define REG_ADC_EVCTRL (*(__IO uint8_t*)0x42001C03U) /**< (ADC) Event Control */
  61. #define REG_ADC_INTENCLR (*(__IO uint8_t*)0x42001C04U) /**< (ADC) Interrupt Enable Clear */
  62. #define REG_ADC_INTENSET (*(__IO uint8_t*)0x42001C05U) /**< (ADC) Interrupt Enable Set */
  63. #define REG_ADC_INTFLAG (*(__IO uint8_t*)0x42001C06U) /**< (ADC) Interrupt Flag Status and Clear */
  64. #define REG_ADC_SEQSTATUS (*(__I uint8_t*)0x42001C07U) /**< (ADC) Sequence Status */
  65. #define REG_ADC_INPUTCTRL (*(__IO uint16_t*)0x42001C08U) /**< (ADC) Input Control */
  66. #define REG_ADC_CTRLC (*(__IO uint16_t*)0x42001C0AU) /**< (ADC) Control C */
  67. #define REG_ADC_AVGCTRL (*(__IO uint8_t*)0x42001C0CU) /**< (ADC) Average Control */
  68. #define REG_ADC_SAMPCTRL (*(__IO uint8_t*)0x42001C0DU) /**< (ADC) Sample Time Control */
  69. #define REG_ADC_WINLT (*(__IO uint16_t*)0x42001C0EU) /**< (ADC) Window Monitor Lower Threshold */
  70. #define REG_ADC_WINUT (*(__IO uint16_t*)0x42001C10U) /**< (ADC) Window Monitor Upper Threshold */
  71. #define REG_ADC_GAINCORR (*(__IO uint16_t*)0x42001C12U) /**< (ADC) Gain Correction */
  72. #define REG_ADC_OFFSETCORR (*(__IO uint16_t*)0x42001C14U) /**< (ADC) Offset Correction */
  73. #define REG_ADC_SWTRIG (*(__IO uint8_t*)0x42001C18U) /**< (ADC) Software Trigger */
  74. #define REG_ADC_DBGCTRL (*(__IO uint8_t*)0x42001C1CU) /**< (ADC) Debug Control */
  75. #define REG_ADC_SYNCBUSY (*(__I uint16_t*)0x42001C20U) /**< (ADC) Synchronization Busy */
  76. #define REG_ADC_RESULT (*(__I uint16_t*)0x42001C24U) /**< (ADC) Result */
  77. #define REG_ADC_SEQCTRL (*(__IO uint32_t*)0x42001C28U) /**< (ADC) Sequence Control */
  78. #define REG_ADC_CALIB (*(__IO uint16_t*)0x42001C2CU) /**< (ADC) Calibration */
  79. #endif /* (defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  80. /* ========== Instance Parameter definitions for ADC peripheral ========== */
  81. #define ADC_DMAC_ID_RESRDY 19 /* index of DMA RESRDY trigger */
  82. #define ADC_EXTCHANNEL_MSB 9 /* Number of external channels */
  83. #define ADC_GCLK_ID 16 /* index of Generic Clock */
  84. #define ADC_INT_CH30 1 /* Select OPAMP or CTAT on Channel 30 */
  85. #define ADC_MASTER_SLAVE_MODE 0 /* ADC Master/Slave Mode */
  86. #define ADC_INSTANCE_ID 71
  87. #endif /* _SAML11_ADC_INSTANCE_ */