mbed library sources change for ST sensors and ST BLE
Fork of mbed-src by
targets/cmsis/TARGET_Maxim/TARGET_MAX32610/max32610.h@636:83ea0d2b909b, 2016-04-14 (annotated)
- Committer:
- NickZhouARM
- Date:
- Thu Apr 14 07:07:44 2016 +0000
- Revision:
- 636:83ea0d2b909b
- Parent:
- 507:d4fc7603a669
Working version for ST BLE + Sensors
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 507:d4fc7603a669 | 1 | /******************************************************************************* |
mbed_official | 507:d4fc7603a669 | 2 | * Copyright (C) 2015 Maxim Integrated Products, Inc., All Rights Reserved. |
mbed_official | 507:d4fc7603a669 | 3 | * |
mbed_official | 507:d4fc7603a669 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
mbed_official | 507:d4fc7603a669 | 5 | * copy of this software and associated documentation files (the "Software"), |
mbed_official | 507:d4fc7603a669 | 6 | * to deal in the Software without restriction, including without limitation |
mbed_official | 507:d4fc7603a669 | 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
mbed_official | 507:d4fc7603a669 | 8 | * and/or sell copies of the Software, and to permit persons to whom the |
mbed_official | 507:d4fc7603a669 | 9 | * Software is furnished to do so, subject to the following conditions: |
mbed_official | 507:d4fc7603a669 | 10 | * |
mbed_official | 507:d4fc7603a669 | 11 | * The above copyright notice and this permission notice shall be included |
mbed_official | 507:d4fc7603a669 | 12 | * in all copies or substantial portions of the Software. |
mbed_official | 507:d4fc7603a669 | 13 | * |
mbed_official | 507:d4fc7603a669 | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
mbed_official | 507:d4fc7603a669 | 15 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
mbed_official | 507:d4fc7603a669 | 16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
mbed_official | 507:d4fc7603a669 | 17 | * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES |
mbed_official | 507:d4fc7603a669 | 18 | * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
mbed_official | 507:d4fc7603a669 | 19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
mbed_official | 507:d4fc7603a669 | 20 | * OTHER DEALINGS IN THE SOFTWARE. |
mbed_official | 507:d4fc7603a669 | 21 | * |
mbed_official | 507:d4fc7603a669 | 22 | * Except as contained in this notice, the name of Maxim Integrated |
mbed_official | 507:d4fc7603a669 | 23 | * Products, Inc. shall not be used except as stated in the Maxim Integrated |
mbed_official | 507:d4fc7603a669 | 24 | * Products, Inc. Branding Policy. |
mbed_official | 507:d4fc7603a669 | 25 | * |
mbed_official | 507:d4fc7603a669 | 26 | * The mere transfer of this software does not imply any licenses |
mbed_official | 507:d4fc7603a669 | 27 | * of trade secrets, proprietary technology, copyrights, patents, |
mbed_official | 507:d4fc7603a669 | 28 | * trademarks, maskwork rights, or any other form of intellectual |
mbed_official | 507:d4fc7603a669 | 29 | * property whatsoever. Maxim Integrated Products, Inc. retains all |
mbed_official | 507:d4fc7603a669 | 30 | * ownership rights. |
mbed_official | 507:d4fc7603a669 | 31 | ******************************************************************************* |
mbed_official | 507:d4fc7603a669 | 32 | */ |
mbed_official | 507:d4fc7603a669 | 33 | |
mbed_official | 507:d4fc7603a669 | 34 | #ifndef _MAX32610_H_ |
mbed_official | 507:d4fc7603a669 | 35 | #define _MAX32610_H_ |
mbed_official | 507:d4fc7603a669 | 36 | |
mbed_official | 507:d4fc7603a669 | 37 | #include <stdint.h> |
mbed_official | 507:d4fc7603a669 | 38 | |
mbed_official | 507:d4fc7603a669 | 39 | typedef enum IRQn_Type { |
mbed_official | 507:d4fc7603a669 | 40 | NonMaskableInt_IRQn = -14, |
mbed_official | 507:d4fc7603a669 | 41 | HardFault_IRQn = -13, |
mbed_official | 507:d4fc7603a669 | 42 | MemoryManagement_IRQn = -12, |
mbed_official | 507:d4fc7603a669 | 43 | BusFault_IRQn = -11, |
mbed_official | 507:d4fc7603a669 | 44 | UsageFault_IRQn = -10, |
mbed_official | 507:d4fc7603a669 | 45 | SVCall_IRQn = -5, |
mbed_official | 507:d4fc7603a669 | 46 | DebugMonitor_IRQn = -4, |
mbed_official | 507:d4fc7603a669 | 47 | PendSV_IRQn = -2, |
mbed_official | 507:d4fc7603a669 | 48 | SysTick_IRQn = -1, |
mbed_official | 507:d4fc7603a669 | 49 | |
mbed_official | 507:d4fc7603a669 | 50 | /* Externals interrupts */ |
mbed_official | 507:d4fc7603a669 | 51 | UART0_IRQn = 0, /* 16:01 UART0 */ |
mbed_official | 507:d4fc7603a669 | 52 | UART1_IRQn, /* 17: 2 UART1 */ |
mbed_official | 507:d4fc7603a669 | 53 | I2CM0_IRQn, /* 18: 3 I2C Master 0 */ |
mbed_official | 507:d4fc7603a669 | 54 | I2CS_IRQn, /* 19: 4 I2C Slave */ |
mbed_official | 507:d4fc7603a669 | 55 | USB_IRQn, /* 20: 5 USB */ |
mbed_official | 507:d4fc7603a669 | 56 | PMU_IRQn, /* 21: 6 DMA */ |
mbed_official | 507:d4fc7603a669 | 57 | AFE_IRQn, /* 22: 7 AFE */ |
mbed_official | 507:d4fc7603a669 | 58 | MAA_IRQn, /* 23: 8 MAA */ |
mbed_official | 507:d4fc7603a669 | 59 | AES_IRQn, /* 24: 9 AES */ |
mbed_official | 507:d4fc7603a669 | 60 | SPI0_IRQn, /* 25:10 SPI0 */ |
mbed_official | 507:d4fc7603a669 | 61 | SPI1_IRQn, /* 26:11 SPI1 */ |
mbed_official | 507:d4fc7603a669 | 62 | SPI2_IRQn, /* 27:12 SPI2 */ |
mbed_official | 507:d4fc7603a669 | 63 | TMR0_IRQn, /* 28:13 Timer32-0 */ |
mbed_official | 507:d4fc7603a669 | 64 | TMR1_IRQn, /* 29:14 Timer32-1 */ |
mbed_official | 507:d4fc7603a669 | 65 | TMR2_IRQn, /* 30:15 Timer32-1 */ |
mbed_official | 507:d4fc7603a669 | 66 | TMR3_IRQn, /* 31:16 Timer32-2 */ |
mbed_official | 507:d4fc7603a669 | 67 | RSVD0_IRQn, /* 32:17 RSVD */ |
mbed_official | 507:d4fc7603a669 | 68 | RSVD1_IRQn, /* 33:18 RSVD */ |
mbed_official | 507:d4fc7603a669 | 69 | DAC0_IRQn, /* 34:19 DAC0 (12-bit DAC) */ |
mbed_official | 507:d4fc7603a669 | 70 | DAC1_IRQn, /* 35:20 DAC1 (12-bit DAC) */ |
mbed_official | 507:d4fc7603a669 | 71 | DAC2_IRQn, /* 36:21 DAC2 (8-bit DAC) */ |
mbed_official | 507:d4fc7603a669 | 72 | DAC3_IRQn, /* 37:22 DAC3 (8-bit DAC) */ |
mbed_official | 507:d4fc7603a669 | 73 | ADC_IRQn, /* 38:23 ADC */ |
mbed_official | 507:d4fc7603a669 | 74 | FLC_IRQn, /* 39:24 Flash Controller */ |
mbed_official | 507:d4fc7603a669 | 75 | PWRMAN_IRQn, /* 40:25 PWRMAN */ |
mbed_official | 507:d4fc7603a669 | 76 | CLKMAN_IRQn, /* 41:26 CLKMAN */ |
mbed_official | 507:d4fc7603a669 | 77 | RTC0_IRQn, /* 42:27 RTC INT0 */ |
mbed_official | 507:d4fc7603a669 | 78 | RTC1_IRQn, /* 43:28 RTC INT1 */ |
mbed_official | 507:d4fc7603a669 | 79 | RTC2_IRQn, /* 44:29 RTC INT2 */ |
mbed_official | 507:d4fc7603a669 | 80 | RTC3_IRQn, /* 45:30 RTC INT3 */ |
mbed_official | 507:d4fc7603a669 | 81 | WDT0_IRQn, /* 46:31 WATCHDOG0 */ |
mbed_official | 507:d4fc7603a669 | 82 | WDT0_P_IRQn, /* 47:32 WATCHDOG0 PRE-WINDOW */ |
mbed_official | 507:d4fc7603a669 | 83 | WDT1_IRQn, /* 48:33 WATCHDOG1 */ |
mbed_official | 507:d4fc7603a669 | 84 | WDT1_P_IRQn, /* 49:34 WATCHDOG1 PRE-WINDOW */ |
mbed_official | 507:d4fc7603a669 | 85 | GPIO_P0_IRQn, /* 50:35 GPIO Port 0 */ |
mbed_official | 507:d4fc7603a669 | 86 | GPIO_P1_IRQn, /* 51:36 GPIO Port 1 */ |
mbed_official | 507:d4fc7603a669 | 87 | GPIO_P2_IRQn, /* 52:37 GPIO Port 2 */ |
mbed_official | 507:d4fc7603a669 | 88 | GPIO_P3_IRQn, /* 53:38 GPIO Port 3 */ |
mbed_official | 507:d4fc7603a669 | 89 | GPIO_P4_IRQn, /* 54:39 GPIO Port 4 */ |
mbed_official | 507:d4fc7603a669 | 90 | GPIO_P5_IRQn, /* 55:40 GPIO Port 5 */ |
mbed_official | 507:d4fc7603a669 | 91 | GPIO_P6_IRQn, /* 56:41 GPIO Port 6 */ |
mbed_official | 507:d4fc7603a669 | 92 | GPIO_P7_IRQn, /* 57:42 GPIO Port 7 */ |
mbed_official | 507:d4fc7603a669 | 93 | TMR16_0_IRQn, /* 58:43 Timer16-s0 */ |
mbed_official | 507:d4fc7603a669 | 94 | TMR16_1_IRQn, /* 59:44 Timer16-s1 */ |
mbed_official | 507:d4fc7603a669 | 95 | TMR16_2_IRQn, /* 60:45 Timer16-s2 */ |
mbed_official | 507:d4fc7603a669 | 96 | TMR16_3_IRQn, /* 61:46 Timer16-s3 */ |
mbed_official | 507:d4fc7603a669 | 97 | I2CM1_IRQn, /* 62:47 I2C Master 1 */ |
mbed_official | 507:d4fc7603a669 | 98 | MXC_IRQ_EXT_COUNT, |
mbed_official | 507:d4fc7603a669 | 99 | } IRQn_Type; |
mbed_official | 507:d4fc7603a669 | 100 | |
mbed_official | 507:d4fc7603a669 | 101 | #define MXC_IRQ_COUNT (MXC_IRQ_EXT_COUNT + 16) |
mbed_official | 507:d4fc7603a669 | 102 | |
mbed_official | 507:d4fc7603a669 | 103 | /* ================================================================================ */ |
mbed_official | 507:d4fc7603a669 | 104 | /* ================ Processor and Core Peripheral Section ================ */ |
mbed_official | 507:d4fc7603a669 | 105 | /* ================================================================================ */ |
mbed_official | 507:d4fc7603a669 | 106 | |
mbed_official | 507:d4fc7603a669 | 107 | #define __NVIC_PRIO_BITS 3 /*!< Number of Bits used for Priority Levels */ |
mbed_official | 507:d4fc7603a669 | 108 | |
mbed_official | 507:d4fc7603a669 | 109 | #include <core_cm3.h> /* Processor and core peripherals */ |
mbed_official | 507:d4fc7603a669 | 110 | #include "system_max32610.h" /* System Header */ |
mbed_official | 507:d4fc7603a669 | 111 | |
mbed_official | 507:d4fc7603a669 | 112 | |
mbed_official | 507:d4fc7603a669 | 113 | /* ================================================================================ */ |
mbed_official | 507:d4fc7603a669 | 114 | /* ================== Device Specific Memory Section ================== */ |
mbed_official | 507:d4fc7603a669 | 115 | /* ================================================================================ */ |
mbed_official | 507:d4fc7603a669 | 116 | |
mbed_official | 507:d4fc7603a669 | 117 | #define MXC_FLASH_MEM_BASE 0x00000000UL |
mbed_official | 507:d4fc7603a669 | 118 | #define MXC_FLASH_PAGE_SIZE 0x1000 // 256 x 128b = 4KB |
mbed_official | 507:d4fc7603a669 | 119 | #define MXC_FLASH_MEM_SIZE 0x00040000UL |
mbed_official | 507:d4fc7603a669 | 120 | #define MXC_SYS_MEM_BASE 0x20000000UL |
mbed_official | 507:d4fc7603a669 | 121 | |
mbed_official | 507:d4fc7603a669 | 122 | /* ================================================================================ */ |
mbed_official | 507:d4fc7603a669 | 123 | /* ================ Device Specific Peripheral Section ================ */ |
mbed_official | 507:d4fc7603a669 | 124 | /* ================================================================================ */ |
mbed_official | 507:d4fc7603a669 | 125 | |
mbed_official | 507:d4fc7603a669 | 126 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 127 | /* General Purpose I/O Ports (GPIO) */ |
mbed_official | 507:d4fc7603a669 | 128 | |
mbed_official | 507:d4fc7603a669 | 129 | |
mbed_official | 507:d4fc7603a669 | 130 | #define MXC_BASE_GPIO ((uint32_t)0x40000000UL) |
mbed_official | 507:d4fc7603a669 | 131 | #define MXC_GPIO ((mxc_gpio_regs_t *)MXC_BASE_GPIO) |
mbed_official | 507:d4fc7603a669 | 132 | #define MXC_BASE_GPIO_BITBAND ((uint32_t)0x42000000UL) |
mbed_official | 507:d4fc7603a669 | 133 | |
mbed_official | 507:d4fc7603a669 | 134 | #define MXC_GPIO_GET_IRQ(i) (((unsigned int)i) + GPIO_P0_IRQn) |
mbed_official | 507:d4fc7603a669 | 135 | |
mbed_official | 507:d4fc7603a669 | 136 | |
mbed_official | 507:d4fc7603a669 | 137 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 138 | /* Pulse Train Generation */ |
mbed_official | 507:d4fc7603a669 | 139 | |
mbed_official | 507:d4fc7603a669 | 140 | #define MXC_CFG_PT_INSTANCES (13) |
mbed_official | 507:d4fc7603a669 | 141 | |
mbed_official | 507:d4fc7603a669 | 142 | #define MXC_BASE_PTG ((uint32_t)0x40001000UL) |
mbed_official | 507:d4fc7603a669 | 143 | #define MXC_PTG ((mxc_ptg_regs_t *)MXC_BASE_PTG) |
mbed_official | 507:d4fc7603a669 | 144 | #define MXC_BASE_PT ((uint32_t)0x40001008UL) |
mbed_official | 507:d4fc7603a669 | 145 | #define MXC_PT ((mxc_pt_regs_t *)MXC_BASE_PT) |
mbed_official | 507:d4fc7603a669 | 146 | #define MXC_BASE_PT0 ((uint32_t)0x40001008UL) |
mbed_official | 507:d4fc7603a669 | 147 | #define MXC_PT0 ((mxc_pt_regs_t *)MXC_BASE_PT0) |
mbed_official | 507:d4fc7603a669 | 148 | #define MXC_BASE_PT1 ((uint32_t)0x40001010UL) |
mbed_official | 507:d4fc7603a669 | 149 | #define MXC_PT1 ((mxc_pt_regs_t *)MXC_BASE_PT1) |
mbed_official | 507:d4fc7603a669 | 150 | #define MXC_BASE_PT2 ((uint32_t)0x40001018UL) |
mbed_official | 507:d4fc7603a669 | 151 | #define MXC_PT2 ((mxc_pt_regs_t *)MXC_BASE_PT2) |
mbed_official | 507:d4fc7603a669 | 152 | #define MXC_BASE_PT3 ((uint32_t)0x40001020UL) |
mbed_official | 507:d4fc7603a669 | 153 | #define MXC_PT3 ((mxc_pt_regs_t *)MXC_BASE_PT3) |
mbed_official | 507:d4fc7603a669 | 154 | #define MXC_BASE_PT4 ((uint32_t)0x40001028UL) |
mbed_official | 507:d4fc7603a669 | 155 | #define MXC_PT4 ((mxc_pt_regs_t *)MXC_BASE_PT4) |
mbed_official | 507:d4fc7603a669 | 156 | #define MXC_BASE_PT5 ((uint32_t)0x40001030UL) |
mbed_official | 507:d4fc7603a669 | 157 | #define MXC_PT5 ((mxc_pt_regs_t *)MXC_BASE_PT5) |
mbed_official | 507:d4fc7603a669 | 158 | #define MXC_BASE_PT6 ((uint32_t)0x40001038UL) |
mbed_official | 507:d4fc7603a669 | 159 | #define MXC_PT6 ((mxc_pt_regs_t *)MXC_BASE_PT6) |
mbed_official | 507:d4fc7603a669 | 160 | #define MXC_BASE_PT7 ((uint32_t)0x40001040UL) |
mbed_official | 507:d4fc7603a669 | 161 | #define MXC_PT7 ((mxc_pt_regs_t *)MXC_BASE_PT7) |
mbed_official | 507:d4fc7603a669 | 162 | |
mbed_official | 507:d4fc7603a669 | 163 | /* PT12, PT13, PT14 are not used */ |
mbed_official | 507:d4fc7603a669 | 164 | |
mbed_official | 507:d4fc7603a669 | 165 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 166 | /* CRC-16/CRC-32 Engine */ |
mbed_official | 507:d4fc7603a669 | 167 | |
mbed_official | 507:d4fc7603a669 | 168 | #define MXC_BASE_CRC ((uint32_t)0x40010000UL) |
mbed_official | 507:d4fc7603a669 | 169 | #define MXC_CRC_REGS ((mxc_crc_regs_t *)MXC_BASE_CRC) |
mbed_official | 507:d4fc7603a669 | 170 | |
mbed_official | 507:d4fc7603a669 | 171 | #define MXC_BASE_CRC_DATA ((uint32_t)0x4010B000UL) |
mbed_official | 507:d4fc7603a669 | 172 | #define MXC_CRC_DATA ((mxc_crc_data_regs_t *)MXC_BASE_CRC_DATA) |
mbed_official | 507:d4fc7603a669 | 173 | |
mbed_official | 507:d4fc7603a669 | 174 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 175 | /* Trust Protection Unit (TPU) */ |
mbed_official | 507:d4fc7603a669 | 176 | |
mbed_official | 507:d4fc7603a669 | 177 | #define MXC_BASE_TPU ((uint32_t)0x40011000UL) |
mbed_official | 507:d4fc7603a669 | 178 | #define MXC_TPU ((mxc_tpu_regs_t *)MXC_BASE_TPU) |
mbed_official | 507:d4fc7603a669 | 179 | |
mbed_official | 507:d4fc7603a669 | 180 | #define MXC_BASE_TPU_TSR ((uint32_t)0x40011C00UL) |
mbed_official | 507:d4fc7603a669 | 181 | #define MXC_TPU_TSR ((mxc_tpu_tsr_regs_t *)MXC_BASE_TPU_TSR) |
mbed_official | 507:d4fc7603a669 | 182 | |
mbed_official | 507:d4fc7603a669 | 183 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 184 | /* AES Cryptographic Engine */ |
mbed_official | 507:d4fc7603a669 | 185 | |
mbed_official | 507:d4fc7603a669 | 186 | #define MXC_BASE_AES ((uint32_t)0x40011400UL) |
mbed_official | 507:d4fc7603a669 | 187 | #define MXC_AES ((mxc_aes_regs_t *)MXC_BASE_AES) |
mbed_official | 507:d4fc7603a669 | 188 | |
mbed_official | 507:d4fc7603a669 | 189 | #define MXC_BASE_AES_MEM ((uint32_t)0x4010A000UL) |
mbed_official | 507:d4fc7603a669 | 190 | #define MXC_AES_MEM ((mxc_aes_mem_regs_t *)MXC_BASE_AES_MEM) |
mbed_official | 507:d4fc7603a669 | 191 | |
mbed_official | 507:d4fc7603a669 | 192 | |
mbed_official | 507:d4fc7603a669 | 193 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 194 | /* MAA Cryptographic Engine */ |
mbed_official | 507:d4fc7603a669 | 195 | |
mbed_official | 507:d4fc7603a669 | 196 | #define MXC_BASE_MAA ((uint32_t)0x40011800UL) |
mbed_official | 507:d4fc7603a669 | 197 | #define MXC_MAA ((mxc_maa_regs_t *)MXC_BASE_MAA) |
mbed_official | 507:d4fc7603a669 | 198 | |
mbed_official | 507:d4fc7603a669 | 199 | #define MXC_BASE_MAA_MEM ((uint32_t)0x4010A800UL) |
mbed_official | 507:d4fc7603a669 | 200 | #define MXC_MAA_MEM ((mxc_maa_mem_regs_t *)MXC_BASE_MAA_MEM) |
mbed_official | 507:d4fc7603a669 | 201 | |
mbed_official | 507:d4fc7603a669 | 202 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 203 | /* 32-Bit PWM Timer/Counter */ |
mbed_official | 507:d4fc7603a669 | 204 | |
mbed_official | 507:d4fc7603a669 | 205 | #define MXC_CFG_TMR_INSTANCES (4) |
mbed_official | 507:d4fc7603a669 | 206 | |
mbed_official | 507:d4fc7603a669 | 207 | #define MXC_BASE_TMR0 ((uint32_t)0x40012000UL) |
mbed_official | 507:d4fc7603a669 | 208 | #define MXC_BASE_TMR0_BITBAND ((uint32_t)0x42240000UL) |
mbed_official | 507:d4fc7603a669 | 209 | #define MXC_TMR0 ((mxc_tmr_regs_t *) MXC_BASE_TMR0) |
mbed_official | 507:d4fc7603a669 | 210 | |
mbed_official | 507:d4fc7603a669 | 211 | #define MXC_BASE_TMR1 ((uint32_t)0x40013000UL) |
mbed_official | 507:d4fc7603a669 | 212 | #define MXC_BASE_TMR1_BITBAND ((uint32_t)0x42260000UL) |
mbed_official | 507:d4fc7603a669 | 213 | #define MXC_TMR1 ((mxc_tmr_regs_t *) MXC_BASE_TMR1) |
mbed_official | 507:d4fc7603a669 | 214 | |
mbed_official | 507:d4fc7603a669 | 215 | #define MXC_BASE_TMR2 ((uint32_t)0x40014000UL) |
mbed_official | 507:d4fc7603a669 | 216 | #define MXC_BASE_TMR2_BITBAND ((uint32_t)0x42280000UL) |
mbed_official | 507:d4fc7603a669 | 217 | #define MXC_TMR2 ((mxc_tmr_regs_t *) MXC_BASE_TMR2) |
mbed_official | 507:d4fc7603a669 | 218 | |
mbed_official | 507:d4fc7603a669 | 219 | #define MXC_BASE_TMR3 ((uint32_t)0x40015000UL) |
mbed_official | 507:d4fc7603a669 | 220 | #define MXC_BASE_TMR3_BITBAND ((uint32_t)0x422A0000UL) |
mbed_official | 507:d4fc7603a669 | 221 | #define MXC_TMR3 ((mxc_tmr_regs_t *) MXC_BASE_TMR3) |
mbed_official | 507:d4fc7603a669 | 222 | |
mbed_official | 507:d4fc7603a669 | 223 | |
mbed_official | 507:d4fc7603a669 | 224 | #define MXC_TMR_GET_IRQ_32(i) ((i) == 0 ? TMR0_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 225 | (i) == 1 ? TMR1_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 226 | (i) == 2 ? TMR2_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 227 | (i) == 3 ? TMR3_IRQn : 0) |
mbed_official | 507:d4fc7603a669 | 228 | |
mbed_official | 507:d4fc7603a669 | 229 | #define MXC_TMR_GET_IRQ_16(i) ((i) == 0 ? TMR0_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 230 | (i) == 1 ? TMR1_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 231 | (i) == 2 ? TMR2_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 232 | (i) == 3 ? TMR3_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 233 | (i) == 4 ? TMR16_0_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 234 | (i) == 5 ? TMR16_1_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 235 | (i) == 6 ? TMR16_2_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 236 | (i) == 7 ? TMR16_3_IRQn : 0) |
mbed_official | 507:d4fc7603a669 | 237 | |
mbed_official | 507:d4fc7603a669 | 238 | #define MXC_TMR_GET_BASE(i) ((i) == 0 ? MXC_BASE_TMR0 : \ |
mbed_official | 507:d4fc7603a669 | 239 | (i) == 1 ? MXC_BASE_TMR1 : \ |
mbed_official | 507:d4fc7603a669 | 240 | (i) == 2 ? MXC_BASE_TMR2 : \ |
mbed_official | 507:d4fc7603a669 | 241 | (i) == 3 ? MXC_BASE_TMR3 : 0) |
mbed_official | 507:d4fc7603a669 | 242 | |
mbed_official | 507:d4fc7603a669 | 243 | #define MXC_TMR_GET_TMR(i) ((i) == 0 ? MXC_TMR0 : \ |
mbed_official | 507:d4fc7603a669 | 244 | (i) == 1 ? MXC_TMR1 : \ |
mbed_official | 507:d4fc7603a669 | 245 | (i) == 2 ? MXC_TMR2 : \ |
mbed_official | 507:d4fc7603a669 | 246 | (i) == 3 ? MXC_TMR3 : 0) |
mbed_official | 507:d4fc7603a669 | 247 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 248 | /* Watchdog Timer */ |
mbed_official | 507:d4fc7603a669 | 249 | |
mbed_official | 507:d4fc7603a669 | 250 | #define MXC_CFG_WDT_INSTANCES (2) |
mbed_official | 507:d4fc7603a669 | 251 | |
mbed_official | 507:d4fc7603a669 | 252 | #define MXC_BASE_WDT0 ((uint32_t)0x40021000UL) |
mbed_official | 507:d4fc7603a669 | 253 | #define MXC_BASE_WDT0_BITBAND ((uint32_t)0x42420000UL) |
mbed_official | 507:d4fc7603a669 | 254 | #define MXC_WDT0 ((mxc_wdt_regs_t *)MXC_BASE_WDT0) |
mbed_official | 507:d4fc7603a669 | 255 | |
mbed_official | 507:d4fc7603a669 | 256 | #define MXC_BASE_WDT1 ((uint32_t)0x40022000UL) |
mbed_official | 507:d4fc7603a669 | 257 | #define MXC_BASE_WDT1_BITBAND ((uint32_t)0x42440000UL) |
mbed_official | 507:d4fc7603a669 | 258 | #define MXC_WDT1 ((mxc_wdt_regs_t *)MXC_BASE_WDT1) |
mbed_official | 507:d4fc7603a669 | 259 | |
mbed_official | 507:d4fc7603a669 | 260 | #define MXC_WDT_GET_IRQ(i) ((i) == 0 ? WDT0_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 261 | (i) == 1 ? WDT1_IRQn : 0) |
mbed_official | 507:d4fc7603a669 | 262 | |
mbed_official | 507:d4fc7603a669 | 263 | #define MXC_WDT_GET_IRQ_P(i) ((i) == 0 ? WDT0_P_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 264 | (i) == 1 ? WDT1_P_IRQn : 0) |
mbed_official | 507:d4fc7603a669 | 265 | |
mbed_official | 507:d4fc7603a669 | 266 | #define MXC_WDT_GET_BASE(i) ((i) == 0 ? MXC_BASE_WDT0 : \ |
mbed_official | 507:d4fc7603a669 | 267 | (i) == 1 ? MXC_BASE_WDT1 : 0) |
mbed_official | 507:d4fc7603a669 | 268 | |
mbed_official | 507:d4fc7603a669 | 269 | #define MXC_WDT_GET_WDT(i) ((i) == 0 ? MXC_WDT0 : \ |
mbed_official | 507:d4fc7603a669 | 270 | (i) == 1 ? MXC_WDT1 : 0) |
mbed_official | 507:d4fc7603a669 | 271 | |
mbed_official | 507:d4fc7603a669 | 272 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 273 | /* SPI Interface */ |
mbed_official | 507:d4fc7603a669 | 274 | |
mbed_official | 507:d4fc7603a669 | 275 | #define MXC_CFG_SPI_INSTANCES (3) |
mbed_official | 507:d4fc7603a669 | 276 | #define MXC_CFG_SPI_FIFO_DEPTH (16) |
mbed_official | 507:d4fc7603a669 | 277 | |
mbed_official | 507:d4fc7603a669 | 278 | #define MXC_BASE_SPI0 ((uint32_t)0x40030000UL) |
mbed_official | 507:d4fc7603a669 | 279 | #define MXC_SPI0 ((mxc_spi_regs_t *)MXC_BASE_SPI0) |
mbed_official | 507:d4fc7603a669 | 280 | |
mbed_official | 507:d4fc7603a669 | 281 | #define MXC_BASE_SPI0_TXFIFO ((uint32_t)0x40100000UL) |
mbed_official | 507:d4fc7603a669 | 282 | #define MXC_SPI0_TXFIFO ((mxc_spi_txfifo_regs_t *)MXC_BASE_SPI0_TXFIFO) |
mbed_official | 507:d4fc7603a669 | 283 | #define MXC_BASE_SPI0_RXFIFO ((uint32_t)0x40100800UL) |
mbed_official | 507:d4fc7603a669 | 284 | #define MXC_SPI0_RXFIFO ((mxc_spi_rxfifo_regs_t *)MXC_BASE_SPI0_RXFIFO) |
mbed_official | 507:d4fc7603a669 | 285 | |
mbed_official | 507:d4fc7603a669 | 286 | #define MXC_BASE_SPI1 ((uint32_t)0x40031000UL) |
mbed_official | 507:d4fc7603a669 | 287 | #define MXC_SPI1 ((mxc_spi_regs_t *)MXC_BASE_SPI1) |
mbed_official | 507:d4fc7603a669 | 288 | |
mbed_official | 507:d4fc7603a669 | 289 | #define MXC_BASE_SPI1_TXFIFO ((uint32_t)0x40101000UL) |
mbed_official | 507:d4fc7603a669 | 290 | #define MXC_SPI1_TXFIFO ((mxc_spi_txfifo_regs_t *)MXC_BASE_SPI1_TXFIFO) |
mbed_official | 507:d4fc7603a669 | 291 | #define MXC_BASE_SPI1_RXFIFO ((uint32_t)0x40101800UL) |
mbed_official | 507:d4fc7603a669 | 292 | #define MXC_SPI1_RXFIFO ((mxc_spi_rxfifo_regs_t *)MXC_BASE_SPI1_RXFIFO) |
mbed_official | 507:d4fc7603a669 | 293 | |
mbed_official | 507:d4fc7603a669 | 294 | #define MXC_BASE_SPI2 ((uint32_t)0x40032000UL) |
mbed_official | 507:d4fc7603a669 | 295 | #define MXC_SPI2 ((mxc_spi_regs_t *)MXC_BASE_SPI2) |
mbed_official | 507:d4fc7603a669 | 296 | |
mbed_official | 507:d4fc7603a669 | 297 | #define MXC_BASE_SPI2_TXFIFO ((uint32_t)0x40102000UL) |
mbed_official | 507:d4fc7603a669 | 298 | #define MXC_SPI2_TXFIFO ((mxc_spi_txfifo_regs_t *)MXC_BASE_SPI2_TXFIFO) |
mbed_official | 507:d4fc7603a669 | 299 | #define MXC_BASE_SPI2_RXFIFO ((uint32_t)0x40102800UL) |
mbed_official | 507:d4fc7603a669 | 300 | #define MXC_SPI2_RXFIFO ((mxc_spi_rxfifo_regs_t *)MXC_BASE_SPI2_RXFIFO) |
mbed_official | 507:d4fc7603a669 | 301 | |
mbed_official | 507:d4fc7603a669 | 302 | |
mbed_official | 507:d4fc7603a669 | 303 | #define MXC_SPI_GET_IRQ(i) ((i) == 0 ? SPI0_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 304 | (i) == 1 ? SPI1_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 305 | (i) == 2 ? SPI2_IRQn : 0) |
mbed_official | 507:d4fc7603a669 | 306 | |
mbed_official | 507:d4fc7603a669 | 307 | #define MXC_SPI_GET_BASE(i) ((i) == 0 ? MXC_BASE_SPI0 : \ |
mbed_official | 507:d4fc7603a669 | 308 | (i) == 1 ? MXC_BASE_SPI1 : \ |
mbed_official | 507:d4fc7603a669 | 309 | (i) == 2 ? MXC_BASE_SPI2 : 0) |
mbed_official | 507:d4fc7603a669 | 310 | |
mbed_official | 507:d4fc7603a669 | 311 | #define MXC_SPI_GET_SPI(i) ((i) == 0 ? MXC_SPI0 : \ |
mbed_official | 507:d4fc7603a669 | 312 | (i) == 1 ? MXC_SPI1 : \ |
mbed_official | 507:d4fc7603a669 | 313 | (i) == 2 ? MXC_SPI2 : 0) |
mbed_official | 507:d4fc7603a669 | 314 | |
mbed_official | 507:d4fc7603a669 | 315 | #define MXC_SPI_GET_RXFIFO(i) ((i) == 0 ? MXC_SPI0_RXFIFO : \ |
mbed_official | 507:d4fc7603a669 | 316 | (i) == 1 ? MXC_SPI1_RXFIFO : \ |
mbed_official | 507:d4fc7603a669 | 317 | (i) == 2 ? MXC_SPI2_RXFIFO : 0) |
mbed_official | 507:d4fc7603a669 | 318 | |
mbed_official | 507:d4fc7603a669 | 319 | #define MXC_SPI_GET_TXFIFO(i) ((i) == 0 ? MXC_SPI0_TXFIFO : \ |
mbed_official | 507:d4fc7603a669 | 320 | (i) == 1 ? MXC_SPI1_TXFIFO : \ |
mbed_official | 507:d4fc7603a669 | 321 | (i) == 2 ? MXC_SPI2_TXFIFO : 0) |
mbed_official | 507:d4fc7603a669 | 322 | |
mbed_official | 507:d4fc7603a669 | 323 | #define MXC_SPI_INSTANCE_TO_BASE(instance) (((uint32_t)(instance) << 12) + MXC_BASE_SPI0) |
mbed_official | 507:d4fc7603a669 | 324 | #define MXC_SPI_BASE_TO_INSTANCE(base) (((uint32_t)(base) & 0x00003000) >> 12) |
mbed_official | 507:d4fc7603a669 | 325 | |
mbed_official | 507:d4fc7603a669 | 326 | |
mbed_official | 507:d4fc7603a669 | 327 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 328 | /* UART Interface */ |
mbed_official | 507:d4fc7603a669 | 329 | |
mbed_official | 507:d4fc7603a669 | 330 | #define MXC_CFG_UART_INSTANCES (2) |
mbed_official | 507:d4fc7603a669 | 331 | |
mbed_official | 507:d4fc7603a669 | 332 | #define MXC_BASE_UART0 ((uint32_t)0x40038000UL) |
mbed_official | 507:d4fc7603a669 | 333 | #define MXC_BASE_UART0_BITBAND ((uint32_t)0x42700000UL) |
mbed_official | 507:d4fc7603a669 | 334 | #define MXC_UART0 ((mxc_uart_regs_t *)MXC_BASE_UART0) |
mbed_official | 507:d4fc7603a669 | 335 | |
mbed_official | 507:d4fc7603a669 | 336 | #define MXC_BASE_UART1 ((uint32_t)0x40039000UL) |
mbed_official | 507:d4fc7603a669 | 337 | #define MXC_BASE_UART1_BITBAND ((uint32_t)0x42720000UL) |
mbed_official | 507:d4fc7603a669 | 338 | #define MXC_UART1 ((mxc_uart_regs_t *)MXC_BASE_UART1) |
mbed_official | 507:d4fc7603a669 | 339 | |
mbed_official | 507:d4fc7603a669 | 340 | |
mbed_official | 507:d4fc7603a669 | 341 | #define MXC_UART_GET_IRQ(i) ((i) == 0 ? UART0_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 342 | (i) == 1 ? UART1_IRQn : 0) |
mbed_official | 507:d4fc7603a669 | 343 | |
mbed_official | 507:d4fc7603a669 | 344 | #define MXC_UART_GET_BASE(i) ((i) == 0 ? MXC_BASE_UART0 : \ |
mbed_official | 507:d4fc7603a669 | 345 | (i) == 1 ? MXC_BASE_UART1 : 0) |
mbed_official | 507:d4fc7603a669 | 346 | |
mbed_official | 507:d4fc7603a669 | 347 | #define MXC_UART_GET_UART(i) ((i) == 0 ? MXC_UART0 : \ |
mbed_official | 507:d4fc7603a669 | 348 | (i) == 1 ? MXC_UART1 : 0) |
mbed_official | 507:d4fc7603a669 | 349 | |
mbed_official | 507:d4fc7603a669 | 350 | #define MXC_UART_INSTANCE_TO_BASE(instance) (((uint32_t)(instance) << 12) + MXC_BASE_UART0) |
mbed_official | 507:d4fc7603a669 | 351 | #define MXC_UART_BASE_TO_INSTANCE(base) (((uint32_t)(base) & 0x00001000) >> 12) |
mbed_official | 507:d4fc7603a669 | 352 | |
mbed_official | 507:d4fc7603a669 | 353 | |
mbed_official | 507:d4fc7603a669 | 354 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 355 | /* I2C Master Interface */ |
mbed_official | 507:d4fc7603a669 | 356 | |
mbed_official | 507:d4fc7603a669 | 357 | #define MXC_CFG_I2CM_INSTANCES (2) |
mbed_official | 507:d4fc7603a669 | 358 | |
mbed_official | 507:d4fc7603a669 | 359 | #define MXC_BASE_I2CM0 ((uint32_t)0x40040000UL) |
mbed_official | 507:d4fc7603a669 | 360 | #define MXC_BASE_I2CM0_BITBAND ((uint32_t)0x42800000UL) |
mbed_official | 507:d4fc7603a669 | 361 | #define MXC_I2CM0 ((mxc_i2cm_regs_t *)MXC_BASE_I2CM0) |
mbed_official | 507:d4fc7603a669 | 362 | #define MXC_BASE_I2CM0_TX_FIFO ((uint32_t)0x40103000UL) |
mbed_official | 507:d4fc7603a669 | 363 | #define MXC_BASE_I2CM0_RX_FIFO ((uint32_t)0x40103800UL) |
mbed_official | 507:d4fc7603a669 | 364 | |
mbed_official | 507:d4fc7603a669 | 365 | #define MXC_BASE_I2CM1 ((uint32_t)0x40042000UL) |
mbed_official | 507:d4fc7603a669 | 366 | #define MXC_BASE_I2CM1_BITBAND ((uint32_t)0x42840000UL) |
mbed_official | 507:d4fc7603a669 | 367 | #define MXC_I2CM1 ((mxc_i2cm_regs_t *)MXC_BASE_I2CM1) |
mbed_official | 507:d4fc7603a669 | 368 | #define MXC_BASE_I2CM1_TX_FIFO ((uint32_t)0x4010D000UL) |
mbed_official | 507:d4fc7603a669 | 369 | #define MXC_BASE_I2CM1_RX_FIFO ((uint32_t)0x4010D800UL) |
mbed_official | 507:d4fc7603a669 | 370 | |
mbed_official | 507:d4fc7603a669 | 371 | #define MXC_I2CM_GET_IRQ(i) ((i) == 0 ? I2CM0_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 372 | (i) == 1 ? I2CM1_IRQn : 0) |
mbed_official | 507:d4fc7603a669 | 373 | |
mbed_official | 507:d4fc7603a669 | 374 | #define MXC_I2CM_GET_BASE(i) ((i) == 0 ? MXC_BASE_I2CM0 : \ |
mbed_official | 507:d4fc7603a669 | 375 | (i) == 1 ? MXC_BASE_I2CM1 : 0) |
mbed_official | 507:d4fc7603a669 | 376 | |
mbed_official | 507:d4fc7603a669 | 377 | #define MXC_I2CM_GET_I2CM(i) ((i) == 0 ? MXC_I2CM0 : \ |
mbed_official | 507:d4fc7603a669 | 378 | (i) == 1 ? MXC_I2CM1 : 0) |
mbed_official | 507:d4fc7603a669 | 379 | |
mbed_official | 507:d4fc7603a669 | 380 | #define MXC_I2CM_GET_BASE_TX_FIFO(i) ((i) == 0 ? MXC_BASE_I2CM0_TX_FIFO : \ |
mbed_official | 507:d4fc7603a669 | 381 | (i) == 1 ? MXC_BASE_I2CM1_TX_FIFO : 0) |
mbed_official | 507:d4fc7603a669 | 382 | |
mbed_official | 507:d4fc7603a669 | 383 | #define MXC_I2CM_GET_BASE_RX_FIFO(i) ((i) == 0 ? MXC_BASE_I2CM0_RX_FIFO : \ |
mbed_official | 507:d4fc7603a669 | 384 | (i) == 1 ? MXC_BASE_I2CM1_RX_FIFO : 0) |
mbed_official | 507:d4fc7603a669 | 385 | |
mbed_official | 507:d4fc7603a669 | 386 | #define MXC_I2CM_INSTANCE_TO_BASE(instance) (((uint32_t)(instance) << 13) + MXC_BASE_I2CM0) |
mbed_official | 507:d4fc7603a669 | 387 | #define MXC_I2CM_BASE_TO_INSTANCE(base) (((uint32_t)(base) & 0x00002000) >> 13) |
mbed_official | 507:d4fc7603a669 | 388 | |
mbed_official | 507:d4fc7603a669 | 389 | |
mbed_official | 507:d4fc7603a669 | 390 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 391 | /* I2C Slave Interface */ |
mbed_official | 507:d4fc7603a669 | 392 | |
mbed_official | 507:d4fc7603a669 | 393 | #define MXC_CFG_I2CS_INSTANCES (1) |
mbed_official | 507:d4fc7603a669 | 394 | |
mbed_official | 507:d4fc7603a669 | 395 | #define MXC_BASE_I2CS0 ((uint32_t)0x40041000UL) |
mbed_official | 507:d4fc7603a669 | 396 | #define MXC_BASE_I2CS0_BITBAND ((uint32_t)0x42820000UL) |
mbed_official | 507:d4fc7603a669 | 397 | #define MXC_I2CS0 ((mxc_i2cs_regs_t *)MXC_BASE_I2CS0) |
mbed_official | 507:d4fc7603a669 | 398 | |
mbed_official | 507:d4fc7603a669 | 399 | #define MXC_BASE_I2CS0_FIFO ((uint32_t)0x40104000UL) |
mbed_official | 507:d4fc7603a669 | 400 | #define MXC_I2CS0_FIFO ((mxc_i2cs_fifo_regs_t *)MXC_BASE_I2CS0) |
mbed_official | 507:d4fc7603a669 | 401 | |
mbed_official | 507:d4fc7603a669 | 402 | |
mbed_official | 507:d4fc7603a669 | 403 | |
mbed_official | 507:d4fc7603a669 | 404 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 405 | /* DACs */ |
mbed_official | 507:d4fc7603a669 | 406 | |
mbed_official | 507:d4fc7603a669 | 407 | #define MXC_CFG_DAC_INSTANCES (4) |
mbed_official | 507:d4fc7603a669 | 408 | #define MXC_CFG_DAC_FIFO_DEPTH (32) |
mbed_official | 507:d4fc7603a669 | 409 | |
mbed_official | 507:d4fc7603a669 | 410 | #define MXC_BASE_DAC0 ((uint32_t)0x40050000UL) |
mbed_official | 507:d4fc7603a669 | 411 | #define MXC_DAC0 ((mxc_dac_regs_t *)MXC_BASE_DAC0) |
mbed_official | 507:d4fc7603a669 | 412 | #define MXC_BASE_DAC0_FIFO ((uint32_t)0x40105000UL) |
mbed_official | 507:d4fc7603a669 | 413 | #define MXC_DAC0_FIFO ((mxc_dac_fifo_regs_t *)MXC_BASE_DAC0_FIFO) |
mbed_official | 507:d4fc7603a669 | 414 | #define MXC_DAC0_WIDTH ((uint8_t)(2)) |
mbed_official | 507:d4fc7603a669 | 415 | |
mbed_official | 507:d4fc7603a669 | 416 | #define MXC_BASE_DAC1 ((uint32_t)0x40051000UL) |
mbed_official | 507:d4fc7603a669 | 417 | #define MXC_DAC1 ((mxc_dac_regs_t *)MXC_BASE_DAC1) |
mbed_official | 507:d4fc7603a669 | 418 | #define MXC_BASE_DAC1_FIFO ((uint32_t)0x40106000UL) |
mbed_official | 507:d4fc7603a669 | 419 | #define MXC_DAC1_FIFO ((mxc_dac_fifo_regs_t *)MXC_BASE_DAC1_FIFO) |
mbed_official | 507:d4fc7603a669 | 420 | #define MXC_DAC1_WIDTH ((uint8_t)(2)) |
mbed_official | 507:d4fc7603a669 | 421 | |
mbed_official | 507:d4fc7603a669 | 422 | #define MXC_BASE_DAC2 ((uint32_t)0x40052000UL) |
mbed_official | 507:d4fc7603a669 | 423 | #define MXC_DAC2 ((mxc_dac_regs_t *)MXC_BASE_DAC2) |
mbed_official | 507:d4fc7603a669 | 424 | #define MXC_BASE_DAC2_FIFO ((uint32_t)0x40107000UL) |
mbed_official | 507:d4fc7603a669 | 425 | #define MXC_DAC2_FIFO ((mxc_dac_fifo_regs_t *)MXC_BASE_DAC2_FIFO) |
mbed_official | 507:d4fc7603a669 | 426 | #define MXC_DAC2_WIDTH ((uint8_t)(1)) |
mbed_official | 507:d4fc7603a669 | 427 | |
mbed_official | 507:d4fc7603a669 | 428 | #define MXC_BASE_DAC3 ((uint32_t)0x40053000UL) |
mbed_official | 507:d4fc7603a669 | 429 | #define MXC_DAC3 ((mxc_dac_regs_t *)MXC_BASE_DAC3) |
mbed_official | 507:d4fc7603a669 | 430 | #define MXC_BASE_DAC3_FIFO ((uint32_t)0x40108000UL) |
mbed_official | 507:d4fc7603a669 | 431 | #define MXC_DAC3_FIFO ((mxc_dac_fifo_regs_t *)MXC_BASE_DAC3_FIFO) |
mbed_official | 507:d4fc7603a669 | 432 | #define MXC_DAC3_WIDTH ((uint8_t)(1)) |
mbed_official | 507:d4fc7603a669 | 433 | |
mbed_official | 507:d4fc7603a669 | 434 | |
mbed_official | 507:d4fc7603a669 | 435 | #define MXC_DAC_GET_IRQ(i) ((i) == 0 ? DAC0_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 436 | (i) == 1 ? DAC1_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 437 | (i) == 2 ? DAC2_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 438 | (i) == 3 ? DAC3_IRQn : 0) |
mbed_official | 507:d4fc7603a669 | 439 | |
mbed_official | 507:d4fc7603a669 | 440 | |
mbed_official | 507:d4fc7603a669 | 441 | #define MXC_DAC_GET_BASE(i) (i == 0 ? MXC_BASE_DAC0 : \ |
mbed_official | 507:d4fc7603a669 | 442 | i == 1 ? MXC_BASE_DAC1 : \ |
mbed_official | 507:d4fc7603a669 | 443 | i == 2 ? MXC_BASE_DAC2 : \ |
mbed_official | 507:d4fc7603a669 | 444 | i == 3 ? MXC_BASE_DAC3 : 0) |
mbed_official | 507:d4fc7603a669 | 445 | |
mbed_official | 507:d4fc7603a669 | 446 | #define MXC_DAC_GET_FIFO(i) (i == 0 ? MXC_BASE_DAC0_FIFO : \ |
mbed_official | 507:d4fc7603a669 | 447 | i == 1 ? MXC_BASE_DAC1_FIFO : \ |
mbed_official | 507:d4fc7603a669 | 448 | i == 2 ? MXC_BASE_DAC2_FIFO : \ |
mbed_official | 507:d4fc7603a669 | 449 | i == 3 ? MXC_BASE_DAC3_FIFO : 0) |
mbed_official | 507:d4fc7603a669 | 450 | |
mbed_official | 507:d4fc7603a669 | 451 | #define MXC_DAC_GET_PMU_FIFO_IRQ(i) (i == 0 ? PMU_IRQ_DAC0_FIFO_AE : \ |
mbed_official | 507:d4fc7603a669 | 452 | i == 1 ? PMU_IRQ_DAC1_FIFO_AE : \ |
mbed_official | 507:d4fc7603a669 | 453 | i == 2 ? PMU_IRQ_DAC2_FIFO_AE : \ |
mbed_official | 507:d4fc7603a669 | 454 | i == 3 ? PMU_IRQ_DAC3_FIFO_AE : 0) |
mbed_official | 507:d4fc7603a669 | 455 | |
mbed_official | 507:d4fc7603a669 | 456 | #define MXC_DAC_GET_DAC(i) (i == 0 ? MXC_DAC0 : \ |
mbed_official | 507:d4fc7603a669 | 457 | i == 1 ? MXC_DAC1 : \ |
mbed_official | 507:d4fc7603a669 | 458 | i == 2 ? MXC_DAC2 : \ |
mbed_official | 507:d4fc7603a669 | 459 | i == 3 ? MXC_DAC3 : 0) |
mbed_official | 507:d4fc7603a669 | 460 | |
mbed_official | 507:d4fc7603a669 | 461 | #define MXC_DAC_GET_WIDTH(i) (i == 0 ? MXC_DAC0_WIDTH : \ |
mbed_official | 507:d4fc7603a669 | 462 | i == 1 ? MXC_DAC1_WIDTH : \ |
mbed_official | 507:d4fc7603a669 | 463 | i == 2 ? MXC_DAC2_WIDTH : \ |
mbed_official | 507:d4fc7603a669 | 464 | i == 3 ? MXC_DAC3_WIDTH : 0) |
mbed_official | 507:d4fc7603a669 | 465 | |
mbed_official | 507:d4fc7603a669 | 466 | |
mbed_official | 507:d4fc7603a669 | 467 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 468 | /* Analog Front End */ |
mbed_official | 507:d4fc7603a669 | 469 | |
mbed_official | 507:d4fc7603a669 | 470 | #define MXC_BASE_AFE ((uint32_t)0x4005401CUL) |
mbed_official | 507:d4fc7603a669 | 471 | #define MXC_AFE ((mxc_afe_regs_t *)MXC_BASE_AFE) |
mbed_official | 507:d4fc7603a669 | 472 | |
mbed_official | 507:d4fc7603a669 | 473 | |
mbed_official | 507:d4fc7603a669 | 474 | |
mbed_official | 507:d4fc7603a669 | 475 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 476 | /* ADC */ |
mbed_official | 507:d4fc7603a669 | 477 | |
mbed_official | 507:d4fc7603a669 | 478 | #define MXC_CFG_ADC_FIFO_DEPTH ((uint32_t)(32)) |
mbed_official | 507:d4fc7603a669 | 479 | |
mbed_official | 507:d4fc7603a669 | 480 | #define MXC_BASE_ADC ((uint32_t)0x40054000UL) |
mbed_official | 507:d4fc7603a669 | 481 | #define MXC_ADC ((mxc_adc_regs_t *)MXC_BASE_ADC) |
mbed_official | 507:d4fc7603a669 | 482 | |
mbed_official | 507:d4fc7603a669 | 483 | #define MXC_BASE_ADCCFG ((uint32_t)0x40054038UL) |
mbed_official | 507:d4fc7603a669 | 484 | #define MXC_ADCCFG ((mxc_adccfg_regs_t *)MXC_BASE_ADCCFG) |
mbed_official | 507:d4fc7603a669 | 485 | |
mbed_official | 507:d4fc7603a669 | 486 | #define MXC_BASE_ADC_FIFO ((uint32_t)0x40109000UL) |
mbed_official | 507:d4fc7603a669 | 487 | #define MXC_ADC_FIFO ((mxc_adc_fifo_regs_t *)MXC_BASE_ADC_FIFO) |
mbed_official | 507:d4fc7603a669 | 488 | |
mbed_official | 507:d4fc7603a669 | 489 | |
mbed_official | 507:d4fc7603a669 | 490 | |
mbed_official | 507:d4fc7603a669 | 491 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 492 | /* Peripheral Management Unit (PMU) - formerly DMA Controller */ |
mbed_official | 507:d4fc7603a669 | 493 | |
mbed_official | 507:d4fc7603a669 | 494 | #define MXC_CFG_PMU_CHANNELS (6) |
mbed_official | 507:d4fc7603a669 | 495 | |
mbed_official | 507:d4fc7603a669 | 496 | #define MXC_BASE_PMU0 ((uint32_t)0x40070000UL) |
mbed_official | 507:d4fc7603a669 | 497 | #define MXC_PMU0 ((mxc_pmu_regs_t *)MXC_BASE_PMU0) |
mbed_official | 507:d4fc7603a669 | 498 | #define MXC_BASE_PMU1 ((uint32_t)0x40070020UL) |
mbed_official | 507:d4fc7603a669 | 499 | #define MXC_PMU1 ((mxc_pmu_regs_t *)MXC_BASE_PMU1) |
mbed_official | 507:d4fc7603a669 | 500 | #define MXC_BASE_PMU2 ((uint32_t)0x40070040UL) |
mbed_official | 507:d4fc7603a669 | 501 | #define MXC_PMU2 ((mxc_pmu_regs_t *)MXC_BASE_PMU2) |
mbed_official | 507:d4fc7603a669 | 502 | #define MXC_BASE_PMU3 ((uint32_t)0x40070060UL) |
mbed_official | 507:d4fc7603a669 | 503 | #define MXC_PMU3 ((mxc_pmu_regs_t *)MXC_BASE_PMU3) |
mbed_official | 507:d4fc7603a669 | 504 | #define MXC_BASE_PMU4 ((uint32_t)0x40070080UL) |
mbed_official | 507:d4fc7603a669 | 505 | #define MXC_PMU4 ((mxc_pmu_regs_t *)MXC_BASE_PMU4) |
mbed_official | 507:d4fc7603a669 | 506 | #define MXC_BASE_PMU5 ((uint32_t)0x400700A0UL) |
mbed_official | 507:d4fc7603a669 | 507 | #define MXC_PMU5 ((mxc_pmu_regs_t *)MXC_BASE_PMU5) |
mbed_official | 507:d4fc7603a669 | 508 | |
mbed_official | 507:d4fc7603a669 | 509 | #define MXC_BASE_PMU_BITBAND ((uint32_t)0x42E00000UL) |
mbed_official | 507:d4fc7603a669 | 510 | #define MXC_BASE_PMU_BITBAND_CHOFFSET ((uint32_t)0x00000400UL) |
mbed_official | 507:d4fc7603a669 | 511 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 512 | |
mbed_official | 507:d4fc7603a669 | 513 | typedef enum { |
mbed_official | 507:d4fc7603a669 | 514 | PMU_IRQ_DAC0_FIFO_AE, |
mbed_official | 507:d4fc7603a669 | 515 | PMU_IRQ_DAC1_FIFO_AE, |
mbed_official | 507:d4fc7603a669 | 516 | PMU_IRQ_DAC2_FIFO_AE, |
mbed_official | 507:d4fc7603a669 | 517 | PMU_IRQ_DAC3_FIFO_AE, |
mbed_official | 507:d4fc7603a669 | 518 | PMU_IRQ_DAC0_DONE, |
mbed_official | 507:d4fc7603a669 | 519 | PMU_IRQ_DAC1_DONE, |
mbed_official | 507:d4fc7603a669 | 520 | PMU_IRQ_DAC2_DONE, |
mbed_official | 507:d4fc7603a669 | 521 | PMU_IRQ_DAC3_DONE, |
mbed_official | 507:d4fc7603a669 | 522 | PMU_IRQ_ADC_FIFO_AF, |
mbed_official | 507:d4fc7603a669 | 523 | PMU_IRQ_ADC_DONE, |
mbed_official | 507:d4fc7603a669 | 524 | PMU_IRQ_I2C_MST0_DONE, |
mbed_official | 507:d4fc7603a669 | 525 | PMU_IRQ_I2C_MST1_DONE, |
mbed_official | 507:d4fc7603a669 | 526 | PMU_IRQ_SPI0_RSLTS_DONE, |
mbed_official | 507:d4fc7603a669 | 527 | PMU_IRQ_SPI1_RSLTS_DONE, |
mbed_official | 507:d4fc7603a669 | 528 | PMU_IRQ_SPI2_RSLTS_DONE, |
mbed_official | 507:d4fc7603a669 | 529 | PMU_IRQ_MAA_DONE, |
mbed_official | 507:d4fc7603a669 | 530 | PMU_IRQ_SPI0_TX_FIFO_AE, |
mbed_official | 507:d4fc7603a669 | 531 | PMU_IRQ_SPI0_RSLTS_FIFO_AF, |
mbed_official | 507:d4fc7603a669 | 532 | PMU_IRQ_SPI1_TX_FIFO_AE, |
mbed_official | 507:d4fc7603a669 | 533 | PMU_IRQ_SPI1_RSLTS_FIFO_AF, |
mbed_official | 507:d4fc7603a669 | 534 | PMU_IRQ_SPI2_TX_FIFO_AE, |
mbed_official | 507:d4fc7603a669 | 535 | PMU_IRQ_SPI3_RSLTS_FIFO_AF, |
mbed_official | 507:d4fc7603a669 | 536 | PMU_IRQ_I2C_MST0_TRANS_FIFO, |
mbed_official | 507:d4fc7603a669 | 537 | PMU_IRQ_I2C_MST0_RSLT_FIFO, |
mbed_official | 507:d4fc7603a669 | 538 | PMU_IRQ_I2C_MST1_TRANS_FIFO, |
mbed_official | 507:d4fc7603a669 | 539 | PMU_IRQ_I2C_MST2_RSLT_FIFO, |
mbed_official | 507:d4fc7603a669 | 540 | PMU_IRQ_I2C_SLV_TRANS_FIFO, |
mbed_official | 507:d4fc7603a669 | 541 | PMU_IRQ_I2C_SLV_RSLT_FIFO, |
mbed_official | 507:d4fc7603a669 | 542 | PMU_IRQ_UART0_TX_FIFO, |
mbed_official | 507:d4fc7603a669 | 543 | PMU_IRQ_UART0_RX_FIFO, |
mbed_official | 507:d4fc7603a669 | 544 | PMU_IRQ_UART1_TX_FIFO, |
mbed_official | 507:d4fc7603a669 | 545 | PMU_IRQ_UART1_RX_FIFO, |
mbed_official | 507:d4fc7603a669 | 546 | PMU_IRQ_SPI0_EXCP, |
mbed_official | 507:d4fc7603a669 | 547 | PMU_IRQ_SPI1_EXCP, |
mbed_official | 507:d4fc7603a669 | 548 | PMU_IRQ_SPI2_EXCP, |
mbed_official | 507:d4fc7603a669 | 549 | PMU_IRQ_RSVD0, |
mbed_official | 507:d4fc7603a669 | 550 | PMU_IRQ_I2C_MST0_EXCP, |
mbed_official | 507:d4fc7603a669 | 551 | PMU_IRQ_I2C_MST1_EXCP, |
mbed_official | 507:d4fc7603a669 | 552 | PMU_IRQ_I2C_SLV_EXCP, |
mbed_official | 507:d4fc7603a669 | 553 | PMU_IRQ_RSVD1, |
mbed_official | 507:d4fc7603a669 | 554 | PMU_IRQ_GPIO0, |
mbed_official | 507:d4fc7603a669 | 555 | PMU_IRQ_GPIO1, |
mbed_official | 507:d4fc7603a669 | 556 | PMU_IRQ_GPIO2, |
mbed_official | 507:d4fc7603a669 | 557 | PMU_IRQ_GPIO3, |
mbed_official | 507:d4fc7603a669 | 558 | PMU_IRQ_GPIO4, |
mbed_official | 507:d4fc7603a669 | 559 | PMU_IRQ_GPIO5, |
mbed_official | 507:d4fc7603a669 | 560 | PMU_IRQ_GPIO6, |
mbed_official | 507:d4fc7603a669 | 561 | PMU_IRQ_GPIO7, |
mbed_official | 507:d4fc7603a669 | 562 | PMU_IRQ_GPIO8, |
mbed_official | 507:d4fc7603a669 | 563 | PMU_IRQ_AFE_COMP_NMI, |
mbed_official | 507:d4fc7603a669 | 564 | PMU_IRQ_AES_ENGINE, |
mbed_official | 507:d4fc7603a669 | 565 | } pmu_int_mask_t; |
mbed_official | 507:d4fc7603a669 | 566 | |
mbed_official | 507:d4fc7603a669 | 567 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 568 | /* USB */ |
mbed_official | 507:d4fc7603a669 | 569 | |
mbed_official | 507:d4fc7603a669 | 570 | #define MXC_BASE_USB ((uint32_t)0x4010C000UL) |
mbed_official | 507:d4fc7603a669 | 571 | #define MXC_USB ((mxc_usb_regs_t *)MXC_BASE_USB) |
mbed_official | 507:d4fc7603a669 | 572 | |
mbed_official | 507:d4fc7603a669 | 573 | #define MXC_USB_MAX_PACKET (64) |
mbed_official | 507:d4fc7603a669 | 574 | #define MXC_USB_NUM_EP (8) |
mbed_official | 507:d4fc7603a669 | 575 | |
mbed_official | 507:d4fc7603a669 | 576 | |
mbed_official | 507:d4fc7603a669 | 577 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 578 | /* Instruction Cache Controller */ |
mbed_official | 507:d4fc7603a669 | 579 | |
mbed_official | 507:d4fc7603a669 | 580 | #define MXC_BASE_ICC ((uint32_t)0x40080000UL) |
mbed_official | 507:d4fc7603a669 | 581 | #define MXC_ICC ((mxc_icc_regs_t *)MXC_BASE_ICC) |
mbed_official | 507:d4fc7603a669 | 582 | |
mbed_official | 507:d4fc7603a669 | 583 | /* System Manager */ |
mbed_official | 507:d4fc7603a669 | 584 | |
mbed_official | 507:d4fc7603a669 | 585 | #define MXC_BASE_SYSMAN ((uint32_t)0x40090000UL) |
mbed_official | 507:d4fc7603a669 | 586 | |
mbed_official | 507:d4fc7603a669 | 587 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 588 | /* Clock Manager */ |
mbed_official | 507:d4fc7603a669 | 589 | |
mbed_official | 507:d4fc7603a669 | 590 | #define MXC_BASE_CLKMAN ((uint32_t)0x40090400UL) |
mbed_official | 507:d4fc7603a669 | 591 | #define MXC_CLKMAN ((mxc_clkman_regs_t *)MXC_BASE_CLKMAN) |
mbed_official | 507:d4fc7603a669 | 592 | |
mbed_official | 507:d4fc7603a669 | 593 | |
mbed_official | 507:d4fc7603a669 | 594 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 595 | /* Power Manager */ |
mbed_official | 507:d4fc7603a669 | 596 | |
mbed_official | 507:d4fc7603a669 | 597 | #define MXC_BASE_PWRMAN ((uint32_t)0x40090800UL) |
mbed_official | 507:d4fc7603a669 | 598 | #define MXC_PWRMAN ((mxc_pwrman_regs_t *)MXC_BASE_PWRMAN) |
mbed_official | 507:d4fc7603a669 | 599 | |
mbed_official | 507:d4fc7603a669 | 600 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 601 | /* I/O Manager */ |
mbed_official | 507:d4fc7603a669 | 602 | |
mbed_official | 507:d4fc7603a669 | 603 | #define MXC_BASE_IOMAN ((uint32_t)0x40090C00UL) |
mbed_official | 507:d4fc7603a669 | 604 | #define MXC_IOMAN ((mxc_ioman_regs_t *)MXC_BASE_IOMAN) |
mbed_official | 507:d4fc7603a669 | 605 | |
mbed_official | 507:d4fc7603a669 | 606 | |
mbed_official | 507:d4fc7603a669 | 607 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 608 | /* RTC: Timer/Alarms */ |
mbed_official | 507:d4fc7603a669 | 609 | |
mbed_official | 507:d4fc7603a669 | 610 | #define MXC_BASE_RTCTMR ((uint32_t)0x40090A00UL) |
mbed_official | 507:d4fc7603a669 | 611 | #define MXC_RTCTMR ((mxc_rtctmr_regs_t *)MXC_BASE_RTCTMR) |
mbed_official | 507:d4fc7603a669 | 612 | |
mbed_official | 507:d4fc7603a669 | 613 | #define MXC_RTCTMR_GET_IRQ(i) (i == 0 ? RTC0_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 614 | i == 1 ? RTC1_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 615 | i == 2 ? RTC2_IRQn : \ |
mbed_official | 507:d4fc7603a669 | 616 | i == 3 ? RTC3_IRQn : 0) |
mbed_official | 507:d4fc7603a669 | 617 | |
mbed_official | 507:d4fc7603a669 | 618 | #define MXC_BASE_RTCCFG ((uint32_t)0x40090A70UL) |
mbed_official | 507:d4fc7603a669 | 619 | #define MXC_RTCCFG ((mxc_rtccfg_regs_t *)MXC_BASE_RTCCFG) |
mbed_official | 507:d4fc7603a669 | 620 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 621 | /* RTC: Power Sequencer */ |
mbed_official | 507:d4fc7603a669 | 622 | |
mbed_official | 507:d4fc7603a669 | 623 | #define MXC_BASE_PWRSEQ ((uint32_t)0x40090A30UL) |
mbed_official | 507:d4fc7603a669 | 624 | #define MXC_PWRSEQ ((mxc_pwrseq_regs_t *)MXC_BASE_PWRSEQ) |
mbed_official | 507:d4fc7603a669 | 625 | |
mbed_official | 507:d4fc7603a669 | 626 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 627 | /* Trim Shadow Registers */ |
mbed_official | 507:d4fc7603a669 | 628 | |
mbed_official | 507:d4fc7603a669 | 629 | #define MXC_BASE_TRIM ((uint32_t)0x400E0000UL) |
mbed_official | 507:d4fc7603a669 | 630 | #define MXC_TRIM ((mxc_ftr_regs_t *)MXC_BASE_TRIM) |
mbed_official | 507:d4fc7603a669 | 631 | |
mbed_official | 507:d4fc7603a669 | 632 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 633 | /* Flash Memory Controller / Security */ |
mbed_official | 507:d4fc7603a669 | 634 | |
mbed_official | 507:d4fc7603a669 | 635 | #define MXC_BASE_FLC ((uint32_t)0x400F0000UL) |
mbed_official | 507:d4fc7603a669 | 636 | #define MXC_FLC ((mxc_flc_regs_t *)MXC_BASE_FLC) |
mbed_official | 507:d4fc7603a669 | 637 | #define MXC_BASE_FLC_BITBAND ((uint32_t)0x43E00000UL) |
mbed_official | 507:d4fc7603a669 | 638 | #define MXC_FLC_PAGE_SIZE_SHIFT 11 |
mbed_official | 507:d4fc7603a669 | 639 | #define MXC_FLC_PAGE_SIZE (1 << MXC_FLC_PAGE_SIZE_SHIFT) |
mbed_official | 507:d4fc7603a669 | 640 | #define MXC_FLC_PAGE_ERASE_MSK ((~(1 << (MXC_FLC_PAGE_SIZE_SHIFT - 1))) >> MXC_FLC_PAGE_SIZE_SHIFT) << MXC_FLC_PAGE_SIZE_SHIFT |
mbed_official | 507:d4fc7603a669 | 641 | |
mbed_official | 507:d4fc7603a669 | 642 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 643 | |
mbed_official | 507:d4fc7603a669 | 644 | #define MXC_SET_FIELD(reg, clr, set) (*(volatile uint32_t *)reg = ((*(volatile uint32_t *)reg & ~clr) | set)) |
mbed_official | 507:d4fc7603a669 | 645 | |
mbed_official | 507:d4fc7603a669 | 646 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 647 | |
mbed_official | 507:d4fc7603a669 | 648 | #define BITBAND(reg, bit) ((0xf0000000 & (uint32_t)(reg)) + 0x2000000 + (((uint32_t)(reg) & 0x0fffffff) << 5) + ((bit) << 2)) |
mbed_official | 507:d4fc7603a669 | 649 | #define BITBAND_ClrBit(reg, bit) *(volatile uint32_t *)BITBAND(reg, bit) = 0 |
mbed_official | 507:d4fc7603a669 | 650 | #define BITBAND_SetBit(reg, bit) *(volatile uint32_t *)BITBAND(reg, bit) = 1 |
mbed_official | 507:d4fc7603a669 | 651 | #define BITBAND_GetBit(reg, bit) (*(volatile uint32_t *)BITBAND(reg, bit)) |
mbed_official | 507:d4fc7603a669 | 652 | |
mbed_official | 507:d4fc7603a669 | 653 | /*******************************************************************************/ |
mbed_official | 507:d4fc7603a669 | 654 | |
mbed_official | 507:d4fc7603a669 | 655 | #endif /* _MAX32610_H_ */ |