dmac.h 6.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /**
  2. * \file
  3. *
  4. * \brief Instance description for DMAC
  5. *
  6. * Copyright (c) 2018 Microchip Technology Inc.
  7. *
  8. * \asf_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"); you may
  15. * not use this file except in compliance with the License.
  16. * You may obtain a copy of the Licence 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, WITHOUT
  22. * 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. * \asf_license_stop
  27. *
  28. */
  29. #ifndef _SAMD11_DMAC_INSTANCE_
  30. #define _SAMD11_DMAC_INSTANCE_
  31. /* ========== Register definition for DMAC peripheral ========== */
  32. #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  33. #define REG_DMAC_CTRL (0x41004800) /**< \brief (DMAC) Control */
  34. #define REG_DMAC_CRCCTRL (0x41004802) /**< \brief (DMAC) CRC Control */
  35. #define REG_DMAC_CRCDATAIN (0x41004804) /**< \brief (DMAC) CRC Data Input */
  36. #define REG_DMAC_CRCCHKSUM (0x41004808) /**< \brief (DMAC) CRC Checksum */
  37. #define REG_DMAC_CRCSTATUS (0x4100480C) /**< \brief (DMAC) CRC Status */
  38. #define REG_DMAC_DBGCTRL (0x4100480D) /**< \brief (DMAC) Debug Control */
  39. #define REG_DMAC_QOSCTRL (0x4100480E) /**< \brief (DMAC) QOS Control */
  40. #define REG_DMAC_SWTRIGCTRL (0x41004810) /**< \brief (DMAC) Software Trigger Control */
  41. #define REG_DMAC_PRICTRL0 (0x41004814) /**< \brief (DMAC) Priority Control 0 */
  42. #define REG_DMAC_INTPEND (0x41004820) /**< \brief (DMAC) Interrupt Pending */
  43. #define REG_DMAC_INTSTATUS (0x41004824) /**< \brief (DMAC) Interrupt Status */
  44. #define REG_DMAC_BUSYCH (0x41004828) /**< \brief (DMAC) Busy Channels */
  45. #define REG_DMAC_PENDCH (0x4100482C) /**< \brief (DMAC) Pending Channels */
  46. #define REG_DMAC_ACTIVE (0x41004830) /**< \brief (DMAC) Active Channel and Levels */
  47. #define REG_DMAC_BASEADDR (0x41004834) /**< \brief (DMAC) Descriptor Memory Section Base Address */
  48. #define REG_DMAC_WRBADDR (0x41004838) /**< \brief (DMAC) Write-Back Memory Section Base Address */
  49. #define REG_DMAC_CHID (0x4100483F) /**< \brief (DMAC) Channel ID */
  50. #define REG_DMAC_CHCTRLA (0x41004840) /**< \brief (DMAC) Channel Control A */
  51. #define REG_DMAC_CHCTRLB (0x41004844) /**< \brief (DMAC) Channel Control B */
  52. #define REG_DMAC_CHINTENCLR (0x4100484C) /**< \brief (DMAC) Channel Interrupt Enable Clear */
  53. #define REG_DMAC_CHINTENSET (0x4100484D) /**< \brief (DMAC) Channel Interrupt Enable Set */
  54. #define REG_DMAC_CHINTFLAG (0x4100484E) /**< \brief (DMAC) Channel Interrupt Flag Status and Clear */
  55. #define REG_DMAC_CHSTATUS (0x4100484F) /**< \brief (DMAC) Channel Status */
  56. #else
  57. #define REG_DMAC_CTRL (*(RwReg16*)0x41004800UL) /**< \brief (DMAC) Control */
  58. #define REG_DMAC_CRCCTRL (*(RwReg16*)0x41004802UL) /**< \brief (DMAC) CRC Control */
  59. #define REG_DMAC_CRCDATAIN (*(RwReg *)0x41004804UL) /**< \brief (DMAC) CRC Data Input */
  60. #define REG_DMAC_CRCCHKSUM (*(RwReg *)0x41004808UL) /**< \brief (DMAC) CRC Checksum */
  61. #define REG_DMAC_CRCSTATUS (*(RwReg8 *)0x4100480CUL) /**< \brief (DMAC) CRC Status */
  62. #define REG_DMAC_DBGCTRL (*(RwReg8 *)0x4100480DUL) /**< \brief (DMAC) Debug Control */
  63. #define REG_DMAC_QOSCTRL (*(RwReg8 *)0x4100480EUL) /**< \brief (DMAC) QOS Control */
  64. #define REG_DMAC_SWTRIGCTRL (*(RwReg *)0x41004810UL) /**< \brief (DMAC) Software Trigger Control */
  65. #define REG_DMAC_PRICTRL0 (*(RwReg *)0x41004814UL) /**< \brief (DMAC) Priority Control 0 */
  66. #define REG_DMAC_INTPEND (*(RwReg16*)0x41004820UL) /**< \brief (DMAC) Interrupt Pending */
  67. #define REG_DMAC_INTSTATUS (*(RoReg *)0x41004824UL) /**< \brief (DMAC) Interrupt Status */
  68. #define REG_DMAC_BUSYCH (*(RoReg *)0x41004828UL) /**< \brief (DMAC) Busy Channels */
  69. #define REG_DMAC_PENDCH (*(RoReg *)0x4100482CUL) /**< \brief (DMAC) Pending Channels */
  70. #define REG_DMAC_ACTIVE (*(RoReg *)0x41004830UL) /**< \brief (DMAC) Active Channel and Levels */
  71. #define REG_DMAC_BASEADDR (*(RwReg *)0x41004834UL) /**< \brief (DMAC) Descriptor Memory Section Base Address */
  72. #define REG_DMAC_WRBADDR (*(RwReg *)0x41004838UL) /**< \brief (DMAC) Write-Back Memory Section Base Address */
  73. #define REG_DMAC_CHID (*(RwReg8 *)0x4100483FUL) /**< \brief (DMAC) Channel ID */
  74. #define REG_DMAC_CHCTRLA (*(RwReg8 *)0x41004840UL) /**< \brief (DMAC) Channel Control A */
  75. #define REG_DMAC_CHCTRLB (*(RwReg *)0x41004844UL) /**< \brief (DMAC) Channel Control B */
  76. #define REG_DMAC_CHINTENCLR (*(RwReg8 *)0x4100484CUL) /**< \brief (DMAC) Channel Interrupt Enable Clear */
  77. #define REG_DMAC_CHINTENSET (*(RwReg8 *)0x4100484DUL) /**< \brief (DMAC) Channel Interrupt Enable Set */
  78. #define REG_DMAC_CHINTFLAG (*(RwReg8 *)0x4100484EUL) /**< \brief (DMAC) Channel Interrupt Flag Status and Clear */
  79. #define REG_DMAC_CHSTATUS (*(RoReg8 *)0x4100484FUL) /**< \brief (DMAC) Channel Status */
  80. #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  81. /* ========== Instance parameters for DMAC peripheral ========== */
  82. #define DMAC_CH_BITS 3 // Number of bits to select channel
  83. #define DMAC_CH_NUM 6 // Number of channels
  84. #define DMAC_CLK_AHB_ID 5 // AHB clock index
  85. #define DMAC_EVIN_NUM 4 // Number of input events
  86. #define DMAC_EVOUT_NUM 4 // Number of output events
  87. #define DMAC_LVL_BITS 2 // Number of bit to select level priority
  88. #define DMAC_LVL_NUM 4 // Enable priority level number
  89. #define DMAC_TRIG_BITS 5 // Number of bits to select trigger source
  90. #define DMAC_TRIG_NUM 20 // Number of peripheral triggers
  91. #endif /* _SAMD11_DMAC_INSTANCE_ */