Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.
Dependents: 1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB
Fork of mbed by
TARGET_WIZWIKI_W7500ECO/W7500x.h@109:9296ab0bfc11, 2015-10-29 (annotated)
- Committer:
- Kojto
- Date:
- Thu Oct 29 08:40:18 2015 +0000
- Revision:
- 109:9296ab0bfc11
Release 109 of the mbed library
Changes:
- new platforms - NUCLEO_F042K6, WIZNWIKI_W7500ECO
- MTS targets - bootloaders update to 0.1.1
- STM F7 - RTC enable fixes
- STM F4 - i2c pending stop before start fix
- STM all targets - analogout normalization fix
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 109:9296ab0bfc11 | 1 | /**************************************************************************//** |
Kojto | 109:9296ab0bfc11 | 2 | * @file W7500x.h |
Kojto | 109:9296ab0bfc11 | 3 | * @brief CMSIS Cortex-M0 Core Peripheral Access Layer Header File for |
Kojto | 109:9296ab0bfc11 | 4 | * Device W7500x |
Kojto | 109:9296ab0bfc11 | 5 | * @version V3.01 |
Kojto | 109:9296ab0bfc11 | 6 | * @date 06. March 2012 |
Kojto | 109:9296ab0bfc11 | 7 | * |
Kojto | 109:9296ab0bfc11 | 8 | * @note |
Kojto | 109:9296ab0bfc11 | 9 | * Copyright (C) 2010-2012 ARM Limited. All rights reserved. |
Kojto | 109:9296ab0bfc11 | 10 | * |
Kojto | 109:9296ab0bfc11 | 11 | * @par |
Kojto | 109:9296ab0bfc11 | 12 | * ARM Limited (ARM) is supplying this software for use with Cortex-M |
Kojto | 109:9296ab0bfc11 | 13 | * processor based microcontrollers. This file can be freely distributed |
Kojto | 109:9296ab0bfc11 | 14 | * within development tools that are supporting such ARM based processors. |
Kojto | 109:9296ab0bfc11 | 15 | * |
Kojto | 109:9296ab0bfc11 | 16 | * @par |
Kojto | 109:9296ab0bfc11 | 17 | * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED |
Kojto | 109:9296ab0bfc11 | 18 | * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF |
Kojto | 109:9296ab0bfc11 | 19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. |
Kojto | 109:9296ab0bfc11 | 20 | * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR |
Kojto | 109:9296ab0bfc11 | 21 | * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. |
Kojto | 109:9296ab0bfc11 | 22 | * |
Kojto | 109:9296ab0bfc11 | 23 | ******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 24 | |
Kojto | 109:9296ab0bfc11 | 25 | |
Kojto | 109:9296ab0bfc11 | 26 | #ifndef W7500x_H |
Kojto | 109:9296ab0bfc11 | 27 | #define W7500x_H |
Kojto | 109:9296ab0bfc11 | 28 | |
Kojto | 109:9296ab0bfc11 | 29 | #ifdef __cplusplus |
Kojto | 109:9296ab0bfc11 | 30 | extern "C" { |
Kojto | 109:9296ab0bfc11 | 31 | #endif |
Kojto | 109:9296ab0bfc11 | 32 | |
Kojto | 109:9296ab0bfc11 | 33 | /** @addtogroup W7500x_Definitions W7500x Definitions |
Kojto | 109:9296ab0bfc11 | 34 | This file defines all structures and symbols for W7500x: |
Kojto | 109:9296ab0bfc11 | 35 | - registers and bitfields |
Kojto | 109:9296ab0bfc11 | 36 | - peripheral base address |
Kojto | 109:9296ab0bfc11 | 37 | - peripheral ID |
Kojto | 109:9296ab0bfc11 | 38 | - Peripheral definitions |
Kojto | 109:9296ab0bfc11 | 39 | @{ |
Kojto | 109:9296ab0bfc11 | 40 | */ |
Kojto | 109:9296ab0bfc11 | 41 | |
Kojto | 109:9296ab0bfc11 | 42 | |
Kojto | 109:9296ab0bfc11 | 43 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 44 | /* Processor and Core Peripherals */ |
Kojto | 109:9296ab0bfc11 | 45 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 46 | /** @addtogroup W7500x_CMSIS Device CMSIS Definitions |
Kojto | 109:9296ab0bfc11 | 47 | Configuration of the Cortex-M0 Processor and Core Peripherals |
Kojto | 109:9296ab0bfc11 | 48 | @{ |
Kojto | 109:9296ab0bfc11 | 49 | */ |
Kojto | 109:9296ab0bfc11 | 50 | |
Kojto | 109:9296ab0bfc11 | 51 | /* |
Kojto | 109:9296ab0bfc11 | 52 | * ========================================================================== |
Kojto | 109:9296ab0bfc11 | 53 | * ---------- Interrupt Number Definition ----------------------------------- |
Kojto | 109:9296ab0bfc11 | 54 | * ========================================================================== |
Kojto | 109:9296ab0bfc11 | 55 | */ |
Kojto | 109:9296ab0bfc11 | 56 | |
Kojto | 109:9296ab0bfc11 | 57 | typedef enum IRQn |
Kojto | 109:9296ab0bfc11 | 58 | { |
Kojto | 109:9296ab0bfc11 | 59 | /****** Cortex-M0 Processor Exceptions Numbers **************************************************/ |
Kojto | 109:9296ab0bfc11 | 60 | |
Kojto | 109:9296ab0bfc11 | 61 | /* ToDo: use this Cortex interrupt numbers if your device is a CORTEX-M0 device */ |
Kojto | 109:9296ab0bfc11 | 62 | NonMaskableInt_IRQn = -14, /*!< 2 Cortex-M0 Non Maskable Interrupt */ |
Kojto | 109:9296ab0bfc11 | 63 | HardFault_IRQn = -13, /*!< 3 Cortex-M0 Hard Fault Interrupt */ |
Kojto | 109:9296ab0bfc11 | 64 | SVCall_IRQn = -5, /*!< 11 Cortex-M0 SV Call Interrupt */ |
Kojto | 109:9296ab0bfc11 | 65 | PendSV_IRQn = -2, /*!< 14 Cortex-M0 Pend SV Interrupt */ |
Kojto | 109:9296ab0bfc11 | 66 | SysTick_IRQn = -1, /*!< 15 Cortex-M0 System Tick Interrupt */ |
Kojto | 109:9296ab0bfc11 | 67 | /****** W7500x Specific Interrupt Numbers *********************************************************/ |
Kojto | 109:9296ab0bfc11 | 68 | SSP0_IRQn = 0, /*!< SSP 0 Interrupt */ |
Kojto | 109:9296ab0bfc11 | 69 | SSP1_IRQn = 1, /*!< SSP 1 Interrupt */ |
Kojto | 109:9296ab0bfc11 | 70 | UART0_IRQn = 2, /*!< UART 0 Interrupt */ |
Kojto | 109:9296ab0bfc11 | 71 | UART1_IRQn = 3, /*!< UART 1 Interrupt */ |
Kojto | 109:9296ab0bfc11 | 72 | UART2_IRQn = 4, /*!< UART 2 Interrupt */ |
Kojto | 109:9296ab0bfc11 | 73 | I2C0_IRQn = 5, /*!< I2C 0 Interrupt */ |
Kojto | 109:9296ab0bfc11 | 74 | I2C1_IRQn = 6, /*!< I2C 1 Interrupt */ |
Kojto | 109:9296ab0bfc11 | 75 | PORT0_IRQn = 7, /*!< Port 1 combined Interrupt */ |
Kojto | 109:9296ab0bfc11 | 76 | PORT1_IRQn = 8, /*!< Port 2 combined Interrupt */ |
Kojto | 109:9296ab0bfc11 | 77 | PORT2_IRQn = 9, /*!< Port 2 combined Interrupt */ |
Kojto | 109:9296ab0bfc11 | 78 | PORT3_IRQn = 10, /*!< Port 2 combined Interrupt */ |
Kojto | 109:9296ab0bfc11 | 79 | DMA_IRQn = 11, /*!< DMA combined Interrupt */ |
Kojto | 109:9296ab0bfc11 | 80 | DUALTIMER0_IRQn = 12, /*!< Dual Timer 0 Interrupt */ |
Kojto | 109:9296ab0bfc11 | 81 | DUALTIMER1_IRQn = 13, /*!< Dual Timer 1 Interrupt */ |
Kojto | 109:9296ab0bfc11 | 82 | PWM0_IRQn = 14, /*!< PWM 0 Interrupt */ |
Kojto | 109:9296ab0bfc11 | 83 | PWM1_IRQn = 15, /*!< PWM 1 Interrupt */ |
Kojto | 109:9296ab0bfc11 | 84 | PWM2_IRQn = 16, /*!< PWM 2 Interrupt */ |
Kojto | 109:9296ab0bfc11 | 85 | PWM3_IRQn = 17, /*!< PWM 3 Interrupt */ |
Kojto | 109:9296ab0bfc11 | 86 | PWM4_IRQn = 18, /*!< PWM 4 Interrupt */ |
Kojto | 109:9296ab0bfc11 | 87 | PWM5_IRQn = 19, /*!< PWM 5 Interrupt */ |
Kojto | 109:9296ab0bfc11 | 88 | PWM6_IRQn = 20, /*!< PWM 6 Interrupt */ |
Kojto | 109:9296ab0bfc11 | 89 | PWM7_IRQn = 21, /*!< PWM 7 Interrupt */ |
Kojto | 109:9296ab0bfc11 | 90 | RTC_IRQn = 22, /*!< RTC Interrupt */ |
Kojto | 109:9296ab0bfc11 | 91 | ADC_IRQn = 23, /*!< ADC Interrupt */ |
Kojto | 109:9296ab0bfc11 | 92 | WZTOE_IRQn = 24, /*!< WZTOE Interrupt */ |
Kojto | 109:9296ab0bfc11 | 93 | EXTI_IRQn = 25 /*!< EXTI Interrupt */ |
Kojto | 109:9296ab0bfc11 | 94 | } IRQn_Type; |
Kojto | 109:9296ab0bfc11 | 95 | |
Kojto | 109:9296ab0bfc11 | 96 | /* |
Kojto | 109:9296ab0bfc11 | 97 | * ========================================================================== |
Kojto | 109:9296ab0bfc11 | 98 | * ----------- Processor and Core Peripheral Section ------------------------ |
Kojto | 109:9296ab0bfc11 | 99 | * ========================================================================== |
Kojto | 109:9296ab0bfc11 | 100 | */ |
Kojto | 109:9296ab0bfc11 | 101 | |
Kojto | 109:9296ab0bfc11 | 102 | /* Configuration of the Cortex-M0 Processor and Core Peripherals */ |
Kojto | 109:9296ab0bfc11 | 103 | #define __CM0_REV 0x0000 /*!< Core Revision r0p0 */ |
Kojto | 109:9296ab0bfc11 | 104 | #define __NVIC_PRIO_BITS 2 /*!< Number of Bits used for Priority Levels */ |
Kojto | 109:9296ab0bfc11 | 105 | #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */ |
Kojto | 109:9296ab0bfc11 | 106 | #define __MPU_PRESENT 0 /*!< MPU present or not */ |
Kojto | 109:9296ab0bfc11 | 107 | |
Kojto | 109:9296ab0bfc11 | 108 | /*@}*/ /* end of group W7500x_CMSIS */ |
Kojto | 109:9296ab0bfc11 | 109 | |
Kojto | 109:9296ab0bfc11 | 110 | |
Kojto | 109:9296ab0bfc11 | 111 | #include "core_cm0.h" /* Cortex-M0 processor and core peripherals */ |
Kojto | 109:9296ab0bfc11 | 112 | #include "system_W7500x.h" /* W7500x System include file */ |
Kojto | 109:9296ab0bfc11 | 113 | |
Kojto | 109:9296ab0bfc11 | 114 | |
Kojto | 109:9296ab0bfc11 | 115 | /** @addtogroup Exported_types |
Kojto | 109:9296ab0bfc11 | 116 | * @{ |
Kojto | 109:9296ab0bfc11 | 117 | */ |
Kojto | 109:9296ab0bfc11 | 118 | |
Kojto | 109:9296ab0bfc11 | 119 | typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus; |
Kojto | 109:9296ab0bfc11 | 120 | typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState; |
Kojto | 109:9296ab0bfc11 | 121 | #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE)) |
Kojto | 109:9296ab0bfc11 | 122 | |
Kojto | 109:9296ab0bfc11 | 123 | typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus; |
Kojto | 109:9296ab0bfc11 | 124 | |
Kojto | 109:9296ab0bfc11 | 125 | |
Kojto | 109:9296ab0bfc11 | 126 | |
Kojto | 109:9296ab0bfc11 | 127 | |
Kojto | 109:9296ab0bfc11 | 128 | /** |
Kojto | 109:9296ab0bfc11 | 129 | * @} |
Kojto | 109:9296ab0bfc11 | 130 | */ |
Kojto | 109:9296ab0bfc11 | 131 | |
Kojto | 109:9296ab0bfc11 | 132 | |
Kojto | 109:9296ab0bfc11 | 133 | |
Kojto | 109:9296ab0bfc11 | 134 | |
Kojto | 109:9296ab0bfc11 | 135 | /** @addtogroup Peripheral_registers_structures |
Kojto | 109:9296ab0bfc11 | 136 | * @{ |
Kojto | 109:9296ab0bfc11 | 137 | */ |
Kojto | 109:9296ab0bfc11 | 138 | |
Kojto | 109:9296ab0bfc11 | 139 | /** |
Kojto | 109:9296ab0bfc11 | 140 | * @brief Clock Reset Generator |
Kojto | 109:9296ab0bfc11 | 141 | */ |
Kojto | 109:9296ab0bfc11 | 142 | typedef struct |
Kojto | 109:9296ab0bfc11 | 143 | { |
Kojto | 109:9296ab0bfc11 | 144 | __IO uint32_t OSC_PDR; /*!< Oscillator power down register, Address offset : 0x00 */ |
Kojto | 109:9296ab0bfc11 | 145 | uint32_t RESERVED0[3]; |
Kojto | 109:9296ab0bfc11 | 146 | __IO uint32_t PLL_PDR; /*!< PLL power down register, Address offset : 0x10 */ |
Kojto | 109:9296ab0bfc11 | 147 | __IO uint32_t PLL_FCR; /*!< PLL frequency calculating register, Address offset : 0x14 */ |
Kojto | 109:9296ab0bfc11 | 148 | __IO uint32_t PLL_OER; /*!< PLL output enable register, Address offset : 0x18 */ |
Kojto | 109:9296ab0bfc11 | 149 | __IO uint32_t PLL_BPR; /*!< PLL bypass register, Address offset : 0x1c */ |
Kojto | 109:9296ab0bfc11 | 150 | __IO uint32_t PLL_IFSR; /*!< PLL input frequency select register, Address offset : 0x20 */ |
Kojto | 109:9296ab0bfc11 | 151 | uint32_t RESERVED1[3]; |
Kojto | 109:9296ab0bfc11 | 152 | __IO uint32_t FCLK_SSR; /*!< FCLK source select register, Address offset : 0x30 */ |
Kojto | 109:9296ab0bfc11 | 153 | __IO uint32_t FCLK_PVSR; /*!< FCLK prescale value select register, Address offset : 0x34 */ |
Kojto | 109:9296ab0bfc11 | 154 | uint32_t RESERVED2[2]; |
Kojto | 109:9296ab0bfc11 | 155 | __IO uint32_t SSPCLK_SSR; /*!< SSPCLK source select register, Address offset : 0x40 */ |
Kojto | 109:9296ab0bfc11 | 156 | __IO uint32_t SSPCLK_PVSR; /*!< SSPCLK prescale value select register, Address offset : 0x44 */ |
Kojto | 109:9296ab0bfc11 | 157 | uint32_t RESERVED3[6]; |
Kojto | 109:9296ab0bfc11 | 158 | __IO uint32_t ADCCLK_SSR; /*!< ADCCLK source select register, Address offset : 0x60 */ |
Kojto | 109:9296ab0bfc11 | 159 | __IO uint32_t ADCCLK_PVSR; /*!< ADCCLK prescale value select register, Address offset : 0x64 */ |
Kojto | 109:9296ab0bfc11 | 160 | uint32_t RESERVED4[2]; |
Kojto | 109:9296ab0bfc11 | 161 | __IO uint32_t TIMER0CLK_SSR; /*!< TIMER0CLK source select register, Address offset : 0x70 */ |
Kojto | 109:9296ab0bfc11 | 162 | __IO uint32_t TIMER0CLK_PVSR; /*!< TIMER0CLK prescale value select register, Address offset : 0x74 */ |
Kojto | 109:9296ab0bfc11 | 163 | uint32_t RESERVED5[2]; |
Kojto | 109:9296ab0bfc11 | 164 | __IO uint32_t TIMER1CLK_SSR; /*!< TIMER1CLK source select register, Address offset : 0x80 */ |
Kojto | 109:9296ab0bfc11 | 165 | __IO uint32_t TIMER1CLK_PVSR; /*!< TIMER1CLK prescale value select register, Address offset : 0x84 */ |
Kojto | 109:9296ab0bfc11 | 166 | uint32_t RESERVED6[10]; |
Kojto | 109:9296ab0bfc11 | 167 | __IO uint32_t PWM0CLK_SSR; /*!< PWM0CLK source select register, Address offset : 0xb0 */ |
Kojto | 109:9296ab0bfc11 | 168 | __IO uint32_t PWM0CLK_PVSR; /*!< PWM0CLK prescale value select register, Address offset : 0xb4 */ |
Kojto | 109:9296ab0bfc11 | 169 | uint32_t RESERVED7[2]; |
Kojto | 109:9296ab0bfc11 | 170 | __IO uint32_t PWM1CLK_SSR; /*!< PWM1CLK source select register, Address offset : 0xc0 */ |
Kojto | 109:9296ab0bfc11 | 171 | __IO uint32_t PWM1CLK_PVSR; /*!< PWM1CLK prescale value select register, Address offset : 0xc4 */ |
Kojto | 109:9296ab0bfc11 | 172 | uint32_t RESERVED8[2]; |
Kojto | 109:9296ab0bfc11 | 173 | __IO uint32_t PWM2CLK_SSR; /*!< PWM2CLK source select register, Address offset : 0xd0 */ |
Kojto | 109:9296ab0bfc11 | 174 | __IO uint32_t PWM2CLK_PVSR; /*!< PWM2CLK prescale value select register, Address offset : 0xd4 */ |
Kojto | 109:9296ab0bfc11 | 175 | uint32_t RESERVED9[2]; |
Kojto | 109:9296ab0bfc11 | 176 | __IO uint32_t PWM3CLK_SSR; /*!< PWM3CLK source select register, Address offset : 0xe0 */ |
Kojto | 109:9296ab0bfc11 | 177 | __IO uint32_t PWM3CLK_PVSR; /*!< PWM3CLK prescale value select register, Address offset : 0xe4 */ |
Kojto | 109:9296ab0bfc11 | 178 | uint32_t RESERVED10[2]; |
Kojto | 109:9296ab0bfc11 | 179 | __IO uint32_t PWM4CLK_SSR; /*!< PWM4CLK source select register, Address offset : 0xf0 */ |
Kojto | 109:9296ab0bfc11 | 180 | __IO uint32_t PWM4CLK_PVSR; /*!< PWM4CLK prescale value select register, Address offset : 0xf4 */ |
Kojto | 109:9296ab0bfc11 | 181 | uint32_t RESERVED11[2]; |
Kojto | 109:9296ab0bfc11 | 182 | __IO uint32_t PWM5CLK_SSR; /*!< PWM5CLK source select register, Address offset : 0x100 */ |
Kojto | 109:9296ab0bfc11 | 183 | __IO uint32_t PWM5LK_PVSR; /*!< PWM5CLK prescale value select register, Address offset : 0x104 */ |
Kojto | 109:9296ab0bfc11 | 184 | uint32_t RESERVED12[2]; |
Kojto | 109:9296ab0bfc11 | 185 | __IO uint32_t PWM6CLK_SSR; /*!< PWM6CLK source select register, Address offset : 0x110 */ |
Kojto | 109:9296ab0bfc11 | 186 | __IO uint32_t PWM6CLK_PVSR; /*!< PWM6CLK prescale value select register, Address offset : 0x114 */ |
Kojto | 109:9296ab0bfc11 | 187 | uint32_t RESERVED13[2]; |
Kojto | 109:9296ab0bfc11 | 188 | __IO uint32_t PWM7CLK_SSR; /*!< PWM7CLK source select register, Address offset : 0x120 */ |
Kojto | 109:9296ab0bfc11 | 189 | __IO uint32_t PWM7CLK_PVSR; /*!< PWM7CLK prescale value select register, Address offset : 0x124 */ |
Kojto | 109:9296ab0bfc11 | 190 | uint32_t RESERVED14[2]; |
Kojto | 109:9296ab0bfc11 | 191 | __IO uint32_t RTC_HS_SSR; /*!< RTC High Speed source select register, Address offset : 0x130 */ |
Kojto | 109:9296ab0bfc11 | 192 | __IO uint32_t RTC_HS_PVSR; /*!< RTC High Speed prescale value select register, Address offset : 0x134 */ |
Kojto | 109:9296ab0bfc11 | 193 | uint32_t RESERVED15; |
Kojto | 109:9296ab0bfc11 | 194 | __IO uint32_t RTC_SSR; /*!< RTC source select register, Address offset : 0x13c */ |
Kojto | 109:9296ab0bfc11 | 195 | |
Kojto | 109:9296ab0bfc11 | 196 | __IO uint32_t WDOGCLK_HS_SSR; /*!< WDOGCLK High Speed source select register, Address offset : 0x140 */ |
Kojto | 109:9296ab0bfc11 | 197 | __IO uint32_t WDOGCLK_HS_PVSR; /*!< WDOGCLK High Speed prescale value select register, Address offset : 0x144 */ |
Kojto | 109:9296ab0bfc11 | 198 | uint32_t RESERVED16; |
Kojto | 109:9296ab0bfc11 | 199 | __IO uint32_t WDOGCLK_SSR; /*!< WDOGCLK source select register, Address offset : 0x14c */ |
Kojto | 109:9296ab0bfc11 | 200 | |
Kojto | 109:9296ab0bfc11 | 201 | __IO uint32_t UARTCLK_SSR; /*!< UARTCLK source select register, Address offset : 0x150 */ |
Kojto | 109:9296ab0bfc11 | 202 | __IO uint32_t UARTCLK_PVSR; /*!< UARTCLK prescale value select register, Address offset : 0x154 */ |
Kojto | 109:9296ab0bfc11 | 203 | uint32_t RESERVED17[2]; |
Kojto | 109:9296ab0bfc11 | 204 | __IO uint32_t MIICLK_ECR; /*!< MII clock enable control register, Address offset : 0x160 */ |
Kojto | 109:9296ab0bfc11 | 205 | uint32_t RESERVED18[3]; |
Kojto | 109:9296ab0bfc11 | 206 | __IO uint32_t MONCLK_SSR; /*!< Monitoring clock source select I found Treasure was IoT Base Station in March.register, Address offset : 0x170 */ |
Kojto | 109:9296ab0bfc11 | 207 | }CRG_TypeDef; |
Kojto | 109:9296ab0bfc11 | 208 | |
Kojto | 109:9296ab0bfc11 | 209 | |
Kojto | 109:9296ab0bfc11 | 210 | /** |
Kojto | 109:9296ab0bfc11 | 211 | * @brief UART |
Kojto | 109:9296ab0bfc11 | 212 | */ |
Kojto | 109:9296ab0bfc11 | 213 | typedef struct |
Kojto | 109:9296ab0bfc11 | 214 | { |
Kojto | 109:9296ab0bfc11 | 215 | __IO uint32_t DR; /*!< Data, Address offset : 0x00 */ |
Kojto | 109:9296ab0bfc11 | 216 | union { |
Kojto | 109:9296ab0bfc11 | 217 | __I uint32_t RSR; /*!< Receive Status, Address offset : 0x04 */ |
Kojto | 109:9296ab0bfc11 | 218 | __O uint32_t ECR; /*!< Error Clear, Address offset : 0x04 */ |
Kojto | 109:9296ab0bfc11 | 219 | } STATUS; |
Kojto | 109:9296ab0bfc11 | 220 | uint32_t RESERVED0[4]; |
Kojto | 109:9296ab0bfc11 | 221 | __IO uint32_t FR; /*!< Flags, Address offset : 0x18 */ |
Kojto | 109:9296ab0bfc11 | 222 | uint32_t RESERVED1; |
Kojto | 109:9296ab0bfc11 | 223 | __IO uint32_t ILPR; /*!< IrDA Low-power Counter, Address offset : 0x20 */ |
Kojto | 109:9296ab0bfc11 | 224 | __IO uint32_t IBRD; /*!< Integer Baud Rate, Address offset : 0x24 */ |
Kojto | 109:9296ab0bfc11 | 225 | __IO uint32_t FBRD; /*!< Fractional Baud Rate, Address offset : 0x28 */ |
Kojto | 109:9296ab0bfc11 | 226 | __IO uint32_t LCR_H; /*!< Line Control, Address offset : 0x2C */ |
Kojto | 109:9296ab0bfc11 | 227 | __IO uint32_t CR; /*!< Control, Address offset : 0x30 */ |
Kojto | 109:9296ab0bfc11 | 228 | __IO uint32_t IFLS; /*!< Interrupt FIFO Level Select, Address offset : 0x34 */ |
Kojto | 109:9296ab0bfc11 | 229 | __IO uint32_t IMSC; /*!< Interrupt Mask Set / Clear, Address offset : 0x38 */ |
Kojto | 109:9296ab0bfc11 | 230 | __IO uint32_t RIS; /*!< Raw Interrupt Status , Address offset : 0x3C */ |
Kojto | 109:9296ab0bfc11 | 231 | __IO uint32_t MIS; /*!< Masked Interrupt Status , Address offset : 0x40 */ |
Kojto | 109:9296ab0bfc11 | 232 | __O uint32_t ICR; /*!< Interrupt Clear, Address offset : 0x44 */ |
Kojto | 109:9296ab0bfc11 | 233 | __IO uint32_t DMACR; /*!< DMA Control, Address offset : 0x48 */ |
Kojto | 109:9296ab0bfc11 | 234 | } UART_TypeDef; |
Kojto | 109:9296ab0bfc11 | 235 | |
Kojto | 109:9296ab0bfc11 | 236 | |
Kojto | 109:9296ab0bfc11 | 237 | /** |
Kojto | 109:9296ab0bfc11 | 238 | * @brief Simple UART |
Kojto | 109:9296ab0bfc11 | 239 | */ |
Kojto | 109:9296ab0bfc11 | 240 | typedef struct |
Kojto | 109:9296ab0bfc11 | 241 | { |
Kojto | 109:9296ab0bfc11 | 242 | __IO uint32_t DATA; /*!< Offset: 0x000 Data Register (R/W) */ |
Kojto | 109:9296ab0bfc11 | 243 | __IO uint32_t STATE; /*!< Offset: 0x004 Status Register (R/W) */ |
Kojto | 109:9296ab0bfc11 | 244 | __IO uint32_t CTRL; /*!< Offset: 0x008 Control Register (R/W) */ |
Kojto | 109:9296ab0bfc11 | 245 | union { |
Kojto | 109:9296ab0bfc11 | 246 | __I uint32_t STATUS; /*!< Offset: 0x00C Interrupt Status Register (R/ ) */ |
Kojto | 109:9296ab0bfc11 | 247 | __O uint32_t CLEAR; /*!< Offset: 0x00C Interrupt Clear Register ( /W) */ |
Kojto | 109:9296ab0bfc11 | 248 | }INT; |
Kojto | 109:9296ab0bfc11 | 249 | __IO uint32_t BAUDDIV; /*!< Offset: 0x010 Baudrate Divider Register (R/W) */ |
Kojto | 109:9296ab0bfc11 | 250 | |
Kojto | 109:9296ab0bfc11 | 251 | } S_UART_TypeDef; |
Kojto | 109:9296ab0bfc11 | 252 | |
Kojto | 109:9296ab0bfc11 | 253 | /** |
Kojto | 109:9296ab0bfc11 | 254 | * @brief Analog Digital Converter |
Kojto | 109:9296ab0bfc11 | 255 | */ |
Kojto | 109:9296ab0bfc11 | 256 | |
Kojto | 109:9296ab0bfc11 | 257 | typedef struct |
Kojto | 109:9296ab0bfc11 | 258 | { |
Kojto | 109:9296ab0bfc11 | 259 | __IO uint32_t ADC_CTR; /* ADC control register, Address offset : 0x000 */ |
Kojto | 109:9296ab0bfc11 | 260 | __IO uint32_t ADC_CHSEL; /* ADC channel select register, Address offset : 0x004 */ |
Kojto | 109:9296ab0bfc11 | 261 | __IO uint32_t ADC_START; /* ADC start register, Address offset : 0x008 */ |
Kojto | 109:9296ab0bfc11 | 262 | __I uint32_t ADC_DATA; /* ADC conversion data register, Address offset : 0x00c */ |
Kojto | 109:9296ab0bfc11 | 263 | __IO uint32_t ADC_INT; /* ADC interrupt register, Address offset : 0x010 */ |
Kojto | 109:9296ab0bfc11 | 264 | uint32_t RESERVED0[2]; |
Kojto | 109:9296ab0bfc11 | 265 | __IO uint32_t ADC_INTCLR; /* ADC interrupt clear register, Address offset : 0x01c */ |
Kojto | 109:9296ab0bfc11 | 266 | }ADC_TypeDef; |
Kojto | 109:9296ab0bfc11 | 267 | |
Kojto | 109:9296ab0bfc11 | 268 | /** |
Kojto | 109:9296ab0bfc11 | 269 | * @brief dualtimer |
Kojto | 109:9296ab0bfc11 | 270 | */ |
Kojto | 109:9296ab0bfc11 | 271 | typedef struct |
Kojto | 109:9296ab0bfc11 | 272 | { |
Kojto | 109:9296ab0bfc11 | 273 | __IO uint32_t TimerLoad; // <h> Timer Load </h> |
Kojto | 109:9296ab0bfc11 | 274 | __I uint32_t TimerValue; // <h> Timer Counter Current Value <r></h> |
Kojto | 109:9296ab0bfc11 | 275 | __IO uint32_t TimerControl; // <h> Timer Control |
Kojto | 109:9296ab0bfc11 | 276 | // <o.7> TimerEn: Timer Enable |
Kojto | 109:9296ab0bfc11 | 277 | // <o.6> TimerMode: Timer Mode |
Kojto | 109:9296ab0bfc11 | 278 | // <0=> Freerunning-mode |
Kojto | 109:9296ab0bfc11 | 279 | // <1=> Periodic mode |
Kojto | 109:9296ab0bfc11 | 280 | // <o.5> IntEnable: Interrupt Enable |
Kojto | 109:9296ab0bfc11 | 281 | // <o.2..3> TimerPre: Timer Prescale |
Kojto | 109:9296ab0bfc11 | 282 | // <0=> / 1 |
Kojto | 109:9296ab0bfc11 | 283 | // <1=> / 16 |
Kojto | 109:9296ab0bfc11 | 284 | // <2=> / 256 |
Kojto | 109:9296ab0bfc11 | 285 | // <3=> Undefined! |
Kojto | 109:9296ab0bfc11 | 286 | // <o.1> TimerSize: Timer Size |
Kojto | 109:9296ab0bfc11 | 287 | // <0=> 16-bit counter |
Kojto | 109:9296ab0bfc11 | 288 | // <1=> 32-bit counter |
Kojto | 109:9296ab0bfc11 | 289 | // <o.0> OneShot: One-shoot mode |
Kojto | 109:9296ab0bfc11 | 290 | // <0=> Wrapping mode |
Kojto | 109:9296ab0bfc11 | 291 | // <1=> One-shot mode |
Kojto | 109:9296ab0bfc11 | 292 | // </h> |
Kojto | 109:9296ab0bfc11 | 293 | __O uint32_t TimerIntClr; // <h> Timer Interrupt Clear <w></h> |
Kojto | 109:9296ab0bfc11 | 294 | __I uint32_t TimerRIS; // <h> Timer Raw Interrupt Status <r></h> |
Kojto | 109:9296ab0bfc11 | 295 | __I uint32_t TimerMIS; // <h> Timer Masked Interrupt Status <r></h> |
Kojto | 109:9296ab0bfc11 | 296 | __IO uint32_t TimerBGLoad; // <h> Background Load Register </h> |
Kojto | 109:9296ab0bfc11 | 297 | } DUALTIMER_TypeDef; |
Kojto | 109:9296ab0bfc11 | 298 | |
Kojto | 109:9296ab0bfc11 | 299 | /** |
Kojto | 109:9296ab0bfc11 | 300 | * @brief GPIO |
Kojto | 109:9296ab0bfc11 | 301 | */ |
Kojto | 109:9296ab0bfc11 | 302 | typedef struct |
Kojto | 109:9296ab0bfc11 | 303 | { |
Kojto | 109:9296ab0bfc11 | 304 | __IO uint32_t DATA; /* DATA Register (R/W), offset : 0x000 */ |
Kojto | 109:9296ab0bfc11 | 305 | __IO uint32_t DATAOUT; /* Data Output Latch Register (R/W), offset : 0x004 */ |
Kojto | 109:9296ab0bfc11 | 306 | uint32_t RESERVED0[2]; |
Kojto | 109:9296ab0bfc11 | 307 | __IO uint32_t OUTENSET; /* Output Enable Set Register (R/W) offset : 0x010 */ |
Kojto | 109:9296ab0bfc11 | 308 | __IO uint32_t OUTENCLR; /* Output Enable Clear Register (R/W) offset : 0x014 */ |
Kojto | 109:9296ab0bfc11 | 309 | __IO uint32_t RESERVED1; /* Alternate Function Set Register (R/W) offset : 0x018 */ |
Kojto | 109:9296ab0bfc11 | 310 | __IO uint32_t RESERVED2; /* Alternate Function Clear Register (R/W) offset : 0x01C */ |
Kojto | 109:9296ab0bfc11 | 311 | __IO uint32_t INTENSET; /* Interrupt Enable Set Register (R/W) offset : 0x020 */ |
Kojto | 109:9296ab0bfc11 | 312 | __IO uint32_t INTENCLR; /* Interrupt Enable Clear Register (R/W) offset : 0x024 */ |
Kojto | 109:9296ab0bfc11 | 313 | __IO uint32_t INTTYPESET; /* Interrupt Type Set Register (R/W) offset : 0x028 */ |
Kojto | 109:9296ab0bfc11 | 314 | __IO uint32_t INTTYPECLR; /* Interrupt Type Clear Register (R/W) offset : 0x02C */ |
Kojto | 109:9296ab0bfc11 | 315 | __IO uint32_t INTPOLSET; /* Interrupt Polarity Set Register (R/W) offset : 0x030 */ |
Kojto | 109:9296ab0bfc11 | 316 | __IO uint32_t INTPOLCLR; /* Interrupt Polarity Clear Register (R/W) offset : 0x034 */ |
Kojto | 109:9296ab0bfc11 | 317 | union { |
Kojto | 109:9296ab0bfc11 | 318 | __I uint32_t INTSTATUS; /* Interrupt Status Register (R/ ) offset : 0x038 */ |
Kojto | 109:9296ab0bfc11 | 319 | __O uint32_t INTCLEAR; /* Interrupt Clear Register ( /W) offset : 0x038 */ |
Kojto | 109:9296ab0bfc11 | 320 | }Interrupt; |
Kojto | 109:9296ab0bfc11 | 321 | uint32_t RESERVED3[241]; |
Kojto | 109:9296ab0bfc11 | 322 | __IO uint32_t LB_MASKED[256]; /* Lower byte Masked Access Register (R/W) offset : 0x400 - 0x7FC */ |
Kojto | 109:9296ab0bfc11 | 323 | __IO uint32_t UB_MASKED[256]; /* Upper byte Masked Access Register (R/W) offset : 0x800 - 0xBFC */ |
Kojto | 109:9296ab0bfc11 | 324 | } GPIO_TypeDef; |
Kojto | 109:9296ab0bfc11 | 325 | |
Kojto | 109:9296ab0bfc11 | 326 | typedef struct |
Kojto | 109:9296ab0bfc11 | 327 | { |
Kojto | 109:9296ab0bfc11 | 328 | __IO uint32_t Port[16]; /* Port_00, offset : 0x00 */ |
Kojto | 109:9296ab0bfc11 | 329 | /* Port_01, offset : 0x04 */ |
Kojto | 109:9296ab0bfc11 | 330 | /* Port_02, offset : 0x08 */ |
Kojto | 109:9296ab0bfc11 | 331 | /* Port_03, offset : 0x0C */ |
Kojto | 109:9296ab0bfc11 | 332 | /* Port_04, offset : 0x10 */ |
Kojto | 109:9296ab0bfc11 | 333 | /* Port_05, offset : 0x14 */ |
Kojto | 109:9296ab0bfc11 | 334 | /* Port_06, offset : 0x18 */ |
Kojto | 109:9296ab0bfc11 | 335 | /* Port_07, offset : 0x1C */ |
Kojto | 109:9296ab0bfc11 | 336 | /* Port_08, offset : 0x20 */ |
Kojto | 109:9296ab0bfc11 | 337 | /* Port_09, offset : 0x24 */ |
Kojto | 109:9296ab0bfc11 | 338 | /* Port_10, offset : 0x28 */ |
Kojto | 109:9296ab0bfc11 | 339 | /* Port_11, offset : 0x2C */ |
Kojto | 109:9296ab0bfc11 | 340 | /* Port_12, offset : 0x30 */ |
Kojto | 109:9296ab0bfc11 | 341 | /* Port_13, offset : 0x34 */ |
Kojto | 109:9296ab0bfc11 | 342 | /* Port_14, offset : 0x38 */ |
Kojto | 109:9296ab0bfc11 | 343 | /* Port_15, offset : 0x3C */ |
Kojto | 109:9296ab0bfc11 | 344 | } P_Port_Def; |
Kojto | 109:9296ab0bfc11 | 345 | |
Kojto | 109:9296ab0bfc11 | 346 | typedef struct |
Kojto | 109:9296ab0bfc11 | 347 | { |
Kojto | 109:9296ab0bfc11 | 348 | __IO uint32_t Port[5]; /* Port_00, offset : 0x00 */ |
Kojto | 109:9296ab0bfc11 | 349 | /* Port_01, offset : 0x04 */ |
Kojto | 109:9296ab0bfc11 | 350 | /* Port_02, offset : 0x08 */ |
Kojto | 109:9296ab0bfc11 | 351 | /* Port_03, offset : 0x0C */ |
Kojto | 109:9296ab0bfc11 | 352 | /* Port_04, offset : 0x10 */ |
Kojto | 109:9296ab0bfc11 | 353 | } P_Port_D_Def; |
Kojto | 109:9296ab0bfc11 | 354 | |
Kojto | 109:9296ab0bfc11 | 355 | /** |
Kojto | 109:9296ab0bfc11 | 356 | * @brief I2C Register structure definition |
Kojto | 109:9296ab0bfc11 | 357 | */ |
Kojto | 109:9296ab0bfc11 | 358 | typedef struct |
Kojto | 109:9296ab0bfc11 | 359 | { |
Kojto | 109:9296ab0bfc11 | 360 | __IO uint32_t PRER; //0x00 |
Kojto | 109:9296ab0bfc11 | 361 | __IO uint32_t CTR; //0x04 |
Kojto | 109:9296ab0bfc11 | 362 | __IO uint32_t CMDR; //0x08 |
Kojto | 109:9296ab0bfc11 | 363 | __I uint32_t SR; //0x0C |
Kojto | 109:9296ab0bfc11 | 364 | __IO uint32_t TSR; //0x10 |
Kojto | 109:9296ab0bfc11 | 365 | __IO uint32_t SADDR; //0x14 |
Kojto | 109:9296ab0bfc11 | 366 | __IO uint32_t TXR; //0x18 |
Kojto | 109:9296ab0bfc11 | 367 | __I uint32_t RXR; //0x1C |
Kojto | 109:9296ab0bfc11 | 368 | __I uint32_t ISR; //0x20 |
Kojto | 109:9296ab0bfc11 | 369 | __IO uint32_t ISCR; //0x24 |
Kojto | 109:9296ab0bfc11 | 370 | __IO uint32_t ISMR; //0x28 |
Kojto | 109:9296ab0bfc11 | 371 | }I2C_TypeDef; |
Kojto | 109:9296ab0bfc11 | 372 | |
Kojto | 109:9296ab0bfc11 | 373 | /** |
Kojto | 109:9296ab0bfc11 | 374 | * @brief PWM Register structure definition |
Kojto | 109:9296ab0bfc11 | 375 | */ |
Kojto | 109:9296ab0bfc11 | 376 | typedef struct |
Kojto | 109:9296ab0bfc11 | 377 | { |
Kojto | 109:9296ab0bfc11 | 378 | __IO uint32_t IER; //Interrupt enable register |
Kojto | 109:9296ab0bfc11 | 379 | // <7> IE7 : Channel 7 interrupt enable <R/W> |
Kojto | 109:9296ab0bfc11 | 380 | // <6> IE6 : Channel 6 interrupt enable <R/W> |
Kojto | 109:9296ab0bfc11 | 381 | // <5> IE5 : Channel 5 interrupt enable <R/W> |
Kojto | 109:9296ab0bfc11 | 382 | // <4> IE4 : Channel 4 interrupt enable <R/W> |
Kojto | 109:9296ab0bfc11 | 383 | // <3> IE3 : Channel 3 interrupt enable <R/W> |
Kojto | 109:9296ab0bfc11 | 384 | // <2> IE2 : Channel 2 interrupt enable <R/W> |
Kojto | 109:9296ab0bfc11 | 385 | // <1> IE1 : Channel 1 interrupt enable <R/W> |
Kojto | 109:9296ab0bfc11 | 386 | // <0> IE0 : Channel 0 interrupt enable <R/W> |
Kojto | 109:9296ab0bfc11 | 387 | |
Kojto | 109:9296ab0bfc11 | 388 | __IO uint32_t SSR; //Start Stop register |
Kojto | 109:9296ab0bfc11 | 389 | // <7> SS7 : Channel 7 TC start or stop <R/W> |
Kojto | 109:9296ab0bfc11 | 390 | // <6> SS6 : Channel 6 TC start or stop <R/W> |
Kojto | 109:9296ab0bfc11 | 391 | // <5> SS5 : Channel 5 TC start or stop <R/W> |
Kojto | 109:9296ab0bfc11 | 392 | // <4> SS4 : Channel 4 TC start or stop <R/W> |
Kojto | 109:9296ab0bfc11 | 393 | // <3> SS3 : Channel 3 TC start or stop <R/W> |
Kojto | 109:9296ab0bfc11 | 394 | // <2> SS2 : Channel 2 TC start or stop <R/W> |
Kojto | 109:9296ab0bfc11 | 395 | // <1> SS1 : Channel 1 TC start or stop <R/W> |
Kojto | 109:9296ab0bfc11 | 396 | // <0> SS0 : Channel 0 TC start or stop <R/W> |
Kojto | 109:9296ab0bfc11 | 397 | |
Kojto | 109:9296ab0bfc11 | 398 | __IO uint32_t PSR; //Pause register |
Kojto | 109:9296ab0bfc11 | 399 | // <7> PS7 : Channel 7 TC pasue <R/W> |
Kojto | 109:9296ab0bfc11 | 400 | // <6> PS6 : Channel 6 TC pasue <R/W> |
Kojto | 109:9296ab0bfc11 | 401 | // <5> PS5 : Channel 5 TC pasue <R/W> |
Kojto | 109:9296ab0bfc11 | 402 | // <4> PS4 : Channel 4 TC pasue <R/W> |
Kojto | 109:9296ab0bfc11 | 403 | // <3> PS3 : Channel 3 TC pasue <R/W> |
Kojto | 109:9296ab0bfc11 | 404 | // <2> PS2 : Channel 2 TC pasue <R/W> |
Kojto | 109:9296ab0bfc11 | 405 | // <1> PS1 : Channel 1 TC pasue <R/W> |
Kojto | 109:9296ab0bfc11 | 406 | // <0> PS0 : Channel 0 TC pasue <R/W> |
Kojto | 109:9296ab0bfc11 | 407 | } PWM_TypeDef; |
Kojto | 109:9296ab0bfc11 | 408 | |
Kojto | 109:9296ab0bfc11 | 409 | typedef struct |
Kojto | 109:9296ab0bfc11 | 410 | { |
Kojto | 109:9296ab0bfc11 | 411 | __I uint32_t IR; //Interrupt register |
Kojto | 109:9296ab0bfc11 | 412 | // <2> CI : Capture interrupt <R> |
Kojto | 109:9296ab0bfc11 | 413 | // <1> OI : Overflow interrupt <R> |
Kojto | 109:9296ab0bfc11 | 414 | // <0> MI : Match interrupt <R> |
Kojto | 109:9296ab0bfc11 | 415 | |
Kojto | 109:9296ab0bfc11 | 416 | __IO uint32_t IER; //Interrupt enable register |
Kojto | 109:9296ab0bfc11 | 417 | // <2> CIE : Capture interrupt enable <R/W> |
Kojto | 109:9296ab0bfc11 | 418 | // <1> OIE : Overflow interrupt enable <R/W> |
Kojto | 109:9296ab0bfc11 | 419 | // <0> MIE : Match interrupt enable <R/W> |
Kojto | 109:9296ab0bfc11 | 420 | |
Kojto | 109:9296ab0bfc11 | 421 | __O uint32_t ICR; //Interrupt clear register |
Kojto | 109:9296ab0bfc11 | 422 | // <2> CIC : Capture interrupt clear <W> |
Kojto | 109:9296ab0bfc11 | 423 | // <1> OIC : Overflow interrupt clear <W> |
Kojto | 109:9296ab0bfc11 | 424 | // <0> MIC : Match interrupt clear <W> |
Kojto | 109:9296ab0bfc11 | 425 | |
Kojto | 109:9296ab0bfc11 | 426 | __I uint32_t TCR; //Timer/Counter register |
Kojto | 109:9296ab0bfc11 | 427 | // <0..31> TCR : Timer/Counter register <R> |
Kojto | 109:9296ab0bfc11 | 428 | |
Kojto | 109:9296ab0bfc11 | 429 | __I uint32_t PCR; //Prescale counter register |
Kojto | 109:9296ab0bfc11 | 430 | // <0..5> PCR : Prescale Counter register <R> |
Kojto | 109:9296ab0bfc11 | 431 | |
Kojto | 109:9296ab0bfc11 | 432 | __IO uint32_t PR; //Prescale register |
Kojto | 109:9296ab0bfc11 | 433 | // <0..5> PR : prescale register <R/W> |
Kojto | 109:9296ab0bfc11 | 434 | |
Kojto | 109:9296ab0bfc11 | 435 | __IO uint32_t MR; //Match register |
Kojto | 109:9296ab0bfc11 | 436 | // <0..31> MR : Match register <R/W> |
Kojto | 109:9296ab0bfc11 | 437 | |
Kojto | 109:9296ab0bfc11 | 438 | __IO uint32_t LR; //Limit register |
Kojto | 109:9296ab0bfc11 | 439 | // <0..31> LR : Limit register <R/W> |
Kojto | 109:9296ab0bfc11 | 440 | __IO uint32_t UDMR; //Up-Down mode register |
Kojto | 109:9296ab0bfc11 | 441 | // <0> UDM : Up-down mode <R/W> |
Kojto | 109:9296ab0bfc11 | 442 | |
Kojto | 109:9296ab0bfc11 | 443 | __IO uint32_t TCMR; //Timer/Counter mode register |
Kojto | 109:9296ab0bfc11 | 444 | // <0> TCM : Timer/Counter mode <R/W> |
Kojto | 109:9296ab0bfc11 | 445 | |
Kojto | 109:9296ab0bfc11 | 446 | __IO uint32_t PEEER; //PWM output enable and external input enable register |
Kojto | 109:9296ab0bfc11 | 447 | // <0..1> PEEE : PWM output enable and external input enable <R/W> |
Kojto | 109:9296ab0bfc11 | 448 | |
Kojto | 109:9296ab0bfc11 | 449 | __IO uint32_t CMR; //Capture mode register |
Kojto | 109:9296ab0bfc11 | 450 | // <0> CM : Capture mode <R/W> |
Kojto | 109:9296ab0bfc11 | 451 | |
Kojto | 109:9296ab0bfc11 | 452 | __IO uint32_t CR; //Capture register |
Kojto | 109:9296ab0bfc11 | 453 | // <0..31> CR : Capture register <R> |
Kojto | 109:9296ab0bfc11 | 454 | |
Kojto | 109:9296ab0bfc11 | 455 | __IO uint32_t PDMR; //Periodic mode register |
Kojto | 109:9296ab0bfc11 | 456 | // <0> PDM : Periodic mode <R/W> |
Kojto | 109:9296ab0bfc11 | 457 | |
Kojto | 109:9296ab0bfc11 | 458 | __IO uint32_t DZER; //Dead-zone enable register |
Kojto | 109:9296ab0bfc11 | 459 | // <0> DZE : Dead-zone enable <R/W> |
Kojto | 109:9296ab0bfc11 | 460 | |
Kojto | 109:9296ab0bfc11 | 461 | __IO uint32_t DZCR; //Dead-zone counter register |
Kojto | 109:9296ab0bfc11 | 462 | // <0..9> DZC : Dead-zone counter <R/W> |
Kojto | 109:9296ab0bfc11 | 463 | } PWM_CHn_TypeDef; |
Kojto | 109:9296ab0bfc11 | 464 | |
Kojto | 109:9296ab0bfc11 | 465 | typedef struct |
Kojto | 109:9296ab0bfc11 | 466 | { |
Kojto | 109:9296ab0bfc11 | 467 | __IO uint32_t PWM_CHn_PR; //Prescale register |
Kojto | 109:9296ab0bfc11 | 468 | // <0..5> PR : prescale register <R/W> |
Kojto | 109:9296ab0bfc11 | 469 | __IO uint32_t PWM_CHn_MR; //Match register |
Kojto | 109:9296ab0bfc11 | 470 | // <0..31> MR : Match register <R/W> |
Kojto | 109:9296ab0bfc11 | 471 | __IO uint32_t PWM_CHn_LR; //Limit register |
Kojto | 109:9296ab0bfc11 | 472 | // <0..31> LR : Limit register <R/W> |
Kojto | 109:9296ab0bfc11 | 473 | __IO uint32_t PWM_CHn_UDMR; //Up-Down mode register |
Kojto | 109:9296ab0bfc11 | 474 | // <0> UDM : Up-down mode <R/W> |
Kojto | 109:9296ab0bfc11 | 475 | __IO uint32_t PWM_CHn_PDMR; //Periodic mode register |
Kojto | 109:9296ab0bfc11 | 476 | // <0> PDM : Periodic mode <R/W> |
Kojto | 109:9296ab0bfc11 | 477 | }PWM_TimerModeInitTypeDef; |
Kojto | 109:9296ab0bfc11 | 478 | |
Kojto | 109:9296ab0bfc11 | 479 | typedef struct |
Kojto | 109:9296ab0bfc11 | 480 | { |
Kojto | 109:9296ab0bfc11 | 481 | __IO uint32_t PWM_CHn_PR; //Prescale register |
Kojto | 109:9296ab0bfc11 | 482 | // <0..5> PR : prescale register <R/W> |
Kojto | 109:9296ab0bfc11 | 483 | __IO uint32_t PWM_CHn_MR; //Match register |
Kojto | 109:9296ab0bfc11 | 484 | // <0..31> MR : Match register <R/W> |
Kojto | 109:9296ab0bfc11 | 485 | __IO uint32_t PWM_CHn_LR; //Limit register |
Kojto | 109:9296ab0bfc11 | 486 | // <0..31> LR : Limit register <R/W> |
Kojto | 109:9296ab0bfc11 | 487 | __IO uint32_t PWM_CHn_UDMR; //Up-Down mode register |
Kojto | 109:9296ab0bfc11 | 488 | // <0> UDM : Up-down mode <R/W> |
Kojto | 109:9296ab0bfc11 | 489 | __IO uint32_t PWM_CHn_PDMR; //Periodic mode register |
Kojto | 109:9296ab0bfc11 | 490 | // <0> PDM : Peiodic mode <R/W> |
Kojto | 109:9296ab0bfc11 | 491 | __IO uint32_t PWM_CHn_CMR; //Capture mode register |
Kojto | 109:9296ab0bfc11 | 492 | // <0> CM : Capture mode <R/W> |
Kojto | 109:9296ab0bfc11 | 493 | }PWM_CaptureModeInitTypeDef; |
Kojto | 109:9296ab0bfc11 | 494 | |
Kojto | 109:9296ab0bfc11 | 495 | typedef struct |
Kojto | 109:9296ab0bfc11 | 496 | { |
Kojto | 109:9296ab0bfc11 | 497 | __IO uint32_t PWM_CHn_MR; |
Kojto | 109:9296ab0bfc11 | 498 | __IO uint32_t PWM_CHn_LR; |
Kojto | 109:9296ab0bfc11 | 499 | __IO uint32_t PWM_CHn_UDMR; |
Kojto | 109:9296ab0bfc11 | 500 | __IO uint32_t PWM_CHn_PDMR; |
Kojto | 109:9296ab0bfc11 | 501 | __IO uint32_t PWM_CHn_TCMR; |
Kojto | 109:9296ab0bfc11 | 502 | }PWM_CounterModeInitTypeDef; |
Kojto | 109:9296ab0bfc11 | 503 | |
Kojto | 109:9296ab0bfc11 | 504 | |
Kojto | 109:9296ab0bfc11 | 505 | /** |
Kojto | 109:9296ab0bfc11 | 506 | * @brief Random Number generator |
Kojto | 109:9296ab0bfc11 | 507 | */ |
Kojto | 109:9296ab0bfc11 | 508 | typedef struct |
Kojto | 109:9296ab0bfc11 | 509 | { |
Kojto | 109:9296ab0bfc11 | 510 | __IO uint32_t RNG_RUN; /* RNG run register, Address offset : 0x000 */ |
Kojto | 109:9296ab0bfc11 | 511 | __IO uint32_t RNG_SEED; /* RNG seed value register, Address offset : 0x004 */ |
Kojto | 109:9296ab0bfc11 | 512 | __IO uint32_t RNG_CLKSEL; /* RNG Clock source select register, Address offset : 0x008 */ |
Kojto | 109:9296ab0bfc11 | 513 | __IO uint32_t RNG_MODE; /* RNG MODE select register, Address offset : 0x00c */ |
Kojto | 109:9296ab0bfc11 | 514 | __I uint32_t RNG_RN; /* RNG random number value register, Address offset : 0x010 */ |
Kojto | 109:9296ab0bfc11 | 515 | __IO uint32_t RNG_POLY; /* RNG polynomial register, Address offset : 0x014 */ |
Kojto | 109:9296ab0bfc11 | 516 | }RNG_TypeDef; |
Kojto | 109:9296ab0bfc11 | 517 | |
Kojto | 109:9296ab0bfc11 | 518 | /** |
Kojto | 109:9296ab0bfc11 | 519 | * @brief Serial Peripheral Interface |
Kojto | 109:9296ab0bfc11 | 520 | */ |
Kojto | 109:9296ab0bfc11 | 521 | typedef struct |
Kojto | 109:9296ab0bfc11 | 522 | { |
Kojto | 109:9296ab0bfc11 | 523 | __IO uint32_t CR0; |
Kojto | 109:9296ab0bfc11 | 524 | __IO uint32_t CR1; |
Kojto | 109:9296ab0bfc11 | 525 | __IO uint32_t DR; |
Kojto | 109:9296ab0bfc11 | 526 | __IO uint32_t SR; |
Kojto | 109:9296ab0bfc11 | 527 | __IO uint32_t CPSR; |
Kojto | 109:9296ab0bfc11 | 528 | __IO uint32_t IMSC; |
Kojto | 109:9296ab0bfc11 | 529 | __IO uint32_t RIS; |
Kojto | 109:9296ab0bfc11 | 530 | __IO uint32_t MIS; |
Kojto | 109:9296ab0bfc11 | 531 | __IO uint32_t ICR; |
Kojto | 109:9296ab0bfc11 | 532 | __IO uint32_t DMACR; |
Kojto | 109:9296ab0bfc11 | 533 | } SSP_TypeDef; |
Kojto | 109:9296ab0bfc11 | 534 | |
Kojto | 109:9296ab0bfc11 | 535 | typedef struct |
Kojto | 109:9296ab0bfc11 | 536 | { |
Kojto | 109:9296ab0bfc11 | 537 | __IO uint32_t WatchdogLoad; // <h> Watchdog Load Register </h> |
Kojto | 109:9296ab0bfc11 | 538 | __I uint32_t WatchdogValue; // <h> Watchdog Value Register </h> |
Kojto | 109:9296ab0bfc11 | 539 | __IO uint32_t WatchdogControl; // <h> Watchdog Control Register |
Kojto | 109:9296ab0bfc11 | 540 | // <o.1> RESEN: Reset enable |
Kojto | 109:9296ab0bfc11 | 541 | // <o.0> INTEN: Interrupt enable |
Kojto | 109:9296ab0bfc11 | 542 | // </h> |
Kojto | 109:9296ab0bfc11 | 543 | __O uint32_t WatchdogIntClr; // <h> Watchdog Clear Interrupt Register </h> |
Kojto | 109:9296ab0bfc11 | 544 | __I uint32_t WatchdogRIS; // <h> Watchdog Raw Interrupt Status Register </h> |
Kojto | 109:9296ab0bfc11 | 545 | __I uint32_t WatchdogMIS; // <h> Watchdog Interrupt Status Register </h> |
Kojto | 109:9296ab0bfc11 | 546 | uint32_t RESERVED[762]; |
Kojto | 109:9296ab0bfc11 | 547 | __IO uint32_t WatchdogLock; // <h> Watchdog Lock Register </h> |
Kojto | 109:9296ab0bfc11 | 548 | }WATCHDOG_TypeDef; |
Kojto | 109:9296ab0bfc11 | 549 | |
Kojto | 109:9296ab0bfc11 | 550 | /** @addtogroup Peripheral_memory_map |
Kojto | 109:9296ab0bfc11 | 551 | * @{ |
Kojto | 109:9296ab0bfc11 | 552 | */ |
Kojto | 109:9296ab0bfc11 | 553 | |
Kojto | 109:9296ab0bfc11 | 554 | /* Peripheral and SRAM base address */ |
Kojto | 109:9296ab0bfc11 | 555 | #define W7500x_FLASH_BASE (0x00000000UL) /*!< (FLASH ) Base Address */ |
Kojto | 109:9296ab0bfc11 | 556 | #define W7500x_SRAM_BASE (0x20000000UL) /*!< (SRAM ) Base Address */ |
Kojto | 109:9296ab0bfc11 | 557 | #define W7500x_PERIPH_BASE (0x40000000UL) /*!< (Peripheral) Base Address */ |
Kojto | 109:9296ab0bfc11 | 558 | |
Kojto | 109:9296ab0bfc11 | 559 | #define W7500x_RAM_BASE (0x20000000UL) |
Kojto | 109:9296ab0bfc11 | 560 | #define W7500x_APB1_BASE (0x40000000UL) |
Kojto | 109:9296ab0bfc11 | 561 | #define W7500x_APB2_BASE (0x41000000UL) |
Kojto | 109:9296ab0bfc11 | 562 | #define W7500x_AHB_BASE (0x42000000UL) |
Kojto | 109:9296ab0bfc11 | 563 | |
Kojto | 109:9296ab0bfc11 | 564 | #define W7500x_UART0_BASE (W7500x_APB1_BASE + 0x0000C000UL) |
Kojto | 109:9296ab0bfc11 | 565 | #define W7500x_UART1_BASE (W7500x_APB1_BASE + 0x0000D000UL) |
Kojto | 109:9296ab0bfc11 | 566 | #define W7500x_UART2_BASE (W7500x_APB1_BASE + 0x00006000UL) |
Kojto | 109:9296ab0bfc11 | 567 | |
Kojto | 109:9296ab0bfc11 | 568 | #define W7500x_CRG_BASE (W7500x_APB2_BASE + 0x00001000UL) |
Kojto | 109:9296ab0bfc11 | 569 | #define W7500x_ADC_BASE (W7500x_APB2_BASE + 0x00000000UL) |
Kojto | 109:9296ab0bfc11 | 570 | |
Kojto | 109:9296ab0bfc11 | 571 | #define W7500x_INFO_BGT (0x0003FDB8) |
Kojto | 109:9296ab0bfc11 | 572 | #define W7500x_INFO_OSC (0x0003FDBC) |
Kojto | 109:9296ab0bfc11 | 573 | |
Kojto | 109:9296ab0bfc11 | 574 | #define W7500x_TRIM_BGT (0x41001210) |
Kojto | 109:9296ab0bfc11 | 575 | #define W7500x_TRIM_OSC (0x41001004) |
Kojto | 109:9296ab0bfc11 | 576 | |
Kojto | 109:9296ab0bfc11 | 577 | #define W7500x_DUALTIMER0_BASE (W7500x_APB1_BASE + 0x00001000ul) |
Kojto | 109:9296ab0bfc11 | 578 | #define W7500x_DUALTIMER1_BASE (W7500x_APB1_BASE + 0x00002000ul) |
Kojto | 109:9296ab0bfc11 | 579 | |
Kojto | 109:9296ab0bfc11 | 580 | #define EXTI_Px_BASE (W7500x_APB2_BASE + 0x00002200UL) |
Kojto | 109:9296ab0bfc11 | 581 | |
Kojto | 109:9296ab0bfc11 | 582 | #define GPIOA_BASE (W7500x_AHB_BASE + 0x00000000UL) // W7500x_AHB_BASE : 0x42000000UL |
Kojto | 109:9296ab0bfc11 | 583 | #define GPIOB_BASE (W7500x_AHB_BASE + 0x01000000UL) |
Kojto | 109:9296ab0bfc11 | 584 | #define GPIOC_BASE (W7500x_AHB_BASE + 0x02000000UL) |
Kojto | 109:9296ab0bfc11 | 585 | #define GPIOD_BASE (W7500x_AHB_BASE + 0x03000000UL) |
Kojto | 109:9296ab0bfc11 | 586 | |
Kojto | 109:9296ab0bfc11 | 587 | #define P_AFSR_BASE (W7500x_APB2_BASE + 0x00002000UL) |
Kojto | 109:9296ab0bfc11 | 588 | |
Kojto | 109:9296ab0bfc11 | 589 | #define P_PCR_BASE (W7500x_APB2_BASE + 0x00003000UL) |
Kojto | 109:9296ab0bfc11 | 590 | |
Kojto | 109:9296ab0bfc11 | 591 | #define I2C0_BASE (W7500x_APB1_BASE + 0x8000) |
Kojto | 109:9296ab0bfc11 | 592 | #define I2C1_BASE (W7500x_APB1_BASE + 0x9000) |
Kojto | 109:9296ab0bfc11 | 593 | |
Kojto | 109:9296ab0bfc11 | 594 | #define W7500x_PWM_BASE (W7500x_APB1_BASE + 0x00005000UL) |
Kojto | 109:9296ab0bfc11 | 595 | |
Kojto | 109:9296ab0bfc11 | 596 | #define W7500x_RNG_BASE (W7500x_APB1_BASE + 0x00007000UL) |
Kojto | 109:9296ab0bfc11 | 597 | |
Kojto | 109:9296ab0bfc11 | 598 | #define SSP0_BASE (0x4000A000) |
Kojto | 109:9296ab0bfc11 | 599 | #define SSP1_BASE (0x4000B000) |
Kojto | 109:9296ab0bfc11 | 600 | |
Kojto | 109:9296ab0bfc11 | 601 | #define W7500x_WATCHDOG_BASE (W7500x_APB1_BASE + 0x0000UL) |
Kojto | 109:9296ab0bfc11 | 602 | |
Kojto | 109:9296ab0bfc11 | 603 | /** |
Kojto | 109:9296ab0bfc11 | 604 | * @} |
Kojto | 109:9296ab0bfc11 | 605 | */ |
Kojto | 109:9296ab0bfc11 | 606 | |
Kojto | 109:9296ab0bfc11 | 607 | |
Kojto | 109:9296ab0bfc11 | 608 | /** @addtogroup Peripheral_declaration |
Kojto | 109:9296ab0bfc11 | 609 | * @{ |
Kojto | 109:9296ab0bfc11 | 610 | */ |
Kojto | 109:9296ab0bfc11 | 611 | #define CRG ((CRG_TypeDef *) W7500x_CRG_BASE) |
Kojto | 109:9296ab0bfc11 | 612 | |
Kojto | 109:9296ab0bfc11 | 613 | #define UART0 ((UART_TypeDef *) W7500x_UART0_BASE) |
Kojto | 109:9296ab0bfc11 | 614 | #define UART1 ((UART_TypeDef *) W7500x_UART1_BASE) |
Kojto | 109:9296ab0bfc11 | 615 | #define UART2 ((S_UART_TypeDef *) W7500x_UART2_BASE) |
Kojto | 109:9296ab0bfc11 | 616 | |
Kojto | 109:9296ab0bfc11 | 617 | #define ADC ((ADC_TypeDef *) W7500x_ADC_BASE) |
Kojto | 109:9296ab0bfc11 | 618 | |
Kojto | 109:9296ab0bfc11 | 619 | #define DUALTIMER0_0 ((DUALTIMER_TypeDef *) (W7500x_DUALTIMER0_BASE) ) |
Kojto | 109:9296ab0bfc11 | 620 | #define DUALTIMER0_1 ((DUALTIMER_TypeDef *) (W7500x_DUALTIMER0_BASE + 0x20ul)) |
Kojto | 109:9296ab0bfc11 | 621 | #define DUALTIMER1_0 ((DUALTIMER_TypeDef *) (W7500x_DUALTIMER1_BASE) ) |
Kojto | 109:9296ab0bfc11 | 622 | #define DUALTIMER1_1 ((DUALTIMER_TypeDef *) (W7500x_DUALTIMER1_BASE + 0x20ul)) |
Kojto | 109:9296ab0bfc11 | 623 | |
Kojto | 109:9296ab0bfc11 | 624 | #define EXTI_PA ((P_Port_Def *) (EXTI_Px_BASE + 0x00000000UL)) /* PA_XX External interrupt Enable Register */ |
Kojto | 109:9296ab0bfc11 | 625 | #define EXTI_PB ((P_Port_Def *) (EXTI_Px_BASE + 0x00000040UL)) /* PB_XX External interrupt Enable Register */ |
Kojto | 109:9296ab0bfc11 | 626 | #define EXTI_PC ((P_Port_Def *) (EXTI_Px_BASE + 0x00000080UL)) /* PC_XX External interrupt Enable Register */ |
Kojto | 109:9296ab0bfc11 | 627 | #define EXTI_PD ((P_Port_D_Def *) (EXTI_Px_BASE + 0x000000C0UL)) /* PD_XX External interrupt Enable Register */ |
Kojto | 109:9296ab0bfc11 | 628 | |
Kojto | 109:9296ab0bfc11 | 629 | #define GPIOA ((GPIO_TypeDef *) (GPIOA_BASE) ) |
Kojto | 109:9296ab0bfc11 | 630 | #define GPIOB ((GPIO_TypeDef *) (GPIOB_BASE) ) |
Kojto | 109:9296ab0bfc11 | 631 | #define GPIOC ((GPIO_TypeDef *) (GPIOC_BASE) ) |
Kojto | 109:9296ab0bfc11 | 632 | #define GPIOD ((GPIO_TypeDef *) (GPIOD_BASE) ) |
Kojto | 109:9296ab0bfc11 | 633 | |
Kojto | 109:9296ab0bfc11 | 634 | #define PA_AFSR ((P_Port_Def *) (P_AFSR_BASE + 0x00000000UL)) /* PA_XX Pad Alternate Function Select Register */ |
Kojto | 109:9296ab0bfc11 | 635 | #define PB_AFSR ((P_Port_Def *) (P_AFSR_BASE + 0x00000040UL)) /* PB_XX Pad Alternate Function Select Register */ |
Kojto | 109:9296ab0bfc11 | 636 | #define PC_AFSR ((P_Port_Def *) (P_AFSR_BASE + 0x00000080UL)) /* PC_XX Pad Alternate Function Select Register */ |
Kojto | 109:9296ab0bfc11 | 637 | #define PD_AFSR ((P_Port_D_Def *) (P_AFSR_BASE + 0x000000C0UL)) /* PD_XX Pad Alternate Function Select Register */ |
Kojto | 109:9296ab0bfc11 | 638 | |
Kojto | 109:9296ab0bfc11 | 639 | #define PA_PCR ((P_Port_Def *) (P_PCR_BASE + 0x00000000UL)) /* PA_XX Pad Control Register */ |
Kojto | 109:9296ab0bfc11 | 640 | #define PB_PCR ((P_Port_Def *) (P_PCR_BASE + 0x00000040UL)) /* PB_XX Pad Control Register */ |
Kojto | 109:9296ab0bfc11 | 641 | #define PC_PCR ((P_Port_Def *) (P_PCR_BASE + 0x00000080UL)) /* PC_XX Pad Control Register */ |
Kojto | 109:9296ab0bfc11 | 642 | #define PD_PCR ((P_Port_D_Def *) (P_PCR_BASE + 0x000000C0UL)) /* PD_XX Pad Control Register */ |
Kojto | 109:9296ab0bfc11 | 643 | |
Kojto | 109:9296ab0bfc11 | 644 | #define I2C0 ((I2C_TypeDef *) I2C0_BASE) |
Kojto | 109:9296ab0bfc11 | 645 | #define I2C1 ((I2C_TypeDef *) I2C1_BASE) |
Kojto | 109:9296ab0bfc11 | 646 | |
Kojto | 109:9296ab0bfc11 | 647 | |
Kojto | 109:9296ab0bfc11 | 648 | #define TIMCLKEN0_0 *(uint32_t *)(W7500x_DUALTIMER0_BASE + 0x80ul) |
Kojto | 109:9296ab0bfc11 | 649 | #define TIMCLKEN0_1 *(uint32_t *)(W7500x_DUALTIMER0_BASE + 0xA0ul) |
Kojto | 109:9296ab0bfc11 | 650 | #define TIMCLKEN1_0 *(uint32_t *)(W7500x_DUALTIMER1_BASE + 0x80ul) |
Kojto | 109:9296ab0bfc11 | 651 | #define TIMCLKEN1_1 *(uint32_t *)(W7500x_DUALTIMER1_BASE + 0xA0ul) |
Kojto | 109:9296ab0bfc11 | 652 | |
Kojto | 109:9296ab0bfc11 | 653 | #define PWM ((PWM_TypeDef *) (W7500x_PWM_BASE + 0x800UL )) |
Kojto | 109:9296ab0bfc11 | 654 | #define PWM_CH0 ((PWM_CHn_TypeDef *) (W7500x_PWM_BASE)) |
Kojto | 109:9296ab0bfc11 | 655 | #define PWM_CH1 ((PWM_CHn_TypeDef *) (W7500x_PWM_BASE + 0x100UL)) |
Kojto | 109:9296ab0bfc11 | 656 | #define PWM_CH2 ((PWM_CHn_TypeDef *) (W7500x_PWM_BASE + 0x200UL)) |
Kojto | 109:9296ab0bfc11 | 657 | #define PWM_CH3 ((PWM_CHn_TypeDef *) (W7500x_PWM_BASE + 0x300UL)) |
Kojto | 109:9296ab0bfc11 | 658 | #define PWM_CH4 ((PWM_CHn_TypeDef *) (W7500x_PWM_BASE + 0x400UL)) |
Kojto | 109:9296ab0bfc11 | 659 | #define PWM_CH5 ((PWM_CHn_TypeDef *) (W7500x_PWM_BASE + 0x500UL)) |
Kojto | 109:9296ab0bfc11 | 660 | #define PWM_CH6 ((PWM_CHn_TypeDef *) (W7500x_PWM_BASE + 0x600UL)) |
Kojto | 109:9296ab0bfc11 | 661 | #define PWM_CH7 ((PWM_CHn_TypeDef *) (W7500x_PWM_BASE + 0x700UL)) |
Kojto | 109:9296ab0bfc11 | 662 | |
Kojto | 109:9296ab0bfc11 | 663 | #define PWM_CH0_BASE (W7500x_PWM_BASE) |
Kojto | 109:9296ab0bfc11 | 664 | #define PWM_CH1_BASE (W7500x_PWM_BASE + 0x100UL) |
Kojto | 109:9296ab0bfc11 | 665 | #define PWM_CH2_BASE (W7500x_PWM_BASE + 0x200UL) |
Kojto | 109:9296ab0bfc11 | 666 | #define PWM_CH3_BASE (W7500x_PWM_BASE + 0x300UL) |
Kojto | 109:9296ab0bfc11 | 667 | #define PWM_CH4_BASE (W7500x_PWM_BASE + 0x400UL) |
Kojto | 109:9296ab0bfc11 | 668 | #define PWM_CH5_BASE (W7500x_PWM_BASE + 0x500UL) |
Kojto | 109:9296ab0bfc11 | 669 | #define PWM_CH6_BASE (W7500x_PWM_BASE + 0x600UL) |
Kojto | 109:9296ab0bfc11 | 670 | #define PWM_CH7_BASE (W7500x_PWM_BASE + 0x700UL) |
Kojto | 109:9296ab0bfc11 | 671 | |
Kojto | 109:9296ab0bfc11 | 672 | #define RNG ((RNG_TypeDef *) W7500x_RNG_BASE) |
Kojto | 109:9296ab0bfc11 | 673 | |
Kojto | 109:9296ab0bfc11 | 674 | #define SSP0 ((SSP_TypeDef*) (SSP0_BASE)) |
Kojto | 109:9296ab0bfc11 | 675 | #define SSP1 ((SSP_TypeDef*) (SSP1_BASE)) |
Kojto | 109:9296ab0bfc11 | 676 | |
Kojto | 109:9296ab0bfc11 | 677 | #define WATCHDOG ((WATCHDOG_TypeDef *) W7500x_WATCHDOG_BASE) |
Kojto | 109:9296ab0bfc11 | 678 | |
Kojto | 109:9296ab0bfc11 | 679 | /** |
Kojto | 109:9296ab0bfc11 | 680 | * @} |
Kojto | 109:9296ab0bfc11 | 681 | */ |
Kojto | 109:9296ab0bfc11 | 682 | |
Kojto | 109:9296ab0bfc11 | 683 | |
Kojto | 109:9296ab0bfc11 | 684 | |
Kojto | 109:9296ab0bfc11 | 685 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 686 | /* */ |
Kojto | 109:9296ab0bfc11 | 687 | /* Clock Reset Generator */ |
Kojto | 109:9296ab0bfc11 | 688 | /* */ |
Kojto | 109:9296ab0bfc11 | 689 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 690 | /**************** Bit definition for CRG_OSC_PDR **************************/ |
Kojto | 109:9296ab0bfc11 | 691 | #define CRG_OSC_PDR_NRMLOP (0x0ul) // Normal Operation |
Kojto | 109:9296ab0bfc11 | 692 | #define CRG_OSC_PDR_PD (0x1ul) // Power Down |
Kojto | 109:9296ab0bfc11 | 693 | /**************** Bit definition for CRG_PLL_PDR **************************/ |
Kojto | 109:9296ab0bfc11 | 694 | #define CRG_PLL_PDR_PD (0x0ul) // Power Down |
Kojto | 109:9296ab0bfc11 | 695 | #define CRG_PLL_PDR_NRMLOP (0x1ul) // Normal Operation |
Kojto | 109:9296ab0bfc11 | 696 | /**************** Bit definition for CRG_PLL_FCR **************************/ |
Kojto | 109:9296ab0bfc11 | 697 | //ToDo |
Kojto | 109:9296ab0bfc11 | 698 | /**************** Bit definition for CRG_PLL_OER **************************/ |
Kojto | 109:9296ab0bfc11 | 699 | #define CRG_PLL_OER_DIS (0x0ul) // Clock out is disable |
Kojto | 109:9296ab0bfc11 | 700 | #define CRG_PLL_OER_EN (0x1ul) // Clock out is enable |
Kojto | 109:9296ab0bfc11 | 701 | /**************** Bit definition for CRG_PLL_BPR **************************/ |
Kojto | 109:9296ab0bfc11 | 702 | #define CRG_PLL_BPR_DIS (0x0ul) // Bypass disable. Normal operation |
Kojto | 109:9296ab0bfc11 | 703 | #define CRG_PLL_BPR_EN (0x1ul) // Bypass enable. Clock will be set to external clock |
Kojto | 109:9296ab0bfc11 | 704 | /**************** Bit definition for CRG_PLL_IFSR **************************/ |
Kojto | 109:9296ab0bfc11 | 705 | #define CRG_PLL_IFSR_RCLK (0x0ul) // Internal 8MHz RC oscillator clock(RCLK) |
Kojto | 109:9296ab0bfc11 | 706 | #define CRG_PLL_IFSR_OCLK (0x1ul) // External oscillator clock (OCLK, 8MHz ~ 24MHz) |
Kojto | 109:9296ab0bfc11 | 707 | /**************** Bit definition for CRG_FCLK_SSR **************************/ |
Kojto | 109:9296ab0bfc11 | 708 | #define CRG_FCLK_SSR_MCLK (0x01ul) // 00,01 Output clock of PLL(MCLK) |
Kojto | 109:9296ab0bfc11 | 709 | #define CRG_FCLK_SSR_RCLK (0x02ul) // Internal 8MHz RC oscillator clock(RCLK) |
Kojto | 109:9296ab0bfc11 | 710 | #define CRG_FCLK_SSR_OCLK (0x03ul) // External oscillator clock(OCLK, 8MHz ~ 24MHz) |
Kojto | 109:9296ab0bfc11 | 711 | /**************** Bit definition for CRG_FCLK_PVSR **************************/ |
Kojto | 109:9296ab0bfc11 | 712 | #define CRG_FCLK_PVSR_DIV1 (0x00ul) // 1/1 (bypass) |
Kojto | 109:9296ab0bfc11 | 713 | #define CRG_FCLK_PVSR_DIV2 (0x01ul) // 1/2 |
Kojto | 109:9296ab0bfc11 | 714 | #define CRG_FCLK_PVSR_DIV4 (0x02ul) // 1/4 |
Kojto | 109:9296ab0bfc11 | 715 | #define CRG_FCLK_PVSR_DIV8 (0x03ul) // 1/8 |
Kojto | 109:9296ab0bfc11 | 716 | /**************** Bit definition for CRG_SSPCLK_SSR **************************/ |
Kojto | 109:9296ab0bfc11 | 717 | #define CRG_SSPCLK_SSR_DIS (0x00ul) // Disable clock |
Kojto | 109:9296ab0bfc11 | 718 | #define CRG_SSPCLK_SSR_MCLK (0x01ul) // PLL output clock(MCLK) |
Kojto | 109:9296ab0bfc11 | 719 | #define CRG_SSPCLK_SSR_RCLK (0x02ul) // Internal 8MHz RC oscillator clock(RCLK) |
Kojto | 109:9296ab0bfc11 | 720 | #define CRG_SSPCLK_SSR_OCLK (0x03ul) // External oscillator clock(OCLK, 8MHz ~ 24MHz) |
Kojto | 109:9296ab0bfc11 | 721 | /**************** Bit definition for CRG_SSPCLK_PVSR **************************/ |
Kojto | 109:9296ab0bfc11 | 722 | #define CRG_SSPCLK_PVSR_DIV1 (0x00ul) // 1/1 (bypass) |
Kojto | 109:9296ab0bfc11 | 723 | #define CRG_SSPCLK_PVSR_DIV2 (0x01ul) // 1/2 |
Kojto | 109:9296ab0bfc11 | 724 | #define CRG_SSPCLK_PVSR_DIV4 (0x02ul) // 1/4 |
Kojto | 109:9296ab0bfc11 | 725 | #define CRG_SSPCLK_PVSR_DIV8 (0x03ul) // 1/8 |
Kojto | 109:9296ab0bfc11 | 726 | /**************** Bit definition for CRG_ADCCLK_SSR **************************/ |
Kojto | 109:9296ab0bfc11 | 727 | #define CRG_ADCCLK_SSR_DIS (0x00ul) // Disable clock |
Kojto | 109:9296ab0bfc11 | 728 | #define CRG_ADCCLK_SSR_MCLK (0x01ul) // PLL output clock(MCLK) |
Kojto | 109:9296ab0bfc11 | 729 | #define CRG_ADCCLK_SSR_RCLK (0x02ul) // Internal 8MHz RC oscillator clock(RCLK) |
Kojto | 109:9296ab0bfc11 | 730 | #define CRG_ADCCLK_SSR_OCLK (0x03ul) // External oscillator clock(OCLK, 8MHz ~ 24MHz) |
Kojto | 109:9296ab0bfc11 | 731 | /**************** Bit definition for CRG_ADCCLK_PVSR **************************/ |
Kojto | 109:9296ab0bfc11 | 732 | #define CRG_ADCCLK_PVSR_DIV1 (0x00ul) // 1/1 (bypass) |
Kojto | 109:9296ab0bfc11 | 733 | #define CRG_ADCCLK_PVSR_DIV2 (0x01ul) // 1/2 |
Kojto | 109:9296ab0bfc11 | 734 | #define CRG_ADCCLK_PVSR_DIV4 (0x02ul) // 1/4 |
Kojto | 109:9296ab0bfc11 | 735 | #define CRG_ADCCLK_PVSR_DIV8 (0x03ul) // 1/8 |
Kojto | 109:9296ab0bfc11 | 736 | /**************** Bit definition for CRG_TIMER0/1CLK_SSR **************************/ |
Kojto | 109:9296ab0bfc11 | 737 | #define CRG_TIMERCLK_SSR_DIS (0x00ul) // Disable clock |
Kojto | 109:9296ab0bfc11 | 738 | #define CRG_TIMERCLK_SSR_MCLK (0x01ul) // PLL output clock(MCLK) |
Kojto | 109:9296ab0bfc11 | 739 | #define CRG_TIMERCLK_SSR_RCLK (0x02ul) // Internal 8MHz RC oscillator clock(RCLK) |
Kojto | 109:9296ab0bfc11 | 740 | #define CRG_TIMERCLK_SSR_OCLK (0x03ul) // External oscillator clock(OCLK, 8MHz ~ 24MHz) |
Kojto | 109:9296ab0bfc11 | 741 | /**************** Bit definition for CRG_TIMER0/1CLK_PVSR **************************/ |
Kojto | 109:9296ab0bfc11 | 742 | #define CRG_TIMERCLK_PVSR_DIV1 (0x00ul) // 1/1 (bypass) |
Kojto | 109:9296ab0bfc11 | 743 | #define CRG_TIMERCLK_PVSR_DIV2 (0x01ul) // 1/2 |
Kojto | 109:9296ab0bfc11 | 744 | #define CRG_TIMERCLK_PVSR_DIV4 (0x02ul) // 1/4 |
Kojto | 109:9296ab0bfc11 | 745 | #define CRG_TIMERCLK_PVSR_DIV8 (0x03ul) // 1/8 |
Kojto | 109:9296ab0bfc11 | 746 | #define CRG_TIMERCLK_PVSR_DIV16 (0x04ul) // 1/16 |
Kojto | 109:9296ab0bfc11 | 747 | #define CRG_TIMERCLK_PVSR_DIV32 (0x05ul) // 1/32 |
Kojto | 109:9296ab0bfc11 | 748 | #define CRG_TIMERCLK_PVSR_DIV64 (0x06ul) // 1/64 |
Kojto | 109:9296ab0bfc11 | 749 | #define CRG_TIMERCLK_PVSR_DIV128 (0x07ul) // 1/128 |
Kojto | 109:9296ab0bfc11 | 750 | /**************** Bit definition for CRG_PWMnCLK_SSR **************************/ |
Kojto | 109:9296ab0bfc11 | 751 | #define CRG_PWMCLK_SSR_DIS (0x00ul) // Disable clock |
Kojto | 109:9296ab0bfc11 | 752 | #define CRG_PWMCLK_SSR_MCLK (0x01ul) // PLL output clock(MCLK) |
Kojto | 109:9296ab0bfc11 | 753 | #define CRG_PWMCLK_SSR_RCLK (0x02ul) // Internal 8MHz RC oscillator clock(RCLK) |
Kojto | 109:9296ab0bfc11 | 754 | #define CRG_PWMCLK_SSR_OCLK (0x03ul) // External oscillator clock(OCLK, 8MHz ~ 24MHz) |
Kojto | 109:9296ab0bfc11 | 755 | /**************** Bit definition for CRG_PWMnCLK_PVSR **************************/ |
Kojto | 109:9296ab0bfc11 | 756 | #define CRG_PWMCLK_PVSR_DIV1 (0x00ul) // 1/1 (bypass) |
Kojto | 109:9296ab0bfc11 | 757 | #define CRG_PWMCLK_PVSR_DIV2 (0x01ul) // 1/2 |
Kojto | 109:9296ab0bfc11 | 758 | #define CRG_PWMCLK_PVSR_DIV4 (0x02ul) // 1/4 |
Kojto | 109:9296ab0bfc11 | 759 | #define CRG_PWMCLK_PVSR_DIV8 (0x03ul) // 1/8 |
Kojto | 109:9296ab0bfc11 | 760 | #define CRG_PWMCLK_PVSR_DIV16 (0x04ul) // 1/16 |
Kojto | 109:9296ab0bfc11 | 761 | #define CRG_PWMCLK_PVSR_DIV32 (0x05ul) // 1/32 |
Kojto | 109:9296ab0bfc11 | 762 | #define CRG_PWMCLK_PVSR_DIV64 (0x06ul) // 1/64 |
Kojto | 109:9296ab0bfc11 | 763 | #define CRG_PWMCLK_PVSR_DIV128 (0x07ul) // 1/128 |
Kojto | 109:9296ab0bfc11 | 764 | /**************** Bit definition for CRG_RTC_HS_SSR **************************/ |
Kojto | 109:9296ab0bfc11 | 765 | #define CRG_RTC_HS_SSR_DIS (0x00ul) // Disable clock |
Kojto | 109:9296ab0bfc11 | 766 | #define CRG_RTC_HS_SSR_MCLK (0x01ul) // PLL output clock(MCLK) |
Kojto | 109:9296ab0bfc11 | 767 | #define CRG_RTC_HS_SSR_RCLK (0x02ul) // Internal 8MHz RC oscillator clock(RCLK) |
Kojto | 109:9296ab0bfc11 | 768 | #define CRG_RTC_HS_SSR_OCLK (0x03ul) // External oscillator clock(OCLK, 8MHz ~ 24MHz) |
Kojto | 109:9296ab0bfc11 | 769 | /**************** Bit definition for CRG_RTC_HS_PVSR **************************/ |
Kojto | 109:9296ab0bfc11 | 770 | #define CRG_RTC_HS_PVSR_DIV1 (0x00ul) // 1/1 (bypass) |
Kojto | 109:9296ab0bfc11 | 771 | #define CRG_RTC_HS_PVSR_DIV2 (0x01ul) // 1/2 |
Kojto | 109:9296ab0bfc11 | 772 | #define CRG_RTC_HS_PVSR_DIV4 (0x02ul) // 1/4 |
Kojto | 109:9296ab0bfc11 | 773 | #define CRG_RTC_HS_PVSR_DIV8 (0x03ul) // 1/8 |
Kojto | 109:9296ab0bfc11 | 774 | #define CRG_RTC_HS_PVSR_DIV16 (0x04ul) // 1/16 |
Kojto | 109:9296ab0bfc11 | 775 | #define CRG_RTC_HS_PVSR_DIV32 (0x05ul) // 1/32 |
Kojto | 109:9296ab0bfc11 | 776 | #define CRG_RTC_HS_PVSR_DIV64 (0x06ul) // 1/64 |
Kojto | 109:9296ab0bfc11 | 777 | #define CRG_RTC_HS_PVSR_DIV128 (0x07ul) // 1/128 |
Kojto | 109:9296ab0bfc11 | 778 | /**************** Bit definition for CRG_RTC_SSR **************************/ |
Kojto | 109:9296ab0bfc11 | 779 | #define CRG_RTC_SSR_HS (0x00ul) // RTCCLK HS(High Speed clock) |
Kojto | 109:9296ab0bfc11 | 780 | #define CRG_RTC_SSR_LW (0x01ul) // 32K_OSC_CLK(Low Speed external oscillator clock) |
Kojto | 109:9296ab0bfc11 | 781 | /**************** Bit definition for CRG_WDOGCLK_HS_SSR **************************/ |
Kojto | 109:9296ab0bfc11 | 782 | #define CRG_WDOGCLK_HS_SSR_DIS (0x00ul) // Disable clock |
Kojto | 109:9296ab0bfc11 | 783 | #define CRG_WDOGCLK_HS_SSR_MCLK (0x01ul) // PLL output clock(MCLK) |
Kojto | 109:9296ab0bfc11 | 784 | #define CRG_WDOGCLK_HS_SSR_RCLK (0x02ul) // Internal 8MHz RC oscillator clock(RCLK) |
Kojto | 109:9296ab0bfc11 | 785 | #define CRG_WDOGCLK_HS_SSR_OCLK (0x03ul) // External oscillator clock(OCLK, 8MHz ~ 24MHz) |
Kojto | 109:9296ab0bfc11 | 786 | /**************** Bit definition for CRG_WDOGCLK_HS_PVSR **************************/ |
Kojto | 109:9296ab0bfc11 | 787 | #define CRG_WDOGCLK_HS_PVSR_DIV1 (0x00ul) // 1/1 (bypass) |
Kojto | 109:9296ab0bfc11 | 788 | #define CRG_WDOGCLK_HS_PVSR_DIV2 (0x01ul) // 1/2 |
Kojto | 109:9296ab0bfc11 | 789 | #define CRG_WDOGCLK_HS_PVSR_DIV4 (0x02ul) // 1/4 |
Kojto | 109:9296ab0bfc11 | 790 | #define CRG_WDOGCLK_HS_PVSR_DIV8 (0x03ul) // 1/8 |
Kojto | 109:9296ab0bfc11 | 791 | #define CRG_WDOGCLK_HS_PVSR_DIV16 (0x04ul) // 1/16 |
Kojto | 109:9296ab0bfc11 | 792 | #define CRG_WDOGCLK_HS_PVSR_DIV32 (0x05ul) // 1/32 |
Kojto | 109:9296ab0bfc11 | 793 | #define CRG_WDOGCLK_HS_PVSR_DIV64 (0x06ul) // 1/64 |
Kojto | 109:9296ab0bfc11 | 794 | #define CRG_WDOGCLK_HS_PVSR_DIV128 (0x07ul) // 1/128 |
Kojto | 109:9296ab0bfc11 | 795 | /**************** Bit definition for CRG_WDOGCLK_SSR **************************/ |
Kojto | 109:9296ab0bfc11 | 796 | #define CRG_WDOGCLK_SSR_HS (0x00ul) // RTCCLK HS(High Speed clock) |
Kojto | 109:9296ab0bfc11 | 797 | #define CRG_WDOGCLK_SSR_LW (0x01ul) // 32K_OSC_CLK(Low Speed external oscillator clock) |
Kojto | 109:9296ab0bfc11 | 798 | /**************** Bit definition for CRG_UARTCLK_SSR **************************/ |
Kojto | 109:9296ab0bfc11 | 799 | #define CRG_UARTCLK_SSR_DIS (0x00ul) // Disable clock |
Kojto | 109:9296ab0bfc11 | 800 | #define CRG_UARTCLK_SSR_MCLK (0x01ul) // PLL output clock(MCLK) |
Kojto | 109:9296ab0bfc11 | 801 | #define CRG_UARTCLK_SSR_RCLK (0x02ul) // Internal 8MHz RC oscillator clock(RCLK) |
Kojto | 109:9296ab0bfc11 | 802 | #define CRG_UARTCLK_SSR_OCLK (0x03ul) // External oscillator clock(OCLK, 8MHz ~ 24MHz) |
Kojto | 109:9296ab0bfc11 | 803 | /**************** Bit definition for CRG_UARTCLK_PVSR **************************/ |
Kojto | 109:9296ab0bfc11 | 804 | #define CRG_UARTCLK_PVSR_DIV1 (0x00ul) // 1/1 (bypass) |
Kojto | 109:9296ab0bfc11 | 805 | #define CRG_UARTCLK_PVSR_DIV2 (0x01ul) // 1/2 |
Kojto | 109:9296ab0bfc11 | 806 | #define CRG_UARTCLK_PVSR_DIV4 (0x02ul) // 1/4 |
Kojto | 109:9296ab0bfc11 | 807 | #define CRG_UARTCLK_PVSR_DIV8 (0x03ul) // 1/8 |
Kojto | 109:9296ab0bfc11 | 808 | /**************** Bit definition for CRG_MIICLK_ECR **************************/ |
Kojto | 109:9296ab0bfc11 | 809 | #define CRG_MIICLK_ECR_EN_RXCLK (0x01ul << 0) // Enable MII_RCK and MII_RCK_N |
Kojto | 109:9296ab0bfc11 | 810 | #define CRG_MIICLK_ECR_EN_TXCLK (0x01ul << 1) // Enable MII_TCK and MII_TCK_N |
Kojto | 109:9296ab0bfc11 | 811 | /**************** Bit definition for CRG_MONCLK_SSR **************************/ |
Kojto | 109:9296ab0bfc11 | 812 | #define CRG_MONCLK_SSR_MCLK (0x00ul) // PLL output clock (MCLK) |
Kojto | 109:9296ab0bfc11 | 813 | #define CRG_MONCLK_SSR_FCLK (0x01ul) // FCLK |
Kojto | 109:9296ab0bfc11 | 814 | #define CRG_MONCLK_SSR_RCLK (0x02ul) // Internal 8MHz RC oscillator clock(RCLK) |
Kojto | 109:9296ab0bfc11 | 815 | #define CRG_MONCLK_SSR_OCLK (0x03ul) // External oscillator clock(OCLK, 8MHz ~ 24MHz) |
Kojto | 109:9296ab0bfc11 | 816 | #define CRG_MONCLK_SSR_ADCCLK (0x04ul) // ADCCLK |
Kojto | 109:9296ab0bfc11 | 817 | #define CRG_MONCLK_SSR_SSPCLK (0x05ul) // SSPCLK |
Kojto | 109:9296ab0bfc11 | 818 | #define CRG_MONCLK_SSR_TIMCLK0 (0x06ul) // TIMCLK0 |
Kojto | 109:9296ab0bfc11 | 819 | #define CRG_MONCLK_SSR_TIMCLK1 (0x07ul) // TIMCLK1 |
Kojto | 109:9296ab0bfc11 | 820 | #define CRG_MONCLK_SSR_PWMCLK0 (0x08ul) // PWMCLK0 |
Kojto | 109:9296ab0bfc11 | 821 | #define CRG_MONCLK_SSR_PWMCLK1 (0x09ul) // PWMCLK1 |
Kojto | 109:9296ab0bfc11 | 822 | #define CRG_MONCLK_SSR_PWMCLK2 (0x0Aul) // PWMCLK2 |
Kojto | 109:9296ab0bfc11 | 823 | #define CRG_MONCLK_SSR_PWMCLK3 (0x0Bul) // PWMCLK3 |
Kojto | 109:9296ab0bfc11 | 824 | #define CRG_MONCLK_SSR_PWMCLK4 (0x0Cul) // PWMCLK4 |
Kojto | 109:9296ab0bfc11 | 825 | #define CRG_MONCLK_SSR_PWMCLK5 (0x0Dul) // PWMCLK5 |
Kojto | 109:9296ab0bfc11 | 826 | #define CRG_MONCLK_SSR_PWMCLK6 (0x0Eul) // PWMCLK6 |
Kojto | 109:9296ab0bfc11 | 827 | #define CRG_MONCLK_SSR_PWMCLK7 (0x0Ful) // PWMCLK7 |
Kojto | 109:9296ab0bfc11 | 828 | #define CRG_MONCLK_SSR_UARTCLK (0x10ul) // UARTCLK |
Kojto | 109:9296ab0bfc11 | 829 | #define CRG_MONCLK_SSR_MII_RXCLK (0x11ul) // MII_RXCLK |
Kojto | 109:9296ab0bfc11 | 830 | #define CRG_MONCLK_SSR_MII_TXCLK (0x12ul) // MII_TXCLK |
Kojto | 109:9296ab0bfc11 | 831 | #define CRG_MONCLK_SSR_RTCCLK (0x13ul) // RTCCLK |
Kojto | 109:9296ab0bfc11 | 832 | |
Kojto | 109:9296ab0bfc11 | 833 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 834 | /* */ |
Kojto | 109:9296ab0bfc11 | 835 | /* UART */ |
Kojto | 109:9296ab0bfc11 | 836 | /* */ |
Kojto | 109:9296ab0bfc11 | 837 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 838 | /****************** Bit definition for UART Data(UARTDR) register *************************/ |
Kojto | 109:9296ab0bfc11 | 839 | #define UART_DR_OE (0x01ul << 11) // Overrun Error |
Kojto | 109:9296ab0bfc11 | 840 | #define UART_DR_BE (0x01ul << 10) // Break Error |
Kojto | 109:9296ab0bfc11 | 841 | #define UART_DR_PE (0x01ul << 9) // Parity Error |
Kojto | 109:9296ab0bfc11 | 842 | #define UART_DR_FE (0x01ul << 8) // Framing Error |
Kojto | 109:9296ab0bfc11 | 843 | //#define UART_DR_DR // ToDo |
Kojto | 109:9296ab0bfc11 | 844 | /***************** Bit definition for UART Receive Status(UARTRSR) register ***************/ |
Kojto | 109:9296ab0bfc11 | 845 | #define UARTR_SR_OE (0x01ul << 3) // Overrun Error |
Kojto | 109:9296ab0bfc11 | 846 | #define UARTR_SR_BE (0x01ul << 2) // Break Error |
Kojto | 109:9296ab0bfc11 | 847 | #define UARTR_SR_PE (0x01ul << 1) // Parity Error |
Kojto | 109:9296ab0bfc11 | 848 | #define UARTR_SR_FE (0x01ul << 0) // Framing Error |
Kojto | 109:9296ab0bfc11 | 849 | /***************** Bit definition for UART Error Clear(UARTECR) register ******************/ |
Kojto | 109:9296ab0bfc11 | 850 | #define UARTE_CR_OE (0x01ul << 3) // Overrun Error |
Kojto | 109:9296ab0bfc11 | 851 | #define UARTE_CR_BE (0x01ul << 2) // Break Error |
Kojto | 109:9296ab0bfc11 | 852 | #define UARTE_CR_PE (0x01ul << 1) // Parity Error |
Kojto | 109:9296ab0bfc11 | 853 | #define UARTE_CR_FE (0x01ul << 0) // Framing Error |
Kojto | 109:9296ab0bfc11 | 854 | /****************** Bit definition for UART Flags(UARTFR) register ************************/ |
Kojto | 109:9296ab0bfc11 | 855 | #define UART_FR_RI (0x01ul << 8) // Ring indicator |
Kojto | 109:9296ab0bfc11 | 856 | #define UART_FR_TXFE (0x01ul << 7) // Transmit FIFO empty |
Kojto | 109:9296ab0bfc11 | 857 | #define UART_FR_RXFF (0x01ul << 6) // Receive FIFO full |
Kojto | 109:9296ab0bfc11 | 858 | #define UART_FR_TXFF (0x01ul << 5) // Transmit FIFO full |
Kojto | 109:9296ab0bfc11 | 859 | #define UART_FR_RXFE (0x01ul << 4) // Receive FIFO empty |
Kojto | 109:9296ab0bfc11 | 860 | #define UART_FR_BUSY (0x01ul << 3) // UART busy |
Kojto | 109:9296ab0bfc11 | 861 | #define UART_FR_DCD (0x01ul << 2) // Data carrier detect |
Kojto | 109:9296ab0bfc11 | 862 | #define UART_FR_DSR (0x01ul << 1) // Data set ready |
Kojto | 109:9296ab0bfc11 | 863 | #define UART_FR_CTS (0x01ul << 0) // Clear to send |
Kojto | 109:9296ab0bfc11 | 864 | /********** Bit definition for UART Low-power Counter(UARTILPR) register *******************/ |
Kojto | 109:9296ab0bfc11 | 865 | #define UARTILPR_COUNTER (0xFFul << 0) // 8-bit low-power divisor value (0..255) |
Kojto | 109:9296ab0bfc11 | 866 | /********************* Bit definition for Line Control(UARTLCR_H) register *****************/ |
Kojto | 109:9296ab0bfc11 | 867 | #define UART_LCR_H_SPS (0x1ul << 7) // Stick parity select |
Kojto | 109:9296ab0bfc11 | 868 | #define UART_LCR_H_WLEN(n) ((n & 0x3ul) << 5) // Word length ( 0=5bits, 1=6bits, 2=7bits, 3=8bits ) |
Kojto | 109:9296ab0bfc11 | 869 | #define UART_LCR_H_FEN (0x1ul << 4) // Enable FIFOs |
Kojto | 109:9296ab0bfc11 | 870 | #define UART_LCR_H_STP2 (0x1ul << 3) // Two stop bits select |
Kojto | 109:9296ab0bfc11 | 871 | #define UART_LCR_H_EPS (0x1ul << 2) // Even parity select |
Kojto | 109:9296ab0bfc11 | 872 | #define UART_LCR_H_PEN (0x1ul << 1) // Parity enable |
Kojto | 109:9296ab0bfc11 | 873 | #define UART_LCR_H_BRK (0x1ul << 0) // Send break |
Kojto | 109:9296ab0bfc11 | 874 | /********************* Bit definition for Contro(UARTCR) register *************************/ |
Kojto | 109:9296ab0bfc11 | 875 | #define UART_CR_CTSEn (0x1ul << 15) // CTS hardware flow control enable |
Kojto | 109:9296ab0bfc11 | 876 | #define UART_CR_RTSEn (0x1ul << 14) // RTS hardware flow control enable |
Kojto | 109:9296ab0bfc11 | 877 | #define UART_CR_Out2 (0x1ul << 13) // Complement of Out2 modem status output |
Kojto | 109:9296ab0bfc11 | 878 | #define UART_CR_Out1 (0x1ul << 12) // Complement of Out1 modem status output |
Kojto | 109:9296ab0bfc11 | 879 | #define UART_CR_RTS (0x1ul << 11) // Request to send |
Kojto | 109:9296ab0bfc11 | 880 | #define UART_CR_DTR (0x1ul << 10) // Data transmit ready |
Kojto | 109:9296ab0bfc11 | 881 | #define UART_CR_RXE (0x1ul << 9) // Receive enable |
Kojto | 109:9296ab0bfc11 | 882 | #define UART_CR_TXE (0x1ul << 8) // Transmit enable |
Kojto | 109:9296ab0bfc11 | 883 | #define UART_CR_LBE (0x1ul << 7) // Loop-back enable |
Kojto | 109:9296ab0bfc11 | 884 | #define UART_CR_SIRLP (0x1ul << 2) // IrDA SIR low power mode |
Kojto | 109:9296ab0bfc11 | 885 | #define UART_CR_SIREN (0x1ul << 1) // SIR enable |
Kojto | 109:9296ab0bfc11 | 886 | #define UART_CR_UARTEN (0x1ul << 0) // UART enable |
Kojto | 109:9296ab0bfc11 | 887 | /******* Bit definition for Interrupt FIFO Level Select(UARTIFLS) register *****************/ |
Kojto | 109:9296ab0bfc11 | 888 | #define UART_IFLS_RXIFLSEL(n) ((n & 0x7ul) << 3) // Receive interrupt FIFO level select(0=1/8 full, 1=1/4 full, 2=1/2 full, 3=3/4 full, 4=7/8 full) |
Kojto | 109:9296ab0bfc11 | 889 | #define UART_IFLS_TXIFLSEL(n) ((n & 0x7ul) << 0) // Transmit interrupt FIFO level select(0=1/8 full, 1=1/4 full, 2=1/2 full, 3=3/4 full, 4=7/8 full) |
Kojto | 109:9296ab0bfc11 | 890 | /******* Bit definition for Interrupt Mask Set/Clear(UARTIMSC) register ********************/ |
Kojto | 109:9296ab0bfc11 | 891 | #define UART_IMSC_OEIM (0x1ul << 10) // Overrun error interrupt mask |
Kojto | 109:9296ab0bfc11 | 892 | #define UART_IMSC_BEIM (0x1ul << 9) // Break error interrupt mask |
Kojto | 109:9296ab0bfc11 | 893 | #define UART_IMSC_PEIM (0x1ul << 8) // Parity error interrupt mask |
Kojto | 109:9296ab0bfc11 | 894 | #define UART_IMSC_FEIM (0x1ul << 7) // Framing error interrupt mask |
Kojto | 109:9296ab0bfc11 | 895 | #define UART_IMSC_RTIM (0x1ul << 6) // Receive interrupt mask |
Kojto | 109:9296ab0bfc11 | 896 | #define UART_IMSC_TXIM (0x1ul << 5) // Transmit interrupt mask |
Kojto | 109:9296ab0bfc11 | 897 | #define UART_IMSC_RXIM (0x1ul << 4) // Receive interrupt mask |
Kojto | 109:9296ab0bfc11 | 898 | #define UART_IMSC_DSRMIM (0x1ul << 3) // nUARTDSR modem interrupt mask |
Kojto | 109:9296ab0bfc11 | 899 | #define UART_IMSC_DCDMIM (0x1ul << 2) // nUARTDCD modem interrupt mask |
Kojto | 109:9296ab0bfc11 | 900 | #define UART_IMSC_CTSMIM (0x1ul << 1) // nUARTCTS modem interrupt mask |
Kojto | 109:9296ab0bfc11 | 901 | #define UART_IMSC_RIMIM (0x1ul << 0) // nUARTRI modem interrupt mask |
Kojto | 109:9296ab0bfc11 | 902 | /*************** Bit definition for Raw Interrupt Status(UARTRIS) register *****************/ |
Kojto | 109:9296ab0bfc11 | 903 | #define UART_RIS_OEIM (0x1ul << 10) // Overrun error interrupt status |
Kojto | 109:9296ab0bfc11 | 904 | #define UART_RIS_BEIM (0x1ul << 9) // Break error interrupt status |
Kojto | 109:9296ab0bfc11 | 905 | #define UART_RIS_PEIM (0x1ul << 8) // Parity error interrupt status |
Kojto | 109:9296ab0bfc11 | 906 | #define UART_RIS_FEIM (0x1ul << 7) // Framing error interrupt status |
Kojto | 109:9296ab0bfc11 | 907 | #define UART_RIS_RTIM (0x1ul << 6) // Receive interrupt status |
Kojto | 109:9296ab0bfc11 | 908 | #define UART_RIS_TXIM (0x1ul << 5) // Transmit interrupt status |
Kojto | 109:9296ab0bfc11 | 909 | #define UART_RIS_RXIM (0x1ul << 4) // Receive interrupt status |
Kojto | 109:9296ab0bfc11 | 910 | #define UART_RIS_DSRMIM (0x1ul << 3) // nUARTDSR modem interrupt status |
Kojto | 109:9296ab0bfc11 | 911 | #define UART_RIS_DCDMIM (0x1ul << 2) // nUARTDCD modem interrupt status |
Kojto | 109:9296ab0bfc11 | 912 | #define UART_RIS_CTSMIM (0x1ul << 1) // nUARTCTS modem interrupt status |
Kojto | 109:9296ab0bfc11 | 913 | #define UART_RIS_RIMIM (0x1ul << 0) // nUARTRI modem interrupt status |
Kojto | 109:9296ab0bfc11 | 914 | /************** Bit definition for Masked Interrupt Status(UARTMIS) register ****************/ |
Kojto | 109:9296ab0bfc11 | 915 | #define UART_MIS_OEIM (0x1ul << 10) // Overrun error masked interrupt status |
Kojto | 109:9296ab0bfc11 | 916 | #define UART_MIS_BEIM (0x1ul << 9) // Break error masked interrupt status |
Kojto | 109:9296ab0bfc11 | 917 | #define UART_MIS_PEIM (0x1ul << 8) // Parity error masked interrupt status |
Kojto | 109:9296ab0bfc11 | 918 | #define UART_MIS_FEIM (0x1ul << 7) // Framing error masked interrupt status |
Kojto | 109:9296ab0bfc11 | 919 | #define UART_MIS_RTIM (0x1ul << 6) // Receive masked interrupt status |
Kojto | 109:9296ab0bfc11 | 920 | #define UART_MIS_TXIM (0x1ul << 5) // Transmit masked interrupt status |
Kojto | 109:9296ab0bfc11 | 921 | #define UART_MIS_RXIM (0x1ul << 4) // Receive masked interrupt status |
Kojto | 109:9296ab0bfc11 | 922 | #define UART_MIS_DSRMIM (0x1ul << 3) // nUARTDSR modem masked interrupt status |
Kojto | 109:9296ab0bfc11 | 923 | #define UART_MIS_DCDMIM (0x1ul << 2) // nUARTDCD modem masked interrupt status |
Kojto | 109:9296ab0bfc11 | 924 | #define UART_MIS_CTSMIM (0x1ul << 1) // nUARTCTS modem masked interrupt status |
Kojto | 109:9296ab0bfc11 | 925 | #define UART_MIS_RIMIM (0x1ul << 0) // nUARTRI modem masked interrupt status |
Kojto | 109:9296ab0bfc11 | 926 | /*************** Bit definition for Interrupt Clear(UARTICR) register ************************/ |
Kojto | 109:9296ab0bfc11 | 927 | #define UART_ICR_OEIM (0x1ul << 10) // Overrun error interrupt clear |
Kojto | 109:9296ab0bfc11 | 928 | #define UART_ICR_BEIM (0x1ul << 9) // Break error interrupt clear |
Kojto | 109:9296ab0bfc11 | 929 | #define UART_ICR_PEIM (0x1ul << 8) // Parity error interrupt clear |
Kojto | 109:9296ab0bfc11 | 930 | #define UART_ICR_FEIM (0x1ul << 7) // Framing error interrupt clear |
Kojto | 109:9296ab0bfc11 | 931 | #define UART_ICR_RTIM (0x1ul << 6) // Receive interrupt clear |
Kojto | 109:9296ab0bfc11 | 932 | #define UART_ICR_TXIM (0x1ul << 5) // Transmit interrupt clear |
Kojto | 109:9296ab0bfc11 | 933 | #define UART_ICR_RXIM (0x1ul << 4) // Receive interrupt clear |
Kojto | 109:9296ab0bfc11 | 934 | #define UART_ICR_DSRMIM (0x1ul << 3) // nUARTDSR modem interrupt clear |
Kojto | 109:9296ab0bfc11 | 935 | #define UART_ICR_DCDMIM (0x1ul << 2) // nUARTDCD modem interrupt clear |
Kojto | 109:9296ab0bfc11 | 936 | #define UART_ICR_CTSMIM (0x1ul << 1) // nUARTCTS modem interrupt clear |
Kojto | 109:9296ab0bfc11 | 937 | #define UART_ICR_RIMIM (0x1ul << 0) // nUARTRI modem interrupt clear |
Kojto | 109:9296ab0bfc11 | 938 | /***************** Bit definition for DMA Control(UARTDMACR) register ************************/ |
Kojto | 109:9296ab0bfc11 | 939 | #define UART_DMACR_DMAONERR (0x1ul << 2) // DMA on error |
Kojto | 109:9296ab0bfc11 | 940 | #define UART_DMACR_TXDMAE (0x1ul << 1) // Transmit DMA enable |
Kojto | 109:9296ab0bfc11 | 941 | #define UART_DMACR_RXDMAE (0x1ul << 0) // Receive DMA enable |
Kojto | 109:9296ab0bfc11 | 942 | |
Kojto | 109:9296ab0bfc11 | 943 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 944 | /* */ |
Kojto | 109:9296ab0bfc11 | 945 | /* Simple UART */ |
Kojto | 109:9296ab0bfc11 | 946 | /* */ |
Kojto | 109:9296ab0bfc11 | 947 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 948 | /***************** Bit definition for S_UART Data () register ************************/ |
Kojto | 109:9296ab0bfc11 | 949 | #define S_UART_DATA (0xFFul << 0) |
Kojto | 109:9296ab0bfc11 | 950 | /***************** Bit definition for S_UART State() register ************************/ |
Kojto | 109:9296ab0bfc11 | 951 | #define S_UART_STATE_TX_BUF_OVERRUN (0x01ul << 2) // TX buffer overrun, wirte 1 to clear. |
Kojto | 109:9296ab0bfc11 | 952 | #define S_UART_STATE_RX_BUF_FULL (0x01ul << 1) // RX buffer full, read only. |
Kojto | 109:9296ab0bfc11 | 953 | #define S_UART_STATE_TX_BUF_FULL (0x01ul << 0) // TX buffer full, read only. |
Kojto | 109:9296ab0bfc11 | 954 | /***************** Bit definition for S_UART Control() register ************************/ |
Kojto | 109:9296ab0bfc11 | 955 | #define S_UART_CTRL_HIGH_SPEED_TEST (0x01ul << 6) // High-speed test mode for TX only. |
Kojto | 109:9296ab0bfc11 | 956 | #define S_UART_CTRL_RX_OVERRUN_EN (0x01ul << 5) // RX overrun interrupt enable. |
Kojto | 109:9296ab0bfc11 | 957 | #define S_UART_CTRL_TX_OVERRUN_EN (0x01ul << 4) // TX overrun interrupt enable. |
Kojto | 109:9296ab0bfc11 | 958 | #define S_UART_CTRL_RX_INT_EN (0x01ul << 3) // RX interrupt enable. |
Kojto | 109:9296ab0bfc11 | 959 | #define S_UART_CTRL_TX_INT_EN (0x01ul << 2) // TX interrupt enable. |
Kojto | 109:9296ab0bfc11 | 960 | #define S_UART_CTRL_RX_EN (0x01ul << 1) // RX enable. |
Kojto | 109:9296ab0bfc11 | 961 | #define S_UART_CTRL_TX_EN (0x01ul << 0) // TX enable. |
Kojto | 109:9296ab0bfc11 | 962 | /***************** Bit definition for S_UART Interrupt() register ************************/ |
Kojto | 109:9296ab0bfc11 | 963 | #define S_UART_INT_RX_OVERRUN (0x01ul << 3) // RX overrun interrupt. Wirte 1 to clear |
Kojto | 109:9296ab0bfc11 | 964 | #define S_UART_INT_TX_OVERRUN (0x01ul << 2) // TX overrun interrupt. Write 1 to clear |
Kojto | 109:9296ab0bfc11 | 965 | #define S_UART_INT_RX (0x01ul << 1) // RX interrupt. Write 1 to clear |
Kojto | 109:9296ab0bfc11 | 966 | #define S_UART_INT_TX (0x01ul << 0) // TX interrupt. Write 1 to clear |
Kojto | 109:9296ab0bfc11 | 967 | |
Kojto | 109:9296ab0bfc11 | 968 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 969 | /* */ |
Kojto | 109:9296ab0bfc11 | 970 | /* Analog Digital Register */ |
Kojto | 109:9296ab0bfc11 | 971 | /* */ |
Kojto | 109:9296ab0bfc11 | 972 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 973 | |
Kojto | 109:9296ab0bfc11 | 974 | /*********************** Bit definition for ADC_CTR ***********************/ |
Kojto | 109:9296ab0bfc11 | 975 | //#define ADC_CTR_SAMSEL_ABNORMAL (0x0ul) // Abnormal Operation |
Kojto | 109:9296ab0bfc11 | 976 | //#define ADC_CTR_SAMSEL_NORMAL (0x1ul) // Normal Operation |
Kojto | 109:9296ab0bfc11 | 977 | #define ADC_CTR_PWD_NRMOP (0x1ul) // Active Operation |
Kojto | 109:9296ab0bfc11 | 978 | #define ADC_CTR_PWD_PD (0x3ul) // Power down |
Kojto | 109:9296ab0bfc11 | 979 | /*********************** Bit definition for ADC_CHSEL ***********************/ |
Kojto | 109:9296ab0bfc11 | 980 | #define ADC_CHSEL_CH0 (0x0ul) // Channel 0 |
Kojto | 109:9296ab0bfc11 | 981 | #define ADC_CHSEL_CH1 (0x1ul) // Channel 1 |
Kojto | 109:9296ab0bfc11 | 982 | #define ADC_CHSEL_CH2 (0x2ul) // Channel 2 |
Kojto | 109:9296ab0bfc11 | 983 | #define ADC_CHSEL_CH3 (0x3ul) // Channel 3 |
Kojto | 109:9296ab0bfc11 | 984 | #define ADC_CHSEL_CH4 (0x4ul) // Channel 4 |
Kojto | 109:9296ab0bfc11 | 985 | #define ADC_CHSEL_CH5 (0x5ul) // Channel 5 |
Kojto | 109:9296ab0bfc11 | 986 | #define ADC_CHSEL_CH6 (0x6ul) // Channel 6 |
Kojto | 109:9296ab0bfc11 | 987 | #define ADC_CHSEL_CH7 (0x7ul) // Channel 7 |
Kojto | 109:9296ab0bfc11 | 988 | #define ADC_CHSEL_CH15 (0xful) // LDO output(1.5V) |
Kojto | 109:9296ab0bfc11 | 989 | /*********************** Bit definition for ADC_START ***********************/ |
Kojto | 109:9296ab0bfc11 | 990 | #define ADC_START_START (0x1ul) // ADC conversion start |
Kojto | 109:9296ab0bfc11 | 991 | /*********************** Bit definition for ADC_DATA ***********************/ |
Kojto | 109:9296ab0bfc11 | 992 | //ToDo (Readonly) |
Kojto | 109:9296ab0bfc11 | 993 | |
Kojto | 109:9296ab0bfc11 | 994 | /*********************** Bit definition for ADC_INT ***********************/ |
Kojto | 109:9296ab0bfc11 | 995 | #define ADC_INT_MASK_DIS (0x0ul << 1) // Interrupt disable |
Kojto | 109:9296ab0bfc11 | 996 | #define ADC_INT_MASK_ENA (0x1ul << 1) // Interrupt enable |
Kojto | 109:9296ab0bfc11 | 997 | //ToDo (Readonly) |
Kojto | 109:9296ab0bfc11 | 998 | |
Kojto | 109:9296ab0bfc11 | 999 | /*********************** Bit definition for ADC_INTCLR ***********************/ |
Kojto | 109:9296ab0bfc11 | 1000 | #define ADC_INTCLEAR (0x1ul) // ADC Interrupt clear |
Kojto | 109:9296ab0bfc11 | 1001 | |
Kojto | 109:9296ab0bfc11 | 1002 | #define W7500x_ADC_BASE (W7500x_APB2_BASE + 0x00000000UL) |
Kojto | 109:9296ab0bfc11 | 1003 | #define ADC ((ADC_TypeDef *) W7500x_ADC_BASE) |
Kojto | 109:9296ab0bfc11 | 1004 | |
Kojto | 109:9296ab0bfc11 | 1005 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 1006 | /* */ |
Kojto | 109:9296ab0bfc11 | 1007 | /* Dual Timer */ |
Kojto | 109:9296ab0bfc11 | 1008 | /* */ |
Kojto | 109:9296ab0bfc11 | 1009 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 1010 | |
Kojto | 109:9296ab0bfc11 | 1011 | /*********************** Bit definition for dualtimer ***********************/ |
Kojto | 109:9296ab0bfc11 | 1012 | #define DUALTIMER_TimerControl_TimerDIsable 0x0ul |
Kojto | 109:9296ab0bfc11 | 1013 | #define DUALTIMER_TimerControl_TimerEnable 0x1ul |
Kojto | 109:9296ab0bfc11 | 1014 | #define DUALTIMER_TimerControl_TimerEnable_Pos 7 |
Kojto | 109:9296ab0bfc11 | 1015 | |
Kojto | 109:9296ab0bfc11 | 1016 | #define DUALTIMER_TimerControl_FreeRunning 0x0ul |
Kojto | 109:9296ab0bfc11 | 1017 | #define DUALTIMER_TimerControl_Periodic 0x1ul |
Kojto | 109:9296ab0bfc11 | 1018 | #define DUALTIMER_TimerControl_TimerMode_Pos 6 |
Kojto | 109:9296ab0bfc11 | 1019 | |
Kojto | 109:9296ab0bfc11 | 1020 | #define DUALTIMER_TimerControl_IntDisable 0x0ul |
Kojto | 109:9296ab0bfc11 | 1021 | #define DUALTIMER_TimerControl_IntEnable 0x1ul |
Kojto | 109:9296ab0bfc11 | 1022 | #define DUALTIMER_TimerControl_IntEnable_Pos 5 |
Kojto | 109:9296ab0bfc11 | 1023 | |
Kojto | 109:9296ab0bfc11 | 1024 | #define DUALTIMER_TimerControl_Pre_1 0x0ul |
Kojto | 109:9296ab0bfc11 | 1025 | #define DUALTIMER_TimerControl_Pre_16 0x1ul |
Kojto | 109:9296ab0bfc11 | 1026 | #define DUALTIMER_TimerControl_Pre_256 0x2ul |
Kojto | 109:9296ab0bfc11 | 1027 | #define DUALTIMER_TimerControl_Pre_Pos 2 |
Kojto | 109:9296ab0bfc11 | 1028 | |
Kojto | 109:9296ab0bfc11 | 1029 | #define DUALTIMER_TimerControl_Size_16 0x0ul |
Kojto | 109:9296ab0bfc11 | 1030 | #define DUALTIMER_TimerControl_Size_32 0x1ul |
Kojto | 109:9296ab0bfc11 | 1031 | #define DUALTIMER_TimerControl_Size_Pos 1 |
Kojto | 109:9296ab0bfc11 | 1032 | |
Kojto | 109:9296ab0bfc11 | 1033 | #define DUALTIMER_TimerControl_Wrapping 0x0ul |
Kojto | 109:9296ab0bfc11 | 1034 | #define DUALTIMER_TimerControl_OneShot 0x1ul |
Kojto | 109:9296ab0bfc11 | 1035 | #define DUALTIMER_TimerControl_OneShot_Pos 0 |
Kojto | 109:9296ab0bfc11 | 1036 | |
Kojto | 109:9296ab0bfc11 | 1037 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 1038 | /* */ |
Kojto | 109:9296ab0bfc11 | 1039 | /* External Interrupt */ |
Kojto | 109:9296ab0bfc11 | 1040 | /* */ |
Kojto | 109:9296ab0bfc11 | 1041 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 1042 | |
Kojto | 109:9296ab0bfc11 | 1043 | /**************** Bit definition for Px_IER **************************/ |
Kojto | 109:9296ab0bfc11 | 1044 | #define EXTI_Px_INTPOR_RISING_EDGE (0x00ul << 0) |
Kojto | 109:9296ab0bfc11 | 1045 | #define EXTI_Px_INTPOR_FALLING_EDGE (0x01ul << 0) |
Kojto | 109:9296ab0bfc11 | 1046 | #define EXTI_Px_INTEN_DISABLE (0x00ul << 1) |
Kojto | 109:9296ab0bfc11 | 1047 | #define EXTI_Px_INTEN_ENABLE (0x01ul << 1) |
Kojto | 109:9296ab0bfc11 | 1048 | |
Kojto | 109:9296ab0bfc11 | 1049 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 1050 | /* */ |
Kojto | 109:9296ab0bfc11 | 1051 | /* GPIO */ |
Kojto | 109:9296ab0bfc11 | 1052 | /* */ |
Kojto | 109:9296ab0bfc11 | 1053 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 1054 | |
Kojto | 109:9296ab0bfc11 | 1055 | /**************** Bit definition for Px_AFSR **************************/ |
Kojto | 109:9296ab0bfc11 | 1056 | #define Px_AFSR_AF0 (0x00ul) |
Kojto | 109:9296ab0bfc11 | 1057 | #define Px_AFSR_AF1 (0x01ul) |
Kojto | 109:9296ab0bfc11 | 1058 | #define Px_AFSR_AF2 (0x02ul) |
Kojto | 109:9296ab0bfc11 | 1059 | #define Px_AFSR_AF3 (0x03ul) |
Kojto | 109:9296ab0bfc11 | 1060 | /**************** Bit definition for Px_PCR **************************/ |
Kojto | 109:9296ab0bfc11 | 1061 | #define Px_PCR_PUPD_DOWN (0x01ul << 0) // Pull Down |
Kojto | 109:9296ab0bfc11 | 1062 | #define Px_PCR_PUPD_UP (0x01ul << 1) // Pull Up |
Kojto | 109:9296ab0bfc11 | 1063 | #define Px_PCR_DS_HIGH (0x01ul << 2) // High Driving |
Kojto | 109:9296ab0bfc11 | 1064 | #define Px_PCR_OD (0x01ul << 3) // Open Drain |
Kojto | 109:9296ab0bfc11 | 1065 | #define Px_PCR_IE (0x01ul << 5) // Input Buffer Enable |
Kojto | 109:9296ab0bfc11 | 1066 | #define Px_PCR_CS_SUMMIT (0x01ul << 6) // Use Summit Trigger Input Buffer |
Kojto | 109:9296ab0bfc11 | 1067 | |
Kojto | 109:9296ab0bfc11 | 1068 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 1069 | /* */ |
Kojto | 109:9296ab0bfc11 | 1070 | /* I2C */ |
Kojto | 109:9296ab0bfc11 | 1071 | /* */ |
Kojto | 109:9296ab0bfc11 | 1072 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 1073 | |
Kojto | 109:9296ab0bfc11 | 1074 | /**************** Bit definition for I2C_CTR **************************/ |
Kojto | 109:9296ab0bfc11 | 1075 | #define I2C_CTR_COREEN (0x01ul << 7 ) // 0x80 |
Kojto | 109:9296ab0bfc11 | 1076 | #define I2C_CTR_INTEREN (0x01ul << 6 ) // 0x40 |
Kojto | 109:9296ab0bfc11 | 1077 | #define I2C_CTR_MODE (0x01ul << 5 ) // 0x20 |
Kojto | 109:9296ab0bfc11 | 1078 | #define I2C_CTR_ADDR10 (0x01ul << 4 ) // 0x10 |
Kojto | 109:9296ab0bfc11 | 1079 | #define I2C_CTR_CTRRWN (0x01ul << 3 ) // 0x08 |
Kojto | 109:9296ab0bfc11 | 1080 | #define I2C_CTR_CTEN (0x01ul << 2 ) // 0x04 |
Kojto | 109:9296ab0bfc11 | 1081 | |
Kojto | 109:9296ab0bfc11 | 1082 | /**************** Bit definition for I2C_CMDR **************************/ |
Kojto | 109:9296ab0bfc11 | 1083 | #define I2C_CMDR_STA (0x01ul << 7 ) // 0x80 |
Kojto | 109:9296ab0bfc11 | 1084 | #define I2C_CMDR_STO (0x01ul << 6 ) // 0x40 |
Kojto | 109:9296ab0bfc11 | 1085 | #define I2C_CMDR_ACK (0x01ul << 5 ) // 0x20 |
Kojto | 109:9296ab0bfc11 | 1086 | #define I2C_CMDR_RESTA (0x01ul << 4 ) // 0x10 |
Kojto | 109:9296ab0bfc11 | 1087 | |
Kojto | 109:9296ab0bfc11 | 1088 | /**************** Bit definition for I2C_ISCR **************************/ |
Kojto | 109:9296ab0bfc11 | 1089 | #define I2C_ISCR_RST (0x01ul << 1) // 0x01 |
Kojto | 109:9296ab0bfc11 | 1090 | |
Kojto | 109:9296ab0bfc11 | 1091 | /**************** Bit definition for I2C_SR **************************/ |
Kojto | 109:9296ab0bfc11 | 1092 | #define I2C_SR_TX (0x01ul << 9 ) // 0x200 |
Kojto | 109:9296ab0bfc11 | 1093 | #define I2C_SR_RX (0x01ul << 8 ) // 0x100 |
Kojto | 109:9296ab0bfc11 | 1094 | #define I2C_SR_ACKT (0x01ul << 7 ) // 0x080 |
Kojto | 109:9296ab0bfc11 | 1095 | #define I2C_SR_BT (0x01ul << 6 ) // 0x040 |
Kojto | 109:9296ab0bfc11 | 1096 | #define I2C_SR_SA (0x01ul << 5 ) // 0x020 |
Kojto | 109:9296ab0bfc11 | 1097 | #define I2C_SR_SB (0x01ul << 4 ) // 0x010 |
Kojto | 109:9296ab0bfc11 | 1098 | #define I2C_SR_AL (0x01ul << 3 ) // 0x008 |
Kojto | 109:9296ab0bfc11 | 1099 | #define I2C_SR_TO (0x01ul << 2 ) // 0x004 |
Kojto | 109:9296ab0bfc11 | 1100 | #define I2C_SR_SRW (0x01ul << 1 ) // 0x002 |
Kojto | 109:9296ab0bfc11 | 1101 | #define I2C_SR_ACKR (0x01ul << 0 ) // 0x001 |
Kojto | 109:9296ab0bfc11 | 1102 | |
Kojto | 109:9296ab0bfc11 | 1103 | /**************** Bit definition for I2C_ISR **************************/ |
Kojto | 109:9296ab0bfc11 | 1104 | #define I2C_ISR_STAE (0x01ul << 4 ) // 0x010 |
Kojto | 109:9296ab0bfc11 | 1105 | #define I2C_ISR_STOE (0x01ul << 3 ) // 0x008 |
Kojto | 109:9296ab0bfc11 | 1106 | #define I2C_ISR_TOE (0x01ul << 2 ) // 0x004 |
Kojto | 109:9296ab0bfc11 | 1107 | #define I2C_ISR_ACK_RXE (0x01ul << 1 ) // 0x002 |
Kojto | 109:9296ab0bfc11 | 1108 | #define I2C_ISR_ACK_TXE (0x01ul << 0 ) // 0x001 |
Kojto | 109:9296ab0bfc11 | 1109 | |
Kojto | 109:9296ab0bfc11 | 1110 | /**************** Bit definition for I2C_ISMR **************************/ |
Kojto | 109:9296ab0bfc11 | 1111 | #define I2C_ISR_STAEM (0x01ul << 4 ) // 0x010 |
Kojto | 109:9296ab0bfc11 | 1112 | #define I2C_ISR_STOEM (0x01ul << 3 ) // 0x008 |
Kojto | 109:9296ab0bfc11 | 1113 | #define I2C_ISR_TOEM (0x01ul << 2 ) // 0x004 |
Kojto | 109:9296ab0bfc11 | 1114 | #define I2C_ISR_ACK_RXEM (0x01ul << 1 ) // 0x002 |
Kojto | 109:9296ab0bfc11 | 1115 | #define I2C_ISR_ACK_TXEM (0x01ul << 0 ) // 0x001 |
Kojto | 109:9296ab0bfc11 | 1116 | |
Kojto | 109:9296ab0bfc11 | 1117 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 1118 | /* */ |
Kojto | 109:9296ab0bfc11 | 1119 | /* PWM */ |
Kojto | 109:9296ab0bfc11 | 1120 | /* */ |
Kojto | 109:9296ab0bfc11 | 1121 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 1122 | |
Kojto | 109:9296ab0bfc11 | 1123 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 1124 | /* */ |
Kojto | 109:9296ab0bfc11 | 1125 | /* Random number generator Register */ |
Kojto | 109:9296ab0bfc11 | 1126 | /* */ |
Kojto | 109:9296ab0bfc11 | 1127 | /******************************************************************************/ |
Kojto | 109:9296ab0bfc11 | 1128 | |
Kojto | 109:9296ab0bfc11 | 1129 | /*********************** Bit definition for RNG_RUN ***********************/ |
Kojto | 109:9296ab0bfc11 | 1130 | #define RNG_RUN_STOP (0x0ul) // STOP RNG shift register |
Kojto | 109:9296ab0bfc11 | 1131 | #define RNG_RUN_RUN (0x1ul) // RUN RNG shift register |
Kojto | 109:9296ab0bfc11 | 1132 | /*********************** Bit definition for RNG_SEED ***********************/ |
Kojto | 109:9296ab0bfc11 | 1133 | //ToDo |
Kojto | 109:9296ab0bfc11 | 1134 | |
Kojto | 109:9296ab0bfc11 | 1135 | /*********************** Bit definition for RNG_CLKSEL ***********************/ |
Kojto | 109:9296ab0bfc11 | 1136 | #define RNG_CLKSEL_RNGCLK (0x0ul) // RNGCLK is source clock for rng shift register |
Kojto | 109:9296ab0bfc11 | 1137 | #define RNG_CLKSEL_APBCLK (0x1ul) // APBCLK is source clock for rng shift register |
Kojto | 109:9296ab0bfc11 | 1138 | /*********************** Bit definition for RNG_ENABLE ***********************/ |
Kojto | 109:9296ab0bfc11 | 1139 | #define RNG_MANUAL_DISABLE (0x0ul) // RNG disble |
Kojto | 109:9296ab0bfc11 | 1140 | #define RNG_MANUAL_ENABLE (0x1ul) // RNG enable |
Kojto | 109:9296ab0bfc11 | 1141 | /*********************** Bit definition for RNG_RN ***********************/ |
Kojto | 109:9296ab0bfc11 | 1142 | //ToDo |
Kojto | 109:9296ab0bfc11 | 1143 | |
Kojto | 109:9296ab0bfc11 | 1144 | /*********************** Bit definition for RNG_POLY ***********************/ |
Kojto | 109:9296ab0bfc11 | 1145 | //ToDo |
Kojto | 109:9296ab0bfc11 | 1146 | |
Kojto | 109:9296ab0bfc11 | 1147 | |
Kojto | 109:9296ab0bfc11 | 1148 | |
Kojto | 109:9296ab0bfc11 | 1149 | typedef enum |
Kojto | 109:9296ab0bfc11 | 1150 | { |
Kojto | 109:9296ab0bfc11 | 1151 | PAD_PA = 0, |
Kojto | 109:9296ab0bfc11 | 1152 | PAD_PB, |
Kojto | 109:9296ab0bfc11 | 1153 | PAD_PC, |
Kojto | 109:9296ab0bfc11 | 1154 | PAD_PD |
Kojto | 109:9296ab0bfc11 | 1155 | }PAD_Type; |
Kojto | 109:9296ab0bfc11 | 1156 | |
Kojto | 109:9296ab0bfc11 | 1157 | typedef enum |
Kojto | 109:9296ab0bfc11 | 1158 | { |
Kojto | 109:9296ab0bfc11 | 1159 | PAD_AF0 = Px_AFSR_AF0, |
Kojto | 109:9296ab0bfc11 | 1160 | PAD_AF1 = Px_AFSR_AF1, |
Kojto | 109:9296ab0bfc11 | 1161 | PAD_AF2 = Px_AFSR_AF2, |
Kojto | 109:9296ab0bfc11 | 1162 | PAD_AF3 = Px_AFSR_AF3 |
Kojto | 109:9296ab0bfc11 | 1163 | }PAD_AF_TypeDef; |
Kojto | 109:9296ab0bfc11 | 1164 | |
Kojto | 109:9296ab0bfc11 | 1165 | |
Kojto | 109:9296ab0bfc11 | 1166 | #if !defined (USE_HAL_DRIVER) |
Kojto | 109:9296ab0bfc11 | 1167 | #define USE_HAL_DRIVER |
Kojto | 109:9296ab0bfc11 | 1168 | #endif /* USE_HAL_DRIVER */ |
Kojto | 109:9296ab0bfc11 | 1169 | |
Kojto | 109:9296ab0bfc11 | 1170 | |
Kojto | 109:9296ab0bfc11 | 1171 | |
Kojto | 109:9296ab0bfc11 | 1172 | #if defined (USE_HAL_DRIVER) |
Kojto | 109:9296ab0bfc11 | 1173 | // #include "system_W7500x.h" |
Kojto | 109:9296ab0bfc11 | 1174 | // #include "W7500x_conf.h" |
Kojto | 109:9296ab0bfc11 | 1175 | #endif |
Kojto | 109:9296ab0bfc11 | 1176 | |
Kojto | 109:9296ab0bfc11 | 1177 | #ifdef USE_FULL_ASSERT |
Kojto | 109:9296ab0bfc11 | 1178 | #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__,__LINE__)) |
Kojto | 109:9296ab0bfc11 | 1179 | #else |
Kojto | 109:9296ab0bfc11 | 1180 | #define assert_param(expr) ((void)0) |
Kojto | 109:9296ab0bfc11 | 1181 | #endif /* USE_FULL_ASSERT */ |
Kojto | 109:9296ab0bfc11 | 1182 | |
Kojto | 109:9296ab0bfc11 | 1183 | #ifdef __cplusplus |
Kojto | 109:9296ab0bfc11 | 1184 | } |
Kojto | 109:9296ab0bfc11 | 1185 | #endif |
Kojto | 109:9296ab0bfc11 | 1186 | |
Kojto | 109:9296ab0bfc11 | 1187 | #endif /* W7500x_H */ |
Kojto | 109:9296ab0bfc11 | 1188 | |
Kojto | 109:9296ab0bfc11 | 1189 | |
Kojto | 109:9296ab0bfc11 | 1190 | |
Kojto | 109:9296ab0bfc11 | 1191 | /************************ (C) COPYRIGHT Wiznet *****END OF FILE****/ |