The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_K64F/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/device/device/MK64F12/MK64F12_usb.h@104:b9ad9a133dc7, 2015-08-05 (annotated)
- Committer:
- Kojto
- Date:
- Wed Aug 05 13:16:35 2015 +0100
- Revision:
- 104:b9ad9a133dc7
- Parent:
- 90:cb3d968589d8
Release 104 of the mbed library:
Changes:
- new platforms: nrf51 microbit
- MAXxxx - fix pwm array search
- LPC8xx - usart enable fix
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 90:cb3d968589d8 | 1 | /* |
Kojto | 90:cb3d968589d8 | 2 | ** ################################################################### |
Kojto | 90:cb3d968589d8 | 3 | ** Compilers: Keil ARM C/C++ Compiler |
Kojto | 90:cb3d968589d8 | 4 | ** Freescale C/C++ for Embedded ARM |
Kojto | 90:cb3d968589d8 | 5 | ** GNU C Compiler |
Kojto | 90:cb3d968589d8 | 6 | ** IAR ANSI C/C++ Compiler for ARM |
Kojto | 90:cb3d968589d8 | 7 | ** |
Kojto | 90:cb3d968589d8 | 8 | ** Reference manual: K64P144M120SF5RM, Rev.2, January 2014 |
Kojto | 90:cb3d968589d8 | 9 | ** Version: rev. 2.5, 2014-02-10 |
Kojto | 90:cb3d968589d8 | 10 | ** Build: b140604 |
Kojto | 90:cb3d968589d8 | 11 | ** |
Kojto | 90:cb3d968589d8 | 12 | ** Abstract: |
Kojto | 90:cb3d968589d8 | 13 | ** Extension to the CMSIS register access layer header. |
Kojto | 90:cb3d968589d8 | 14 | ** |
Kojto | 90:cb3d968589d8 | 15 | ** Copyright (c) 2014 Freescale Semiconductor, Inc. |
Kojto | 90:cb3d968589d8 | 16 | ** All rights reserved. |
Kojto | 90:cb3d968589d8 | 17 | ** |
Kojto | 90:cb3d968589d8 | 18 | ** Redistribution and use in source and binary forms, with or without modification, |
Kojto | 90:cb3d968589d8 | 19 | ** are permitted provided that the following conditions are met: |
Kojto | 90:cb3d968589d8 | 20 | ** |
Kojto | 90:cb3d968589d8 | 21 | ** o Redistributions of source code must retain the above copyright notice, this list |
Kojto | 90:cb3d968589d8 | 22 | ** of conditions and the following disclaimer. |
Kojto | 90:cb3d968589d8 | 23 | ** |
Kojto | 90:cb3d968589d8 | 24 | ** o Redistributions in binary form must reproduce the above copyright notice, this |
Kojto | 90:cb3d968589d8 | 25 | ** list of conditions and the following disclaimer in the documentation and/or |
Kojto | 90:cb3d968589d8 | 26 | ** other materials provided with the distribution. |
Kojto | 90:cb3d968589d8 | 27 | ** |
Kojto | 90:cb3d968589d8 | 28 | ** o Neither the name of Freescale Semiconductor, Inc. nor the names of its |
Kojto | 90:cb3d968589d8 | 29 | ** contributors may be used to endorse or promote products derived from this |
Kojto | 90:cb3d968589d8 | 30 | ** software without specific prior written permission. |
Kojto | 90:cb3d968589d8 | 31 | ** |
Kojto | 90:cb3d968589d8 | 32 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
Kojto | 90:cb3d968589d8 | 33 | ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
Kojto | 90:cb3d968589d8 | 34 | ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Kojto | 90:cb3d968589d8 | 35 | ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
Kojto | 90:cb3d968589d8 | 36 | ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
Kojto | 90:cb3d968589d8 | 37 | ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
Kojto | 90:cb3d968589d8 | 38 | ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
Kojto | 90:cb3d968589d8 | 39 | ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
Kojto | 90:cb3d968589d8 | 40 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
Kojto | 90:cb3d968589d8 | 41 | ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Kojto | 90:cb3d968589d8 | 42 | ** |
Kojto | 90:cb3d968589d8 | 43 | ** http: www.freescale.com |
Kojto | 90:cb3d968589d8 | 44 | ** mail: support@freescale.com |
Kojto | 90:cb3d968589d8 | 45 | ** |
Kojto | 90:cb3d968589d8 | 46 | ** Revisions: |
Kojto | 90:cb3d968589d8 | 47 | ** - rev. 1.0 (2013-08-12) |
Kojto | 90:cb3d968589d8 | 48 | ** Initial version. |
Kojto | 90:cb3d968589d8 | 49 | ** - rev. 2.0 (2013-10-29) |
Kojto | 90:cb3d968589d8 | 50 | ** Register accessor macros added to the memory map. |
Kojto | 90:cb3d968589d8 | 51 | ** Symbols for Processor Expert memory map compatibility added to the memory map. |
Kojto | 90:cb3d968589d8 | 52 | ** Startup file for gcc has been updated according to CMSIS 3.2. |
Kojto | 90:cb3d968589d8 | 53 | ** System initialization updated. |
Kojto | 90:cb3d968589d8 | 54 | ** MCG - registers updated. |
Kojto | 90:cb3d968589d8 | 55 | ** PORTA, PORTB, PORTC, PORTE - registers for digital filter removed. |
Kojto | 90:cb3d968589d8 | 56 | ** - rev. 2.1 (2013-10-30) |
Kojto | 90:cb3d968589d8 | 57 | ** Definition of BITBAND macros updated to support peripherals with 32-bit acces disabled. |
Kojto | 90:cb3d968589d8 | 58 | ** - rev. 2.2 (2013-12-09) |
Kojto | 90:cb3d968589d8 | 59 | ** DMA - EARS register removed. |
Kojto | 90:cb3d968589d8 | 60 | ** AIPS0, AIPS1 - MPRA register updated. |
Kojto | 90:cb3d968589d8 | 61 | ** - rev. 2.3 (2014-01-24) |
Kojto | 90:cb3d968589d8 | 62 | ** Update according to reference manual rev. 2 |
Kojto | 90:cb3d968589d8 | 63 | ** ENET, MCG, MCM, SIM, USB - registers updated |
Kojto | 90:cb3d968589d8 | 64 | ** - rev. 2.4 (2014-02-10) |
Kojto | 90:cb3d968589d8 | 65 | ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h |
Kojto | 90:cb3d968589d8 | 66 | ** Update of SystemInit() and SystemCoreClockUpdate() functions. |
Kojto | 90:cb3d968589d8 | 67 | ** - rev. 2.5 (2014-02-10) |
Kojto | 90:cb3d968589d8 | 68 | ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h |
Kojto | 90:cb3d968589d8 | 69 | ** Update of SystemInit() and SystemCoreClockUpdate() functions. |
Kojto | 90:cb3d968589d8 | 70 | ** Module access macro module_BASES replaced by module_BASE_PTRS. |
Kojto | 90:cb3d968589d8 | 71 | ** |
Kojto | 90:cb3d968589d8 | 72 | ** ################################################################### |
Kojto | 90:cb3d968589d8 | 73 | */ |
Kojto | 90:cb3d968589d8 | 74 | |
Kojto | 90:cb3d968589d8 | 75 | /* |
Kojto | 90:cb3d968589d8 | 76 | * WARNING! DO NOT EDIT THIS FILE DIRECTLY! |
Kojto | 90:cb3d968589d8 | 77 | * |
Kojto | 90:cb3d968589d8 | 78 | * This file was generated automatically and any changes may be lost. |
Kojto | 90:cb3d968589d8 | 79 | */ |
Kojto | 90:cb3d968589d8 | 80 | #ifndef __HW_USB_REGISTERS_H__ |
Kojto | 90:cb3d968589d8 | 81 | #define __HW_USB_REGISTERS_H__ |
Kojto | 90:cb3d968589d8 | 82 | |
Kojto | 90:cb3d968589d8 | 83 | #include "MK64F12.h" |
Kojto | 90:cb3d968589d8 | 84 | #include "fsl_bitaccess.h" |
Kojto | 90:cb3d968589d8 | 85 | |
Kojto | 90:cb3d968589d8 | 86 | /* |
Kojto | 90:cb3d968589d8 | 87 | * MK64F12 USB |
Kojto | 90:cb3d968589d8 | 88 | * |
Kojto | 90:cb3d968589d8 | 89 | * Universal Serial Bus, OTG Capable Controller |
Kojto | 90:cb3d968589d8 | 90 | * |
Kojto | 90:cb3d968589d8 | 91 | * Registers defined in this header file: |
Kojto | 90:cb3d968589d8 | 92 | * - HW_USB_PERID - Peripheral ID register |
Kojto | 90:cb3d968589d8 | 93 | * - HW_USB_IDCOMP - Peripheral ID Complement register |
Kojto | 90:cb3d968589d8 | 94 | * - HW_USB_REV - Peripheral Revision register |
Kojto | 90:cb3d968589d8 | 95 | * - HW_USB_ADDINFO - Peripheral Additional Info register |
Kojto | 90:cb3d968589d8 | 96 | * - HW_USB_OTGISTAT - OTG Interrupt Status register |
Kojto | 90:cb3d968589d8 | 97 | * - HW_USB_OTGICR - OTG Interrupt Control register |
Kojto | 90:cb3d968589d8 | 98 | * - HW_USB_OTGSTAT - OTG Status register |
Kojto | 90:cb3d968589d8 | 99 | * - HW_USB_OTGCTL - OTG Control register |
Kojto | 90:cb3d968589d8 | 100 | * - HW_USB_ISTAT - Interrupt Status register |
Kojto | 90:cb3d968589d8 | 101 | * - HW_USB_INTEN - Interrupt Enable register |
Kojto | 90:cb3d968589d8 | 102 | * - HW_USB_ERRSTAT - Error Interrupt Status register |
Kojto | 90:cb3d968589d8 | 103 | * - HW_USB_ERREN - Error Interrupt Enable register |
Kojto | 90:cb3d968589d8 | 104 | * - HW_USB_STAT - Status register |
Kojto | 90:cb3d968589d8 | 105 | * - HW_USB_CTL - Control register |
Kojto | 90:cb3d968589d8 | 106 | * - HW_USB_ADDR - Address register |
Kojto | 90:cb3d968589d8 | 107 | * - HW_USB_BDTPAGE1 - BDT Page register 1 |
Kojto | 90:cb3d968589d8 | 108 | * - HW_USB_FRMNUML - Frame Number register Low |
Kojto | 90:cb3d968589d8 | 109 | * - HW_USB_FRMNUMH - Frame Number register High |
Kojto | 90:cb3d968589d8 | 110 | * - HW_USB_TOKEN - Token register |
Kojto | 90:cb3d968589d8 | 111 | * - HW_USB_SOFTHLD - SOF Threshold register |
Kojto | 90:cb3d968589d8 | 112 | * - HW_USB_BDTPAGE2 - BDT Page Register 2 |
Kojto | 90:cb3d968589d8 | 113 | * - HW_USB_BDTPAGE3 - BDT Page Register 3 |
Kojto | 90:cb3d968589d8 | 114 | * - HW_USB_ENDPTn - Endpoint Control register |
Kojto | 90:cb3d968589d8 | 115 | * - HW_USB_USBCTRL - USB Control register |
Kojto | 90:cb3d968589d8 | 116 | * - HW_USB_OBSERVE - USB OTG Observe register |
Kojto | 90:cb3d968589d8 | 117 | * - HW_USB_CONTROL - USB OTG Control register |
Kojto | 90:cb3d968589d8 | 118 | * - HW_USB_USBTRC0 - USB Transceiver Control register 0 |
Kojto | 90:cb3d968589d8 | 119 | * - HW_USB_USBFRMADJUST - Frame Adjust Register |
Kojto | 90:cb3d968589d8 | 120 | * - HW_USB_CLK_RECOVER_CTRL - USB Clock recovery control |
Kojto | 90:cb3d968589d8 | 121 | * - HW_USB_CLK_RECOVER_IRC_EN - IRC48M oscillator enable register |
Kojto | 90:cb3d968589d8 | 122 | * - HW_USB_CLK_RECOVER_INT_STATUS - Clock recovery separated interrupt status |
Kojto | 90:cb3d968589d8 | 123 | * |
Kojto | 90:cb3d968589d8 | 124 | * - hw_usb_t - Struct containing all module registers. |
Kojto | 90:cb3d968589d8 | 125 | */ |
Kojto | 90:cb3d968589d8 | 126 | |
Kojto | 90:cb3d968589d8 | 127 | #define HW_USB_INSTANCE_COUNT (1U) /*!< Number of instances of the USB module. */ |
Kojto | 90:cb3d968589d8 | 128 | |
Kojto | 90:cb3d968589d8 | 129 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 130 | * HW_USB_PERID - Peripheral ID register |
Kojto | 90:cb3d968589d8 | 131 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 132 | |
Kojto | 90:cb3d968589d8 | 133 | /*! |
Kojto | 90:cb3d968589d8 | 134 | * @brief HW_USB_PERID - Peripheral ID register (RO) |
Kojto | 90:cb3d968589d8 | 135 | * |
Kojto | 90:cb3d968589d8 | 136 | * Reset value: 0x04U |
Kojto | 90:cb3d968589d8 | 137 | * |
Kojto | 90:cb3d968589d8 | 138 | * Reads back the value of 0x04. This value is defined for the USB peripheral. |
Kojto | 90:cb3d968589d8 | 139 | */ |
Kojto | 90:cb3d968589d8 | 140 | typedef union _hw_usb_perid |
Kojto | 90:cb3d968589d8 | 141 | { |
Kojto | 90:cb3d968589d8 | 142 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 143 | struct _hw_usb_perid_bitfields |
Kojto | 90:cb3d968589d8 | 144 | { |
Kojto | 90:cb3d968589d8 | 145 | uint8_t ID : 6; /*!< [5:0] Peripheral Identification */ |
Kojto | 90:cb3d968589d8 | 146 | uint8_t RESERVED0 : 2; /*!< [7:6] */ |
Kojto | 90:cb3d968589d8 | 147 | } B; |
Kojto | 90:cb3d968589d8 | 148 | } hw_usb_perid_t; |
Kojto | 90:cb3d968589d8 | 149 | |
Kojto | 90:cb3d968589d8 | 150 | /*! |
Kojto | 90:cb3d968589d8 | 151 | * @name Constants and macros for entire USB_PERID register |
Kojto | 90:cb3d968589d8 | 152 | */ |
Kojto | 90:cb3d968589d8 | 153 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 154 | #define HW_USB_PERID_ADDR(x) ((x) + 0x0U) |
Kojto | 90:cb3d968589d8 | 155 | |
Kojto | 90:cb3d968589d8 | 156 | #define HW_USB_PERID(x) (*(__I hw_usb_perid_t *) HW_USB_PERID_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 157 | #define HW_USB_PERID_RD(x) (HW_USB_PERID(x).U) |
Kojto | 90:cb3d968589d8 | 158 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 159 | |
Kojto | 90:cb3d968589d8 | 160 | /* |
Kojto | 90:cb3d968589d8 | 161 | * Constants & macros for individual USB_PERID bitfields |
Kojto | 90:cb3d968589d8 | 162 | */ |
Kojto | 90:cb3d968589d8 | 163 | |
Kojto | 90:cb3d968589d8 | 164 | /*! |
Kojto | 90:cb3d968589d8 | 165 | * @name Register USB_PERID, field ID[5:0] (RO) |
Kojto | 90:cb3d968589d8 | 166 | * |
Kojto | 90:cb3d968589d8 | 167 | * This field always reads 0x4h. |
Kojto | 90:cb3d968589d8 | 168 | */ |
Kojto | 90:cb3d968589d8 | 169 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 170 | #define BP_USB_PERID_ID (0U) /*!< Bit position for USB_PERID_ID. */ |
Kojto | 90:cb3d968589d8 | 171 | #define BM_USB_PERID_ID (0x3FU) /*!< Bit mask for USB_PERID_ID. */ |
Kojto | 90:cb3d968589d8 | 172 | #define BS_USB_PERID_ID (6U) /*!< Bit field size in bits for USB_PERID_ID. */ |
Kojto | 90:cb3d968589d8 | 173 | |
Kojto | 90:cb3d968589d8 | 174 | /*! @brief Read current value of the USB_PERID_ID field. */ |
Kojto | 90:cb3d968589d8 | 175 | #define BR_USB_PERID_ID(x) (HW_USB_PERID(x).B.ID) |
Kojto | 90:cb3d968589d8 | 176 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 177 | |
Kojto | 90:cb3d968589d8 | 178 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 179 | * HW_USB_IDCOMP - Peripheral ID Complement register |
Kojto | 90:cb3d968589d8 | 180 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 181 | |
Kojto | 90:cb3d968589d8 | 182 | /*! |
Kojto | 90:cb3d968589d8 | 183 | * @brief HW_USB_IDCOMP - Peripheral ID Complement register (RO) |
Kojto | 90:cb3d968589d8 | 184 | * |
Kojto | 90:cb3d968589d8 | 185 | * Reset value: 0xFBU |
Kojto | 90:cb3d968589d8 | 186 | * |
Kojto | 90:cb3d968589d8 | 187 | * Reads back the complement of the Peripheral ID register. For the USB |
Kojto | 90:cb3d968589d8 | 188 | * peripheral, the value is 0xFB. |
Kojto | 90:cb3d968589d8 | 189 | */ |
Kojto | 90:cb3d968589d8 | 190 | typedef union _hw_usb_idcomp |
Kojto | 90:cb3d968589d8 | 191 | { |
Kojto | 90:cb3d968589d8 | 192 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 193 | struct _hw_usb_idcomp_bitfields |
Kojto | 90:cb3d968589d8 | 194 | { |
Kojto | 90:cb3d968589d8 | 195 | uint8_t NID : 6; /*!< [5:0] */ |
Kojto | 90:cb3d968589d8 | 196 | uint8_t RESERVED0 : 2; /*!< [7:6] */ |
Kojto | 90:cb3d968589d8 | 197 | } B; |
Kojto | 90:cb3d968589d8 | 198 | } hw_usb_idcomp_t; |
Kojto | 90:cb3d968589d8 | 199 | |
Kojto | 90:cb3d968589d8 | 200 | /*! |
Kojto | 90:cb3d968589d8 | 201 | * @name Constants and macros for entire USB_IDCOMP register |
Kojto | 90:cb3d968589d8 | 202 | */ |
Kojto | 90:cb3d968589d8 | 203 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 204 | #define HW_USB_IDCOMP_ADDR(x) ((x) + 0x4U) |
Kojto | 90:cb3d968589d8 | 205 | |
Kojto | 90:cb3d968589d8 | 206 | #define HW_USB_IDCOMP(x) (*(__I hw_usb_idcomp_t *) HW_USB_IDCOMP_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 207 | #define HW_USB_IDCOMP_RD(x) (HW_USB_IDCOMP(x).U) |
Kojto | 90:cb3d968589d8 | 208 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 209 | |
Kojto | 90:cb3d968589d8 | 210 | /* |
Kojto | 90:cb3d968589d8 | 211 | * Constants & macros for individual USB_IDCOMP bitfields |
Kojto | 90:cb3d968589d8 | 212 | */ |
Kojto | 90:cb3d968589d8 | 213 | |
Kojto | 90:cb3d968589d8 | 214 | /*! |
Kojto | 90:cb3d968589d8 | 215 | * @name Register USB_IDCOMP, field NID[5:0] (RO) |
Kojto | 90:cb3d968589d8 | 216 | * |
Kojto | 90:cb3d968589d8 | 217 | * Ones' complement of PERID[ID]. bits. |
Kojto | 90:cb3d968589d8 | 218 | */ |
Kojto | 90:cb3d968589d8 | 219 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 220 | #define BP_USB_IDCOMP_NID (0U) /*!< Bit position for USB_IDCOMP_NID. */ |
Kojto | 90:cb3d968589d8 | 221 | #define BM_USB_IDCOMP_NID (0x3FU) /*!< Bit mask for USB_IDCOMP_NID. */ |
Kojto | 90:cb3d968589d8 | 222 | #define BS_USB_IDCOMP_NID (6U) /*!< Bit field size in bits for USB_IDCOMP_NID. */ |
Kojto | 90:cb3d968589d8 | 223 | |
Kojto | 90:cb3d968589d8 | 224 | /*! @brief Read current value of the USB_IDCOMP_NID field. */ |
Kojto | 90:cb3d968589d8 | 225 | #define BR_USB_IDCOMP_NID(x) (HW_USB_IDCOMP(x).B.NID) |
Kojto | 90:cb3d968589d8 | 226 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 227 | |
Kojto | 90:cb3d968589d8 | 228 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 229 | * HW_USB_REV - Peripheral Revision register |
Kojto | 90:cb3d968589d8 | 230 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 231 | |
Kojto | 90:cb3d968589d8 | 232 | /*! |
Kojto | 90:cb3d968589d8 | 233 | * @brief HW_USB_REV - Peripheral Revision register (RO) |
Kojto | 90:cb3d968589d8 | 234 | * |
Kojto | 90:cb3d968589d8 | 235 | * Reset value: 0x33U |
Kojto | 90:cb3d968589d8 | 236 | * |
Kojto | 90:cb3d968589d8 | 237 | * Contains the revision number of the USB module. |
Kojto | 90:cb3d968589d8 | 238 | */ |
Kojto | 90:cb3d968589d8 | 239 | typedef union _hw_usb_rev |
Kojto | 90:cb3d968589d8 | 240 | { |
Kojto | 90:cb3d968589d8 | 241 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 242 | struct _hw_usb_rev_bitfields |
Kojto | 90:cb3d968589d8 | 243 | { |
Kojto | 90:cb3d968589d8 | 244 | uint8_t REV : 8; /*!< [7:0] Revision */ |
Kojto | 90:cb3d968589d8 | 245 | } B; |
Kojto | 90:cb3d968589d8 | 246 | } hw_usb_rev_t; |
Kojto | 90:cb3d968589d8 | 247 | |
Kojto | 90:cb3d968589d8 | 248 | /*! |
Kojto | 90:cb3d968589d8 | 249 | * @name Constants and macros for entire USB_REV register |
Kojto | 90:cb3d968589d8 | 250 | */ |
Kojto | 90:cb3d968589d8 | 251 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 252 | #define HW_USB_REV_ADDR(x) ((x) + 0x8U) |
Kojto | 90:cb3d968589d8 | 253 | |
Kojto | 90:cb3d968589d8 | 254 | #define HW_USB_REV(x) (*(__I hw_usb_rev_t *) HW_USB_REV_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 255 | #define HW_USB_REV_RD(x) (HW_USB_REV(x).U) |
Kojto | 90:cb3d968589d8 | 256 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 257 | |
Kojto | 90:cb3d968589d8 | 258 | /* |
Kojto | 90:cb3d968589d8 | 259 | * Constants & macros for individual USB_REV bitfields |
Kojto | 90:cb3d968589d8 | 260 | */ |
Kojto | 90:cb3d968589d8 | 261 | |
Kojto | 90:cb3d968589d8 | 262 | /*! |
Kojto | 90:cb3d968589d8 | 263 | * @name Register USB_REV, field REV[7:0] (RO) |
Kojto | 90:cb3d968589d8 | 264 | * |
Kojto | 90:cb3d968589d8 | 265 | * Indicates the revision number of the USB Core. |
Kojto | 90:cb3d968589d8 | 266 | */ |
Kojto | 90:cb3d968589d8 | 267 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 268 | #define BP_USB_REV_REV (0U) /*!< Bit position for USB_REV_REV. */ |
Kojto | 90:cb3d968589d8 | 269 | #define BM_USB_REV_REV (0xFFU) /*!< Bit mask for USB_REV_REV. */ |
Kojto | 90:cb3d968589d8 | 270 | #define BS_USB_REV_REV (8U) /*!< Bit field size in bits for USB_REV_REV. */ |
Kojto | 90:cb3d968589d8 | 271 | |
Kojto | 90:cb3d968589d8 | 272 | /*! @brief Read current value of the USB_REV_REV field. */ |
Kojto | 90:cb3d968589d8 | 273 | #define BR_USB_REV_REV(x) (HW_USB_REV(x).U) |
Kojto | 90:cb3d968589d8 | 274 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 275 | |
Kojto | 90:cb3d968589d8 | 276 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 277 | * HW_USB_ADDINFO - Peripheral Additional Info register |
Kojto | 90:cb3d968589d8 | 278 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 279 | |
Kojto | 90:cb3d968589d8 | 280 | /*! |
Kojto | 90:cb3d968589d8 | 281 | * @brief HW_USB_ADDINFO - Peripheral Additional Info register (RO) |
Kojto | 90:cb3d968589d8 | 282 | * |
Kojto | 90:cb3d968589d8 | 283 | * Reset value: 0x01U |
Kojto | 90:cb3d968589d8 | 284 | * |
Kojto | 90:cb3d968589d8 | 285 | * Reads back the value of the fixed Interrupt Request Level (IRQNUM) along with |
Kojto | 90:cb3d968589d8 | 286 | * the Host Enable bit. |
Kojto | 90:cb3d968589d8 | 287 | */ |
Kojto | 90:cb3d968589d8 | 288 | typedef union _hw_usb_addinfo |
Kojto | 90:cb3d968589d8 | 289 | { |
Kojto | 90:cb3d968589d8 | 290 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 291 | struct _hw_usb_addinfo_bitfields |
Kojto | 90:cb3d968589d8 | 292 | { |
Kojto | 90:cb3d968589d8 | 293 | uint8_t IEHOST : 1; /*!< [0] */ |
Kojto | 90:cb3d968589d8 | 294 | uint8_t RESERVED0 : 2; /*!< [2:1] */ |
Kojto | 90:cb3d968589d8 | 295 | uint8_t IRQNUM : 5; /*!< [7:3] Assigned Interrupt Request Number */ |
Kojto | 90:cb3d968589d8 | 296 | } B; |
Kojto | 90:cb3d968589d8 | 297 | } hw_usb_addinfo_t; |
Kojto | 90:cb3d968589d8 | 298 | |
Kojto | 90:cb3d968589d8 | 299 | /*! |
Kojto | 90:cb3d968589d8 | 300 | * @name Constants and macros for entire USB_ADDINFO register |
Kojto | 90:cb3d968589d8 | 301 | */ |
Kojto | 90:cb3d968589d8 | 302 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 303 | #define HW_USB_ADDINFO_ADDR(x) ((x) + 0xCU) |
Kojto | 90:cb3d968589d8 | 304 | |
Kojto | 90:cb3d968589d8 | 305 | #define HW_USB_ADDINFO(x) (*(__I hw_usb_addinfo_t *) HW_USB_ADDINFO_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 306 | #define HW_USB_ADDINFO_RD(x) (HW_USB_ADDINFO(x).U) |
Kojto | 90:cb3d968589d8 | 307 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 308 | |
Kojto | 90:cb3d968589d8 | 309 | /* |
Kojto | 90:cb3d968589d8 | 310 | * Constants & macros for individual USB_ADDINFO bitfields |
Kojto | 90:cb3d968589d8 | 311 | */ |
Kojto | 90:cb3d968589d8 | 312 | |
Kojto | 90:cb3d968589d8 | 313 | /*! |
Kojto | 90:cb3d968589d8 | 314 | * @name Register USB_ADDINFO, field IEHOST[0] (RO) |
Kojto | 90:cb3d968589d8 | 315 | * |
Kojto | 90:cb3d968589d8 | 316 | * This bit is set if host mode is enabled. |
Kojto | 90:cb3d968589d8 | 317 | */ |
Kojto | 90:cb3d968589d8 | 318 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 319 | #define BP_USB_ADDINFO_IEHOST (0U) /*!< Bit position for USB_ADDINFO_IEHOST. */ |
Kojto | 90:cb3d968589d8 | 320 | #define BM_USB_ADDINFO_IEHOST (0x01U) /*!< Bit mask for USB_ADDINFO_IEHOST. */ |
Kojto | 90:cb3d968589d8 | 321 | #define BS_USB_ADDINFO_IEHOST (1U) /*!< Bit field size in bits for USB_ADDINFO_IEHOST. */ |
Kojto | 90:cb3d968589d8 | 322 | |
Kojto | 90:cb3d968589d8 | 323 | /*! @brief Read current value of the USB_ADDINFO_IEHOST field. */ |
Kojto | 90:cb3d968589d8 | 324 | #define BR_USB_ADDINFO_IEHOST(x) (BITBAND_ACCESS8(HW_USB_ADDINFO_ADDR(x), BP_USB_ADDINFO_IEHOST)) |
Kojto | 90:cb3d968589d8 | 325 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 326 | |
Kojto | 90:cb3d968589d8 | 327 | /*! |
Kojto | 90:cb3d968589d8 | 328 | * @name Register USB_ADDINFO, field IRQNUM[7:3] (RO) |
Kojto | 90:cb3d968589d8 | 329 | */ |
Kojto | 90:cb3d968589d8 | 330 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 331 | #define BP_USB_ADDINFO_IRQNUM (3U) /*!< Bit position for USB_ADDINFO_IRQNUM. */ |
Kojto | 90:cb3d968589d8 | 332 | #define BM_USB_ADDINFO_IRQNUM (0xF8U) /*!< Bit mask for USB_ADDINFO_IRQNUM. */ |
Kojto | 90:cb3d968589d8 | 333 | #define BS_USB_ADDINFO_IRQNUM (5U) /*!< Bit field size in bits for USB_ADDINFO_IRQNUM. */ |
Kojto | 90:cb3d968589d8 | 334 | |
Kojto | 90:cb3d968589d8 | 335 | /*! @brief Read current value of the USB_ADDINFO_IRQNUM field. */ |
Kojto | 90:cb3d968589d8 | 336 | #define BR_USB_ADDINFO_IRQNUM(x) (HW_USB_ADDINFO(x).B.IRQNUM) |
Kojto | 90:cb3d968589d8 | 337 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 338 | |
Kojto | 90:cb3d968589d8 | 339 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 340 | * HW_USB_OTGISTAT - OTG Interrupt Status register |
Kojto | 90:cb3d968589d8 | 341 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 342 | |
Kojto | 90:cb3d968589d8 | 343 | /*! |
Kojto | 90:cb3d968589d8 | 344 | * @brief HW_USB_OTGISTAT - OTG Interrupt Status register (RW) |
Kojto | 90:cb3d968589d8 | 345 | * |
Kojto | 90:cb3d968589d8 | 346 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 347 | * |
Kojto | 90:cb3d968589d8 | 348 | * Records changes of the ID sense and VBUS signals. Software can read this |
Kojto | 90:cb3d968589d8 | 349 | * register to determine the event that triggers an interrupt. Only bits that have |
Kojto | 90:cb3d968589d8 | 350 | * changed since the last software read are set. Writing a one to a bit clears the |
Kojto | 90:cb3d968589d8 | 351 | * associated interrupt. |
Kojto | 90:cb3d968589d8 | 352 | */ |
Kojto | 90:cb3d968589d8 | 353 | typedef union _hw_usb_otgistat |
Kojto | 90:cb3d968589d8 | 354 | { |
Kojto | 90:cb3d968589d8 | 355 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 356 | struct _hw_usb_otgistat_bitfields |
Kojto | 90:cb3d968589d8 | 357 | { |
Kojto | 90:cb3d968589d8 | 358 | uint8_t AVBUSCHG : 1; /*!< [0] */ |
Kojto | 90:cb3d968589d8 | 359 | uint8_t RESERVED0 : 1; /*!< [1] */ |
Kojto | 90:cb3d968589d8 | 360 | uint8_t B_SESS_CHG : 1; /*!< [2] */ |
Kojto | 90:cb3d968589d8 | 361 | uint8_t SESSVLDCHG : 1; /*!< [3] */ |
Kojto | 90:cb3d968589d8 | 362 | uint8_t RESERVED1 : 1; /*!< [4] */ |
Kojto | 90:cb3d968589d8 | 363 | uint8_t LINE_STATE_CHG : 1; /*!< [5] */ |
Kojto | 90:cb3d968589d8 | 364 | uint8_t ONEMSEC : 1; /*!< [6] */ |
Kojto | 90:cb3d968589d8 | 365 | uint8_t IDCHG : 1; /*!< [7] */ |
Kojto | 90:cb3d968589d8 | 366 | } B; |
Kojto | 90:cb3d968589d8 | 367 | } hw_usb_otgistat_t; |
Kojto | 90:cb3d968589d8 | 368 | |
Kojto | 90:cb3d968589d8 | 369 | /*! |
Kojto | 90:cb3d968589d8 | 370 | * @name Constants and macros for entire USB_OTGISTAT register |
Kojto | 90:cb3d968589d8 | 371 | */ |
Kojto | 90:cb3d968589d8 | 372 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 373 | #define HW_USB_OTGISTAT_ADDR(x) ((x) + 0x10U) |
Kojto | 90:cb3d968589d8 | 374 | |
Kojto | 90:cb3d968589d8 | 375 | #define HW_USB_OTGISTAT(x) (*(__IO hw_usb_otgistat_t *) HW_USB_OTGISTAT_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 376 | #define HW_USB_OTGISTAT_RD(x) (HW_USB_OTGISTAT(x).U) |
Kojto | 90:cb3d968589d8 | 377 | #define HW_USB_OTGISTAT_WR(x, v) (HW_USB_OTGISTAT(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 378 | #define HW_USB_OTGISTAT_SET(x, v) (HW_USB_OTGISTAT_WR(x, HW_USB_OTGISTAT_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 379 | #define HW_USB_OTGISTAT_CLR(x, v) (HW_USB_OTGISTAT_WR(x, HW_USB_OTGISTAT_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 380 | #define HW_USB_OTGISTAT_TOG(x, v) (HW_USB_OTGISTAT_WR(x, HW_USB_OTGISTAT_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 381 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 382 | |
Kojto | 90:cb3d968589d8 | 383 | /* |
Kojto | 90:cb3d968589d8 | 384 | * Constants & macros for individual USB_OTGISTAT bitfields |
Kojto | 90:cb3d968589d8 | 385 | */ |
Kojto | 90:cb3d968589d8 | 386 | |
Kojto | 90:cb3d968589d8 | 387 | /*! |
Kojto | 90:cb3d968589d8 | 388 | * @name Register USB_OTGISTAT, field AVBUSCHG[0] (RW) |
Kojto | 90:cb3d968589d8 | 389 | * |
Kojto | 90:cb3d968589d8 | 390 | * This bit is set when a change in VBUS is detected on an A device. |
Kojto | 90:cb3d968589d8 | 391 | */ |
Kojto | 90:cb3d968589d8 | 392 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 393 | #define BP_USB_OTGISTAT_AVBUSCHG (0U) /*!< Bit position for USB_OTGISTAT_AVBUSCHG. */ |
Kojto | 90:cb3d968589d8 | 394 | #define BM_USB_OTGISTAT_AVBUSCHG (0x01U) /*!< Bit mask for USB_OTGISTAT_AVBUSCHG. */ |
Kojto | 90:cb3d968589d8 | 395 | #define BS_USB_OTGISTAT_AVBUSCHG (1U) /*!< Bit field size in bits for USB_OTGISTAT_AVBUSCHG. */ |
Kojto | 90:cb3d968589d8 | 396 | |
Kojto | 90:cb3d968589d8 | 397 | /*! @brief Read current value of the USB_OTGISTAT_AVBUSCHG field. */ |
Kojto | 90:cb3d968589d8 | 398 | #define BR_USB_OTGISTAT_AVBUSCHG(x) (BITBAND_ACCESS8(HW_USB_OTGISTAT_ADDR(x), BP_USB_OTGISTAT_AVBUSCHG)) |
Kojto | 90:cb3d968589d8 | 399 | |
Kojto | 90:cb3d968589d8 | 400 | /*! @brief Format value for bitfield USB_OTGISTAT_AVBUSCHG. */ |
Kojto | 90:cb3d968589d8 | 401 | #define BF_USB_OTGISTAT_AVBUSCHG(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGISTAT_AVBUSCHG) & BM_USB_OTGISTAT_AVBUSCHG) |
Kojto | 90:cb3d968589d8 | 402 | |
Kojto | 90:cb3d968589d8 | 403 | /*! @brief Set the AVBUSCHG field to a new value. */ |
Kojto | 90:cb3d968589d8 | 404 | #define BW_USB_OTGISTAT_AVBUSCHG(x, v) (BITBAND_ACCESS8(HW_USB_OTGISTAT_ADDR(x), BP_USB_OTGISTAT_AVBUSCHG) = (v)) |
Kojto | 90:cb3d968589d8 | 405 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 406 | |
Kojto | 90:cb3d968589d8 | 407 | /*! |
Kojto | 90:cb3d968589d8 | 408 | * @name Register USB_OTGISTAT, field B_SESS_CHG[2] (RW) |
Kojto | 90:cb3d968589d8 | 409 | * |
Kojto | 90:cb3d968589d8 | 410 | * This bit is set when a change in VBUS is detected on a B device. |
Kojto | 90:cb3d968589d8 | 411 | */ |
Kojto | 90:cb3d968589d8 | 412 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 413 | #define BP_USB_OTGISTAT_B_SESS_CHG (2U) /*!< Bit position for USB_OTGISTAT_B_SESS_CHG. */ |
Kojto | 90:cb3d968589d8 | 414 | #define BM_USB_OTGISTAT_B_SESS_CHG (0x04U) /*!< Bit mask for USB_OTGISTAT_B_SESS_CHG. */ |
Kojto | 90:cb3d968589d8 | 415 | #define BS_USB_OTGISTAT_B_SESS_CHG (1U) /*!< Bit field size in bits for USB_OTGISTAT_B_SESS_CHG. */ |
Kojto | 90:cb3d968589d8 | 416 | |
Kojto | 90:cb3d968589d8 | 417 | /*! @brief Read current value of the USB_OTGISTAT_B_SESS_CHG field. */ |
Kojto | 90:cb3d968589d8 | 418 | #define BR_USB_OTGISTAT_B_SESS_CHG(x) (BITBAND_ACCESS8(HW_USB_OTGISTAT_ADDR(x), BP_USB_OTGISTAT_B_SESS_CHG)) |
Kojto | 90:cb3d968589d8 | 419 | |
Kojto | 90:cb3d968589d8 | 420 | /*! @brief Format value for bitfield USB_OTGISTAT_B_SESS_CHG. */ |
Kojto | 90:cb3d968589d8 | 421 | #define BF_USB_OTGISTAT_B_SESS_CHG(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGISTAT_B_SESS_CHG) & BM_USB_OTGISTAT_B_SESS_CHG) |
Kojto | 90:cb3d968589d8 | 422 | |
Kojto | 90:cb3d968589d8 | 423 | /*! @brief Set the B_SESS_CHG field to a new value. */ |
Kojto | 90:cb3d968589d8 | 424 | #define BW_USB_OTGISTAT_B_SESS_CHG(x, v) (BITBAND_ACCESS8(HW_USB_OTGISTAT_ADDR(x), BP_USB_OTGISTAT_B_SESS_CHG) = (v)) |
Kojto | 90:cb3d968589d8 | 425 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 426 | |
Kojto | 90:cb3d968589d8 | 427 | /*! |
Kojto | 90:cb3d968589d8 | 428 | * @name Register USB_OTGISTAT, field SESSVLDCHG[3] (RW) |
Kojto | 90:cb3d968589d8 | 429 | * |
Kojto | 90:cb3d968589d8 | 430 | * This bit is set when a change in VBUS is detected indicating a session valid |
Kojto | 90:cb3d968589d8 | 431 | * or a session no longer valid. |
Kojto | 90:cb3d968589d8 | 432 | */ |
Kojto | 90:cb3d968589d8 | 433 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 434 | #define BP_USB_OTGISTAT_SESSVLDCHG (3U) /*!< Bit position for USB_OTGISTAT_SESSVLDCHG. */ |
Kojto | 90:cb3d968589d8 | 435 | #define BM_USB_OTGISTAT_SESSVLDCHG (0x08U) /*!< Bit mask for USB_OTGISTAT_SESSVLDCHG. */ |
Kojto | 90:cb3d968589d8 | 436 | #define BS_USB_OTGISTAT_SESSVLDCHG (1U) /*!< Bit field size in bits for USB_OTGISTAT_SESSVLDCHG. */ |
Kojto | 90:cb3d968589d8 | 437 | |
Kojto | 90:cb3d968589d8 | 438 | /*! @brief Read current value of the USB_OTGISTAT_SESSVLDCHG field. */ |
Kojto | 90:cb3d968589d8 | 439 | #define BR_USB_OTGISTAT_SESSVLDCHG(x) (BITBAND_ACCESS8(HW_USB_OTGISTAT_ADDR(x), BP_USB_OTGISTAT_SESSVLDCHG)) |
Kojto | 90:cb3d968589d8 | 440 | |
Kojto | 90:cb3d968589d8 | 441 | /*! @brief Format value for bitfield USB_OTGISTAT_SESSVLDCHG. */ |
Kojto | 90:cb3d968589d8 | 442 | #define BF_USB_OTGISTAT_SESSVLDCHG(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGISTAT_SESSVLDCHG) & BM_USB_OTGISTAT_SESSVLDCHG) |
Kojto | 90:cb3d968589d8 | 443 | |
Kojto | 90:cb3d968589d8 | 444 | /*! @brief Set the SESSVLDCHG field to a new value. */ |
Kojto | 90:cb3d968589d8 | 445 | #define BW_USB_OTGISTAT_SESSVLDCHG(x, v) (BITBAND_ACCESS8(HW_USB_OTGISTAT_ADDR(x), BP_USB_OTGISTAT_SESSVLDCHG) = (v)) |
Kojto | 90:cb3d968589d8 | 446 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 447 | |
Kojto | 90:cb3d968589d8 | 448 | /*! |
Kojto | 90:cb3d968589d8 | 449 | * @name Register USB_OTGISTAT, field LINE_STATE_CHG[5] (RW) |
Kojto | 90:cb3d968589d8 | 450 | * |
Kojto | 90:cb3d968589d8 | 451 | * This interrupt is set when the USB line state (CTL[SE0] and CTL[JSTATE] bits) |
Kojto | 90:cb3d968589d8 | 452 | * are stable without change for 1 millisecond, and the value of the line state |
Kojto | 90:cb3d968589d8 | 453 | * is different from the last time when the line state was stable. It is set on |
Kojto | 90:cb3d968589d8 | 454 | * transitions between SE0 and J-state, SE0 and K-state, and J-state and K-state. |
Kojto | 90:cb3d968589d8 | 455 | * Changes in J-state while SE0 is true do not cause an interrupt. This interrupt |
Kojto | 90:cb3d968589d8 | 456 | * can be used in detecting Reset, Resume, Connect, and Data Line Pulse |
Kojto | 90:cb3d968589d8 | 457 | * signaling. |
Kojto | 90:cb3d968589d8 | 458 | */ |
Kojto | 90:cb3d968589d8 | 459 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 460 | #define BP_USB_OTGISTAT_LINE_STATE_CHG (5U) /*!< Bit position for USB_OTGISTAT_LINE_STATE_CHG. */ |
Kojto | 90:cb3d968589d8 | 461 | #define BM_USB_OTGISTAT_LINE_STATE_CHG (0x20U) /*!< Bit mask for USB_OTGISTAT_LINE_STATE_CHG. */ |
Kojto | 90:cb3d968589d8 | 462 | #define BS_USB_OTGISTAT_LINE_STATE_CHG (1U) /*!< Bit field size in bits for USB_OTGISTAT_LINE_STATE_CHG. */ |
Kojto | 90:cb3d968589d8 | 463 | |
Kojto | 90:cb3d968589d8 | 464 | /*! @brief Read current value of the USB_OTGISTAT_LINE_STATE_CHG field. */ |
Kojto | 90:cb3d968589d8 | 465 | #define BR_USB_OTGISTAT_LINE_STATE_CHG(x) (BITBAND_ACCESS8(HW_USB_OTGISTAT_ADDR(x), BP_USB_OTGISTAT_LINE_STATE_CHG)) |
Kojto | 90:cb3d968589d8 | 466 | |
Kojto | 90:cb3d968589d8 | 467 | /*! @brief Format value for bitfield USB_OTGISTAT_LINE_STATE_CHG. */ |
Kojto | 90:cb3d968589d8 | 468 | #define BF_USB_OTGISTAT_LINE_STATE_CHG(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGISTAT_LINE_STATE_CHG) & BM_USB_OTGISTAT_LINE_STATE_CHG) |
Kojto | 90:cb3d968589d8 | 469 | |
Kojto | 90:cb3d968589d8 | 470 | /*! @brief Set the LINE_STATE_CHG field to a new value. */ |
Kojto | 90:cb3d968589d8 | 471 | #define BW_USB_OTGISTAT_LINE_STATE_CHG(x, v) (BITBAND_ACCESS8(HW_USB_OTGISTAT_ADDR(x), BP_USB_OTGISTAT_LINE_STATE_CHG) = (v)) |
Kojto | 90:cb3d968589d8 | 472 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 473 | |
Kojto | 90:cb3d968589d8 | 474 | /*! |
Kojto | 90:cb3d968589d8 | 475 | * @name Register USB_OTGISTAT, field ONEMSEC[6] (RW) |
Kojto | 90:cb3d968589d8 | 476 | * |
Kojto | 90:cb3d968589d8 | 477 | * This bit is set when the 1 millisecond timer expires. This bit stays asserted |
Kojto | 90:cb3d968589d8 | 478 | * until cleared by software. The interrupt must be serviced every millisecond |
Kojto | 90:cb3d968589d8 | 479 | * to avoid losing 1msec counts. |
Kojto | 90:cb3d968589d8 | 480 | */ |
Kojto | 90:cb3d968589d8 | 481 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 482 | #define BP_USB_OTGISTAT_ONEMSEC (6U) /*!< Bit position for USB_OTGISTAT_ONEMSEC. */ |
Kojto | 90:cb3d968589d8 | 483 | #define BM_USB_OTGISTAT_ONEMSEC (0x40U) /*!< Bit mask for USB_OTGISTAT_ONEMSEC. */ |
Kojto | 90:cb3d968589d8 | 484 | #define BS_USB_OTGISTAT_ONEMSEC (1U) /*!< Bit field size in bits for USB_OTGISTAT_ONEMSEC. */ |
Kojto | 90:cb3d968589d8 | 485 | |
Kojto | 90:cb3d968589d8 | 486 | /*! @brief Read current value of the USB_OTGISTAT_ONEMSEC field. */ |
Kojto | 90:cb3d968589d8 | 487 | #define BR_USB_OTGISTAT_ONEMSEC(x) (BITBAND_ACCESS8(HW_USB_OTGISTAT_ADDR(x), BP_USB_OTGISTAT_ONEMSEC)) |
Kojto | 90:cb3d968589d8 | 488 | |
Kojto | 90:cb3d968589d8 | 489 | /*! @brief Format value for bitfield USB_OTGISTAT_ONEMSEC. */ |
Kojto | 90:cb3d968589d8 | 490 | #define BF_USB_OTGISTAT_ONEMSEC(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGISTAT_ONEMSEC) & BM_USB_OTGISTAT_ONEMSEC) |
Kojto | 90:cb3d968589d8 | 491 | |
Kojto | 90:cb3d968589d8 | 492 | /*! @brief Set the ONEMSEC field to a new value. */ |
Kojto | 90:cb3d968589d8 | 493 | #define BW_USB_OTGISTAT_ONEMSEC(x, v) (BITBAND_ACCESS8(HW_USB_OTGISTAT_ADDR(x), BP_USB_OTGISTAT_ONEMSEC) = (v)) |
Kojto | 90:cb3d968589d8 | 494 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 495 | |
Kojto | 90:cb3d968589d8 | 496 | /*! |
Kojto | 90:cb3d968589d8 | 497 | * @name Register USB_OTGISTAT, field IDCHG[7] (RW) |
Kojto | 90:cb3d968589d8 | 498 | * |
Kojto | 90:cb3d968589d8 | 499 | * This bit is set when a change in the ID Signal from the USB connector is |
Kojto | 90:cb3d968589d8 | 500 | * sensed. |
Kojto | 90:cb3d968589d8 | 501 | */ |
Kojto | 90:cb3d968589d8 | 502 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 503 | #define BP_USB_OTGISTAT_IDCHG (7U) /*!< Bit position for USB_OTGISTAT_IDCHG. */ |
Kojto | 90:cb3d968589d8 | 504 | #define BM_USB_OTGISTAT_IDCHG (0x80U) /*!< Bit mask for USB_OTGISTAT_IDCHG. */ |
Kojto | 90:cb3d968589d8 | 505 | #define BS_USB_OTGISTAT_IDCHG (1U) /*!< Bit field size in bits for USB_OTGISTAT_IDCHG. */ |
Kojto | 90:cb3d968589d8 | 506 | |
Kojto | 90:cb3d968589d8 | 507 | /*! @brief Read current value of the USB_OTGISTAT_IDCHG field. */ |
Kojto | 90:cb3d968589d8 | 508 | #define BR_USB_OTGISTAT_IDCHG(x) (BITBAND_ACCESS8(HW_USB_OTGISTAT_ADDR(x), BP_USB_OTGISTAT_IDCHG)) |
Kojto | 90:cb3d968589d8 | 509 | |
Kojto | 90:cb3d968589d8 | 510 | /*! @brief Format value for bitfield USB_OTGISTAT_IDCHG. */ |
Kojto | 90:cb3d968589d8 | 511 | #define BF_USB_OTGISTAT_IDCHG(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGISTAT_IDCHG) & BM_USB_OTGISTAT_IDCHG) |
Kojto | 90:cb3d968589d8 | 512 | |
Kojto | 90:cb3d968589d8 | 513 | /*! @brief Set the IDCHG field to a new value. */ |
Kojto | 90:cb3d968589d8 | 514 | #define BW_USB_OTGISTAT_IDCHG(x, v) (BITBAND_ACCESS8(HW_USB_OTGISTAT_ADDR(x), BP_USB_OTGISTAT_IDCHG) = (v)) |
Kojto | 90:cb3d968589d8 | 515 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 516 | |
Kojto | 90:cb3d968589d8 | 517 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 518 | * HW_USB_OTGICR - OTG Interrupt Control register |
Kojto | 90:cb3d968589d8 | 519 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 520 | |
Kojto | 90:cb3d968589d8 | 521 | /*! |
Kojto | 90:cb3d968589d8 | 522 | * @brief HW_USB_OTGICR - OTG Interrupt Control register (RW) |
Kojto | 90:cb3d968589d8 | 523 | * |
Kojto | 90:cb3d968589d8 | 524 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 525 | * |
Kojto | 90:cb3d968589d8 | 526 | * Enables the corresponding interrupt status bits defined in the OTG Interrupt |
Kojto | 90:cb3d968589d8 | 527 | * Status Register. |
Kojto | 90:cb3d968589d8 | 528 | */ |
Kojto | 90:cb3d968589d8 | 529 | typedef union _hw_usb_otgicr |
Kojto | 90:cb3d968589d8 | 530 | { |
Kojto | 90:cb3d968589d8 | 531 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 532 | struct _hw_usb_otgicr_bitfields |
Kojto | 90:cb3d968589d8 | 533 | { |
Kojto | 90:cb3d968589d8 | 534 | uint8_t AVBUSEN : 1; /*!< [0] A VBUS Valid Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 535 | uint8_t RESERVED0 : 1; /*!< [1] */ |
Kojto | 90:cb3d968589d8 | 536 | uint8_t BSESSEN : 1; /*!< [2] B Session END Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 537 | uint8_t SESSVLDEN : 1; /*!< [3] Session Valid Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 538 | uint8_t RESERVED1 : 1; /*!< [4] */ |
Kojto | 90:cb3d968589d8 | 539 | uint8_t LINESTATEEN : 1; /*!< [5] Line State Change Interrupt Enable |
Kojto | 90:cb3d968589d8 | 540 | * */ |
Kojto | 90:cb3d968589d8 | 541 | uint8_t ONEMSECEN : 1; /*!< [6] One Millisecond Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 542 | uint8_t IDEN : 1; /*!< [7] ID Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 543 | } B; |
Kojto | 90:cb3d968589d8 | 544 | } hw_usb_otgicr_t; |
Kojto | 90:cb3d968589d8 | 545 | |
Kojto | 90:cb3d968589d8 | 546 | /*! |
Kojto | 90:cb3d968589d8 | 547 | * @name Constants and macros for entire USB_OTGICR register |
Kojto | 90:cb3d968589d8 | 548 | */ |
Kojto | 90:cb3d968589d8 | 549 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 550 | #define HW_USB_OTGICR_ADDR(x) ((x) + 0x14U) |
Kojto | 90:cb3d968589d8 | 551 | |
Kojto | 90:cb3d968589d8 | 552 | #define HW_USB_OTGICR(x) (*(__IO hw_usb_otgicr_t *) HW_USB_OTGICR_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 553 | #define HW_USB_OTGICR_RD(x) (HW_USB_OTGICR(x).U) |
Kojto | 90:cb3d968589d8 | 554 | #define HW_USB_OTGICR_WR(x, v) (HW_USB_OTGICR(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 555 | #define HW_USB_OTGICR_SET(x, v) (HW_USB_OTGICR_WR(x, HW_USB_OTGICR_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 556 | #define HW_USB_OTGICR_CLR(x, v) (HW_USB_OTGICR_WR(x, HW_USB_OTGICR_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 557 | #define HW_USB_OTGICR_TOG(x, v) (HW_USB_OTGICR_WR(x, HW_USB_OTGICR_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 558 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 559 | |
Kojto | 90:cb3d968589d8 | 560 | /* |
Kojto | 90:cb3d968589d8 | 561 | * Constants & macros for individual USB_OTGICR bitfields |
Kojto | 90:cb3d968589d8 | 562 | */ |
Kojto | 90:cb3d968589d8 | 563 | |
Kojto | 90:cb3d968589d8 | 564 | /*! |
Kojto | 90:cb3d968589d8 | 565 | * @name Register USB_OTGICR, field AVBUSEN[0] (RW) |
Kojto | 90:cb3d968589d8 | 566 | * |
Kojto | 90:cb3d968589d8 | 567 | * Values: |
Kojto | 90:cb3d968589d8 | 568 | * - 0 - Disables the AVBUSCHG interrupt. |
Kojto | 90:cb3d968589d8 | 569 | * - 1 - Enables the AVBUSCHG interrupt. |
Kojto | 90:cb3d968589d8 | 570 | */ |
Kojto | 90:cb3d968589d8 | 571 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 572 | #define BP_USB_OTGICR_AVBUSEN (0U) /*!< Bit position for USB_OTGICR_AVBUSEN. */ |
Kojto | 90:cb3d968589d8 | 573 | #define BM_USB_OTGICR_AVBUSEN (0x01U) /*!< Bit mask for USB_OTGICR_AVBUSEN. */ |
Kojto | 90:cb3d968589d8 | 574 | #define BS_USB_OTGICR_AVBUSEN (1U) /*!< Bit field size in bits for USB_OTGICR_AVBUSEN. */ |
Kojto | 90:cb3d968589d8 | 575 | |
Kojto | 90:cb3d968589d8 | 576 | /*! @brief Read current value of the USB_OTGICR_AVBUSEN field. */ |
Kojto | 90:cb3d968589d8 | 577 | #define BR_USB_OTGICR_AVBUSEN(x) (BITBAND_ACCESS8(HW_USB_OTGICR_ADDR(x), BP_USB_OTGICR_AVBUSEN)) |
Kojto | 90:cb3d968589d8 | 578 | |
Kojto | 90:cb3d968589d8 | 579 | /*! @brief Format value for bitfield USB_OTGICR_AVBUSEN. */ |
Kojto | 90:cb3d968589d8 | 580 | #define BF_USB_OTGICR_AVBUSEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGICR_AVBUSEN) & BM_USB_OTGICR_AVBUSEN) |
Kojto | 90:cb3d968589d8 | 581 | |
Kojto | 90:cb3d968589d8 | 582 | /*! @brief Set the AVBUSEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 583 | #define BW_USB_OTGICR_AVBUSEN(x, v) (BITBAND_ACCESS8(HW_USB_OTGICR_ADDR(x), BP_USB_OTGICR_AVBUSEN) = (v)) |
Kojto | 90:cb3d968589d8 | 584 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 585 | |
Kojto | 90:cb3d968589d8 | 586 | /*! |
Kojto | 90:cb3d968589d8 | 587 | * @name Register USB_OTGICR, field BSESSEN[2] (RW) |
Kojto | 90:cb3d968589d8 | 588 | * |
Kojto | 90:cb3d968589d8 | 589 | * Values: |
Kojto | 90:cb3d968589d8 | 590 | * - 0 - Disables the B_SESS_CHG interrupt. |
Kojto | 90:cb3d968589d8 | 591 | * - 1 - Enables the B_SESS_CHG interrupt. |
Kojto | 90:cb3d968589d8 | 592 | */ |
Kojto | 90:cb3d968589d8 | 593 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 594 | #define BP_USB_OTGICR_BSESSEN (2U) /*!< Bit position for USB_OTGICR_BSESSEN. */ |
Kojto | 90:cb3d968589d8 | 595 | #define BM_USB_OTGICR_BSESSEN (0x04U) /*!< Bit mask for USB_OTGICR_BSESSEN. */ |
Kojto | 90:cb3d968589d8 | 596 | #define BS_USB_OTGICR_BSESSEN (1U) /*!< Bit field size in bits for USB_OTGICR_BSESSEN. */ |
Kojto | 90:cb3d968589d8 | 597 | |
Kojto | 90:cb3d968589d8 | 598 | /*! @brief Read current value of the USB_OTGICR_BSESSEN field. */ |
Kojto | 90:cb3d968589d8 | 599 | #define BR_USB_OTGICR_BSESSEN(x) (BITBAND_ACCESS8(HW_USB_OTGICR_ADDR(x), BP_USB_OTGICR_BSESSEN)) |
Kojto | 90:cb3d968589d8 | 600 | |
Kojto | 90:cb3d968589d8 | 601 | /*! @brief Format value for bitfield USB_OTGICR_BSESSEN. */ |
Kojto | 90:cb3d968589d8 | 602 | #define BF_USB_OTGICR_BSESSEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGICR_BSESSEN) & BM_USB_OTGICR_BSESSEN) |
Kojto | 90:cb3d968589d8 | 603 | |
Kojto | 90:cb3d968589d8 | 604 | /*! @brief Set the BSESSEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 605 | #define BW_USB_OTGICR_BSESSEN(x, v) (BITBAND_ACCESS8(HW_USB_OTGICR_ADDR(x), BP_USB_OTGICR_BSESSEN) = (v)) |
Kojto | 90:cb3d968589d8 | 606 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 607 | |
Kojto | 90:cb3d968589d8 | 608 | /*! |
Kojto | 90:cb3d968589d8 | 609 | * @name Register USB_OTGICR, field SESSVLDEN[3] (RW) |
Kojto | 90:cb3d968589d8 | 610 | * |
Kojto | 90:cb3d968589d8 | 611 | * Values: |
Kojto | 90:cb3d968589d8 | 612 | * - 0 - Disables the SESSVLDCHG interrupt. |
Kojto | 90:cb3d968589d8 | 613 | * - 1 - Enables the SESSVLDCHG interrupt. |
Kojto | 90:cb3d968589d8 | 614 | */ |
Kojto | 90:cb3d968589d8 | 615 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 616 | #define BP_USB_OTGICR_SESSVLDEN (3U) /*!< Bit position for USB_OTGICR_SESSVLDEN. */ |
Kojto | 90:cb3d968589d8 | 617 | #define BM_USB_OTGICR_SESSVLDEN (0x08U) /*!< Bit mask for USB_OTGICR_SESSVLDEN. */ |
Kojto | 90:cb3d968589d8 | 618 | #define BS_USB_OTGICR_SESSVLDEN (1U) /*!< Bit field size in bits for USB_OTGICR_SESSVLDEN. */ |
Kojto | 90:cb3d968589d8 | 619 | |
Kojto | 90:cb3d968589d8 | 620 | /*! @brief Read current value of the USB_OTGICR_SESSVLDEN field. */ |
Kojto | 90:cb3d968589d8 | 621 | #define BR_USB_OTGICR_SESSVLDEN(x) (BITBAND_ACCESS8(HW_USB_OTGICR_ADDR(x), BP_USB_OTGICR_SESSVLDEN)) |
Kojto | 90:cb3d968589d8 | 622 | |
Kojto | 90:cb3d968589d8 | 623 | /*! @brief Format value for bitfield USB_OTGICR_SESSVLDEN. */ |
Kojto | 90:cb3d968589d8 | 624 | #define BF_USB_OTGICR_SESSVLDEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGICR_SESSVLDEN) & BM_USB_OTGICR_SESSVLDEN) |
Kojto | 90:cb3d968589d8 | 625 | |
Kojto | 90:cb3d968589d8 | 626 | /*! @brief Set the SESSVLDEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 627 | #define BW_USB_OTGICR_SESSVLDEN(x, v) (BITBAND_ACCESS8(HW_USB_OTGICR_ADDR(x), BP_USB_OTGICR_SESSVLDEN) = (v)) |
Kojto | 90:cb3d968589d8 | 628 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 629 | |
Kojto | 90:cb3d968589d8 | 630 | /*! |
Kojto | 90:cb3d968589d8 | 631 | * @name Register USB_OTGICR, field LINESTATEEN[5] (RW) |
Kojto | 90:cb3d968589d8 | 632 | * |
Kojto | 90:cb3d968589d8 | 633 | * Values: |
Kojto | 90:cb3d968589d8 | 634 | * - 0 - Disables the LINE_STAT_CHG interrupt. |
Kojto | 90:cb3d968589d8 | 635 | * - 1 - Enables the LINE_STAT_CHG interrupt. |
Kojto | 90:cb3d968589d8 | 636 | */ |
Kojto | 90:cb3d968589d8 | 637 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 638 | #define BP_USB_OTGICR_LINESTATEEN (5U) /*!< Bit position for USB_OTGICR_LINESTATEEN. */ |
Kojto | 90:cb3d968589d8 | 639 | #define BM_USB_OTGICR_LINESTATEEN (0x20U) /*!< Bit mask for USB_OTGICR_LINESTATEEN. */ |
Kojto | 90:cb3d968589d8 | 640 | #define BS_USB_OTGICR_LINESTATEEN (1U) /*!< Bit field size in bits for USB_OTGICR_LINESTATEEN. */ |
Kojto | 90:cb3d968589d8 | 641 | |
Kojto | 90:cb3d968589d8 | 642 | /*! @brief Read current value of the USB_OTGICR_LINESTATEEN field. */ |
Kojto | 90:cb3d968589d8 | 643 | #define BR_USB_OTGICR_LINESTATEEN(x) (BITBAND_ACCESS8(HW_USB_OTGICR_ADDR(x), BP_USB_OTGICR_LINESTATEEN)) |
Kojto | 90:cb3d968589d8 | 644 | |
Kojto | 90:cb3d968589d8 | 645 | /*! @brief Format value for bitfield USB_OTGICR_LINESTATEEN. */ |
Kojto | 90:cb3d968589d8 | 646 | #define BF_USB_OTGICR_LINESTATEEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGICR_LINESTATEEN) & BM_USB_OTGICR_LINESTATEEN) |
Kojto | 90:cb3d968589d8 | 647 | |
Kojto | 90:cb3d968589d8 | 648 | /*! @brief Set the LINESTATEEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 649 | #define BW_USB_OTGICR_LINESTATEEN(x, v) (BITBAND_ACCESS8(HW_USB_OTGICR_ADDR(x), BP_USB_OTGICR_LINESTATEEN) = (v)) |
Kojto | 90:cb3d968589d8 | 650 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 651 | |
Kojto | 90:cb3d968589d8 | 652 | /*! |
Kojto | 90:cb3d968589d8 | 653 | * @name Register USB_OTGICR, field ONEMSECEN[6] (RW) |
Kojto | 90:cb3d968589d8 | 654 | * |
Kojto | 90:cb3d968589d8 | 655 | * Values: |
Kojto | 90:cb3d968589d8 | 656 | * - 0 - Diables the 1ms timer interrupt. |
Kojto | 90:cb3d968589d8 | 657 | * - 1 - Enables the 1ms timer interrupt. |
Kojto | 90:cb3d968589d8 | 658 | */ |
Kojto | 90:cb3d968589d8 | 659 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 660 | #define BP_USB_OTGICR_ONEMSECEN (6U) /*!< Bit position for USB_OTGICR_ONEMSECEN. */ |
Kojto | 90:cb3d968589d8 | 661 | #define BM_USB_OTGICR_ONEMSECEN (0x40U) /*!< Bit mask for USB_OTGICR_ONEMSECEN. */ |
Kojto | 90:cb3d968589d8 | 662 | #define BS_USB_OTGICR_ONEMSECEN (1U) /*!< Bit field size in bits for USB_OTGICR_ONEMSECEN. */ |
Kojto | 90:cb3d968589d8 | 663 | |
Kojto | 90:cb3d968589d8 | 664 | /*! @brief Read current value of the USB_OTGICR_ONEMSECEN field. */ |
Kojto | 90:cb3d968589d8 | 665 | #define BR_USB_OTGICR_ONEMSECEN(x) (BITBAND_ACCESS8(HW_USB_OTGICR_ADDR(x), BP_USB_OTGICR_ONEMSECEN)) |
Kojto | 90:cb3d968589d8 | 666 | |
Kojto | 90:cb3d968589d8 | 667 | /*! @brief Format value for bitfield USB_OTGICR_ONEMSECEN. */ |
Kojto | 90:cb3d968589d8 | 668 | #define BF_USB_OTGICR_ONEMSECEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGICR_ONEMSECEN) & BM_USB_OTGICR_ONEMSECEN) |
Kojto | 90:cb3d968589d8 | 669 | |
Kojto | 90:cb3d968589d8 | 670 | /*! @brief Set the ONEMSECEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 671 | #define BW_USB_OTGICR_ONEMSECEN(x, v) (BITBAND_ACCESS8(HW_USB_OTGICR_ADDR(x), BP_USB_OTGICR_ONEMSECEN) = (v)) |
Kojto | 90:cb3d968589d8 | 672 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 673 | |
Kojto | 90:cb3d968589d8 | 674 | /*! |
Kojto | 90:cb3d968589d8 | 675 | * @name Register USB_OTGICR, field IDEN[7] (RW) |
Kojto | 90:cb3d968589d8 | 676 | * |
Kojto | 90:cb3d968589d8 | 677 | * Values: |
Kojto | 90:cb3d968589d8 | 678 | * - 0 - The ID interrupt is disabled |
Kojto | 90:cb3d968589d8 | 679 | * - 1 - The ID interrupt is enabled |
Kojto | 90:cb3d968589d8 | 680 | */ |
Kojto | 90:cb3d968589d8 | 681 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 682 | #define BP_USB_OTGICR_IDEN (7U) /*!< Bit position for USB_OTGICR_IDEN. */ |
Kojto | 90:cb3d968589d8 | 683 | #define BM_USB_OTGICR_IDEN (0x80U) /*!< Bit mask for USB_OTGICR_IDEN. */ |
Kojto | 90:cb3d968589d8 | 684 | #define BS_USB_OTGICR_IDEN (1U) /*!< Bit field size in bits for USB_OTGICR_IDEN. */ |
Kojto | 90:cb3d968589d8 | 685 | |
Kojto | 90:cb3d968589d8 | 686 | /*! @brief Read current value of the USB_OTGICR_IDEN field. */ |
Kojto | 90:cb3d968589d8 | 687 | #define BR_USB_OTGICR_IDEN(x) (BITBAND_ACCESS8(HW_USB_OTGICR_ADDR(x), BP_USB_OTGICR_IDEN)) |
Kojto | 90:cb3d968589d8 | 688 | |
Kojto | 90:cb3d968589d8 | 689 | /*! @brief Format value for bitfield USB_OTGICR_IDEN. */ |
Kojto | 90:cb3d968589d8 | 690 | #define BF_USB_OTGICR_IDEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGICR_IDEN) & BM_USB_OTGICR_IDEN) |
Kojto | 90:cb3d968589d8 | 691 | |
Kojto | 90:cb3d968589d8 | 692 | /*! @brief Set the IDEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 693 | #define BW_USB_OTGICR_IDEN(x, v) (BITBAND_ACCESS8(HW_USB_OTGICR_ADDR(x), BP_USB_OTGICR_IDEN) = (v)) |
Kojto | 90:cb3d968589d8 | 694 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 695 | |
Kojto | 90:cb3d968589d8 | 696 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 697 | * HW_USB_OTGSTAT - OTG Status register |
Kojto | 90:cb3d968589d8 | 698 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 699 | |
Kojto | 90:cb3d968589d8 | 700 | /*! |
Kojto | 90:cb3d968589d8 | 701 | * @brief HW_USB_OTGSTAT - OTG Status register (RW) |
Kojto | 90:cb3d968589d8 | 702 | * |
Kojto | 90:cb3d968589d8 | 703 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 704 | * |
Kojto | 90:cb3d968589d8 | 705 | * Displays the actual value from the external comparator outputs of the ID pin |
Kojto | 90:cb3d968589d8 | 706 | * and VBUS. |
Kojto | 90:cb3d968589d8 | 707 | */ |
Kojto | 90:cb3d968589d8 | 708 | typedef union _hw_usb_otgstat |
Kojto | 90:cb3d968589d8 | 709 | { |
Kojto | 90:cb3d968589d8 | 710 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 711 | struct _hw_usb_otgstat_bitfields |
Kojto | 90:cb3d968589d8 | 712 | { |
Kojto | 90:cb3d968589d8 | 713 | uint8_t AVBUSVLD : 1; /*!< [0] A VBUS Valid */ |
Kojto | 90:cb3d968589d8 | 714 | uint8_t RESERVED0 : 1; /*!< [1] */ |
Kojto | 90:cb3d968589d8 | 715 | uint8_t BSESSEND : 1; /*!< [2] B Session End */ |
Kojto | 90:cb3d968589d8 | 716 | uint8_t SESS_VLD : 1; /*!< [3] Session Valid */ |
Kojto | 90:cb3d968589d8 | 717 | uint8_t RESERVED1 : 1; /*!< [4] */ |
Kojto | 90:cb3d968589d8 | 718 | uint8_t LINESTATESTABLE : 1; /*!< [5] */ |
Kojto | 90:cb3d968589d8 | 719 | uint8_t ONEMSECEN : 1; /*!< [6] */ |
Kojto | 90:cb3d968589d8 | 720 | uint8_t ID : 1; /*!< [7] */ |
Kojto | 90:cb3d968589d8 | 721 | } B; |
Kojto | 90:cb3d968589d8 | 722 | } hw_usb_otgstat_t; |
Kojto | 90:cb3d968589d8 | 723 | |
Kojto | 90:cb3d968589d8 | 724 | /*! |
Kojto | 90:cb3d968589d8 | 725 | * @name Constants and macros for entire USB_OTGSTAT register |
Kojto | 90:cb3d968589d8 | 726 | */ |
Kojto | 90:cb3d968589d8 | 727 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 728 | #define HW_USB_OTGSTAT_ADDR(x) ((x) + 0x18U) |
Kojto | 90:cb3d968589d8 | 729 | |
Kojto | 90:cb3d968589d8 | 730 | #define HW_USB_OTGSTAT(x) (*(__IO hw_usb_otgstat_t *) HW_USB_OTGSTAT_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 731 | #define HW_USB_OTGSTAT_RD(x) (HW_USB_OTGSTAT(x).U) |
Kojto | 90:cb3d968589d8 | 732 | #define HW_USB_OTGSTAT_WR(x, v) (HW_USB_OTGSTAT(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 733 | #define HW_USB_OTGSTAT_SET(x, v) (HW_USB_OTGSTAT_WR(x, HW_USB_OTGSTAT_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 734 | #define HW_USB_OTGSTAT_CLR(x, v) (HW_USB_OTGSTAT_WR(x, HW_USB_OTGSTAT_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 735 | #define HW_USB_OTGSTAT_TOG(x, v) (HW_USB_OTGSTAT_WR(x, HW_USB_OTGSTAT_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 736 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 737 | |
Kojto | 90:cb3d968589d8 | 738 | /* |
Kojto | 90:cb3d968589d8 | 739 | * Constants & macros for individual USB_OTGSTAT bitfields |
Kojto | 90:cb3d968589d8 | 740 | */ |
Kojto | 90:cb3d968589d8 | 741 | |
Kojto | 90:cb3d968589d8 | 742 | /*! |
Kojto | 90:cb3d968589d8 | 743 | * @name Register USB_OTGSTAT, field AVBUSVLD[0] (RW) |
Kojto | 90:cb3d968589d8 | 744 | * |
Kojto | 90:cb3d968589d8 | 745 | * Values: |
Kojto | 90:cb3d968589d8 | 746 | * - 0 - The VBUS voltage is below the A VBUS Valid threshold. |
Kojto | 90:cb3d968589d8 | 747 | * - 1 - The VBUS voltage is above the A VBUS Valid threshold. |
Kojto | 90:cb3d968589d8 | 748 | */ |
Kojto | 90:cb3d968589d8 | 749 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 750 | #define BP_USB_OTGSTAT_AVBUSVLD (0U) /*!< Bit position for USB_OTGSTAT_AVBUSVLD. */ |
Kojto | 90:cb3d968589d8 | 751 | #define BM_USB_OTGSTAT_AVBUSVLD (0x01U) /*!< Bit mask for USB_OTGSTAT_AVBUSVLD. */ |
Kojto | 90:cb3d968589d8 | 752 | #define BS_USB_OTGSTAT_AVBUSVLD (1U) /*!< Bit field size in bits for USB_OTGSTAT_AVBUSVLD. */ |
Kojto | 90:cb3d968589d8 | 753 | |
Kojto | 90:cb3d968589d8 | 754 | /*! @brief Read current value of the USB_OTGSTAT_AVBUSVLD field. */ |
Kojto | 90:cb3d968589d8 | 755 | #define BR_USB_OTGSTAT_AVBUSVLD(x) (BITBAND_ACCESS8(HW_USB_OTGSTAT_ADDR(x), BP_USB_OTGSTAT_AVBUSVLD)) |
Kojto | 90:cb3d968589d8 | 756 | |
Kojto | 90:cb3d968589d8 | 757 | /*! @brief Format value for bitfield USB_OTGSTAT_AVBUSVLD. */ |
Kojto | 90:cb3d968589d8 | 758 | #define BF_USB_OTGSTAT_AVBUSVLD(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGSTAT_AVBUSVLD) & BM_USB_OTGSTAT_AVBUSVLD) |
Kojto | 90:cb3d968589d8 | 759 | |
Kojto | 90:cb3d968589d8 | 760 | /*! @brief Set the AVBUSVLD field to a new value. */ |
Kojto | 90:cb3d968589d8 | 761 | #define BW_USB_OTGSTAT_AVBUSVLD(x, v) (BITBAND_ACCESS8(HW_USB_OTGSTAT_ADDR(x), BP_USB_OTGSTAT_AVBUSVLD) = (v)) |
Kojto | 90:cb3d968589d8 | 762 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 763 | |
Kojto | 90:cb3d968589d8 | 764 | /*! |
Kojto | 90:cb3d968589d8 | 765 | * @name Register USB_OTGSTAT, field BSESSEND[2] (RW) |
Kojto | 90:cb3d968589d8 | 766 | * |
Kojto | 90:cb3d968589d8 | 767 | * Values: |
Kojto | 90:cb3d968589d8 | 768 | * - 0 - The VBUS voltage is above the B session end threshold. |
Kojto | 90:cb3d968589d8 | 769 | * - 1 - The VBUS voltage is below the B session end threshold. |
Kojto | 90:cb3d968589d8 | 770 | */ |
Kojto | 90:cb3d968589d8 | 771 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 772 | #define BP_USB_OTGSTAT_BSESSEND (2U) /*!< Bit position for USB_OTGSTAT_BSESSEND. */ |
Kojto | 90:cb3d968589d8 | 773 | #define BM_USB_OTGSTAT_BSESSEND (0x04U) /*!< Bit mask for USB_OTGSTAT_BSESSEND. */ |
Kojto | 90:cb3d968589d8 | 774 | #define BS_USB_OTGSTAT_BSESSEND (1U) /*!< Bit field size in bits for USB_OTGSTAT_BSESSEND. */ |
Kojto | 90:cb3d968589d8 | 775 | |
Kojto | 90:cb3d968589d8 | 776 | /*! @brief Read current value of the USB_OTGSTAT_BSESSEND field. */ |
Kojto | 90:cb3d968589d8 | 777 | #define BR_USB_OTGSTAT_BSESSEND(x) (BITBAND_ACCESS8(HW_USB_OTGSTAT_ADDR(x), BP_USB_OTGSTAT_BSESSEND)) |
Kojto | 90:cb3d968589d8 | 778 | |
Kojto | 90:cb3d968589d8 | 779 | /*! @brief Format value for bitfield USB_OTGSTAT_BSESSEND. */ |
Kojto | 90:cb3d968589d8 | 780 | #define BF_USB_OTGSTAT_BSESSEND(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGSTAT_BSESSEND) & BM_USB_OTGSTAT_BSESSEND) |
Kojto | 90:cb3d968589d8 | 781 | |
Kojto | 90:cb3d968589d8 | 782 | /*! @brief Set the BSESSEND field to a new value. */ |
Kojto | 90:cb3d968589d8 | 783 | #define BW_USB_OTGSTAT_BSESSEND(x, v) (BITBAND_ACCESS8(HW_USB_OTGSTAT_ADDR(x), BP_USB_OTGSTAT_BSESSEND) = (v)) |
Kojto | 90:cb3d968589d8 | 784 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 785 | |
Kojto | 90:cb3d968589d8 | 786 | /*! |
Kojto | 90:cb3d968589d8 | 787 | * @name Register USB_OTGSTAT, field SESS_VLD[3] (RW) |
Kojto | 90:cb3d968589d8 | 788 | * |
Kojto | 90:cb3d968589d8 | 789 | * Values: |
Kojto | 90:cb3d968589d8 | 790 | * - 0 - The VBUS voltage is below the B session valid threshold |
Kojto | 90:cb3d968589d8 | 791 | * - 1 - The VBUS voltage is above the B session valid threshold. |
Kojto | 90:cb3d968589d8 | 792 | */ |
Kojto | 90:cb3d968589d8 | 793 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 794 | #define BP_USB_OTGSTAT_SESS_VLD (3U) /*!< Bit position for USB_OTGSTAT_SESS_VLD. */ |
Kojto | 90:cb3d968589d8 | 795 | #define BM_USB_OTGSTAT_SESS_VLD (0x08U) /*!< Bit mask for USB_OTGSTAT_SESS_VLD. */ |
Kojto | 90:cb3d968589d8 | 796 | #define BS_USB_OTGSTAT_SESS_VLD (1U) /*!< Bit field size in bits for USB_OTGSTAT_SESS_VLD. */ |
Kojto | 90:cb3d968589d8 | 797 | |
Kojto | 90:cb3d968589d8 | 798 | /*! @brief Read current value of the USB_OTGSTAT_SESS_VLD field. */ |
Kojto | 90:cb3d968589d8 | 799 | #define BR_USB_OTGSTAT_SESS_VLD(x) (BITBAND_ACCESS8(HW_USB_OTGSTAT_ADDR(x), BP_USB_OTGSTAT_SESS_VLD)) |
Kojto | 90:cb3d968589d8 | 800 | |
Kojto | 90:cb3d968589d8 | 801 | /*! @brief Format value for bitfield USB_OTGSTAT_SESS_VLD. */ |
Kojto | 90:cb3d968589d8 | 802 | #define BF_USB_OTGSTAT_SESS_VLD(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGSTAT_SESS_VLD) & BM_USB_OTGSTAT_SESS_VLD) |
Kojto | 90:cb3d968589d8 | 803 | |
Kojto | 90:cb3d968589d8 | 804 | /*! @brief Set the SESS_VLD field to a new value. */ |
Kojto | 90:cb3d968589d8 | 805 | #define BW_USB_OTGSTAT_SESS_VLD(x, v) (BITBAND_ACCESS8(HW_USB_OTGSTAT_ADDR(x), BP_USB_OTGSTAT_SESS_VLD) = (v)) |
Kojto | 90:cb3d968589d8 | 806 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 807 | |
Kojto | 90:cb3d968589d8 | 808 | /*! |
Kojto | 90:cb3d968589d8 | 809 | * @name Register USB_OTGSTAT, field LINESTATESTABLE[5] (RW) |
Kojto | 90:cb3d968589d8 | 810 | * |
Kojto | 90:cb3d968589d8 | 811 | * Indicates that the internal signals that control the LINE_STATE_CHG field of |
Kojto | 90:cb3d968589d8 | 812 | * OTGISTAT are stable for at least 1 millisecond. First read LINE_STATE_CHG |
Kojto | 90:cb3d968589d8 | 813 | * field and then read this field. If this field reads as 1, then the value of |
Kojto | 90:cb3d968589d8 | 814 | * LINE_STATE_CHG can be considered stable. |
Kojto | 90:cb3d968589d8 | 815 | * |
Kojto | 90:cb3d968589d8 | 816 | * Values: |
Kojto | 90:cb3d968589d8 | 817 | * - 0 - The LINE_STAT_CHG bit is not yet stable. |
Kojto | 90:cb3d968589d8 | 818 | * - 1 - The LINE_STAT_CHG bit has been debounced and is stable. |
Kojto | 90:cb3d968589d8 | 819 | */ |
Kojto | 90:cb3d968589d8 | 820 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 821 | #define BP_USB_OTGSTAT_LINESTATESTABLE (5U) /*!< Bit position for USB_OTGSTAT_LINESTATESTABLE. */ |
Kojto | 90:cb3d968589d8 | 822 | #define BM_USB_OTGSTAT_LINESTATESTABLE (0x20U) /*!< Bit mask for USB_OTGSTAT_LINESTATESTABLE. */ |
Kojto | 90:cb3d968589d8 | 823 | #define BS_USB_OTGSTAT_LINESTATESTABLE (1U) /*!< Bit field size in bits for USB_OTGSTAT_LINESTATESTABLE. */ |
Kojto | 90:cb3d968589d8 | 824 | |
Kojto | 90:cb3d968589d8 | 825 | /*! @brief Read current value of the USB_OTGSTAT_LINESTATESTABLE field. */ |
Kojto | 90:cb3d968589d8 | 826 | #define BR_USB_OTGSTAT_LINESTATESTABLE(x) (BITBAND_ACCESS8(HW_USB_OTGSTAT_ADDR(x), BP_USB_OTGSTAT_LINESTATESTABLE)) |
Kojto | 90:cb3d968589d8 | 827 | |
Kojto | 90:cb3d968589d8 | 828 | /*! @brief Format value for bitfield USB_OTGSTAT_LINESTATESTABLE. */ |
Kojto | 90:cb3d968589d8 | 829 | #define BF_USB_OTGSTAT_LINESTATESTABLE(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGSTAT_LINESTATESTABLE) & BM_USB_OTGSTAT_LINESTATESTABLE) |
Kojto | 90:cb3d968589d8 | 830 | |
Kojto | 90:cb3d968589d8 | 831 | /*! @brief Set the LINESTATESTABLE field to a new value. */ |
Kojto | 90:cb3d968589d8 | 832 | #define BW_USB_OTGSTAT_LINESTATESTABLE(x, v) (BITBAND_ACCESS8(HW_USB_OTGSTAT_ADDR(x), BP_USB_OTGSTAT_LINESTATESTABLE) = (v)) |
Kojto | 90:cb3d968589d8 | 833 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 834 | |
Kojto | 90:cb3d968589d8 | 835 | /*! |
Kojto | 90:cb3d968589d8 | 836 | * @name Register USB_OTGSTAT, field ONEMSECEN[6] (RW) |
Kojto | 90:cb3d968589d8 | 837 | * |
Kojto | 90:cb3d968589d8 | 838 | * This bit is reserved for the 1ms count, but it is not useful to software. |
Kojto | 90:cb3d968589d8 | 839 | */ |
Kojto | 90:cb3d968589d8 | 840 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 841 | #define BP_USB_OTGSTAT_ONEMSECEN (6U) /*!< Bit position for USB_OTGSTAT_ONEMSECEN. */ |
Kojto | 90:cb3d968589d8 | 842 | #define BM_USB_OTGSTAT_ONEMSECEN (0x40U) /*!< Bit mask for USB_OTGSTAT_ONEMSECEN. */ |
Kojto | 90:cb3d968589d8 | 843 | #define BS_USB_OTGSTAT_ONEMSECEN (1U) /*!< Bit field size in bits for USB_OTGSTAT_ONEMSECEN. */ |
Kojto | 90:cb3d968589d8 | 844 | |
Kojto | 90:cb3d968589d8 | 845 | /*! @brief Read current value of the USB_OTGSTAT_ONEMSECEN field. */ |
Kojto | 90:cb3d968589d8 | 846 | #define BR_USB_OTGSTAT_ONEMSECEN(x) (BITBAND_ACCESS8(HW_USB_OTGSTAT_ADDR(x), BP_USB_OTGSTAT_ONEMSECEN)) |
Kojto | 90:cb3d968589d8 | 847 | |
Kojto | 90:cb3d968589d8 | 848 | /*! @brief Format value for bitfield USB_OTGSTAT_ONEMSECEN. */ |
Kojto | 90:cb3d968589d8 | 849 | #define BF_USB_OTGSTAT_ONEMSECEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGSTAT_ONEMSECEN) & BM_USB_OTGSTAT_ONEMSECEN) |
Kojto | 90:cb3d968589d8 | 850 | |
Kojto | 90:cb3d968589d8 | 851 | /*! @brief Set the ONEMSECEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 852 | #define BW_USB_OTGSTAT_ONEMSECEN(x, v) (BITBAND_ACCESS8(HW_USB_OTGSTAT_ADDR(x), BP_USB_OTGSTAT_ONEMSECEN) = (v)) |
Kojto | 90:cb3d968589d8 | 853 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 854 | |
Kojto | 90:cb3d968589d8 | 855 | /*! |
Kojto | 90:cb3d968589d8 | 856 | * @name Register USB_OTGSTAT, field ID[7] (RW) |
Kojto | 90:cb3d968589d8 | 857 | * |
Kojto | 90:cb3d968589d8 | 858 | * Indicates the current state of the ID pin on the USB connector |
Kojto | 90:cb3d968589d8 | 859 | * |
Kojto | 90:cb3d968589d8 | 860 | * Values: |
Kojto | 90:cb3d968589d8 | 861 | * - 0 - Indicates a Type A cable is plugged into the USB connector. |
Kojto | 90:cb3d968589d8 | 862 | * - 1 - Indicates no cable is attached or a Type B cable is plugged into the |
Kojto | 90:cb3d968589d8 | 863 | * USB connector. |
Kojto | 90:cb3d968589d8 | 864 | */ |
Kojto | 90:cb3d968589d8 | 865 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 866 | #define BP_USB_OTGSTAT_ID (7U) /*!< Bit position for USB_OTGSTAT_ID. */ |
Kojto | 90:cb3d968589d8 | 867 | #define BM_USB_OTGSTAT_ID (0x80U) /*!< Bit mask for USB_OTGSTAT_ID. */ |
Kojto | 90:cb3d968589d8 | 868 | #define BS_USB_OTGSTAT_ID (1U) /*!< Bit field size in bits for USB_OTGSTAT_ID. */ |
Kojto | 90:cb3d968589d8 | 869 | |
Kojto | 90:cb3d968589d8 | 870 | /*! @brief Read current value of the USB_OTGSTAT_ID field. */ |
Kojto | 90:cb3d968589d8 | 871 | #define BR_USB_OTGSTAT_ID(x) (BITBAND_ACCESS8(HW_USB_OTGSTAT_ADDR(x), BP_USB_OTGSTAT_ID)) |
Kojto | 90:cb3d968589d8 | 872 | |
Kojto | 90:cb3d968589d8 | 873 | /*! @brief Format value for bitfield USB_OTGSTAT_ID. */ |
Kojto | 90:cb3d968589d8 | 874 | #define BF_USB_OTGSTAT_ID(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGSTAT_ID) & BM_USB_OTGSTAT_ID) |
Kojto | 90:cb3d968589d8 | 875 | |
Kojto | 90:cb3d968589d8 | 876 | /*! @brief Set the ID field to a new value. */ |
Kojto | 90:cb3d968589d8 | 877 | #define BW_USB_OTGSTAT_ID(x, v) (BITBAND_ACCESS8(HW_USB_OTGSTAT_ADDR(x), BP_USB_OTGSTAT_ID) = (v)) |
Kojto | 90:cb3d968589d8 | 878 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 879 | |
Kojto | 90:cb3d968589d8 | 880 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 881 | * HW_USB_OTGCTL - OTG Control register |
Kojto | 90:cb3d968589d8 | 882 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 883 | |
Kojto | 90:cb3d968589d8 | 884 | /*! |
Kojto | 90:cb3d968589d8 | 885 | * @brief HW_USB_OTGCTL - OTG Control register (RW) |
Kojto | 90:cb3d968589d8 | 886 | * |
Kojto | 90:cb3d968589d8 | 887 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 888 | * |
Kojto | 90:cb3d968589d8 | 889 | * Controls the operation of VBUS and Data Line termination resistors. |
Kojto | 90:cb3d968589d8 | 890 | */ |
Kojto | 90:cb3d968589d8 | 891 | typedef union _hw_usb_otgctl |
Kojto | 90:cb3d968589d8 | 892 | { |
Kojto | 90:cb3d968589d8 | 893 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 894 | struct _hw_usb_otgctl_bitfields |
Kojto | 90:cb3d968589d8 | 895 | { |
Kojto | 90:cb3d968589d8 | 896 | uint8_t RESERVED0 : 2; /*!< [1:0] */ |
Kojto | 90:cb3d968589d8 | 897 | uint8_t OTGEN : 1; /*!< [2] On-The-Go pullup/pulldown resistor enable |
Kojto | 90:cb3d968589d8 | 898 | * */ |
Kojto | 90:cb3d968589d8 | 899 | uint8_t RESERVED1 : 1; /*!< [3] */ |
Kojto | 90:cb3d968589d8 | 900 | uint8_t DMLOW : 1; /*!< [4] D- Data Line pull-down resistor enable */ |
Kojto | 90:cb3d968589d8 | 901 | uint8_t DPLOW : 1; /*!< [5] D+ Data Line pull-down resistor enable */ |
Kojto | 90:cb3d968589d8 | 902 | uint8_t RESERVED2 : 1; /*!< [6] */ |
Kojto | 90:cb3d968589d8 | 903 | uint8_t DPHIGH : 1; /*!< [7] D+ Data Line pullup resistor enable */ |
Kojto | 90:cb3d968589d8 | 904 | } B; |
Kojto | 90:cb3d968589d8 | 905 | } hw_usb_otgctl_t; |
Kojto | 90:cb3d968589d8 | 906 | |
Kojto | 90:cb3d968589d8 | 907 | /*! |
Kojto | 90:cb3d968589d8 | 908 | * @name Constants and macros for entire USB_OTGCTL register |
Kojto | 90:cb3d968589d8 | 909 | */ |
Kojto | 90:cb3d968589d8 | 910 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 911 | #define HW_USB_OTGCTL_ADDR(x) ((x) + 0x1CU) |
Kojto | 90:cb3d968589d8 | 912 | |
Kojto | 90:cb3d968589d8 | 913 | #define HW_USB_OTGCTL(x) (*(__IO hw_usb_otgctl_t *) HW_USB_OTGCTL_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 914 | #define HW_USB_OTGCTL_RD(x) (HW_USB_OTGCTL(x).U) |
Kojto | 90:cb3d968589d8 | 915 | #define HW_USB_OTGCTL_WR(x, v) (HW_USB_OTGCTL(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 916 | #define HW_USB_OTGCTL_SET(x, v) (HW_USB_OTGCTL_WR(x, HW_USB_OTGCTL_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 917 | #define HW_USB_OTGCTL_CLR(x, v) (HW_USB_OTGCTL_WR(x, HW_USB_OTGCTL_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 918 | #define HW_USB_OTGCTL_TOG(x, v) (HW_USB_OTGCTL_WR(x, HW_USB_OTGCTL_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 919 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 920 | |
Kojto | 90:cb3d968589d8 | 921 | /* |
Kojto | 90:cb3d968589d8 | 922 | * Constants & macros for individual USB_OTGCTL bitfields |
Kojto | 90:cb3d968589d8 | 923 | */ |
Kojto | 90:cb3d968589d8 | 924 | |
Kojto | 90:cb3d968589d8 | 925 | /*! |
Kojto | 90:cb3d968589d8 | 926 | * @name Register USB_OTGCTL, field OTGEN[2] (RW) |
Kojto | 90:cb3d968589d8 | 927 | * |
Kojto | 90:cb3d968589d8 | 928 | * Values: |
Kojto | 90:cb3d968589d8 | 929 | * - 0 - If USB_EN is 1 and HOST_MODE is 0 in the Control Register (CTL), then |
Kojto | 90:cb3d968589d8 | 930 | * the D+ Data Line pull-up resistors are enabled. If HOST_MODE is 1 the D+ |
Kojto | 90:cb3d968589d8 | 931 | * and D- Data Line pull-down resistors are engaged. |
Kojto | 90:cb3d968589d8 | 932 | * - 1 - The pull-up and pull-down controls in this register are used. |
Kojto | 90:cb3d968589d8 | 933 | */ |
Kojto | 90:cb3d968589d8 | 934 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 935 | #define BP_USB_OTGCTL_OTGEN (2U) /*!< Bit position for USB_OTGCTL_OTGEN. */ |
Kojto | 90:cb3d968589d8 | 936 | #define BM_USB_OTGCTL_OTGEN (0x04U) /*!< Bit mask for USB_OTGCTL_OTGEN. */ |
Kojto | 90:cb3d968589d8 | 937 | #define BS_USB_OTGCTL_OTGEN (1U) /*!< Bit field size in bits for USB_OTGCTL_OTGEN. */ |
Kojto | 90:cb3d968589d8 | 938 | |
Kojto | 90:cb3d968589d8 | 939 | /*! @brief Read current value of the USB_OTGCTL_OTGEN field. */ |
Kojto | 90:cb3d968589d8 | 940 | #define BR_USB_OTGCTL_OTGEN(x) (BITBAND_ACCESS8(HW_USB_OTGCTL_ADDR(x), BP_USB_OTGCTL_OTGEN)) |
Kojto | 90:cb3d968589d8 | 941 | |
Kojto | 90:cb3d968589d8 | 942 | /*! @brief Format value for bitfield USB_OTGCTL_OTGEN. */ |
Kojto | 90:cb3d968589d8 | 943 | #define BF_USB_OTGCTL_OTGEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGCTL_OTGEN) & BM_USB_OTGCTL_OTGEN) |
Kojto | 90:cb3d968589d8 | 944 | |
Kojto | 90:cb3d968589d8 | 945 | /*! @brief Set the OTGEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 946 | #define BW_USB_OTGCTL_OTGEN(x, v) (BITBAND_ACCESS8(HW_USB_OTGCTL_ADDR(x), BP_USB_OTGCTL_OTGEN) = (v)) |
Kojto | 90:cb3d968589d8 | 947 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 948 | |
Kojto | 90:cb3d968589d8 | 949 | /*! |
Kojto | 90:cb3d968589d8 | 950 | * @name Register USB_OTGCTL, field DMLOW[4] (RW) |
Kojto | 90:cb3d968589d8 | 951 | * |
Kojto | 90:cb3d968589d8 | 952 | * Values: |
Kojto | 90:cb3d968589d8 | 953 | * - 0 - D- pulldown resistor is not enabled. |
Kojto | 90:cb3d968589d8 | 954 | * - 1 - D- pulldown resistor is enabled. |
Kojto | 90:cb3d968589d8 | 955 | */ |
Kojto | 90:cb3d968589d8 | 956 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 957 | #define BP_USB_OTGCTL_DMLOW (4U) /*!< Bit position for USB_OTGCTL_DMLOW. */ |
Kojto | 90:cb3d968589d8 | 958 | #define BM_USB_OTGCTL_DMLOW (0x10U) /*!< Bit mask for USB_OTGCTL_DMLOW. */ |
Kojto | 90:cb3d968589d8 | 959 | #define BS_USB_OTGCTL_DMLOW (1U) /*!< Bit field size in bits for USB_OTGCTL_DMLOW. */ |
Kojto | 90:cb3d968589d8 | 960 | |
Kojto | 90:cb3d968589d8 | 961 | /*! @brief Read current value of the USB_OTGCTL_DMLOW field. */ |
Kojto | 90:cb3d968589d8 | 962 | #define BR_USB_OTGCTL_DMLOW(x) (BITBAND_ACCESS8(HW_USB_OTGCTL_ADDR(x), BP_USB_OTGCTL_DMLOW)) |
Kojto | 90:cb3d968589d8 | 963 | |
Kojto | 90:cb3d968589d8 | 964 | /*! @brief Format value for bitfield USB_OTGCTL_DMLOW. */ |
Kojto | 90:cb3d968589d8 | 965 | #define BF_USB_OTGCTL_DMLOW(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGCTL_DMLOW) & BM_USB_OTGCTL_DMLOW) |
Kojto | 90:cb3d968589d8 | 966 | |
Kojto | 90:cb3d968589d8 | 967 | /*! @brief Set the DMLOW field to a new value. */ |
Kojto | 90:cb3d968589d8 | 968 | #define BW_USB_OTGCTL_DMLOW(x, v) (BITBAND_ACCESS8(HW_USB_OTGCTL_ADDR(x), BP_USB_OTGCTL_DMLOW) = (v)) |
Kojto | 90:cb3d968589d8 | 969 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 970 | |
Kojto | 90:cb3d968589d8 | 971 | /*! |
Kojto | 90:cb3d968589d8 | 972 | * @name Register USB_OTGCTL, field DPLOW[5] (RW) |
Kojto | 90:cb3d968589d8 | 973 | * |
Kojto | 90:cb3d968589d8 | 974 | * This bit should always be enabled together with bit 4 (DMLOW) |
Kojto | 90:cb3d968589d8 | 975 | * |
Kojto | 90:cb3d968589d8 | 976 | * Values: |
Kojto | 90:cb3d968589d8 | 977 | * - 0 - D+ pulldown resistor is not enabled. |
Kojto | 90:cb3d968589d8 | 978 | * - 1 - D+ pulldown resistor is enabled. |
Kojto | 90:cb3d968589d8 | 979 | */ |
Kojto | 90:cb3d968589d8 | 980 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 981 | #define BP_USB_OTGCTL_DPLOW (5U) /*!< Bit position for USB_OTGCTL_DPLOW. */ |
Kojto | 90:cb3d968589d8 | 982 | #define BM_USB_OTGCTL_DPLOW (0x20U) /*!< Bit mask for USB_OTGCTL_DPLOW. */ |
Kojto | 90:cb3d968589d8 | 983 | #define BS_USB_OTGCTL_DPLOW (1U) /*!< Bit field size in bits for USB_OTGCTL_DPLOW. */ |
Kojto | 90:cb3d968589d8 | 984 | |
Kojto | 90:cb3d968589d8 | 985 | /*! @brief Read current value of the USB_OTGCTL_DPLOW field. */ |
Kojto | 90:cb3d968589d8 | 986 | #define BR_USB_OTGCTL_DPLOW(x) (BITBAND_ACCESS8(HW_USB_OTGCTL_ADDR(x), BP_USB_OTGCTL_DPLOW)) |
Kojto | 90:cb3d968589d8 | 987 | |
Kojto | 90:cb3d968589d8 | 988 | /*! @brief Format value for bitfield USB_OTGCTL_DPLOW. */ |
Kojto | 90:cb3d968589d8 | 989 | #define BF_USB_OTGCTL_DPLOW(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGCTL_DPLOW) & BM_USB_OTGCTL_DPLOW) |
Kojto | 90:cb3d968589d8 | 990 | |
Kojto | 90:cb3d968589d8 | 991 | /*! @brief Set the DPLOW field to a new value. */ |
Kojto | 90:cb3d968589d8 | 992 | #define BW_USB_OTGCTL_DPLOW(x, v) (BITBAND_ACCESS8(HW_USB_OTGCTL_ADDR(x), BP_USB_OTGCTL_DPLOW) = (v)) |
Kojto | 90:cb3d968589d8 | 993 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 994 | |
Kojto | 90:cb3d968589d8 | 995 | /*! |
Kojto | 90:cb3d968589d8 | 996 | * @name Register USB_OTGCTL, field DPHIGH[7] (RW) |
Kojto | 90:cb3d968589d8 | 997 | * |
Kojto | 90:cb3d968589d8 | 998 | * Values: |
Kojto | 90:cb3d968589d8 | 999 | * - 0 - D+ pullup resistor is not enabled |
Kojto | 90:cb3d968589d8 | 1000 | * - 1 - D+ pullup resistor is enabled |
Kojto | 90:cb3d968589d8 | 1001 | */ |
Kojto | 90:cb3d968589d8 | 1002 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1003 | #define BP_USB_OTGCTL_DPHIGH (7U) /*!< Bit position for USB_OTGCTL_DPHIGH. */ |
Kojto | 90:cb3d968589d8 | 1004 | #define BM_USB_OTGCTL_DPHIGH (0x80U) /*!< Bit mask for USB_OTGCTL_DPHIGH. */ |
Kojto | 90:cb3d968589d8 | 1005 | #define BS_USB_OTGCTL_DPHIGH (1U) /*!< Bit field size in bits for USB_OTGCTL_DPHIGH. */ |
Kojto | 90:cb3d968589d8 | 1006 | |
Kojto | 90:cb3d968589d8 | 1007 | /*! @brief Read current value of the USB_OTGCTL_DPHIGH field. */ |
Kojto | 90:cb3d968589d8 | 1008 | #define BR_USB_OTGCTL_DPHIGH(x) (BITBAND_ACCESS8(HW_USB_OTGCTL_ADDR(x), BP_USB_OTGCTL_DPHIGH)) |
Kojto | 90:cb3d968589d8 | 1009 | |
Kojto | 90:cb3d968589d8 | 1010 | /*! @brief Format value for bitfield USB_OTGCTL_DPHIGH. */ |
Kojto | 90:cb3d968589d8 | 1011 | #define BF_USB_OTGCTL_DPHIGH(v) ((uint8_t)((uint8_t)(v) << BP_USB_OTGCTL_DPHIGH) & BM_USB_OTGCTL_DPHIGH) |
Kojto | 90:cb3d968589d8 | 1012 | |
Kojto | 90:cb3d968589d8 | 1013 | /*! @brief Set the DPHIGH field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1014 | #define BW_USB_OTGCTL_DPHIGH(x, v) (BITBAND_ACCESS8(HW_USB_OTGCTL_ADDR(x), BP_USB_OTGCTL_DPHIGH) = (v)) |
Kojto | 90:cb3d968589d8 | 1015 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1016 | |
Kojto | 90:cb3d968589d8 | 1017 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 1018 | * HW_USB_ISTAT - Interrupt Status register |
Kojto | 90:cb3d968589d8 | 1019 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 1020 | |
Kojto | 90:cb3d968589d8 | 1021 | /*! |
Kojto | 90:cb3d968589d8 | 1022 | * @brief HW_USB_ISTAT - Interrupt Status register (W1C) |
Kojto | 90:cb3d968589d8 | 1023 | * |
Kojto | 90:cb3d968589d8 | 1024 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 1025 | * |
Kojto | 90:cb3d968589d8 | 1026 | * Contains fields for each of the interrupt sources within the USB Module. Each |
Kojto | 90:cb3d968589d8 | 1027 | * of these fields are qualified with their respective interrupt enable bits. |
Kojto | 90:cb3d968589d8 | 1028 | * All fields of this register are logically OR'd together along with the OTG |
Kojto | 90:cb3d968589d8 | 1029 | * Interrupt Status Register (OTGSTAT) to form a single interrupt source for the |
Kojto | 90:cb3d968589d8 | 1030 | * processor's interrupt controller. After an interrupt bit has been set it may only |
Kojto | 90:cb3d968589d8 | 1031 | * be cleared by writing a one to the respective interrupt bit. This register |
Kojto | 90:cb3d968589d8 | 1032 | * contains the value of 0x00 after a reset. |
Kojto | 90:cb3d968589d8 | 1033 | */ |
Kojto | 90:cb3d968589d8 | 1034 | typedef union _hw_usb_istat |
Kojto | 90:cb3d968589d8 | 1035 | { |
Kojto | 90:cb3d968589d8 | 1036 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 1037 | struct _hw_usb_istat_bitfields |
Kojto | 90:cb3d968589d8 | 1038 | { |
Kojto | 90:cb3d968589d8 | 1039 | uint8_t USBRST : 1; /*!< [0] */ |
Kojto | 90:cb3d968589d8 | 1040 | uint8_t ERROR : 1; /*!< [1] */ |
Kojto | 90:cb3d968589d8 | 1041 | uint8_t SOFTOK : 1; /*!< [2] */ |
Kojto | 90:cb3d968589d8 | 1042 | uint8_t TOKDNE : 1; /*!< [3] */ |
Kojto | 90:cb3d968589d8 | 1043 | uint8_t SLEEP : 1; /*!< [4] */ |
Kojto | 90:cb3d968589d8 | 1044 | uint8_t RESUME : 1; /*!< [5] */ |
Kojto | 90:cb3d968589d8 | 1045 | uint8_t ATTACH : 1; /*!< [6] Attach Interrupt */ |
Kojto | 90:cb3d968589d8 | 1046 | uint8_t STALL : 1; /*!< [7] Stall Interrupt */ |
Kojto | 90:cb3d968589d8 | 1047 | } B; |
Kojto | 90:cb3d968589d8 | 1048 | } hw_usb_istat_t; |
Kojto | 90:cb3d968589d8 | 1049 | |
Kojto | 90:cb3d968589d8 | 1050 | /*! |
Kojto | 90:cb3d968589d8 | 1051 | * @name Constants and macros for entire USB_ISTAT register |
Kojto | 90:cb3d968589d8 | 1052 | */ |
Kojto | 90:cb3d968589d8 | 1053 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1054 | #define HW_USB_ISTAT_ADDR(x) ((x) + 0x80U) |
Kojto | 90:cb3d968589d8 | 1055 | |
Kojto | 90:cb3d968589d8 | 1056 | #define HW_USB_ISTAT(x) (*(__IO hw_usb_istat_t *) HW_USB_ISTAT_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 1057 | #define HW_USB_ISTAT_RD(x) (HW_USB_ISTAT(x).U) |
Kojto | 90:cb3d968589d8 | 1058 | #define HW_USB_ISTAT_WR(x, v) (HW_USB_ISTAT(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 1059 | #define HW_USB_ISTAT_SET(x, v) (HW_USB_ISTAT_WR(x, HW_USB_ISTAT_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 1060 | #define HW_USB_ISTAT_CLR(x, v) (HW_USB_ISTAT_WR(x, HW_USB_ISTAT_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 1061 | #define HW_USB_ISTAT_TOG(x, v) (HW_USB_ISTAT_WR(x, HW_USB_ISTAT_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 1062 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1063 | |
Kojto | 90:cb3d968589d8 | 1064 | /* |
Kojto | 90:cb3d968589d8 | 1065 | * Constants & macros for individual USB_ISTAT bitfields |
Kojto | 90:cb3d968589d8 | 1066 | */ |
Kojto | 90:cb3d968589d8 | 1067 | |
Kojto | 90:cb3d968589d8 | 1068 | /*! |
Kojto | 90:cb3d968589d8 | 1069 | * @name Register USB_ISTAT, field USBRST[0] (W1C) |
Kojto | 90:cb3d968589d8 | 1070 | * |
Kojto | 90:cb3d968589d8 | 1071 | * This bit is set when the USB Module has decoded a valid USB reset. This |
Kojto | 90:cb3d968589d8 | 1072 | * informs the processor that it should write 0x00 into the address register and |
Kojto | 90:cb3d968589d8 | 1073 | * enable endpoint 0. USBRST is set after a USB reset has been detected for 2.5 |
Kojto | 90:cb3d968589d8 | 1074 | * microseconds. It is not asserted again until the USB reset condition has been |
Kojto | 90:cb3d968589d8 | 1075 | * removed and then reasserted. |
Kojto | 90:cb3d968589d8 | 1076 | */ |
Kojto | 90:cb3d968589d8 | 1077 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1078 | #define BP_USB_ISTAT_USBRST (0U) /*!< Bit position for USB_ISTAT_USBRST. */ |
Kojto | 90:cb3d968589d8 | 1079 | #define BM_USB_ISTAT_USBRST (0x01U) /*!< Bit mask for USB_ISTAT_USBRST. */ |
Kojto | 90:cb3d968589d8 | 1080 | #define BS_USB_ISTAT_USBRST (1U) /*!< Bit field size in bits for USB_ISTAT_USBRST. */ |
Kojto | 90:cb3d968589d8 | 1081 | |
Kojto | 90:cb3d968589d8 | 1082 | /*! @brief Read current value of the USB_ISTAT_USBRST field. */ |
Kojto | 90:cb3d968589d8 | 1083 | #define BR_USB_ISTAT_USBRST(x) (BITBAND_ACCESS8(HW_USB_ISTAT_ADDR(x), BP_USB_ISTAT_USBRST)) |
Kojto | 90:cb3d968589d8 | 1084 | |
Kojto | 90:cb3d968589d8 | 1085 | /*! @brief Format value for bitfield USB_ISTAT_USBRST. */ |
Kojto | 90:cb3d968589d8 | 1086 | #define BF_USB_ISTAT_USBRST(v) ((uint8_t)((uint8_t)(v) << BP_USB_ISTAT_USBRST) & BM_USB_ISTAT_USBRST) |
Kojto | 90:cb3d968589d8 | 1087 | |
Kojto | 90:cb3d968589d8 | 1088 | /*! @brief Set the USBRST field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1089 | #define BW_USB_ISTAT_USBRST(x, v) (BITBAND_ACCESS8(HW_USB_ISTAT_ADDR(x), BP_USB_ISTAT_USBRST) = (v)) |
Kojto | 90:cb3d968589d8 | 1090 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1091 | |
Kojto | 90:cb3d968589d8 | 1092 | /*! |
Kojto | 90:cb3d968589d8 | 1093 | * @name Register USB_ISTAT, field ERROR[1] (W1C) |
Kojto | 90:cb3d968589d8 | 1094 | * |
Kojto | 90:cb3d968589d8 | 1095 | * This bit is set when any of the error conditions within Error Interrupt |
Kojto | 90:cb3d968589d8 | 1096 | * Status (ERRSTAT) register occur. The processor must then read the ERRSTAT register |
Kojto | 90:cb3d968589d8 | 1097 | * to determine the source of the error. |
Kojto | 90:cb3d968589d8 | 1098 | */ |
Kojto | 90:cb3d968589d8 | 1099 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1100 | #define BP_USB_ISTAT_ERROR (1U) /*!< Bit position for USB_ISTAT_ERROR. */ |
Kojto | 90:cb3d968589d8 | 1101 | #define BM_USB_ISTAT_ERROR (0x02U) /*!< Bit mask for USB_ISTAT_ERROR. */ |
Kojto | 90:cb3d968589d8 | 1102 | #define BS_USB_ISTAT_ERROR (1U) /*!< Bit field size in bits for USB_ISTAT_ERROR. */ |
Kojto | 90:cb3d968589d8 | 1103 | |
Kojto | 90:cb3d968589d8 | 1104 | /*! @brief Read current value of the USB_ISTAT_ERROR field. */ |
Kojto | 90:cb3d968589d8 | 1105 | #define BR_USB_ISTAT_ERROR(x) (BITBAND_ACCESS8(HW_USB_ISTAT_ADDR(x), BP_USB_ISTAT_ERROR)) |
Kojto | 90:cb3d968589d8 | 1106 | |
Kojto | 90:cb3d968589d8 | 1107 | /*! @brief Format value for bitfield USB_ISTAT_ERROR. */ |
Kojto | 90:cb3d968589d8 | 1108 | #define BF_USB_ISTAT_ERROR(v) ((uint8_t)((uint8_t)(v) << BP_USB_ISTAT_ERROR) & BM_USB_ISTAT_ERROR) |
Kojto | 90:cb3d968589d8 | 1109 | |
Kojto | 90:cb3d968589d8 | 1110 | /*! @brief Set the ERROR field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1111 | #define BW_USB_ISTAT_ERROR(x, v) (BITBAND_ACCESS8(HW_USB_ISTAT_ADDR(x), BP_USB_ISTAT_ERROR) = (v)) |
Kojto | 90:cb3d968589d8 | 1112 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1113 | |
Kojto | 90:cb3d968589d8 | 1114 | /*! |
Kojto | 90:cb3d968589d8 | 1115 | * @name Register USB_ISTAT, field SOFTOK[2] (W1C) |
Kojto | 90:cb3d968589d8 | 1116 | * |
Kojto | 90:cb3d968589d8 | 1117 | * This bit is set when the USB Module receives a Start Of Frame (SOF) token. In |
Kojto | 90:cb3d968589d8 | 1118 | * Host mode this field is set when the SOF threshold is reached, so that |
Kojto | 90:cb3d968589d8 | 1119 | * software can prepare for the next SOF. |
Kojto | 90:cb3d968589d8 | 1120 | */ |
Kojto | 90:cb3d968589d8 | 1121 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1122 | #define BP_USB_ISTAT_SOFTOK (2U) /*!< Bit position for USB_ISTAT_SOFTOK. */ |
Kojto | 90:cb3d968589d8 | 1123 | #define BM_USB_ISTAT_SOFTOK (0x04U) /*!< Bit mask for USB_ISTAT_SOFTOK. */ |
Kojto | 90:cb3d968589d8 | 1124 | #define BS_USB_ISTAT_SOFTOK (1U) /*!< Bit field size in bits for USB_ISTAT_SOFTOK. */ |
Kojto | 90:cb3d968589d8 | 1125 | |
Kojto | 90:cb3d968589d8 | 1126 | /*! @brief Read current value of the USB_ISTAT_SOFTOK field. */ |
Kojto | 90:cb3d968589d8 | 1127 | #define BR_USB_ISTAT_SOFTOK(x) (BITBAND_ACCESS8(HW_USB_ISTAT_ADDR(x), BP_USB_ISTAT_SOFTOK)) |
Kojto | 90:cb3d968589d8 | 1128 | |
Kojto | 90:cb3d968589d8 | 1129 | /*! @brief Format value for bitfield USB_ISTAT_SOFTOK. */ |
Kojto | 90:cb3d968589d8 | 1130 | #define BF_USB_ISTAT_SOFTOK(v) ((uint8_t)((uint8_t)(v) << BP_USB_ISTAT_SOFTOK) & BM_USB_ISTAT_SOFTOK) |
Kojto | 90:cb3d968589d8 | 1131 | |
Kojto | 90:cb3d968589d8 | 1132 | /*! @brief Set the SOFTOK field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1133 | #define BW_USB_ISTAT_SOFTOK(x, v) (BITBAND_ACCESS8(HW_USB_ISTAT_ADDR(x), BP_USB_ISTAT_SOFTOK) = (v)) |
Kojto | 90:cb3d968589d8 | 1134 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1135 | |
Kojto | 90:cb3d968589d8 | 1136 | /*! |
Kojto | 90:cb3d968589d8 | 1137 | * @name Register USB_ISTAT, field TOKDNE[3] (W1C) |
Kojto | 90:cb3d968589d8 | 1138 | * |
Kojto | 90:cb3d968589d8 | 1139 | * This bit is set when the current token being processed has completed. The |
Kojto | 90:cb3d968589d8 | 1140 | * processor must immediately read the STATUS (STAT) register to determine the |
Kojto | 90:cb3d968589d8 | 1141 | * EndPoint and BD used for this token. Clearing this bit (by writing a one) causes |
Kojto | 90:cb3d968589d8 | 1142 | * STAT to be cleared or the STAT holding register to be loaded into the STAT |
Kojto | 90:cb3d968589d8 | 1143 | * register. |
Kojto | 90:cb3d968589d8 | 1144 | */ |
Kojto | 90:cb3d968589d8 | 1145 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1146 | #define BP_USB_ISTAT_TOKDNE (3U) /*!< Bit position for USB_ISTAT_TOKDNE. */ |
Kojto | 90:cb3d968589d8 | 1147 | #define BM_USB_ISTAT_TOKDNE (0x08U) /*!< Bit mask for USB_ISTAT_TOKDNE. */ |
Kojto | 90:cb3d968589d8 | 1148 | #define BS_USB_ISTAT_TOKDNE (1U) /*!< Bit field size in bits for USB_ISTAT_TOKDNE. */ |
Kojto | 90:cb3d968589d8 | 1149 | |
Kojto | 90:cb3d968589d8 | 1150 | /*! @brief Read current value of the USB_ISTAT_TOKDNE field. */ |
Kojto | 90:cb3d968589d8 | 1151 | #define BR_USB_ISTAT_TOKDNE(x) (BITBAND_ACCESS8(HW_USB_ISTAT_ADDR(x), BP_USB_ISTAT_TOKDNE)) |
Kojto | 90:cb3d968589d8 | 1152 | |
Kojto | 90:cb3d968589d8 | 1153 | /*! @brief Format value for bitfield USB_ISTAT_TOKDNE. */ |
Kojto | 90:cb3d968589d8 | 1154 | #define BF_USB_ISTAT_TOKDNE(v) ((uint8_t)((uint8_t)(v) << BP_USB_ISTAT_TOKDNE) & BM_USB_ISTAT_TOKDNE) |
Kojto | 90:cb3d968589d8 | 1155 | |
Kojto | 90:cb3d968589d8 | 1156 | /*! @brief Set the TOKDNE field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1157 | #define BW_USB_ISTAT_TOKDNE(x, v) (BITBAND_ACCESS8(HW_USB_ISTAT_ADDR(x), BP_USB_ISTAT_TOKDNE) = (v)) |
Kojto | 90:cb3d968589d8 | 1158 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1159 | |
Kojto | 90:cb3d968589d8 | 1160 | /*! |
Kojto | 90:cb3d968589d8 | 1161 | * @name Register USB_ISTAT, field SLEEP[4] (W1C) |
Kojto | 90:cb3d968589d8 | 1162 | * |
Kojto | 90:cb3d968589d8 | 1163 | * This bit is set when the USB Module detects a constant idle on the USB bus |
Kojto | 90:cb3d968589d8 | 1164 | * for 3 ms. The sleep timer is reset by activity on the USB bus. |
Kojto | 90:cb3d968589d8 | 1165 | */ |
Kojto | 90:cb3d968589d8 | 1166 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1167 | #define BP_USB_ISTAT_SLEEP (4U) /*!< Bit position for USB_ISTAT_SLEEP. */ |
Kojto | 90:cb3d968589d8 | 1168 | #define BM_USB_ISTAT_SLEEP (0x10U) /*!< Bit mask for USB_ISTAT_SLEEP. */ |
Kojto | 90:cb3d968589d8 | 1169 | #define BS_USB_ISTAT_SLEEP (1U) /*!< Bit field size in bits for USB_ISTAT_SLEEP. */ |
Kojto | 90:cb3d968589d8 | 1170 | |
Kojto | 90:cb3d968589d8 | 1171 | /*! @brief Read current value of the USB_ISTAT_SLEEP field. */ |
Kojto | 90:cb3d968589d8 | 1172 | #define BR_USB_ISTAT_SLEEP(x) (BITBAND_ACCESS8(HW_USB_ISTAT_ADDR(x), BP_USB_ISTAT_SLEEP)) |
Kojto | 90:cb3d968589d8 | 1173 | |
Kojto | 90:cb3d968589d8 | 1174 | /*! @brief Format value for bitfield USB_ISTAT_SLEEP. */ |
Kojto | 90:cb3d968589d8 | 1175 | #define BF_USB_ISTAT_SLEEP(v) ((uint8_t)((uint8_t)(v) << BP_USB_ISTAT_SLEEP) & BM_USB_ISTAT_SLEEP) |
Kojto | 90:cb3d968589d8 | 1176 | |
Kojto | 90:cb3d968589d8 | 1177 | /*! @brief Set the SLEEP field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1178 | #define BW_USB_ISTAT_SLEEP(x, v) (BITBAND_ACCESS8(HW_USB_ISTAT_ADDR(x), BP_USB_ISTAT_SLEEP) = (v)) |
Kojto | 90:cb3d968589d8 | 1179 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1180 | |
Kojto | 90:cb3d968589d8 | 1181 | /*! |
Kojto | 90:cb3d968589d8 | 1182 | * @name Register USB_ISTAT, field RESUME[5] (W1C) |
Kojto | 90:cb3d968589d8 | 1183 | * |
Kojto | 90:cb3d968589d8 | 1184 | * This bit is set when a K-state is observed on the DP/DM signals for 2.5 us. |
Kojto | 90:cb3d968589d8 | 1185 | * When not in suspend mode this interrupt must be disabled. |
Kojto | 90:cb3d968589d8 | 1186 | */ |
Kojto | 90:cb3d968589d8 | 1187 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1188 | #define BP_USB_ISTAT_RESUME (5U) /*!< Bit position for USB_ISTAT_RESUME. */ |
Kojto | 90:cb3d968589d8 | 1189 | #define BM_USB_ISTAT_RESUME (0x20U) /*!< Bit mask for USB_ISTAT_RESUME. */ |
Kojto | 90:cb3d968589d8 | 1190 | #define BS_USB_ISTAT_RESUME (1U) /*!< Bit field size in bits for USB_ISTAT_RESUME. */ |
Kojto | 90:cb3d968589d8 | 1191 | |
Kojto | 90:cb3d968589d8 | 1192 | /*! @brief Read current value of the USB_ISTAT_RESUME field. */ |
Kojto | 90:cb3d968589d8 | 1193 | #define BR_USB_ISTAT_RESUME(x) (BITBAND_ACCESS8(HW_USB_ISTAT_ADDR(x), BP_USB_ISTAT_RESUME)) |
Kojto | 90:cb3d968589d8 | 1194 | |
Kojto | 90:cb3d968589d8 | 1195 | /*! @brief Format value for bitfield USB_ISTAT_RESUME. */ |
Kojto | 90:cb3d968589d8 | 1196 | #define BF_USB_ISTAT_RESUME(v) ((uint8_t)((uint8_t)(v) << BP_USB_ISTAT_RESUME) & BM_USB_ISTAT_RESUME) |
Kojto | 90:cb3d968589d8 | 1197 | |
Kojto | 90:cb3d968589d8 | 1198 | /*! @brief Set the RESUME field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1199 | #define BW_USB_ISTAT_RESUME(x, v) (BITBAND_ACCESS8(HW_USB_ISTAT_ADDR(x), BP_USB_ISTAT_RESUME) = (v)) |
Kojto | 90:cb3d968589d8 | 1200 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1201 | |
Kojto | 90:cb3d968589d8 | 1202 | /*! |
Kojto | 90:cb3d968589d8 | 1203 | * @name Register USB_ISTAT, field ATTACH[6] (W1C) |
Kojto | 90:cb3d968589d8 | 1204 | * |
Kojto | 90:cb3d968589d8 | 1205 | * This bit is set when the USB Module detects an attach of a USB device. This |
Kojto | 90:cb3d968589d8 | 1206 | * signal is only valid if HOSTMODEEN is true. This interrupt signifies that a |
Kojto | 90:cb3d968589d8 | 1207 | * peripheral is now present and must be configured; it is asserted if there have |
Kojto | 90:cb3d968589d8 | 1208 | * been no transitions on the USB for 2.5 us and the current bus state is not SE0." |
Kojto | 90:cb3d968589d8 | 1209 | */ |
Kojto | 90:cb3d968589d8 | 1210 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1211 | #define BP_USB_ISTAT_ATTACH (6U) /*!< Bit position for USB_ISTAT_ATTACH. */ |
Kojto | 90:cb3d968589d8 | 1212 | #define BM_USB_ISTAT_ATTACH (0x40U) /*!< Bit mask for USB_ISTAT_ATTACH. */ |
Kojto | 90:cb3d968589d8 | 1213 | #define BS_USB_ISTAT_ATTACH (1U) /*!< Bit field size in bits for USB_ISTAT_ATTACH. */ |
Kojto | 90:cb3d968589d8 | 1214 | |
Kojto | 90:cb3d968589d8 | 1215 | /*! @brief Read current value of the USB_ISTAT_ATTACH field. */ |
Kojto | 90:cb3d968589d8 | 1216 | #define BR_USB_ISTAT_ATTACH(x) (BITBAND_ACCESS8(HW_USB_ISTAT_ADDR(x), BP_USB_ISTAT_ATTACH)) |
Kojto | 90:cb3d968589d8 | 1217 | |
Kojto | 90:cb3d968589d8 | 1218 | /*! @brief Format value for bitfield USB_ISTAT_ATTACH. */ |
Kojto | 90:cb3d968589d8 | 1219 | #define BF_USB_ISTAT_ATTACH(v) ((uint8_t)((uint8_t)(v) << BP_USB_ISTAT_ATTACH) & BM_USB_ISTAT_ATTACH) |
Kojto | 90:cb3d968589d8 | 1220 | |
Kojto | 90:cb3d968589d8 | 1221 | /*! @brief Set the ATTACH field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1222 | #define BW_USB_ISTAT_ATTACH(x, v) (BITBAND_ACCESS8(HW_USB_ISTAT_ADDR(x), BP_USB_ISTAT_ATTACH) = (v)) |
Kojto | 90:cb3d968589d8 | 1223 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1224 | |
Kojto | 90:cb3d968589d8 | 1225 | /*! |
Kojto | 90:cb3d968589d8 | 1226 | * @name Register USB_ISTAT, field STALL[7] (W1C) |
Kojto | 90:cb3d968589d8 | 1227 | * |
Kojto | 90:cb3d968589d8 | 1228 | * In Target mode this bit is asserted when a STALL handshake is sent by the |
Kojto | 90:cb3d968589d8 | 1229 | * SIE. In Host mode this bit is set when the USB Module detects a STALL acknowledge |
Kojto | 90:cb3d968589d8 | 1230 | * during the handshake phase of a USB transaction.This interrupt can be used to |
Kojto | 90:cb3d968589d8 | 1231 | * determine whether the last USB transaction was completed successfully or |
Kojto | 90:cb3d968589d8 | 1232 | * stalled. |
Kojto | 90:cb3d968589d8 | 1233 | */ |
Kojto | 90:cb3d968589d8 | 1234 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1235 | #define BP_USB_ISTAT_STALL (7U) /*!< Bit position for USB_ISTAT_STALL. */ |
Kojto | 90:cb3d968589d8 | 1236 | #define BM_USB_ISTAT_STALL (0x80U) /*!< Bit mask for USB_ISTAT_STALL. */ |
Kojto | 90:cb3d968589d8 | 1237 | #define BS_USB_ISTAT_STALL (1U) /*!< Bit field size in bits for USB_ISTAT_STALL. */ |
Kojto | 90:cb3d968589d8 | 1238 | |
Kojto | 90:cb3d968589d8 | 1239 | /*! @brief Read current value of the USB_ISTAT_STALL field. */ |
Kojto | 90:cb3d968589d8 | 1240 | #define BR_USB_ISTAT_STALL(x) (BITBAND_ACCESS8(HW_USB_ISTAT_ADDR(x), BP_USB_ISTAT_STALL)) |
Kojto | 90:cb3d968589d8 | 1241 | |
Kojto | 90:cb3d968589d8 | 1242 | /*! @brief Format value for bitfield USB_ISTAT_STALL. */ |
Kojto | 90:cb3d968589d8 | 1243 | #define BF_USB_ISTAT_STALL(v) ((uint8_t)((uint8_t)(v) << BP_USB_ISTAT_STALL) & BM_USB_ISTAT_STALL) |
Kojto | 90:cb3d968589d8 | 1244 | |
Kojto | 90:cb3d968589d8 | 1245 | /*! @brief Set the STALL field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1246 | #define BW_USB_ISTAT_STALL(x, v) (BITBAND_ACCESS8(HW_USB_ISTAT_ADDR(x), BP_USB_ISTAT_STALL) = (v)) |
Kojto | 90:cb3d968589d8 | 1247 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1248 | |
Kojto | 90:cb3d968589d8 | 1249 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 1250 | * HW_USB_INTEN - Interrupt Enable register |
Kojto | 90:cb3d968589d8 | 1251 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 1252 | |
Kojto | 90:cb3d968589d8 | 1253 | /*! |
Kojto | 90:cb3d968589d8 | 1254 | * @brief HW_USB_INTEN - Interrupt Enable register (RW) |
Kojto | 90:cb3d968589d8 | 1255 | * |
Kojto | 90:cb3d968589d8 | 1256 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 1257 | * |
Kojto | 90:cb3d968589d8 | 1258 | * Contains enable fields for each of the interrupt sources within the USB |
Kojto | 90:cb3d968589d8 | 1259 | * Module. Setting any of these bits enables the respective interrupt source in the |
Kojto | 90:cb3d968589d8 | 1260 | * ISTAT register. This register contains the value of 0x00 after a reset. |
Kojto | 90:cb3d968589d8 | 1261 | */ |
Kojto | 90:cb3d968589d8 | 1262 | typedef union _hw_usb_inten |
Kojto | 90:cb3d968589d8 | 1263 | { |
Kojto | 90:cb3d968589d8 | 1264 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 1265 | struct _hw_usb_inten_bitfields |
Kojto | 90:cb3d968589d8 | 1266 | { |
Kojto | 90:cb3d968589d8 | 1267 | uint8_t USBRSTEN : 1; /*!< [0] USBRST Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 1268 | uint8_t ERROREN : 1; /*!< [1] ERROR Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 1269 | uint8_t SOFTOKEN : 1; /*!< [2] SOFTOK Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 1270 | uint8_t TOKDNEEN : 1; /*!< [3] TOKDNE Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 1271 | uint8_t SLEEPEN : 1; /*!< [4] SLEEP Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 1272 | uint8_t RESUMEEN : 1; /*!< [5] RESUME Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 1273 | uint8_t ATTACHEN : 1; /*!< [6] ATTACH Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 1274 | uint8_t STALLEN : 1; /*!< [7] STALL Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 1275 | } B; |
Kojto | 90:cb3d968589d8 | 1276 | } hw_usb_inten_t; |
Kojto | 90:cb3d968589d8 | 1277 | |
Kojto | 90:cb3d968589d8 | 1278 | /*! |
Kojto | 90:cb3d968589d8 | 1279 | * @name Constants and macros for entire USB_INTEN register |
Kojto | 90:cb3d968589d8 | 1280 | */ |
Kojto | 90:cb3d968589d8 | 1281 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1282 | #define HW_USB_INTEN_ADDR(x) ((x) + 0x84U) |
Kojto | 90:cb3d968589d8 | 1283 | |
Kojto | 90:cb3d968589d8 | 1284 | #define HW_USB_INTEN(x) (*(__IO hw_usb_inten_t *) HW_USB_INTEN_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 1285 | #define HW_USB_INTEN_RD(x) (HW_USB_INTEN(x).U) |
Kojto | 90:cb3d968589d8 | 1286 | #define HW_USB_INTEN_WR(x, v) (HW_USB_INTEN(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 1287 | #define HW_USB_INTEN_SET(x, v) (HW_USB_INTEN_WR(x, HW_USB_INTEN_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 1288 | #define HW_USB_INTEN_CLR(x, v) (HW_USB_INTEN_WR(x, HW_USB_INTEN_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 1289 | #define HW_USB_INTEN_TOG(x, v) (HW_USB_INTEN_WR(x, HW_USB_INTEN_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 1290 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1291 | |
Kojto | 90:cb3d968589d8 | 1292 | /* |
Kojto | 90:cb3d968589d8 | 1293 | * Constants & macros for individual USB_INTEN bitfields |
Kojto | 90:cb3d968589d8 | 1294 | */ |
Kojto | 90:cb3d968589d8 | 1295 | |
Kojto | 90:cb3d968589d8 | 1296 | /*! |
Kojto | 90:cb3d968589d8 | 1297 | * @name Register USB_INTEN, field USBRSTEN[0] (RW) |
Kojto | 90:cb3d968589d8 | 1298 | * |
Kojto | 90:cb3d968589d8 | 1299 | * Values: |
Kojto | 90:cb3d968589d8 | 1300 | * - 0 - Disables the USBRST interrupt. |
Kojto | 90:cb3d968589d8 | 1301 | * - 1 - Enables the USBRST interrupt. |
Kojto | 90:cb3d968589d8 | 1302 | */ |
Kojto | 90:cb3d968589d8 | 1303 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1304 | #define BP_USB_INTEN_USBRSTEN (0U) /*!< Bit position for USB_INTEN_USBRSTEN. */ |
Kojto | 90:cb3d968589d8 | 1305 | #define BM_USB_INTEN_USBRSTEN (0x01U) /*!< Bit mask for USB_INTEN_USBRSTEN. */ |
Kojto | 90:cb3d968589d8 | 1306 | #define BS_USB_INTEN_USBRSTEN (1U) /*!< Bit field size in bits for USB_INTEN_USBRSTEN. */ |
Kojto | 90:cb3d968589d8 | 1307 | |
Kojto | 90:cb3d968589d8 | 1308 | /*! @brief Read current value of the USB_INTEN_USBRSTEN field. */ |
Kojto | 90:cb3d968589d8 | 1309 | #define BR_USB_INTEN_USBRSTEN(x) (BITBAND_ACCESS8(HW_USB_INTEN_ADDR(x), BP_USB_INTEN_USBRSTEN)) |
Kojto | 90:cb3d968589d8 | 1310 | |
Kojto | 90:cb3d968589d8 | 1311 | /*! @brief Format value for bitfield USB_INTEN_USBRSTEN. */ |
Kojto | 90:cb3d968589d8 | 1312 | #define BF_USB_INTEN_USBRSTEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_INTEN_USBRSTEN) & BM_USB_INTEN_USBRSTEN) |
Kojto | 90:cb3d968589d8 | 1313 | |
Kojto | 90:cb3d968589d8 | 1314 | /*! @brief Set the USBRSTEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1315 | #define BW_USB_INTEN_USBRSTEN(x, v) (BITBAND_ACCESS8(HW_USB_INTEN_ADDR(x), BP_USB_INTEN_USBRSTEN) = (v)) |
Kojto | 90:cb3d968589d8 | 1316 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1317 | |
Kojto | 90:cb3d968589d8 | 1318 | /*! |
Kojto | 90:cb3d968589d8 | 1319 | * @name Register USB_INTEN, field ERROREN[1] (RW) |
Kojto | 90:cb3d968589d8 | 1320 | * |
Kojto | 90:cb3d968589d8 | 1321 | * Values: |
Kojto | 90:cb3d968589d8 | 1322 | * - 0 - Disables the ERROR interrupt. |
Kojto | 90:cb3d968589d8 | 1323 | * - 1 - Enables the ERROR interrupt. |
Kojto | 90:cb3d968589d8 | 1324 | */ |
Kojto | 90:cb3d968589d8 | 1325 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1326 | #define BP_USB_INTEN_ERROREN (1U) /*!< Bit position for USB_INTEN_ERROREN. */ |
Kojto | 90:cb3d968589d8 | 1327 | #define BM_USB_INTEN_ERROREN (0x02U) /*!< Bit mask for USB_INTEN_ERROREN. */ |
Kojto | 90:cb3d968589d8 | 1328 | #define BS_USB_INTEN_ERROREN (1U) /*!< Bit field size in bits for USB_INTEN_ERROREN. */ |
Kojto | 90:cb3d968589d8 | 1329 | |
Kojto | 90:cb3d968589d8 | 1330 | /*! @brief Read current value of the USB_INTEN_ERROREN field. */ |
Kojto | 90:cb3d968589d8 | 1331 | #define BR_USB_INTEN_ERROREN(x) (BITBAND_ACCESS8(HW_USB_INTEN_ADDR(x), BP_USB_INTEN_ERROREN)) |
Kojto | 90:cb3d968589d8 | 1332 | |
Kojto | 90:cb3d968589d8 | 1333 | /*! @brief Format value for bitfield USB_INTEN_ERROREN. */ |
Kojto | 90:cb3d968589d8 | 1334 | #define BF_USB_INTEN_ERROREN(v) ((uint8_t)((uint8_t)(v) << BP_USB_INTEN_ERROREN) & BM_USB_INTEN_ERROREN) |
Kojto | 90:cb3d968589d8 | 1335 | |
Kojto | 90:cb3d968589d8 | 1336 | /*! @brief Set the ERROREN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1337 | #define BW_USB_INTEN_ERROREN(x, v) (BITBAND_ACCESS8(HW_USB_INTEN_ADDR(x), BP_USB_INTEN_ERROREN) = (v)) |
Kojto | 90:cb3d968589d8 | 1338 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1339 | |
Kojto | 90:cb3d968589d8 | 1340 | /*! |
Kojto | 90:cb3d968589d8 | 1341 | * @name Register USB_INTEN, field SOFTOKEN[2] (RW) |
Kojto | 90:cb3d968589d8 | 1342 | * |
Kojto | 90:cb3d968589d8 | 1343 | * Values: |
Kojto | 90:cb3d968589d8 | 1344 | * - 0 - Disbles the SOFTOK interrupt. |
Kojto | 90:cb3d968589d8 | 1345 | * - 1 - Enables the SOFTOK interrupt. |
Kojto | 90:cb3d968589d8 | 1346 | */ |
Kojto | 90:cb3d968589d8 | 1347 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1348 | #define BP_USB_INTEN_SOFTOKEN (2U) /*!< Bit position for USB_INTEN_SOFTOKEN. */ |
Kojto | 90:cb3d968589d8 | 1349 | #define BM_USB_INTEN_SOFTOKEN (0x04U) /*!< Bit mask for USB_INTEN_SOFTOKEN. */ |
Kojto | 90:cb3d968589d8 | 1350 | #define BS_USB_INTEN_SOFTOKEN (1U) /*!< Bit field size in bits for USB_INTEN_SOFTOKEN. */ |
Kojto | 90:cb3d968589d8 | 1351 | |
Kojto | 90:cb3d968589d8 | 1352 | /*! @brief Read current value of the USB_INTEN_SOFTOKEN field. */ |
Kojto | 90:cb3d968589d8 | 1353 | #define BR_USB_INTEN_SOFTOKEN(x) (BITBAND_ACCESS8(HW_USB_INTEN_ADDR(x), BP_USB_INTEN_SOFTOKEN)) |
Kojto | 90:cb3d968589d8 | 1354 | |
Kojto | 90:cb3d968589d8 | 1355 | /*! @brief Format value for bitfield USB_INTEN_SOFTOKEN. */ |
Kojto | 90:cb3d968589d8 | 1356 | #define BF_USB_INTEN_SOFTOKEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_INTEN_SOFTOKEN) & BM_USB_INTEN_SOFTOKEN) |
Kojto | 90:cb3d968589d8 | 1357 | |
Kojto | 90:cb3d968589d8 | 1358 | /*! @brief Set the SOFTOKEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1359 | #define BW_USB_INTEN_SOFTOKEN(x, v) (BITBAND_ACCESS8(HW_USB_INTEN_ADDR(x), BP_USB_INTEN_SOFTOKEN) = (v)) |
Kojto | 90:cb3d968589d8 | 1360 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1361 | |
Kojto | 90:cb3d968589d8 | 1362 | /*! |
Kojto | 90:cb3d968589d8 | 1363 | * @name Register USB_INTEN, field TOKDNEEN[3] (RW) |
Kojto | 90:cb3d968589d8 | 1364 | * |
Kojto | 90:cb3d968589d8 | 1365 | * Values: |
Kojto | 90:cb3d968589d8 | 1366 | * - 0 - Disables the TOKDNE interrupt. |
Kojto | 90:cb3d968589d8 | 1367 | * - 1 - Enables the TOKDNE interrupt. |
Kojto | 90:cb3d968589d8 | 1368 | */ |
Kojto | 90:cb3d968589d8 | 1369 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1370 | #define BP_USB_INTEN_TOKDNEEN (3U) /*!< Bit position for USB_INTEN_TOKDNEEN. */ |
Kojto | 90:cb3d968589d8 | 1371 | #define BM_USB_INTEN_TOKDNEEN (0x08U) /*!< Bit mask for USB_INTEN_TOKDNEEN. */ |
Kojto | 90:cb3d968589d8 | 1372 | #define BS_USB_INTEN_TOKDNEEN (1U) /*!< Bit field size in bits for USB_INTEN_TOKDNEEN. */ |
Kojto | 90:cb3d968589d8 | 1373 | |
Kojto | 90:cb3d968589d8 | 1374 | /*! @brief Read current value of the USB_INTEN_TOKDNEEN field. */ |
Kojto | 90:cb3d968589d8 | 1375 | #define BR_USB_INTEN_TOKDNEEN(x) (BITBAND_ACCESS8(HW_USB_INTEN_ADDR(x), BP_USB_INTEN_TOKDNEEN)) |
Kojto | 90:cb3d968589d8 | 1376 | |
Kojto | 90:cb3d968589d8 | 1377 | /*! @brief Format value for bitfield USB_INTEN_TOKDNEEN. */ |
Kojto | 90:cb3d968589d8 | 1378 | #define BF_USB_INTEN_TOKDNEEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_INTEN_TOKDNEEN) & BM_USB_INTEN_TOKDNEEN) |
Kojto | 90:cb3d968589d8 | 1379 | |
Kojto | 90:cb3d968589d8 | 1380 | /*! @brief Set the TOKDNEEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1381 | #define BW_USB_INTEN_TOKDNEEN(x, v) (BITBAND_ACCESS8(HW_USB_INTEN_ADDR(x), BP_USB_INTEN_TOKDNEEN) = (v)) |
Kojto | 90:cb3d968589d8 | 1382 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1383 | |
Kojto | 90:cb3d968589d8 | 1384 | /*! |
Kojto | 90:cb3d968589d8 | 1385 | * @name Register USB_INTEN, field SLEEPEN[4] (RW) |
Kojto | 90:cb3d968589d8 | 1386 | * |
Kojto | 90:cb3d968589d8 | 1387 | * Values: |
Kojto | 90:cb3d968589d8 | 1388 | * - 0 - Disables the SLEEP interrupt. |
Kojto | 90:cb3d968589d8 | 1389 | * - 1 - Enables the SLEEP interrupt. |
Kojto | 90:cb3d968589d8 | 1390 | */ |
Kojto | 90:cb3d968589d8 | 1391 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1392 | #define BP_USB_INTEN_SLEEPEN (4U) /*!< Bit position for USB_INTEN_SLEEPEN. */ |
Kojto | 90:cb3d968589d8 | 1393 | #define BM_USB_INTEN_SLEEPEN (0x10U) /*!< Bit mask for USB_INTEN_SLEEPEN. */ |
Kojto | 90:cb3d968589d8 | 1394 | #define BS_USB_INTEN_SLEEPEN (1U) /*!< Bit field size in bits for USB_INTEN_SLEEPEN. */ |
Kojto | 90:cb3d968589d8 | 1395 | |
Kojto | 90:cb3d968589d8 | 1396 | /*! @brief Read current value of the USB_INTEN_SLEEPEN field. */ |
Kojto | 90:cb3d968589d8 | 1397 | #define BR_USB_INTEN_SLEEPEN(x) (BITBAND_ACCESS8(HW_USB_INTEN_ADDR(x), BP_USB_INTEN_SLEEPEN)) |
Kojto | 90:cb3d968589d8 | 1398 | |
Kojto | 90:cb3d968589d8 | 1399 | /*! @brief Format value for bitfield USB_INTEN_SLEEPEN. */ |
Kojto | 90:cb3d968589d8 | 1400 | #define BF_USB_INTEN_SLEEPEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_INTEN_SLEEPEN) & BM_USB_INTEN_SLEEPEN) |
Kojto | 90:cb3d968589d8 | 1401 | |
Kojto | 90:cb3d968589d8 | 1402 | /*! @brief Set the SLEEPEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1403 | #define BW_USB_INTEN_SLEEPEN(x, v) (BITBAND_ACCESS8(HW_USB_INTEN_ADDR(x), BP_USB_INTEN_SLEEPEN) = (v)) |
Kojto | 90:cb3d968589d8 | 1404 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1405 | |
Kojto | 90:cb3d968589d8 | 1406 | /*! |
Kojto | 90:cb3d968589d8 | 1407 | * @name Register USB_INTEN, field RESUMEEN[5] (RW) |
Kojto | 90:cb3d968589d8 | 1408 | * |
Kojto | 90:cb3d968589d8 | 1409 | * Values: |
Kojto | 90:cb3d968589d8 | 1410 | * - 0 - Disables the RESUME interrupt. |
Kojto | 90:cb3d968589d8 | 1411 | * - 1 - Enables the RESUME interrupt. |
Kojto | 90:cb3d968589d8 | 1412 | */ |
Kojto | 90:cb3d968589d8 | 1413 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1414 | #define BP_USB_INTEN_RESUMEEN (5U) /*!< Bit position for USB_INTEN_RESUMEEN. */ |
Kojto | 90:cb3d968589d8 | 1415 | #define BM_USB_INTEN_RESUMEEN (0x20U) /*!< Bit mask for USB_INTEN_RESUMEEN. */ |
Kojto | 90:cb3d968589d8 | 1416 | #define BS_USB_INTEN_RESUMEEN (1U) /*!< Bit field size in bits for USB_INTEN_RESUMEEN. */ |
Kojto | 90:cb3d968589d8 | 1417 | |
Kojto | 90:cb3d968589d8 | 1418 | /*! @brief Read current value of the USB_INTEN_RESUMEEN field. */ |
Kojto | 90:cb3d968589d8 | 1419 | #define BR_USB_INTEN_RESUMEEN(x) (BITBAND_ACCESS8(HW_USB_INTEN_ADDR(x), BP_USB_INTEN_RESUMEEN)) |
Kojto | 90:cb3d968589d8 | 1420 | |
Kojto | 90:cb3d968589d8 | 1421 | /*! @brief Format value for bitfield USB_INTEN_RESUMEEN. */ |
Kojto | 90:cb3d968589d8 | 1422 | #define BF_USB_INTEN_RESUMEEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_INTEN_RESUMEEN) & BM_USB_INTEN_RESUMEEN) |
Kojto | 90:cb3d968589d8 | 1423 | |
Kojto | 90:cb3d968589d8 | 1424 | /*! @brief Set the RESUMEEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1425 | #define BW_USB_INTEN_RESUMEEN(x, v) (BITBAND_ACCESS8(HW_USB_INTEN_ADDR(x), BP_USB_INTEN_RESUMEEN) = (v)) |
Kojto | 90:cb3d968589d8 | 1426 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1427 | |
Kojto | 90:cb3d968589d8 | 1428 | /*! |
Kojto | 90:cb3d968589d8 | 1429 | * @name Register USB_INTEN, field ATTACHEN[6] (RW) |
Kojto | 90:cb3d968589d8 | 1430 | * |
Kojto | 90:cb3d968589d8 | 1431 | * Values: |
Kojto | 90:cb3d968589d8 | 1432 | * - 0 - Disables the ATTACH interrupt. |
Kojto | 90:cb3d968589d8 | 1433 | * - 1 - Enables the ATTACH interrupt. |
Kojto | 90:cb3d968589d8 | 1434 | */ |
Kojto | 90:cb3d968589d8 | 1435 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1436 | #define BP_USB_INTEN_ATTACHEN (6U) /*!< Bit position for USB_INTEN_ATTACHEN. */ |
Kojto | 90:cb3d968589d8 | 1437 | #define BM_USB_INTEN_ATTACHEN (0x40U) /*!< Bit mask for USB_INTEN_ATTACHEN. */ |
Kojto | 90:cb3d968589d8 | 1438 | #define BS_USB_INTEN_ATTACHEN (1U) /*!< Bit field size in bits for USB_INTEN_ATTACHEN. */ |
Kojto | 90:cb3d968589d8 | 1439 | |
Kojto | 90:cb3d968589d8 | 1440 | /*! @brief Read current value of the USB_INTEN_ATTACHEN field. */ |
Kojto | 90:cb3d968589d8 | 1441 | #define BR_USB_INTEN_ATTACHEN(x) (BITBAND_ACCESS8(HW_USB_INTEN_ADDR(x), BP_USB_INTEN_ATTACHEN)) |
Kojto | 90:cb3d968589d8 | 1442 | |
Kojto | 90:cb3d968589d8 | 1443 | /*! @brief Format value for bitfield USB_INTEN_ATTACHEN. */ |
Kojto | 90:cb3d968589d8 | 1444 | #define BF_USB_INTEN_ATTACHEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_INTEN_ATTACHEN) & BM_USB_INTEN_ATTACHEN) |
Kojto | 90:cb3d968589d8 | 1445 | |
Kojto | 90:cb3d968589d8 | 1446 | /*! @brief Set the ATTACHEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1447 | #define BW_USB_INTEN_ATTACHEN(x, v) (BITBAND_ACCESS8(HW_USB_INTEN_ADDR(x), BP_USB_INTEN_ATTACHEN) = (v)) |
Kojto | 90:cb3d968589d8 | 1448 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1449 | |
Kojto | 90:cb3d968589d8 | 1450 | /*! |
Kojto | 90:cb3d968589d8 | 1451 | * @name Register USB_INTEN, field STALLEN[7] (RW) |
Kojto | 90:cb3d968589d8 | 1452 | * |
Kojto | 90:cb3d968589d8 | 1453 | * Values: |
Kojto | 90:cb3d968589d8 | 1454 | * - 0 - Diasbles the STALL interrupt. |
Kojto | 90:cb3d968589d8 | 1455 | * - 1 - Enables the STALL interrupt. |
Kojto | 90:cb3d968589d8 | 1456 | */ |
Kojto | 90:cb3d968589d8 | 1457 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1458 | #define BP_USB_INTEN_STALLEN (7U) /*!< Bit position for USB_INTEN_STALLEN. */ |
Kojto | 90:cb3d968589d8 | 1459 | #define BM_USB_INTEN_STALLEN (0x80U) /*!< Bit mask for USB_INTEN_STALLEN. */ |
Kojto | 90:cb3d968589d8 | 1460 | #define BS_USB_INTEN_STALLEN (1U) /*!< Bit field size in bits for USB_INTEN_STALLEN. */ |
Kojto | 90:cb3d968589d8 | 1461 | |
Kojto | 90:cb3d968589d8 | 1462 | /*! @brief Read current value of the USB_INTEN_STALLEN field. */ |
Kojto | 90:cb3d968589d8 | 1463 | #define BR_USB_INTEN_STALLEN(x) (BITBAND_ACCESS8(HW_USB_INTEN_ADDR(x), BP_USB_INTEN_STALLEN)) |
Kojto | 90:cb3d968589d8 | 1464 | |
Kojto | 90:cb3d968589d8 | 1465 | /*! @brief Format value for bitfield USB_INTEN_STALLEN. */ |
Kojto | 90:cb3d968589d8 | 1466 | #define BF_USB_INTEN_STALLEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_INTEN_STALLEN) & BM_USB_INTEN_STALLEN) |
Kojto | 90:cb3d968589d8 | 1467 | |
Kojto | 90:cb3d968589d8 | 1468 | /*! @brief Set the STALLEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1469 | #define BW_USB_INTEN_STALLEN(x, v) (BITBAND_ACCESS8(HW_USB_INTEN_ADDR(x), BP_USB_INTEN_STALLEN) = (v)) |
Kojto | 90:cb3d968589d8 | 1470 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1471 | |
Kojto | 90:cb3d968589d8 | 1472 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 1473 | * HW_USB_ERRSTAT - Error Interrupt Status register |
Kojto | 90:cb3d968589d8 | 1474 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 1475 | |
Kojto | 90:cb3d968589d8 | 1476 | /*! |
Kojto | 90:cb3d968589d8 | 1477 | * @brief HW_USB_ERRSTAT - Error Interrupt Status register (RW) |
Kojto | 90:cb3d968589d8 | 1478 | * |
Kojto | 90:cb3d968589d8 | 1479 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 1480 | * |
Kojto | 90:cb3d968589d8 | 1481 | * Contains enable bits for each of the error sources within the USB Module. |
Kojto | 90:cb3d968589d8 | 1482 | * Each of these bits are qualified with their respective error enable bits. All |
Kojto | 90:cb3d968589d8 | 1483 | * bits of this register are logically OR'd together and the result placed in the |
Kojto | 90:cb3d968589d8 | 1484 | * ERROR bit of the ISTAT register. After an interrupt bit has been set it may only |
Kojto | 90:cb3d968589d8 | 1485 | * be cleared by writing a one to the respective interrupt bit. Each bit is set |
Kojto | 90:cb3d968589d8 | 1486 | * as soon as the error condition is detected. Therefore, the interrupt does not |
Kojto | 90:cb3d968589d8 | 1487 | * typically correspond with the end of a token being processed. This register |
Kojto | 90:cb3d968589d8 | 1488 | * contains the value of 0x00 after a reset. |
Kojto | 90:cb3d968589d8 | 1489 | */ |
Kojto | 90:cb3d968589d8 | 1490 | typedef union _hw_usb_errstat |
Kojto | 90:cb3d968589d8 | 1491 | { |
Kojto | 90:cb3d968589d8 | 1492 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 1493 | struct _hw_usb_errstat_bitfields |
Kojto | 90:cb3d968589d8 | 1494 | { |
Kojto | 90:cb3d968589d8 | 1495 | uint8_t PIDERR : 1; /*!< [0] */ |
Kojto | 90:cb3d968589d8 | 1496 | uint8_t CRC5EOF : 1; /*!< [1] */ |
Kojto | 90:cb3d968589d8 | 1497 | uint8_t CRC16 : 1; /*!< [2] */ |
Kojto | 90:cb3d968589d8 | 1498 | uint8_t DFN8 : 1; /*!< [3] */ |
Kojto | 90:cb3d968589d8 | 1499 | uint8_t BTOERR : 1; /*!< [4] */ |
Kojto | 90:cb3d968589d8 | 1500 | uint8_t DMAERR : 1; /*!< [5] */ |
Kojto | 90:cb3d968589d8 | 1501 | uint8_t RESERVED0 : 1; /*!< [6] */ |
Kojto | 90:cb3d968589d8 | 1502 | uint8_t BTSERR : 1; /*!< [7] */ |
Kojto | 90:cb3d968589d8 | 1503 | } B; |
Kojto | 90:cb3d968589d8 | 1504 | } hw_usb_errstat_t; |
Kojto | 90:cb3d968589d8 | 1505 | |
Kojto | 90:cb3d968589d8 | 1506 | /*! |
Kojto | 90:cb3d968589d8 | 1507 | * @name Constants and macros for entire USB_ERRSTAT register |
Kojto | 90:cb3d968589d8 | 1508 | */ |
Kojto | 90:cb3d968589d8 | 1509 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1510 | #define HW_USB_ERRSTAT_ADDR(x) ((x) + 0x88U) |
Kojto | 90:cb3d968589d8 | 1511 | |
Kojto | 90:cb3d968589d8 | 1512 | #define HW_USB_ERRSTAT(x) (*(__IO hw_usb_errstat_t *) HW_USB_ERRSTAT_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 1513 | #define HW_USB_ERRSTAT_RD(x) (HW_USB_ERRSTAT(x).U) |
Kojto | 90:cb3d968589d8 | 1514 | #define HW_USB_ERRSTAT_WR(x, v) (HW_USB_ERRSTAT(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 1515 | #define HW_USB_ERRSTAT_SET(x, v) (HW_USB_ERRSTAT_WR(x, HW_USB_ERRSTAT_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 1516 | #define HW_USB_ERRSTAT_CLR(x, v) (HW_USB_ERRSTAT_WR(x, HW_USB_ERRSTAT_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 1517 | #define HW_USB_ERRSTAT_TOG(x, v) (HW_USB_ERRSTAT_WR(x, HW_USB_ERRSTAT_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 1518 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1519 | |
Kojto | 90:cb3d968589d8 | 1520 | /* |
Kojto | 90:cb3d968589d8 | 1521 | * Constants & macros for individual USB_ERRSTAT bitfields |
Kojto | 90:cb3d968589d8 | 1522 | */ |
Kojto | 90:cb3d968589d8 | 1523 | |
Kojto | 90:cb3d968589d8 | 1524 | /*! |
Kojto | 90:cb3d968589d8 | 1525 | * @name Register USB_ERRSTAT, field PIDERR[0] (W1C) |
Kojto | 90:cb3d968589d8 | 1526 | * |
Kojto | 90:cb3d968589d8 | 1527 | * This bit is set when the PID check field fails. |
Kojto | 90:cb3d968589d8 | 1528 | */ |
Kojto | 90:cb3d968589d8 | 1529 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1530 | #define BP_USB_ERRSTAT_PIDERR (0U) /*!< Bit position for USB_ERRSTAT_PIDERR. */ |
Kojto | 90:cb3d968589d8 | 1531 | #define BM_USB_ERRSTAT_PIDERR (0x01U) /*!< Bit mask for USB_ERRSTAT_PIDERR. */ |
Kojto | 90:cb3d968589d8 | 1532 | #define BS_USB_ERRSTAT_PIDERR (1U) /*!< Bit field size in bits for USB_ERRSTAT_PIDERR. */ |
Kojto | 90:cb3d968589d8 | 1533 | |
Kojto | 90:cb3d968589d8 | 1534 | /*! @brief Read current value of the USB_ERRSTAT_PIDERR field. */ |
Kojto | 90:cb3d968589d8 | 1535 | #define BR_USB_ERRSTAT_PIDERR(x) (BITBAND_ACCESS8(HW_USB_ERRSTAT_ADDR(x), BP_USB_ERRSTAT_PIDERR)) |
Kojto | 90:cb3d968589d8 | 1536 | |
Kojto | 90:cb3d968589d8 | 1537 | /*! @brief Format value for bitfield USB_ERRSTAT_PIDERR. */ |
Kojto | 90:cb3d968589d8 | 1538 | #define BF_USB_ERRSTAT_PIDERR(v) ((uint8_t)((uint8_t)(v) << BP_USB_ERRSTAT_PIDERR) & BM_USB_ERRSTAT_PIDERR) |
Kojto | 90:cb3d968589d8 | 1539 | |
Kojto | 90:cb3d968589d8 | 1540 | /*! @brief Set the PIDERR field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1541 | #define BW_USB_ERRSTAT_PIDERR(x, v) (BITBAND_ACCESS8(HW_USB_ERRSTAT_ADDR(x), BP_USB_ERRSTAT_PIDERR) = (v)) |
Kojto | 90:cb3d968589d8 | 1542 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1543 | |
Kojto | 90:cb3d968589d8 | 1544 | /*! |
Kojto | 90:cb3d968589d8 | 1545 | * @name Register USB_ERRSTAT, field CRC5EOF[1] (W1C) |
Kojto | 90:cb3d968589d8 | 1546 | * |
Kojto | 90:cb3d968589d8 | 1547 | * This error interrupt has two functions. When the USB Module is operating in |
Kojto | 90:cb3d968589d8 | 1548 | * peripheral mode (HOSTMODEEN=0), this interrupt detects CRC5 errors in the token |
Kojto | 90:cb3d968589d8 | 1549 | * packets generated by the host. If set the token packet was rejected due to a |
Kojto | 90:cb3d968589d8 | 1550 | * CRC5 error. When the USB Module is operating in host mode (HOSTMODEEN=1), this |
Kojto | 90:cb3d968589d8 | 1551 | * interrupt detects End Of Frame (EOF) error conditions. This occurs when the |
Kojto | 90:cb3d968589d8 | 1552 | * USB Module is transmitting or receiving data and the SOF counter reaches zero. |
Kojto | 90:cb3d968589d8 | 1553 | * This interrupt is useful when developing USB packet scheduling software to |
Kojto | 90:cb3d968589d8 | 1554 | * ensure that no USB transactions cross the start of the next frame. |
Kojto | 90:cb3d968589d8 | 1555 | */ |
Kojto | 90:cb3d968589d8 | 1556 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1557 | #define BP_USB_ERRSTAT_CRC5EOF (1U) /*!< Bit position for USB_ERRSTAT_CRC5EOF. */ |
Kojto | 90:cb3d968589d8 | 1558 | #define BM_USB_ERRSTAT_CRC5EOF (0x02U) /*!< Bit mask for USB_ERRSTAT_CRC5EOF. */ |
Kojto | 90:cb3d968589d8 | 1559 | #define BS_USB_ERRSTAT_CRC5EOF (1U) /*!< Bit field size in bits for USB_ERRSTAT_CRC5EOF. */ |
Kojto | 90:cb3d968589d8 | 1560 | |
Kojto | 90:cb3d968589d8 | 1561 | /*! @brief Read current value of the USB_ERRSTAT_CRC5EOF field. */ |
Kojto | 90:cb3d968589d8 | 1562 | #define BR_USB_ERRSTAT_CRC5EOF(x) (BITBAND_ACCESS8(HW_USB_ERRSTAT_ADDR(x), BP_USB_ERRSTAT_CRC5EOF)) |
Kojto | 90:cb3d968589d8 | 1563 | |
Kojto | 90:cb3d968589d8 | 1564 | /*! @brief Format value for bitfield USB_ERRSTAT_CRC5EOF. */ |
Kojto | 90:cb3d968589d8 | 1565 | #define BF_USB_ERRSTAT_CRC5EOF(v) ((uint8_t)((uint8_t)(v) << BP_USB_ERRSTAT_CRC5EOF) & BM_USB_ERRSTAT_CRC5EOF) |
Kojto | 90:cb3d968589d8 | 1566 | |
Kojto | 90:cb3d968589d8 | 1567 | /*! @brief Set the CRC5EOF field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1568 | #define BW_USB_ERRSTAT_CRC5EOF(x, v) (BITBAND_ACCESS8(HW_USB_ERRSTAT_ADDR(x), BP_USB_ERRSTAT_CRC5EOF) = (v)) |
Kojto | 90:cb3d968589d8 | 1569 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1570 | |
Kojto | 90:cb3d968589d8 | 1571 | /*! |
Kojto | 90:cb3d968589d8 | 1572 | * @name Register USB_ERRSTAT, field CRC16[2] (W1C) |
Kojto | 90:cb3d968589d8 | 1573 | * |
Kojto | 90:cb3d968589d8 | 1574 | * This bit is set when a data packet is rejected due to a CRC16 error. |
Kojto | 90:cb3d968589d8 | 1575 | */ |
Kojto | 90:cb3d968589d8 | 1576 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1577 | #define BP_USB_ERRSTAT_CRC16 (2U) /*!< Bit position for USB_ERRSTAT_CRC16. */ |
Kojto | 90:cb3d968589d8 | 1578 | #define BM_USB_ERRSTAT_CRC16 (0x04U) /*!< Bit mask for USB_ERRSTAT_CRC16. */ |
Kojto | 90:cb3d968589d8 | 1579 | #define BS_USB_ERRSTAT_CRC16 (1U) /*!< Bit field size in bits for USB_ERRSTAT_CRC16. */ |
Kojto | 90:cb3d968589d8 | 1580 | |
Kojto | 90:cb3d968589d8 | 1581 | /*! @brief Read current value of the USB_ERRSTAT_CRC16 field. */ |
Kojto | 90:cb3d968589d8 | 1582 | #define BR_USB_ERRSTAT_CRC16(x) (BITBAND_ACCESS8(HW_USB_ERRSTAT_ADDR(x), BP_USB_ERRSTAT_CRC16)) |
Kojto | 90:cb3d968589d8 | 1583 | |
Kojto | 90:cb3d968589d8 | 1584 | /*! @brief Format value for bitfield USB_ERRSTAT_CRC16. */ |
Kojto | 90:cb3d968589d8 | 1585 | #define BF_USB_ERRSTAT_CRC16(v) ((uint8_t)((uint8_t)(v) << BP_USB_ERRSTAT_CRC16) & BM_USB_ERRSTAT_CRC16) |
Kojto | 90:cb3d968589d8 | 1586 | |
Kojto | 90:cb3d968589d8 | 1587 | /*! @brief Set the CRC16 field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1588 | #define BW_USB_ERRSTAT_CRC16(x, v) (BITBAND_ACCESS8(HW_USB_ERRSTAT_ADDR(x), BP_USB_ERRSTAT_CRC16) = (v)) |
Kojto | 90:cb3d968589d8 | 1589 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1590 | |
Kojto | 90:cb3d968589d8 | 1591 | /*! |
Kojto | 90:cb3d968589d8 | 1592 | * @name Register USB_ERRSTAT, field DFN8[3] (W1C) |
Kojto | 90:cb3d968589d8 | 1593 | * |
Kojto | 90:cb3d968589d8 | 1594 | * This bit is set if the data field received was not 8 bits in length. USB |
Kojto | 90:cb3d968589d8 | 1595 | * Specification 1.0 requires that data fields be an integral number of bytes. If the |
Kojto | 90:cb3d968589d8 | 1596 | * data field was not an integral number of bytes, this bit is set. |
Kojto | 90:cb3d968589d8 | 1597 | */ |
Kojto | 90:cb3d968589d8 | 1598 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1599 | #define BP_USB_ERRSTAT_DFN8 (3U) /*!< Bit position for USB_ERRSTAT_DFN8. */ |
Kojto | 90:cb3d968589d8 | 1600 | #define BM_USB_ERRSTAT_DFN8 (0x08U) /*!< Bit mask for USB_ERRSTAT_DFN8. */ |
Kojto | 90:cb3d968589d8 | 1601 | #define BS_USB_ERRSTAT_DFN8 (1U) /*!< Bit field size in bits for USB_ERRSTAT_DFN8. */ |
Kojto | 90:cb3d968589d8 | 1602 | |
Kojto | 90:cb3d968589d8 | 1603 | /*! @brief Read current value of the USB_ERRSTAT_DFN8 field. */ |
Kojto | 90:cb3d968589d8 | 1604 | #define BR_USB_ERRSTAT_DFN8(x) (BITBAND_ACCESS8(HW_USB_ERRSTAT_ADDR(x), BP_USB_ERRSTAT_DFN8)) |
Kojto | 90:cb3d968589d8 | 1605 | |
Kojto | 90:cb3d968589d8 | 1606 | /*! @brief Format value for bitfield USB_ERRSTAT_DFN8. */ |
Kojto | 90:cb3d968589d8 | 1607 | #define BF_USB_ERRSTAT_DFN8(v) ((uint8_t)((uint8_t)(v) << BP_USB_ERRSTAT_DFN8) & BM_USB_ERRSTAT_DFN8) |
Kojto | 90:cb3d968589d8 | 1608 | |
Kojto | 90:cb3d968589d8 | 1609 | /*! @brief Set the DFN8 field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1610 | #define BW_USB_ERRSTAT_DFN8(x, v) (BITBAND_ACCESS8(HW_USB_ERRSTAT_ADDR(x), BP_USB_ERRSTAT_DFN8) = (v)) |
Kojto | 90:cb3d968589d8 | 1611 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1612 | |
Kojto | 90:cb3d968589d8 | 1613 | /*! |
Kojto | 90:cb3d968589d8 | 1614 | * @name Register USB_ERRSTAT, field BTOERR[4] (W1C) |
Kojto | 90:cb3d968589d8 | 1615 | * |
Kojto | 90:cb3d968589d8 | 1616 | * This bit is set when a bus turnaround timeout error occurs. The USB module |
Kojto | 90:cb3d968589d8 | 1617 | * contains a bus turnaround timer that keeps track of the amount of time elapsed |
Kojto | 90:cb3d968589d8 | 1618 | * between the token and data phases of a SETUP or OUT TOKEN or the data and |
Kojto | 90:cb3d968589d8 | 1619 | * handshake phases of a IN TOKEN. If more than 16 bit times are counted from the |
Kojto | 90:cb3d968589d8 | 1620 | * previous EOP before a transition from IDLE, a bus turnaround timeout error occurs. |
Kojto | 90:cb3d968589d8 | 1621 | */ |
Kojto | 90:cb3d968589d8 | 1622 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1623 | #define BP_USB_ERRSTAT_BTOERR (4U) /*!< Bit position for USB_ERRSTAT_BTOERR. */ |
Kojto | 90:cb3d968589d8 | 1624 | #define BM_USB_ERRSTAT_BTOERR (0x10U) /*!< Bit mask for USB_ERRSTAT_BTOERR. */ |
Kojto | 90:cb3d968589d8 | 1625 | #define BS_USB_ERRSTAT_BTOERR (1U) /*!< Bit field size in bits for USB_ERRSTAT_BTOERR. */ |
Kojto | 90:cb3d968589d8 | 1626 | |
Kojto | 90:cb3d968589d8 | 1627 | /*! @brief Read current value of the USB_ERRSTAT_BTOERR field. */ |
Kojto | 90:cb3d968589d8 | 1628 | #define BR_USB_ERRSTAT_BTOERR(x) (BITBAND_ACCESS8(HW_USB_ERRSTAT_ADDR(x), BP_USB_ERRSTAT_BTOERR)) |
Kojto | 90:cb3d968589d8 | 1629 | |
Kojto | 90:cb3d968589d8 | 1630 | /*! @brief Format value for bitfield USB_ERRSTAT_BTOERR. */ |
Kojto | 90:cb3d968589d8 | 1631 | #define BF_USB_ERRSTAT_BTOERR(v) ((uint8_t)((uint8_t)(v) << BP_USB_ERRSTAT_BTOERR) & BM_USB_ERRSTAT_BTOERR) |
Kojto | 90:cb3d968589d8 | 1632 | |
Kojto | 90:cb3d968589d8 | 1633 | /*! @brief Set the BTOERR field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1634 | #define BW_USB_ERRSTAT_BTOERR(x, v) (BITBAND_ACCESS8(HW_USB_ERRSTAT_ADDR(x), BP_USB_ERRSTAT_BTOERR) = (v)) |
Kojto | 90:cb3d968589d8 | 1635 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1636 | |
Kojto | 90:cb3d968589d8 | 1637 | /*! |
Kojto | 90:cb3d968589d8 | 1638 | * @name Register USB_ERRSTAT, field DMAERR[5] (W1C) |
Kojto | 90:cb3d968589d8 | 1639 | * |
Kojto | 90:cb3d968589d8 | 1640 | * This bit is set if the USB Module has requested a DMA access to read a new |
Kojto | 90:cb3d968589d8 | 1641 | * BDT but has not been given the bus before it needs to receive or transmit data. |
Kojto | 90:cb3d968589d8 | 1642 | * If processing a TX transfer this would cause a transmit data underflow |
Kojto | 90:cb3d968589d8 | 1643 | * condition. If processing a RX transfer this would cause a receive data overflow |
Kojto | 90:cb3d968589d8 | 1644 | * condition. This interrupt is useful when developing device arbitration hardware for |
Kojto | 90:cb3d968589d8 | 1645 | * the microprocessor and the USB module to minimize bus request and bus grant |
Kojto | 90:cb3d968589d8 | 1646 | * latency. This bit is also set if a data packet to or from the host is larger |
Kojto | 90:cb3d968589d8 | 1647 | * than the buffer size allocated in the BDT. In this case the data packet is |
Kojto | 90:cb3d968589d8 | 1648 | * truncated as it is put in buffer memory. |
Kojto | 90:cb3d968589d8 | 1649 | */ |
Kojto | 90:cb3d968589d8 | 1650 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1651 | #define BP_USB_ERRSTAT_DMAERR (5U) /*!< Bit position for USB_ERRSTAT_DMAERR. */ |
Kojto | 90:cb3d968589d8 | 1652 | #define BM_USB_ERRSTAT_DMAERR (0x20U) /*!< Bit mask for USB_ERRSTAT_DMAERR. */ |
Kojto | 90:cb3d968589d8 | 1653 | #define BS_USB_ERRSTAT_DMAERR (1U) /*!< Bit field size in bits for USB_ERRSTAT_DMAERR. */ |
Kojto | 90:cb3d968589d8 | 1654 | |
Kojto | 90:cb3d968589d8 | 1655 | /*! @brief Read current value of the USB_ERRSTAT_DMAERR field. */ |
Kojto | 90:cb3d968589d8 | 1656 | #define BR_USB_ERRSTAT_DMAERR(x) (BITBAND_ACCESS8(HW_USB_ERRSTAT_ADDR(x), BP_USB_ERRSTAT_DMAERR)) |
Kojto | 90:cb3d968589d8 | 1657 | |
Kojto | 90:cb3d968589d8 | 1658 | /*! @brief Format value for bitfield USB_ERRSTAT_DMAERR. */ |
Kojto | 90:cb3d968589d8 | 1659 | #define BF_USB_ERRSTAT_DMAERR(v) ((uint8_t)((uint8_t)(v) << BP_USB_ERRSTAT_DMAERR) & BM_USB_ERRSTAT_DMAERR) |
Kojto | 90:cb3d968589d8 | 1660 | |
Kojto | 90:cb3d968589d8 | 1661 | /*! @brief Set the DMAERR field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1662 | #define BW_USB_ERRSTAT_DMAERR(x, v) (BITBAND_ACCESS8(HW_USB_ERRSTAT_ADDR(x), BP_USB_ERRSTAT_DMAERR) = (v)) |
Kojto | 90:cb3d968589d8 | 1663 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1664 | |
Kojto | 90:cb3d968589d8 | 1665 | /*! |
Kojto | 90:cb3d968589d8 | 1666 | * @name Register USB_ERRSTAT, field BTSERR[7] (W1C) |
Kojto | 90:cb3d968589d8 | 1667 | * |
Kojto | 90:cb3d968589d8 | 1668 | * This bit is set when a bit stuff error is detected. If set, the corresponding |
Kojto | 90:cb3d968589d8 | 1669 | * packet is rejected due to the error. |
Kojto | 90:cb3d968589d8 | 1670 | */ |
Kojto | 90:cb3d968589d8 | 1671 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1672 | #define BP_USB_ERRSTAT_BTSERR (7U) /*!< Bit position for USB_ERRSTAT_BTSERR. */ |
Kojto | 90:cb3d968589d8 | 1673 | #define BM_USB_ERRSTAT_BTSERR (0x80U) /*!< Bit mask for USB_ERRSTAT_BTSERR. */ |
Kojto | 90:cb3d968589d8 | 1674 | #define BS_USB_ERRSTAT_BTSERR (1U) /*!< Bit field size in bits for USB_ERRSTAT_BTSERR. */ |
Kojto | 90:cb3d968589d8 | 1675 | |
Kojto | 90:cb3d968589d8 | 1676 | /*! @brief Read current value of the USB_ERRSTAT_BTSERR field. */ |
Kojto | 90:cb3d968589d8 | 1677 | #define BR_USB_ERRSTAT_BTSERR(x) (BITBAND_ACCESS8(HW_USB_ERRSTAT_ADDR(x), BP_USB_ERRSTAT_BTSERR)) |
Kojto | 90:cb3d968589d8 | 1678 | |
Kojto | 90:cb3d968589d8 | 1679 | /*! @brief Format value for bitfield USB_ERRSTAT_BTSERR. */ |
Kojto | 90:cb3d968589d8 | 1680 | #define BF_USB_ERRSTAT_BTSERR(v) ((uint8_t)((uint8_t)(v) << BP_USB_ERRSTAT_BTSERR) & BM_USB_ERRSTAT_BTSERR) |
Kojto | 90:cb3d968589d8 | 1681 | |
Kojto | 90:cb3d968589d8 | 1682 | /*! @brief Set the BTSERR field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1683 | #define BW_USB_ERRSTAT_BTSERR(x, v) (BITBAND_ACCESS8(HW_USB_ERRSTAT_ADDR(x), BP_USB_ERRSTAT_BTSERR) = (v)) |
Kojto | 90:cb3d968589d8 | 1684 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1685 | |
Kojto | 90:cb3d968589d8 | 1686 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 1687 | * HW_USB_ERREN - Error Interrupt Enable register |
Kojto | 90:cb3d968589d8 | 1688 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 1689 | |
Kojto | 90:cb3d968589d8 | 1690 | /*! |
Kojto | 90:cb3d968589d8 | 1691 | * @brief HW_USB_ERREN - Error Interrupt Enable register (RW) |
Kojto | 90:cb3d968589d8 | 1692 | * |
Kojto | 90:cb3d968589d8 | 1693 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 1694 | * |
Kojto | 90:cb3d968589d8 | 1695 | * Contains enable bits for each of the error interrupt sources within the USB |
Kojto | 90:cb3d968589d8 | 1696 | * module. Setting any of these bits enables the respective interrupt source in |
Kojto | 90:cb3d968589d8 | 1697 | * ERRSTAT. Each bit is set as soon as the error condition is detected. Therefore, |
Kojto | 90:cb3d968589d8 | 1698 | * the interrupt does not typically correspond with the end of a token being |
Kojto | 90:cb3d968589d8 | 1699 | * processed. This register contains the value of 0x00 after a reset. |
Kojto | 90:cb3d968589d8 | 1700 | */ |
Kojto | 90:cb3d968589d8 | 1701 | typedef union _hw_usb_erren |
Kojto | 90:cb3d968589d8 | 1702 | { |
Kojto | 90:cb3d968589d8 | 1703 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 1704 | struct _hw_usb_erren_bitfields |
Kojto | 90:cb3d968589d8 | 1705 | { |
Kojto | 90:cb3d968589d8 | 1706 | uint8_t PIDERREN : 1; /*!< [0] PIDERR Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 1707 | uint8_t CRC5EOFEN : 1; /*!< [1] CRC5/EOF Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 1708 | uint8_t CRC16EN : 1; /*!< [2] CRC16 Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 1709 | uint8_t DFN8EN : 1; /*!< [3] DFN8 Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 1710 | uint8_t BTOERREN : 1; /*!< [4] BTOERR Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 1711 | uint8_t DMAERREN : 1; /*!< [5] DMAERR Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 1712 | uint8_t RESERVED0 : 1; /*!< [6] */ |
Kojto | 90:cb3d968589d8 | 1713 | uint8_t BTSERREN : 1; /*!< [7] BTSERR Interrupt Enable */ |
Kojto | 90:cb3d968589d8 | 1714 | } B; |
Kojto | 90:cb3d968589d8 | 1715 | } hw_usb_erren_t; |
Kojto | 90:cb3d968589d8 | 1716 | |
Kojto | 90:cb3d968589d8 | 1717 | /*! |
Kojto | 90:cb3d968589d8 | 1718 | * @name Constants and macros for entire USB_ERREN register |
Kojto | 90:cb3d968589d8 | 1719 | */ |
Kojto | 90:cb3d968589d8 | 1720 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1721 | #define HW_USB_ERREN_ADDR(x) ((x) + 0x8CU) |
Kojto | 90:cb3d968589d8 | 1722 | |
Kojto | 90:cb3d968589d8 | 1723 | #define HW_USB_ERREN(x) (*(__IO hw_usb_erren_t *) HW_USB_ERREN_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 1724 | #define HW_USB_ERREN_RD(x) (HW_USB_ERREN(x).U) |
Kojto | 90:cb3d968589d8 | 1725 | #define HW_USB_ERREN_WR(x, v) (HW_USB_ERREN(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 1726 | #define HW_USB_ERREN_SET(x, v) (HW_USB_ERREN_WR(x, HW_USB_ERREN_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 1727 | #define HW_USB_ERREN_CLR(x, v) (HW_USB_ERREN_WR(x, HW_USB_ERREN_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 1728 | #define HW_USB_ERREN_TOG(x, v) (HW_USB_ERREN_WR(x, HW_USB_ERREN_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 1729 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1730 | |
Kojto | 90:cb3d968589d8 | 1731 | /* |
Kojto | 90:cb3d968589d8 | 1732 | * Constants & macros for individual USB_ERREN bitfields |
Kojto | 90:cb3d968589d8 | 1733 | */ |
Kojto | 90:cb3d968589d8 | 1734 | |
Kojto | 90:cb3d968589d8 | 1735 | /*! |
Kojto | 90:cb3d968589d8 | 1736 | * @name Register USB_ERREN, field PIDERREN[0] (RW) |
Kojto | 90:cb3d968589d8 | 1737 | * |
Kojto | 90:cb3d968589d8 | 1738 | * Values: |
Kojto | 90:cb3d968589d8 | 1739 | * - 0 - Disables the PIDERR interrupt. |
Kojto | 90:cb3d968589d8 | 1740 | * - 1 - Enters the PIDERR interrupt. |
Kojto | 90:cb3d968589d8 | 1741 | */ |
Kojto | 90:cb3d968589d8 | 1742 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1743 | #define BP_USB_ERREN_PIDERREN (0U) /*!< Bit position for USB_ERREN_PIDERREN. */ |
Kojto | 90:cb3d968589d8 | 1744 | #define BM_USB_ERREN_PIDERREN (0x01U) /*!< Bit mask for USB_ERREN_PIDERREN. */ |
Kojto | 90:cb3d968589d8 | 1745 | #define BS_USB_ERREN_PIDERREN (1U) /*!< Bit field size in bits for USB_ERREN_PIDERREN. */ |
Kojto | 90:cb3d968589d8 | 1746 | |
Kojto | 90:cb3d968589d8 | 1747 | /*! @brief Read current value of the USB_ERREN_PIDERREN field. */ |
Kojto | 90:cb3d968589d8 | 1748 | #define BR_USB_ERREN_PIDERREN(x) (BITBAND_ACCESS8(HW_USB_ERREN_ADDR(x), BP_USB_ERREN_PIDERREN)) |
Kojto | 90:cb3d968589d8 | 1749 | |
Kojto | 90:cb3d968589d8 | 1750 | /*! @brief Format value for bitfield USB_ERREN_PIDERREN. */ |
Kojto | 90:cb3d968589d8 | 1751 | #define BF_USB_ERREN_PIDERREN(v) ((uint8_t)((uint8_t)(v) << BP_USB_ERREN_PIDERREN) & BM_USB_ERREN_PIDERREN) |
Kojto | 90:cb3d968589d8 | 1752 | |
Kojto | 90:cb3d968589d8 | 1753 | /*! @brief Set the PIDERREN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1754 | #define BW_USB_ERREN_PIDERREN(x, v) (BITBAND_ACCESS8(HW_USB_ERREN_ADDR(x), BP_USB_ERREN_PIDERREN) = (v)) |
Kojto | 90:cb3d968589d8 | 1755 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1756 | |
Kojto | 90:cb3d968589d8 | 1757 | /*! |
Kojto | 90:cb3d968589d8 | 1758 | * @name Register USB_ERREN, field CRC5EOFEN[1] (RW) |
Kojto | 90:cb3d968589d8 | 1759 | * |
Kojto | 90:cb3d968589d8 | 1760 | * Values: |
Kojto | 90:cb3d968589d8 | 1761 | * - 0 - Disables the CRC5/EOF interrupt. |
Kojto | 90:cb3d968589d8 | 1762 | * - 1 - Enables the CRC5/EOF interrupt. |
Kojto | 90:cb3d968589d8 | 1763 | */ |
Kojto | 90:cb3d968589d8 | 1764 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1765 | #define BP_USB_ERREN_CRC5EOFEN (1U) /*!< Bit position for USB_ERREN_CRC5EOFEN. */ |
Kojto | 90:cb3d968589d8 | 1766 | #define BM_USB_ERREN_CRC5EOFEN (0x02U) /*!< Bit mask for USB_ERREN_CRC5EOFEN. */ |
Kojto | 90:cb3d968589d8 | 1767 | #define BS_USB_ERREN_CRC5EOFEN (1U) /*!< Bit field size in bits for USB_ERREN_CRC5EOFEN. */ |
Kojto | 90:cb3d968589d8 | 1768 | |
Kojto | 90:cb3d968589d8 | 1769 | /*! @brief Read current value of the USB_ERREN_CRC5EOFEN field. */ |
Kojto | 90:cb3d968589d8 | 1770 | #define BR_USB_ERREN_CRC5EOFEN(x) (BITBAND_ACCESS8(HW_USB_ERREN_ADDR(x), BP_USB_ERREN_CRC5EOFEN)) |
Kojto | 90:cb3d968589d8 | 1771 | |
Kojto | 90:cb3d968589d8 | 1772 | /*! @brief Format value for bitfield USB_ERREN_CRC5EOFEN. */ |
Kojto | 90:cb3d968589d8 | 1773 | #define BF_USB_ERREN_CRC5EOFEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_ERREN_CRC5EOFEN) & BM_USB_ERREN_CRC5EOFEN) |
Kojto | 90:cb3d968589d8 | 1774 | |
Kojto | 90:cb3d968589d8 | 1775 | /*! @brief Set the CRC5EOFEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1776 | #define BW_USB_ERREN_CRC5EOFEN(x, v) (BITBAND_ACCESS8(HW_USB_ERREN_ADDR(x), BP_USB_ERREN_CRC5EOFEN) = (v)) |
Kojto | 90:cb3d968589d8 | 1777 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1778 | |
Kojto | 90:cb3d968589d8 | 1779 | /*! |
Kojto | 90:cb3d968589d8 | 1780 | * @name Register USB_ERREN, field CRC16EN[2] (RW) |
Kojto | 90:cb3d968589d8 | 1781 | * |
Kojto | 90:cb3d968589d8 | 1782 | * Values: |
Kojto | 90:cb3d968589d8 | 1783 | * - 0 - Disables the CRC16 interrupt. |
Kojto | 90:cb3d968589d8 | 1784 | * - 1 - Enables the CRC16 interrupt. |
Kojto | 90:cb3d968589d8 | 1785 | */ |
Kojto | 90:cb3d968589d8 | 1786 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1787 | #define BP_USB_ERREN_CRC16EN (2U) /*!< Bit position for USB_ERREN_CRC16EN. */ |
Kojto | 90:cb3d968589d8 | 1788 | #define BM_USB_ERREN_CRC16EN (0x04U) /*!< Bit mask for USB_ERREN_CRC16EN. */ |
Kojto | 90:cb3d968589d8 | 1789 | #define BS_USB_ERREN_CRC16EN (1U) /*!< Bit field size in bits for USB_ERREN_CRC16EN. */ |
Kojto | 90:cb3d968589d8 | 1790 | |
Kojto | 90:cb3d968589d8 | 1791 | /*! @brief Read current value of the USB_ERREN_CRC16EN field. */ |
Kojto | 90:cb3d968589d8 | 1792 | #define BR_USB_ERREN_CRC16EN(x) (BITBAND_ACCESS8(HW_USB_ERREN_ADDR(x), BP_USB_ERREN_CRC16EN)) |
Kojto | 90:cb3d968589d8 | 1793 | |
Kojto | 90:cb3d968589d8 | 1794 | /*! @brief Format value for bitfield USB_ERREN_CRC16EN. */ |
Kojto | 90:cb3d968589d8 | 1795 | #define BF_USB_ERREN_CRC16EN(v) ((uint8_t)((uint8_t)(v) << BP_USB_ERREN_CRC16EN) & BM_USB_ERREN_CRC16EN) |
Kojto | 90:cb3d968589d8 | 1796 | |
Kojto | 90:cb3d968589d8 | 1797 | /*! @brief Set the CRC16EN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1798 | #define BW_USB_ERREN_CRC16EN(x, v) (BITBAND_ACCESS8(HW_USB_ERREN_ADDR(x), BP_USB_ERREN_CRC16EN) = (v)) |
Kojto | 90:cb3d968589d8 | 1799 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1800 | |
Kojto | 90:cb3d968589d8 | 1801 | /*! |
Kojto | 90:cb3d968589d8 | 1802 | * @name Register USB_ERREN, field DFN8EN[3] (RW) |
Kojto | 90:cb3d968589d8 | 1803 | * |
Kojto | 90:cb3d968589d8 | 1804 | * Values: |
Kojto | 90:cb3d968589d8 | 1805 | * - 0 - Disables the DFN8 interrupt. |
Kojto | 90:cb3d968589d8 | 1806 | * - 1 - Enables the DFN8 interrupt. |
Kojto | 90:cb3d968589d8 | 1807 | */ |
Kojto | 90:cb3d968589d8 | 1808 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1809 | #define BP_USB_ERREN_DFN8EN (3U) /*!< Bit position for USB_ERREN_DFN8EN. */ |
Kojto | 90:cb3d968589d8 | 1810 | #define BM_USB_ERREN_DFN8EN (0x08U) /*!< Bit mask for USB_ERREN_DFN8EN. */ |
Kojto | 90:cb3d968589d8 | 1811 | #define BS_USB_ERREN_DFN8EN (1U) /*!< Bit field size in bits for USB_ERREN_DFN8EN. */ |
Kojto | 90:cb3d968589d8 | 1812 | |
Kojto | 90:cb3d968589d8 | 1813 | /*! @brief Read current value of the USB_ERREN_DFN8EN field. */ |
Kojto | 90:cb3d968589d8 | 1814 | #define BR_USB_ERREN_DFN8EN(x) (BITBAND_ACCESS8(HW_USB_ERREN_ADDR(x), BP_USB_ERREN_DFN8EN)) |
Kojto | 90:cb3d968589d8 | 1815 | |
Kojto | 90:cb3d968589d8 | 1816 | /*! @brief Format value for bitfield USB_ERREN_DFN8EN. */ |
Kojto | 90:cb3d968589d8 | 1817 | #define BF_USB_ERREN_DFN8EN(v) ((uint8_t)((uint8_t)(v) << BP_USB_ERREN_DFN8EN) & BM_USB_ERREN_DFN8EN) |
Kojto | 90:cb3d968589d8 | 1818 | |
Kojto | 90:cb3d968589d8 | 1819 | /*! @brief Set the DFN8EN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1820 | #define BW_USB_ERREN_DFN8EN(x, v) (BITBAND_ACCESS8(HW_USB_ERREN_ADDR(x), BP_USB_ERREN_DFN8EN) = (v)) |
Kojto | 90:cb3d968589d8 | 1821 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1822 | |
Kojto | 90:cb3d968589d8 | 1823 | /*! |
Kojto | 90:cb3d968589d8 | 1824 | * @name Register USB_ERREN, field BTOERREN[4] (RW) |
Kojto | 90:cb3d968589d8 | 1825 | * |
Kojto | 90:cb3d968589d8 | 1826 | * Values: |
Kojto | 90:cb3d968589d8 | 1827 | * - 0 - Disables the BTOERR interrupt. |
Kojto | 90:cb3d968589d8 | 1828 | * - 1 - Enables the BTOERR interrupt. |
Kojto | 90:cb3d968589d8 | 1829 | */ |
Kojto | 90:cb3d968589d8 | 1830 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1831 | #define BP_USB_ERREN_BTOERREN (4U) /*!< Bit position for USB_ERREN_BTOERREN. */ |
Kojto | 90:cb3d968589d8 | 1832 | #define BM_USB_ERREN_BTOERREN (0x10U) /*!< Bit mask for USB_ERREN_BTOERREN. */ |
Kojto | 90:cb3d968589d8 | 1833 | #define BS_USB_ERREN_BTOERREN (1U) /*!< Bit field size in bits for USB_ERREN_BTOERREN. */ |
Kojto | 90:cb3d968589d8 | 1834 | |
Kojto | 90:cb3d968589d8 | 1835 | /*! @brief Read current value of the USB_ERREN_BTOERREN field. */ |
Kojto | 90:cb3d968589d8 | 1836 | #define BR_USB_ERREN_BTOERREN(x) (BITBAND_ACCESS8(HW_USB_ERREN_ADDR(x), BP_USB_ERREN_BTOERREN)) |
Kojto | 90:cb3d968589d8 | 1837 | |
Kojto | 90:cb3d968589d8 | 1838 | /*! @brief Format value for bitfield USB_ERREN_BTOERREN. */ |
Kojto | 90:cb3d968589d8 | 1839 | #define BF_USB_ERREN_BTOERREN(v) ((uint8_t)((uint8_t)(v) << BP_USB_ERREN_BTOERREN) & BM_USB_ERREN_BTOERREN) |
Kojto | 90:cb3d968589d8 | 1840 | |
Kojto | 90:cb3d968589d8 | 1841 | /*! @brief Set the BTOERREN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1842 | #define BW_USB_ERREN_BTOERREN(x, v) (BITBAND_ACCESS8(HW_USB_ERREN_ADDR(x), BP_USB_ERREN_BTOERREN) = (v)) |
Kojto | 90:cb3d968589d8 | 1843 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1844 | |
Kojto | 90:cb3d968589d8 | 1845 | /*! |
Kojto | 90:cb3d968589d8 | 1846 | * @name Register USB_ERREN, field DMAERREN[5] (RW) |
Kojto | 90:cb3d968589d8 | 1847 | * |
Kojto | 90:cb3d968589d8 | 1848 | * Values: |
Kojto | 90:cb3d968589d8 | 1849 | * - 0 - Disables the DMAERR interrupt. |
Kojto | 90:cb3d968589d8 | 1850 | * - 1 - Enables the DMAERR interrupt. |
Kojto | 90:cb3d968589d8 | 1851 | */ |
Kojto | 90:cb3d968589d8 | 1852 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1853 | #define BP_USB_ERREN_DMAERREN (5U) /*!< Bit position for USB_ERREN_DMAERREN. */ |
Kojto | 90:cb3d968589d8 | 1854 | #define BM_USB_ERREN_DMAERREN (0x20U) /*!< Bit mask for USB_ERREN_DMAERREN. */ |
Kojto | 90:cb3d968589d8 | 1855 | #define BS_USB_ERREN_DMAERREN (1U) /*!< Bit field size in bits for USB_ERREN_DMAERREN. */ |
Kojto | 90:cb3d968589d8 | 1856 | |
Kojto | 90:cb3d968589d8 | 1857 | /*! @brief Read current value of the USB_ERREN_DMAERREN field. */ |
Kojto | 90:cb3d968589d8 | 1858 | #define BR_USB_ERREN_DMAERREN(x) (BITBAND_ACCESS8(HW_USB_ERREN_ADDR(x), BP_USB_ERREN_DMAERREN)) |
Kojto | 90:cb3d968589d8 | 1859 | |
Kojto | 90:cb3d968589d8 | 1860 | /*! @brief Format value for bitfield USB_ERREN_DMAERREN. */ |
Kojto | 90:cb3d968589d8 | 1861 | #define BF_USB_ERREN_DMAERREN(v) ((uint8_t)((uint8_t)(v) << BP_USB_ERREN_DMAERREN) & BM_USB_ERREN_DMAERREN) |
Kojto | 90:cb3d968589d8 | 1862 | |
Kojto | 90:cb3d968589d8 | 1863 | /*! @brief Set the DMAERREN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1864 | #define BW_USB_ERREN_DMAERREN(x, v) (BITBAND_ACCESS8(HW_USB_ERREN_ADDR(x), BP_USB_ERREN_DMAERREN) = (v)) |
Kojto | 90:cb3d968589d8 | 1865 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1866 | |
Kojto | 90:cb3d968589d8 | 1867 | /*! |
Kojto | 90:cb3d968589d8 | 1868 | * @name Register USB_ERREN, field BTSERREN[7] (RW) |
Kojto | 90:cb3d968589d8 | 1869 | * |
Kojto | 90:cb3d968589d8 | 1870 | * Values: |
Kojto | 90:cb3d968589d8 | 1871 | * - 0 - Disables the BTSERR interrupt. |
Kojto | 90:cb3d968589d8 | 1872 | * - 1 - Enables the BTSERR interrupt. |
Kojto | 90:cb3d968589d8 | 1873 | */ |
Kojto | 90:cb3d968589d8 | 1874 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1875 | #define BP_USB_ERREN_BTSERREN (7U) /*!< Bit position for USB_ERREN_BTSERREN. */ |
Kojto | 90:cb3d968589d8 | 1876 | #define BM_USB_ERREN_BTSERREN (0x80U) /*!< Bit mask for USB_ERREN_BTSERREN. */ |
Kojto | 90:cb3d968589d8 | 1877 | #define BS_USB_ERREN_BTSERREN (1U) /*!< Bit field size in bits for USB_ERREN_BTSERREN. */ |
Kojto | 90:cb3d968589d8 | 1878 | |
Kojto | 90:cb3d968589d8 | 1879 | /*! @brief Read current value of the USB_ERREN_BTSERREN field. */ |
Kojto | 90:cb3d968589d8 | 1880 | #define BR_USB_ERREN_BTSERREN(x) (BITBAND_ACCESS8(HW_USB_ERREN_ADDR(x), BP_USB_ERREN_BTSERREN)) |
Kojto | 90:cb3d968589d8 | 1881 | |
Kojto | 90:cb3d968589d8 | 1882 | /*! @brief Format value for bitfield USB_ERREN_BTSERREN. */ |
Kojto | 90:cb3d968589d8 | 1883 | #define BF_USB_ERREN_BTSERREN(v) ((uint8_t)((uint8_t)(v) << BP_USB_ERREN_BTSERREN) & BM_USB_ERREN_BTSERREN) |
Kojto | 90:cb3d968589d8 | 1884 | |
Kojto | 90:cb3d968589d8 | 1885 | /*! @brief Set the BTSERREN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 1886 | #define BW_USB_ERREN_BTSERREN(x, v) (BITBAND_ACCESS8(HW_USB_ERREN_ADDR(x), BP_USB_ERREN_BTSERREN) = (v)) |
Kojto | 90:cb3d968589d8 | 1887 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1888 | |
Kojto | 90:cb3d968589d8 | 1889 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 1890 | * HW_USB_STAT - Status register |
Kojto | 90:cb3d968589d8 | 1891 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 1892 | |
Kojto | 90:cb3d968589d8 | 1893 | /*! |
Kojto | 90:cb3d968589d8 | 1894 | * @brief HW_USB_STAT - Status register (RO) |
Kojto | 90:cb3d968589d8 | 1895 | * |
Kojto | 90:cb3d968589d8 | 1896 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 1897 | * |
Kojto | 90:cb3d968589d8 | 1898 | * Reports the transaction status within the USB module. When the processor's |
Kojto | 90:cb3d968589d8 | 1899 | * interrupt controller has received a TOKDNE, interrupt the Status Register must |
Kojto | 90:cb3d968589d8 | 1900 | * be read to determine the status of the previous endpoint communication. The |
Kojto | 90:cb3d968589d8 | 1901 | * data in the status register is valid when TOKDNE interrupt is asserted. The |
Kojto | 90:cb3d968589d8 | 1902 | * Status register is actually a read window into a status FIFO maintained by the USB |
Kojto | 90:cb3d968589d8 | 1903 | * module. When the USB module uses a BD, it updates the Status register. If |
Kojto | 90:cb3d968589d8 | 1904 | * another USB transaction is performed before the TOKDNE interrupt is serviced, the |
Kojto | 90:cb3d968589d8 | 1905 | * USB module stores the status of the next transaction in the STAT FIFO. Thus |
Kojto | 90:cb3d968589d8 | 1906 | * STAT is actually a four byte FIFO that allows the processor core to process one |
Kojto | 90:cb3d968589d8 | 1907 | * transaction while the SIE is processing the next transaction. Clearing the |
Kojto | 90:cb3d968589d8 | 1908 | * TOKDNE bit in the ISTAT register causes the SIE to update STAT with the contents |
Kojto | 90:cb3d968589d8 | 1909 | * of the next STAT value. If the data in the STAT holding register is valid, the |
Kojto | 90:cb3d968589d8 | 1910 | * SIE immediately reasserts to TOKDNE interrupt. |
Kojto | 90:cb3d968589d8 | 1911 | */ |
Kojto | 90:cb3d968589d8 | 1912 | typedef union _hw_usb_stat |
Kojto | 90:cb3d968589d8 | 1913 | { |
Kojto | 90:cb3d968589d8 | 1914 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 1915 | struct _hw_usb_stat_bitfields |
Kojto | 90:cb3d968589d8 | 1916 | { |
Kojto | 90:cb3d968589d8 | 1917 | uint8_t RESERVED0 : 2; /*!< [1:0] */ |
Kojto | 90:cb3d968589d8 | 1918 | uint8_t ODD : 1; /*!< [2] */ |
Kojto | 90:cb3d968589d8 | 1919 | uint8_t TX : 1; /*!< [3] Transmit Indicator */ |
Kojto | 90:cb3d968589d8 | 1920 | uint8_t ENDP : 4; /*!< [7:4] */ |
Kojto | 90:cb3d968589d8 | 1921 | } B; |
Kojto | 90:cb3d968589d8 | 1922 | } hw_usb_stat_t; |
Kojto | 90:cb3d968589d8 | 1923 | |
Kojto | 90:cb3d968589d8 | 1924 | /*! |
Kojto | 90:cb3d968589d8 | 1925 | * @name Constants and macros for entire USB_STAT register |
Kojto | 90:cb3d968589d8 | 1926 | */ |
Kojto | 90:cb3d968589d8 | 1927 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1928 | #define HW_USB_STAT_ADDR(x) ((x) + 0x90U) |
Kojto | 90:cb3d968589d8 | 1929 | |
Kojto | 90:cb3d968589d8 | 1930 | #define HW_USB_STAT(x) (*(__I hw_usb_stat_t *) HW_USB_STAT_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 1931 | #define HW_USB_STAT_RD(x) (HW_USB_STAT(x).U) |
Kojto | 90:cb3d968589d8 | 1932 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1933 | |
Kojto | 90:cb3d968589d8 | 1934 | /* |
Kojto | 90:cb3d968589d8 | 1935 | * Constants & macros for individual USB_STAT bitfields |
Kojto | 90:cb3d968589d8 | 1936 | */ |
Kojto | 90:cb3d968589d8 | 1937 | |
Kojto | 90:cb3d968589d8 | 1938 | /*! |
Kojto | 90:cb3d968589d8 | 1939 | * @name Register USB_STAT, field ODD[2] (RO) |
Kojto | 90:cb3d968589d8 | 1940 | * |
Kojto | 90:cb3d968589d8 | 1941 | * This bit is set if the last buffer descriptor updated was in the odd bank of |
Kojto | 90:cb3d968589d8 | 1942 | * the BDT. |
Kojto | 90:cb3d968589d8 | 1943 | */ |
Kojto | 90:cb3d968589d8 | 1944 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1945 | #define BP_USB_STAT_ODD (2U) /*!< Bit position for USB_STAT_ODD. */ |
Kojto | 90:cb3d968589d8 | 1946 | #define BM_USB_STAT_ODD (0x04U) /*!< Bit mask for USB_STAT_ODD. */ |
Kojto | 90:cb3d968589d8 | 1947 | #define BS_USB_STAT_ODD (1U) /*!< Bit field size in bits for USB_STAT_ODD. */ |
Kojto | 90:cb3d968589d8 | 1948 | |
Kojto | 90:cb3d968589d8 | 1949 | /*! @brief Read current value of the USB_STAT_ODD field. */ |
Kojto | 90:cb3d968589d8 | 1950 | #define BR_USB_STAT_ODD(x) (BITBAND_ACCESS8(HW_USB_STAT_ADDR(x), BP_USB_STAT_ODD)) |
Kojto | 90:cb3d968589d8 | 1951 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1952 | |
Kojto | 90:cb3d968589d8 | 1953 | /*! |
Kojto | 90:cb3d968589d8 | 1954 | * @name Register USB_STAT, field TX[3] (RO) |
Kojto | 90:cb3d968589d8 | 1955 | * |
Kojto | 90:cb3d968589d8 | 1956 | * Values: |
Kojto | 90:cb3d968589d8 | 1957 | * - 0 - The most recent transaction was a receive operation. |
Kojto | 90:cb3d968589d8 | 1958 | * - 1 - The most recent transaction was a transmit operation. |
Kojto | 90:cb3d968589d8 | 1959 | */ |
Kojto | 90:cb3d968589d8 | 1960 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1961 | #define BP_USB_STAT_TX (3U) /*!< Bit position for USB_STAT_TX. */ |
Kojto | 90:cb3d968589d8 | 1962 | #define BM_USB_STAT_TX (0x08U) /*!< Bit mask for USB_STAT_TX. */ |
Kojto | 90:cb3d968589d8 | 1963 | #define BS_USB_STAT_TX (1U) /*!< Bit field size in bits for USB_STAT_TX. */ |
Kojto | 90:cb3d968589d8 | 1964 | |
Kojto | 90:cb3d968589d8 | 1965 | /*! @brief Read current value of the USB_STAT_TX field. */ |
Kojto | 90:cb3d968589d8 | 1966 | #define BR_USB_STAT_TX(x) (BITBAND_ACCESS8(HW_USB_STAT_ADDR(x), BP_USB_STAT_TX)) |
Kojto | 90:cb3d968589d8 | 1967 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1968 | |
Kojto | 90:cb3d968589d8 | 1969 | /*! |
Kojto | 90:cb3d968589d8 | 1970 | * @name Register USB_STAT, field ENDP[7:4] (RO) |
Kojto | 90:cb3d968589d8 | 1971 | * |
Kojto | 90:cb3d968589d8 | 1972 | * This four-bit field encodes the endpoint address that received or transmitted |
Kojto | 90:cb3d968589d8 | 1973 | * the previous token. This allows the processor core to determine the BDT entry |
Kojto | 90:cb3d968589d8 | 1974 | * that was updated by the last USB transaction. |
Kojto | 90:cb3d968589d8 | 1975 | */ |
Kojto | 90:cb3d968589d8 | 1976 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 1977 | #define BP_USB_STAT_ENDP (4U) /*!< Bit position for USB_STAT_ENDP. */ |
Kojto | 90:cb3d968589d8 | 1978 | #define BM_USB_STAT_ENDP (0xF0U) /*!< Bit mask for USB_STAT_ENDP. */ |
Kojto | 90:cb3d968589d8 | 1979 | #define BS_USB_STAT_ENDP (4U) /*!< Bit field size in bits for USB_STAT_ENDP. */ |
Kojto | 90:cb3d968589d8 | 1980 | |
Kojto | 90:cb3d968589d8 | 1981 | /*! @brief Read current value of the USB_STAT_ENDP field. */ |
Kojto | 90:cb3d968589d8 | 1982 | #define BR_USB_STAT_ENDP(x) (HW_USB_STAT(x).B.ENDP) |
Kojto | 90:cb3d968589d8 | 1983 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 1984 | |
Kojto | 90:cb3d968589d8 | 1985 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 1986 | * HW_USB_CTL - Control register |
Kojto | 90:cb3d968589d8 | 1987 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 1988 | |
Kojto | 90:cb3d968589d8 | 1989 | /*! |
Kojto | 90:cb3d968589d8 | 1990 | * @brief HW_USB_CTL - Control register (RW) |
Kojto | 90:cb3d968589d8 | 1991 | * |
Kojto | 90:cb3d968589d8 | 1992 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 1993 | * |
Kojto | 90:cb3d968589d8 | 1994 | * Provides various control and configuration information for the USB module. |
Kojto | 90:cb3d968589d8 | 1995 | */ |
Kojto | 90:cb3d968589d8 | 1996 | typedef union _hw_usb_ctl |
Kojto | 90:cb3d968589d8 | 1997 | { |
Kojto | 90:cb3d968589d8 | 1998 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 1999 | struct _hw_usb_ctl_bitfields |
Kojto | 90:cb3d968589d8 | 2000 | { |
Kojto | 90:cb3d968589d8 | 2001 | uint8_t USBENSOFEN : 1; /*!< [0] USB Enable */ |
Kojto | 90:cb3d968589d8 | 2002 | uint8_t ODDRST : 1; /*!< [1] */ |
Kojto | 90:cb3d968589d8 | 2003 | uint8_t RESUME : 1; /*!< [2] */ |
Kojto | 90:cb3d968589d8 | 2004 | uint8_t HOSTMODEEN : 1; /*!< [3] */ |
Kojto | 90:cb3d968589d8 | 2005 | uint8_t RESET : 1; /*!< [4] */ |
Kojto | 90:cb3d968589d8 | 2006 | uint8_t TXSUSPENDTOKENBUSY : 1; /*!< [5] */ |
Kojto | 90:cb3d968589d8 | 2007 | uint8_t SE0 : 1; /*!< [6] Live USB Single Ended Zero signal */ |
Kojto | 90:cb3d968589d8 | 2008 | uint8_t JSTATE : 1; /*!< [7] Live USB differential receiver JSTATE |
Kojto | 90:cb3d968589d8 | 2009 | * signal */ |
Kojto | 90:cb3d968589d8 | 2010 | } B; |
Kojto | 90:cb3d968589d8 | 2011 | } hw_usb_ctl_t; |
Kojto | 90:cb3d968589d8 | 2012 | |
Kojto | 90:cb3d968589d8 | 2013 | /*! |
Kojto | 90:cb3d968589d8 | 2014 | * @name Constants and macros for entire USB_CTL register |
Kojto | 90:cb3d968589d8 | 2015 | */ |
Kojto | 90:cb3d968589d8 | 2016 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2017 | #define HW_USB_CTL_ADDR(x) ((x) + 0x94U) |
Kojto | 90:cb3d968589d8 | 2018 | |
Kojto | 90:cb3d968589d8 | 2019 | #define HW_USB_CTL(x) (*(__IO hw_usb_ctl_t *) HW_USB_CTL_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 2020 | #define HW_USB_CTL_RD(x) (HW_USB_CTL(x).U) |
Kojto | 90:cb3d968589d8 | 2021 | #define HW_USB_CTL_WR(x, v) (HW_USB_CTL(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 2022 | #define HW_USB_CTL_SET(x, v) (HW_USB_CTL_WR(x, HW_USB_CTL_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 2023 | #define HW_USB_CTL_CLR(x, v) (HW_USB_CTL_WR(x, HW_USB_CTL_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 2024 | #define HW_USB_CTL_TOG(x, v) (HW_USB_CTL_WR(x, HW_USB_CTL_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 2025 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2026 | |
Kojto | 90:cb3d968589d8 | 2027 | /* |
Kojto | 90:cb3d968589d8 | 2028 | * Constants & macros for individual USB_CTL bitfields |
Kojto | 90:cb3d968589d8 | 2029 | */ |
Kojto | 90:cb3d968589d8 | 2030 | |
Kojto | 90:cb3d968589d8 | 2031 | /*! |
Kojto | 90:cb3d968589d8 | 2032 | * @name Register USB_CTL, field USBENSOFEN[0] (RW) |
Kojto | 90:cb3d968589d8 | 2033 | * |
Kojto | 90:cb3d968589d8 | 2034 | * Setting this bit enables the USB-FS to operate; clearing it disables the |
Kojto | 90:cb3d968589d8 | 2035 | * USB-FS. Setting the bit causes the SIE to reset all of its ODD bits to the BDTs. |
Kojto | 90:cb3d968589d8 | 2036 | * Therefore, setting this bit resets much of the logic in the SIE. When host mode |
Kojto | 90:cb3d968589d8 | 2037 | * is enabled, clearing this bit causes the SIE to stop sending SOF tokens. |
Kojto | 90:cb3d968589d8 | 2038 | * |
Kojto | 90:cb3d968589d8 | 2039 | * Values: |
Kojto | 90:cb3d968589d8 | 2040 | * - 0 - Disables the USB Module. |
Kojto | 90:cb3d968589d8 | 2041 | * - 1 - Enables the USB Module. |
Kojto | 90:cb3d968589d8 | 2042 | */ |
Kojto | 90:cb3d968589d8 | 2043 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2044 | #define BP_USB_CTL_USBENSOFEN (0U) /*!< Bit position for USB_CTL_USBENSOFEN. */ |
Kojto | 90:cb3d968589d8 | 2045 | #define BM_USB_CTL_USBENSOFEN (0x01U) /*!< Bit mask for USB_CTL_USBENSOFEN. */ |
Kojto | 90:cb3d968589d8 | 2046 | #define BS_USB_CTL_USBENSOFEN (1U) /*!< Bit field size in bits for USB_CTL_USBENSOFEN. */ |
Kojto | 90:cb3d968589d8 | 2047 | |
Kojto | 90:cb3d968589d8 | 2048 | /*! @brief Read current value of the USB_CTL_USBENSOFEN field. */ |
Kojto | 90:cb3d968589d8 | 2049 | #define BR_USB_CTL_USBENSOFEN(x) (BITBAND_ACCESS8(HW_USB_CTL_ADDR(x), BP_USB_CTL_USBENSOFEN)) |
Kojto | 90:cb3d968589d8 | 2050 | |
Kojto | 90:cb3d968589d8 | 2051 | /*! @brief Format value for bitfield USB_CTL_USBENSOFEN. */ |
Kojto | 90:cb3d968589d8 | 2052 | #define BF_USB_CTL_USBENSOFEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_CTL_USBENSOFEN) & BM_USB_CTL_USBENSOFEN) |
Kojto | 90:cb3d968589d8 | 2053 | |
Kojto | 90:cb3d968589d8 | 2054 | /*! @brief Set the USBENSOFEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2055 | #define BW_USB_CTL_USBENSOFEN(x, v) (BITBAND_ACCESS8(HW_USB_CTL_ADDR(x), BP_USB_CTL_USBENSOFEN) = (v)) |
Kojto | 90:cb3d968589d8 | 2056 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2057 | |
Kojto | 90:cb3d968589d8 | 2058 | /*! |
Kojto | 90:cb3d968589d8 | 2059 | * @name Register USB_CTL, field ODDRST[1] (RW) |
Kojto | 90:cb3d968589d8 | 2060 | * |
Kojto | 90:cb3d968589d8 | 2061 | * Setting this bit to 1 resets all the BDT ODD ping/pong fields to 0, which |
Kojto | 90:cb3d968589d8 | 2062 | * then specifies the EVEN BDT bank. |
Kojto | 90:cb3d968589d8 | 2063 | */ |
Kojto | 90:cb3d968589d8 | 2064 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2065 | #define BP_USB_CTL_ODDRST (1U) /*!< Bit position for USB_CTL_ODDRST. */ |
Kojto | 90:cb3d968589d8 | 2066 | #define BM_USB_CTL_ODDRST (0x02U) /*!< Bit mask for USB_CTL_ODDRST. */ |
Kojto | 90:cb3d968589d8 | 2067 | #define BS_USB_CTL_ODDRST (1U) /*!< Bit field size in bits for USB_CTL_ODDRST. */ |
Kojto | 90:cb3d968589d8 | 2068 | |
Kojto | 90:cb3d968589d8 | 2069 | /*! @brief Read current value of the USB_CTL_ODDRST field. */ |
Kojto | 90:cb3d968589d8 | 2070 | #define BR_USB_CTL_ODDRST(x) (BITBAND_ACCESS8(HW_USB_CTL_ADDR(x), BP_USB_CTL_ODDRST)) |
Kojto | 90:cb3d968589d8 | 2071 | |
Kojto | 90:cb3d968589d8 | 2072 | /*! @brief Format value for bitfield USB_CTL_ODDRST. */ |
Kojto | 90:cb3d968589d8 | 2073 | #define BF_USB_CTL_ODDRST(v) ((uint8_t)((uint8_t)(v) << BP_USB_CTL_ODDRST) & BM_USB_CTL_ODDRST) |
Kojto | 90:cb3d968589d8 | 2074 | |
Kojto | 90:cb3d968589d8 | 2075 | /*! @brief Set the ODDRST field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2076 | #define BW_USB_CTL_ODDRST(x, v) (BITBAND_ACCESS8(HW_USB_CTL_ADDR(x), BP_USB_CTL_ODDRST) = (v)) |
Kojto | 90:cb3d968589d8 | 2077 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2078 | |
Kojto | 90:cb3d968589d8 | 2079 | /*! |
Kojto | 90:cb3d968589d8 | 2080 | * @name Register USB_CTL, field RESUME[2] (RW) |
Kojto | 90:cb3d968589d8 | 2081 | * |
Kojto | 90:cb3d968589d8 | 2082 | * When set to 1 this bit enables the USB Module to execute resume signaling. |
Kojto | 90:cb3d968589d8 | 2083 | * This allows the USB Module to perform remote wake-up. Software must set RESUME |
Kojto | 90:cb3d968589d8 | 2084 | * to 1 for the required amount of time and then clear it to 0. If the HOSTMODEEN |
Kojto | 90:cb3d968589d8 | 2085 | * bit is set, the USB module appends a Low Speed End of Packet to the Resume |
Kojto | 90:cb3d968589d8 | 2086 | * signaling when the RESUME bit is cleared. For more information on RESUME |
Kojto | 90:cb3d968589d8 | 2087 | * signaling see Section 7.1.4.5 of the USB specification version 1.0. |
Kojto | 90:cb3d968589d8 | 2088 | */ |
Kojto | 90:cb3d968589d8 | 2089 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2090 | #define BP_USB_CTL_RESUME (2U) /*!< Bit position for USB_CTL_RESUME. */ |
Kojto | 90:cb3d968589d8 | 2091 | #define BM_USB_CTL_RESUME (0x04U) /*!< Bit mask for USB_CTL_RESUME. */ |
Kojto | 90:cb3d968589d8 | 2092 | #define BS_USB_CTL_RESUME (1U) /*!< Bit field size in bits for USB_CTL_RESUME. */ |
Kojto | 90:cb3d968589d8 | 2093 | |
Kojto | 90:cb3d968589d8 | 2094 | /*! @brief Read current value of the USB_CTL_RESUME field. */ |
Kojto | 90:cb3d968589d8 | 2095 | #define BR_USB_CTL_RESUME(x) (BITBAND_ACCESS8(HW_USB_CTL_ADDR(x), BP_USB_CTL_RESUME)) |
Kojto | 90:cb3d968589d8 | 2096 | |
Kojto | 90:cb3d968589d8 | 2097 | /*! @brief Format value for bitfield USB_CTL_RESUME. */ |
Kojto | 90:cb3d968589d8 | 2098 | #define BF_USB_CTL_RESUME(v) ((uint8_t)((uint8_t)(v) << BP_USB_CTL_RESUME) & BM_USB_CTL_RESUME) |
Kojto | 90:cb3d968589d8 | 2099 | |
Kojto | 90:cb3d968589d8 | 2100 | /*! @brief Set the RESUME field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2101 | #define BW_USB_CTL_RESUME(x, v) (BITBAND_ACCESS8(HW_USB_CTL_ADDR(x), BP_USB_CTL_RESUME) = (v)) |
Kojto | 90:cb3d968589d8 | 2102 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2103 | |
Kojto | 90:cb3d968589d8 | 2104 | /*! |
Kojto | 90:cb3d968589d8 | 2105 | * @name Register USB_CTL, field HOSTMODEEN[3] (RW) |
Kojto | 90:cb3d968589d8 | 2106 | * |
Kojto | 90:cb3d968589d8 | 2107 | * When set to 1, this bit enables the USB Module to operate in Host mode. In |
Kojto | 90:cb3d968589d8 | 2108 | * host mode, the USB module performs USB transactions under the programmed control |
Kojto | 90:cb3d968589d8 | 2109 | * of the host processor. |
Kojto | 90:cb3d968589d8 | 2110 | */ |
Kojto | 90:cb3d968589d8 | 2111 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2112 | #define BP_USB_CTL_HOSTMODEEN (3U) /*!< Bit position for USB_CTL_HOSTMODEEN. */ |
Kojto | 90:cb3d968589d8 | 2113 | #define BM_USB_CTL_HOSTMODEEN (0x08U) /*!< Bit mask for USB_CTL_HOSTMODEEN. */ |
Kojto | 90:cb3d968589d8 | 2114 | #define BS_USB_CTL_HOSTMODEEN (1U) /*!< Bit field size in bits for USB_CTL_HOSTMODEEN. */ |
Kojto | 90:cb3d968589d8 | 2115 | |
Kojto | 90:cb3d968589d8 | 2116 | /*! @brief Read current value of the USB_CTL_HOSTMODEEN field. */ |
Kojto | 90:cb3d968589d8 | 2117 | #define BR_USB_CTL_HOSTMODEEN(x) (BITBAND_ACCESS8(HW_USB_CTL_ADDR(x), BP_USB_CTL_HOSTMODEEN)) |
Kojto | 90:cb3d968589d8 | 2118 | |
Kojto | 90:cb3d968589d8 | 2119 | /*! @brief Format value for bitfield USB_CTL_HOSTMODEEN. */ |
Kojto | 90:cb3d968589d8 | 2120 | #define BF_USB_CTL_HOSTMODEEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_CTL_HOSTMODEEN) & BM_USB_CTL_HOSTMODEEN) |
Kojto | 90:cb3d968589d8 | 2121 | |
Kojto | 90:cb3d968589d8 | 2122 | /*! @brief Set the HOSTMODEEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2123 | #define BW_USB_CTL_HOSTMODEEN(x, v) (BITBAND_ACCESS8(HW_USB_CTL_ADDR(x), BP_USB_CTL_HOSTMODEEN) = (v)) |
Kojto | 90:cb3d968589d8 | 2124 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2125 | |
Kojto | 90:cb3d968589d8 | 2126 | /*! |
Kojto | 90:cb3d968589d8 | 2127 | * @name Register USB_CTL, field RESET[4] (RW) |
Kojto | 90:cb3d968589d8 | 2128 | * |
Kojto | 90:cb3d968589d8 | 2129 | * Setting this bit enables the USB Module to generate USB reset signaling. This |
Kojto | 90:cb3d968589d8 | 2130 | * allows the USB Module to reset USB peripherals. This control signal is only |
Kojto | 90:cb3d968589d8 | 2131 | * valid in Host mode (HOSTMODEEN=1). Software must set RESET to 1 for the |
Kojto | 90:cb3d968589d8 | 2132 | * required amount of time and then clear it to 0 to end reset signaling. For more |
Kojto | 90:cb3d968589d8 | 2133 | * information on reset signaling see Section 7.1.4.3 of the USB specification version |
Kojto | 90:cb3d968589d8 | 2134 | * 1.0. |
Kojto | 90:cb3d968589d8 | 2135 | */ |
Kojto | 90:cb3d968589d8 | 2136 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2137 | #define BP_USB_CTL_RESET (4U) /*!< Bit position for USB_CTL_RESET. */ |
Kojto | 90:cb3d968589d8 | 2138 | #define BM_USB_CTL_RESET (0x10U) /*!< Bit mask for USB_CTL_RESET. */ |
Kojto | 90:cb3d968589d8 | 2139 | #define BS_USB_CTL_RESET (1U) /*!< Bit field size in bits for USB_CTL_RESET. */ |
Kojto | 90:cb3d968589d8 | 2140 | |
Kojto | 90:cb3d968589d8 | 2141 | /*! @brief Read current value of the USB_CTL_RESET field. */ |
Kojto | 90:cb3d968589d8 | 2142 | #define BR_USB_CTL_RESET(x) (BITBAND_ACCESS8(HW_USB_CTL_ADDR(x), BP_USB_CTL_RESET)) |
Kojto | 90:cb3d968589d8 | 2143 | |
Kojto | 90:cb3d968589d8 | 2144 | /*! @brief Format value for bitfield USB_CTL_RESET. */ |
Kojto | 90:cb3d968589d8 | 2145 | #define BF_USB_CTL_RESET(v) ((uint8_t)((uint8_t)(v) << BP_USB_CTL_RESET) & BM_USB_CTL_RESET) |
Kojto | 90:cb3d968589d8 | 2146 | |
Kojto | 90:cb3d968589d8 | 2147 | /*! @brief Set the RESET field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2148 | #define BW_USB_CTL_RESET(x, v) (BITBAND_ACCESS8(HW_USB_CTL_ADDR(x), BP_USB_CTL_RESET) = (v)) |
Kojto | 90:cb3d968589d8 | 2149 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2150 | |
Kojto | 90:cb3d968589d8 | 2151 | /*! |
Kojto | 90:cb3d968589d8 | 2152 | * @name Register USB_CTL, field TXSUSPENDTOKENBUSY[5] (RW) |
Kojto | 90:cb3d968589d8 | 2153 | * |
Kojto | 90:cb3d968589d8 | 2154 | * In Host mode, TOKEN_BUSY is set when the USB module is busy executing a USB |
Kojto | 90:cb3d968589d8 | 2155 | * token. Software must not write more token commands to the Token Register when |
Kojto | 90:cb3d968589d8 | 2156 | * TOKEN_BUSY is set. Software should check this field before writing any tokens |
Kojto | 90:cb3d968589d8 | 2157 | * to the Token Register to ensure that token commands are not lost. In Target |
Kojto | 90:cb3d968589d8 | 2158 | * mode, TXD_SUSPEND is set when the SIE has disabled packet transmission and |
Kojto | 90:cb3d968589d8 | 2159 | * reception. Clearing this bit allows the SIE to continue token processing. This bit |
Kojto | 90:cb3d968589d8 | 2160 | * is set by the SIE when a SETUP Token is received allowing software to dequeue |
Kojto | 90:cb3d968589d8 | 2161 | * any pending packet transactions in the BDT before resuming token processing. |
Kojto | 90:cb3d968589d8 | 2162 | */ |
Kojto | 90:cb3d968589d8 | 2163 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2164 | #define BP_USB_CTL_TXSUSPENDTOKENBUSY (5U) /*!< Bit position for USB_CTL_TXSUSPENDTOKENBUSY. */ |
Kojto | 90:cb3d968589d8 | 2165 | #define BM_USB_CTL_TXSUSPENDTOKENBUSY (0x20U) /*!< Bit mask for USB_CTL_TXSUSPENDTOKENBUSY. */ |
Kojto | 90:cb3d968589d8 | 2166 | #define BS_USB_CTL_TXSUSPENDTOKENBUSY (1U) /*!< Bit field size in bits for USB_CTL_TXSUSPENDTOKENBUSY. */ |
Kojto | 90:cb3d968589d8 | 2167 | |
Kojto | 90:cb3d968589d8 | 2168 | /*! @brief Read current value of the USB_CTL_TXSUSPENDTOKENBUSY field. */ |
Kojto | 90:cb3d968589d8 | 2169 | #define BR_USB_CTL_TXSUSPENDTOKENBUSY(x) (BITBAND_ACCESS8(HW_USB_CTL_ADDR(x), BP_USB_CTL_TXSUSPENDTOKENBUSY)) |
Kojto | 90:cb3d968589d8 | 2170 | |
Kojto | 90:cb3d968589d8 | 2171 | /*! @brief Format value for bitfield USB_CTL_TXSUSPENDTOKENBUSY. */ |
Kojto | 90:cb3d968589d8 | 2172 | #define BF_USB_CTL_TXSUSPENDTOKENBUSY(v) ((uint8_t)((uint8_t)(v) << BP_USB_CTL_TXSUSPENDTOKENBUSY) & BM_USB_CTL_TXSUSPENDTOKENBUSY) |
Kojto | 90:cb3d968589d8 | 2173 | |
Kojto | 90:cb3d968589d8 | 2174 | /*! @brief Set the TXSUSPENDTOKENBUSY field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2175 | #define BW_USB_CTL_TXSUSPENDTOKENBUSY(x, v) (BITBAND_ACCESS8(HW_USB_CTL_ADDR(x), BP_USB_CTL_TXSUSPENDTOKENBUSY) = (v)) |
Kojto | 90:cb3d968589d8 | 2176 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2177 | |
Kojto | 90:cb3d968589d8 | 2178 | /*! |
Kojto | 90:cb3d968589d8 | 2179 | * @name Register USB_CTL, field SE0[6] (RW) |
Kojto | 90:cb3d968589d8 | 2180 | */ |
Kojto | 90:cb3d968589d8 | 2181 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2182 | #define BP_USB_CTL_SE0 (6U) /*!< Bit position for USB_CTL_SE0. */ |
Kojto | 90:cb3d968589d8 | 2183 | #define BM_USB_CTL_SE0 (0x40U) /*!< Bit mask for USB_CTL_SE0. */ |
Kojto | 90:cb3d968589d8 | 2184 | #define BS_USB_CTL_SE0 (1U) /*!< Bit field size in bits for USB_CTL_SE0. */ |
Kojto | 90:cb3d968589d8 | 2185 | |
Kojto | 90:cb3d968589d8 | 2186 | /*! @brief Read current value of the USB_CTL_SE0 field. */ |
Kojto | 90:cb3d968589d8 | 2187 | #define BR_USB_CTL_SE0(x) (BITBAND_ACCESS8(HW_USB_CTL_ADDR(x), BP_USB_CTL_SE0)) |
Kojto | 90:cb3d968589d8 | 2188 | |
Kojto | 90:cb3d968589d8 | 2189 | /*! @brief Format value for bitfield USB_CTL_SE0. */ |
Kojto | 90:cb3d968589d8 | 2190 | #define BF_USB_CTL_SE0(v) ((uint8_t)((uint8_t)(v) << BP_USB_CTL_SE0) & BM_USB_CTL_SE0) |
Kojto | 90:cb3d968589d8 | 2191 | |
Kojto | 90:cb3d968589d8 | 2192 | /*! @brief Set the SE0 field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2193 | #define BW_USB_CTL_SE0(x, v) (BITBAND_ACCESS8(HW_USB_CTL_ADDR(x), BP_USB_CTL_SE0) = (v)) |
Kojto | 90:cb3d968589d8 | 2194 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2195 | |
Kojto | 90:cb3d968589d8 | 2196 | /*! |
Kojto | 90:cb3d968589d8 | 2197 | * @name Register USB_CTL, field JSTATE[7] (RW) |
Kojto | 90:cb3d968589d8 | 2198 | * |
Kojto | 90:cb3d968589d8 | 2199 | * The polarity of this signal is affected by the current state of LSEN . |
Kojto | 90:cb3d968589d8 | 2200 | */ |
Kojto | 90:cb3d968589d8 | 2201 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2202 | #define BP_USB_CTL_JSTATE (7U) /*!< Bit position for USB_CTL_JSTATE. */ |
Kojto | 90:cb3d968589d8 | 2203 | #define BM_USB_CTL_JSTATE (0x80U) /*!< Bit mask for USB_CTL_JSTATE. */ |
Kojto | 90:cb3d968589d8 | 2204 | #define BS_USB_CTL_JSTATE (1U) /*!< Bit field size in bits for USB_CTL_JSTATE. */ |
Kojto | 90:cb3d968589d8 | 2205 | |
Kojto | 90:cb3d968589d8 | 2206 | /*! @brief Read current value of the USB_CTL_JSTATE field. */ |
Kojto | 90:cb3d968589d8 | 2207 | #define BR_USB_CTL_JSTATE(x) (BITBAND_ACCESS8(HW_USB_CTL_ADDR(x), BP_USB_CTL_JSTATE)) |
Kojto | 90:cb3d968589d8 | 2208 | |
Kojto | 90:cb3d968589d8 | 2209 | /*! @brief Format value for bitfield USB_CTL_JSTATE. */ |
Kojto | 90:cb3d968589d8 | 2210 | #define BF_USB_CTL_JSTATE(v) ((uint8_t)((uint8_t)(v) << BP_USB_CTL_JSTATE) & BM_USB_CTL_JSTATE) |
Kojto | 90:cb3d968589d8 | 2211 | |
Kojto | 90:cb3d968589d8 | 2212 | /*! @brief Set the JSTATE field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2213 | #define BW_USB_CTL_JSTATE(x, v) (BITBAND_ACCESS8(HW_USB_CTL_ADDR(x), BP_USB_CTL_JSTATE) = (v)) |
Kojto | 90:cb3d968589d8 | 2214 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2215 | |
Kojto | 90:cb3d968589d8 | 2216 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 2217 | * HW_USB_ADDR - Address register |
Kojto | 90:cb3d968589d8 | 2218 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 2219 | |
Kojto | 90:cb3d968589d8 | 2220 | /*! |
Kojto | 90:cb3d968589d8 | 2221 | * @brief HW_USB_ADDR - Address register (RW) |
Kojto | 90:cb3d968589d8 | 2222 | * |
Kojto | 90:cb3d968589d8 | 2223 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 2224 | * |
Kojto | 90:cb3d968589d8 | 2225 | * Holds the unique USB address that the USB module decodes when in Peripheral |
Kojto | 90:cb3d968589d8 | 2226 | * mode (HOSTMODEEN=0). When operating in Host mode (HOSTMODEEN=1) the USB module |
Kojto | 90:cb3d968589d8 | 2227 | * transmits this address with a TOKEN packet. This enables the USB module to |
Kojto | 90:cb3d968589d8 | 2228 | * uniquely address any USB peripheral. In either mode, CTL[USBENSOFEN] must be 1. |
Kojto | 90:cb3d968589d8 | 2229 | * The Address register is reset to 0x00 after the reset input becomes active or |
Kojto | 90:cb3d968589d8 | 2230 | * the USB module decodes a USB reset signal. This action initializes the Address |
Kojto | 90:cb3d968589d8 | 2231 | * register to decode address 0x00 as required by the USB specification. |
Kojto | 90:cb3d968589d8 | 2232 | */ |
Kojto | 90:cb3d968589d8 | 2233 | typedef union _hw_usb_addr |
Kojto | 90:cb3d968589d8 | 2234 | { |
Kojto | 90:cb3d968589d8 | 2235 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 2236 | struct _hw_usb_addr_bitfields |
Kojto | 90:cb3d968589d8 | 2237 | { |
Kojto | 90:cb3d968589d8 | 2238 | uint8_t ADDR : 7; /*!< [6:0] USB Address */ |
Kojto | 90:cb3d968589d8 | 2239 | uint8_t LSEN : 1; /*!< [7] Low Speed Enable bit */ |
Kojto | 90:cb3d968589d8 | 2240 | } B; |
Kojto | 90:cb3d968589d8 | 2241 | } hw_usb_addr_t; |
Kojto | 90:cb3d968589d8 | 2242 | |
Kojto | 90:cb3d968589d8 | 2243 | /*! |
Kojto | 90:cb3d968589d8 | 2244 | * @name Constants and macros for entire USB_ADDR register |
Kojto | 90:cb3d968589d8 | 2245 | */ |
Kojto | 90:cb3d968589d8 | 2246 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2247 | #define HW_USB_ADDR_ADDR(x) ((x) + 0x98U) |
Kojto | 90:cb3d968589d8 | 2248 | |
Kojto | 90:cb3d968589d8 | 2249 | #define HW_USB_ADDR(x) (*(__IO hw_usb_addr_t *) HW_USB_ADDR_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 2250 | #define HW_USB_ADDR_RD(x) (HW_USB_ADDR(x).U) |
Kojto | 90:cb3d968589d8 | 2251 | #define HW_USB_ADDR_WR(x, v) (HW_USB_ADDR(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 2252 | #define HW_USB_ADDR_SET(x, v) (HW_USB_ADDR_WR(x, HW_USB_ADDR_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 2253 | #define HW_USB_ADDR_CLR(x, v) (HW_USB_ADDR_WR(x, HW_USB_ADDR_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 2254 | #define HW_USB_ADDR_TOG(x, v) (HW_USB_ADDR_WR(x, HW_USB_ADDR_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 2255 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2256 | |
Kojto | 90:cb3d968589d8 | 2257 | /* |
Kojto | 90:cb3d968589d8 | 2258 | * Constants & macros for individual USB_ADDR bitfields |
Kojto | 90:cb3d968589d8 | 2259 | */ |
Kojto | 90:cb3d968589d8 | 2260 | |
Kojto | 90:cb3d968589d8 | 2261 | /*! |
Kojto | 90:cb3d968589d8 | 2262 | * @name Register USB_ADDR, field ADDR[6:0] (RW) |
Kojto | 90:cb3d968589d8 | 2263 | * |
Kojto | 90:cb3d968589d8 | 2264 | * Defines the USB address that the USB module decodes in peripheral mode, or |
Kojto | 90:cb3d968589d8 | 2265 | * transmits when in host mode. |
Kojto | 90:cb3d968589d8 | 2266 | */ |
Kojto | 90:cb3d968589d8 | 2267 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2268 | #define BP_USB_ADDR_ADDR (0U) /*!< Bit position for USB_ADDR_ADDR. */ |
Kojto | 90:cb3d968589d8 | 2269 | #define BM_USB_ADDR_ADDR (0x7FU) /*!< Bit mask for USB_ADDR_ADDR. */ |
Kojto | 90:cb3d968589d8 | 2270 | #define BS_USB_ADDR_ADDR (7U) /*!< Bit field size in bits for USB_ADDR_ADDR. */ |
Kojto | 90:cb3d968589d8 | 2271 | |
Kojto | 90:cb3d968589d8 | 2272 | /*! @brief Read current value of the USB_ADDR_ADDR field. */ |
Kojto | 90:cb3d968589d8 | 2273 | #define BR_USB_ADDR_ADDR(x) (HW_USB_ADDR(x).B.ADDR) |
Kojto | 90:cb3d968589d8 | 2274 | |
Kojto | 90:cb3d968589d8 | 2275 | /*! @brief Format value for bitfield USB_ADDR_ADDR. */ |
Kojto | 90:cb3d968589d8 | 2276 | #define BF_USB_ADDR_ADDR(v) ((uint8_t)((uint8_t)(v) << BP_USB_ADDR_ADDR) & BM_USB_ADDR_ADDR) |
Kojto | 90:cb3d968589d8 | 2277 | |
Kojto | 90:cb3d968589d8 | 2278 | /*! @brief Set the ADDR field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2279 | #define BW_USB_ADDR_ADDR(x, v) (HW_USB_ADDR_WR(x, (HW_USB_ADDR_RD(x) & ~BM_USB_ADDR_ADDR) | BF_USB_ADDR_ADDR(v))) |
Kojto | 90:cb3d968589d8 | 2280 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2281 | |
Kojto | 90:cb3d968589d8 | 2282 | /*! |
Kojto | 90:cb3d968589d8 | 2283 | * @name Register USB_ADDR, field LSEN[7] (RW) |
Kojto | 90:cb3d968589d8 | 2284 | * |
Kojto | 90:cb3d968589d8 | 2285 | * Informs the USB module that the next token command written to the token |
Kojto | 90:cb3d968589d8 | 2286 | * register must be performed at low speed. This enables the USB module to perform the |
Kojto | 90:cb3d968589d8 | 2287 | * necessary preamble required for low-speed data transmissions. |
Kojto | 90:cb3d968589d8 | 2288 | */ |
Kojto | 90:cb3d968589d8 | 2289 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2290 | #define BP_USB_ADDR_LSEN (7U) /*!< Bit position for USB_ADDR_LSEN. */ |
Kojto | 90:cb3d968589d8 | 2291 | #define BM_USB_ADDR_LSEN (0x80U) /*!< Bit mask for USB_ADDR_LSEN. */ |
Kojto | 90:cb3d968589d8 | 2292 | #define BS_USB_ADDR_LSEN (1U) /*!< Bit field size in bits for USB_ADDR_LSEN. */ |
Kojto | 90:cb3d968589d8 | 2293 | |
Kojto | 90:cb3d968589d8 | 2294 | /*! @brief Read current value of the USB_ADDR_LSEN field. */ |
Kojto | 90:cb3d968589d8 | 2295 | #define BR_USB_ADDR_LSEN(x) (BITBAND_ACCESS8(HW_USB_ADDR_ADDR(x), BP_USB_ADDR_LSEN)) |
Kojto | 90:cb3d968589d8 | 2296 | |
Kojto | 90:cb3d968589d8 | 2297 | /*! @brief Format value for bitfield USB_ADDR_LSEN. */ |
Kojto | 90:cb3d968589d8 | 2298 | #define BF_USB_ADDR_LSEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_ADDR_LSEN) & BM_USB_ADDR_LSEN) |
Kojto | 90:cb3d968589d8 | 2299 | |
Kojto | 90:cb3d968589d8 | 2300 | /*! @brief Set the LSEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2301 | #define BW_USB_ADDR_LSEN(x, v) (BITBAND_ACCESS8(HW_USB_ADDR_ADDR(x), BP_USB_ADDR_LSEN) = (v)) |
Kojto | 90:cb3d968589d8 | 2302 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2303 | |
Kojto | 90:cb3d968589d8 | 2304 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 2305 | * HW_USB_BDTPAGE1 - BDT Page register 1 |
Kojto | 90:cb3d968589d8 | 2306 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 2307 | |
Kojto | 90:cb3d968589d8 | 2308 | /*! |
Kojto | 90:cb3d968589d8 | 2309 | * @brief HW_USB_BDTPAGE1 - BDT Page register 1 (RW) |
Kojto | 90:cb3d968589d8 | 2310 | * |
Kojto | 90:cb3d968589d8 | 2311 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 2312 | * |
Kojto | 90:cb3d968589d8 | 2313 | * Provides address bits 15 through 9 of the base address where the current |
Kojto | 90:cb3d968589d8 | 2314 | * Buffer Descriptor Table (BDT) resides in system memory. See Buffer Descriptor |
Kojto | 90:cb3d968589d8 | 2315 | * Table. The 32-bit BDT Base Address is always aligned on 512-byte boundaries, so |
Kojto | 90:cb3d968589d8 | 2316 | * bits 8 through 0 of the base address are always zero. |
Kojto | 90:cb3d968589d8 | 2317 | */ |
Kojto | 90:cb3d968589d8 | 2318 | typedef union _hw_usb_bdtpage1 |
Kojto | 90:cb3d968589d8 | 2319 | { |
Kojto | 90:cb3d968589d8 | 2320 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 2321 | struct _hw_usb_bdtpage1_bitfields |
Kojto | 90:cb3d968589d8 | 2322 | { |
Kojto | 90:cb3d968589d8 | 2323 | uint8_t RESERVED0 : 1; /*!< [0] */ |
Kojto | 90:cb3d968589d8 | 2324 | uint8_t BDTBA : 7; /*!< [7:1] */ |
Kojto | 90:cb3d968589d8 | 2325 | } B; |
Kojto | 90:cb3d968589d8 | 2326 | } hw_usb_bdtpage1_t; |
Kojto | 90:cb3d968589d8 | 2327 | |
Kojto | 90:cb3d968589d8 | 2328 | /*! |
Kojto | 90:cb3d968589d8 | 2329 | * @name Constants and macros for entire USB_BDTPAGE1 register |
Kojto | 90:cb3d968589d8 | 2330 | */ |
Kojto | 90:cb3d968589d8 | 2331 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2332 | #define HW_USB_BDTPAGE1_ADDR(x) ((x) + 0x9CU) |
Kojto | 90:cb3d968589d8 | 2333 | |
Kojto | 90:cb3d968589d8 | 2334 | #define HW_USB_BDTPAGE1(x) (*(__IO hw_usb_bdtpage1_t *) HW_USB_BDTPAGE1_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 2335 | #define HW_USB_BDTPAGE1_RD(x) (HW_USB_BDTPAGE1(x).U) |
Kojto | 90:cb3d968589d8 | 2336 | #define HW_USB_BDTPAGE1_WR(x, v) (HW_USB_BDTPAGE1(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 2337 | #define HW_USB_BDTPAGE1_SET(x, v) (HW_USB_BDTPAGE1_WR(x, HW_USB_BDTPAGE1_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 2338 | #define HW_USB_BDTPAGE1_CLR(x, v) (HW_USB_BDTPAGE1_WR(x, HW_USB_BDTPAGE1_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 2339 | #define HW_USB_BDTPAGE1_TOG(x, v) (HW_USB_BDTPAGE1_WR(x, HW_USB_BDTPAGE1_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 2340 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2341 | |
Kojto | 90:cb3d968589d8 | 2342 | /* |
Kojto | 90:cb3d968589d8 | 2343 | * Constants & macros for individual USB_BDTPAGE1 bitfields |
Kojto | 90:cb3d968589d8 | 2344 | */ |
Kojto | 90:cb3d968589d8 | 2345 | |
Kojto | 90:cb3d968589d8 | 2346 | /*! |
Kojto | 90:cb3d968589d8 | 2347 | * @name Register USB_BDTPAGE1, field BDTBA[7:1] (RW) |
Kojto | 90:cb3d968589d8 | 2348 | * |
Kojto | 90:cb3d968589d8 | 2349 | * Provides address bits 15 through 9 of the BDT base address. |
Kojto | 90:cb3d968589d8 | 2350 | */ |
Kojto | 90:cb3d968589d8 | 2351 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2352 | #define BP_USB_BDTPAGE1_BDTBA (1U) /*!< Bit position for USB_BDTPAGE1_BDTBA. */ |
Kojto | 90:cb3d968589d8 | 2353 | #define BM_USB_BDTPAGE1_BDTBA (0xFEU) /*!< Bit mask for USB_BDTPAGE1_BDTBA. */ |
Kojto | 90:cb3d968589d8 | 2354 | #define BS_USB_BDTPAGE1_BDTBA (7U) /*!< Bit field size in bits for USB_BDTPAGE1_BDTBA. */ |
Kojto | 90:cb3d968589d8 | 2355 | |
Kojto | 90:cb3d968589d8 | 2356 | /*! @brief Read current value of the USB_BDTPAGE1_BDTBA field. */ |
Kojto | 90:cb3d968589d8 | 2357 | #define BR_USB_BDTPAGE1_BDTBA(x) (HW_USB_BDTPAGE1(x).B.BDTBA) |
Kojto | 90:cb3d968589d8 | 2358 | |
Kojto | 90:cb3d968589d8 | 2359 | /*! @brief Format value for bitfield USB_BDTPAGE1_BDTBA. */ |
Kojto | 90:cb3d968589d8 | 2360 | #define BF_USB_BDTPAGE1_BDTBA(v) ((uint8_t)((uint8_t)(v) << BP_USB_BDTPAGE1_BDTBA) & BM_USB_BDTPAGE1_BDTBA) |
Kojto | 90:cb3d968589d8 | 2361 | |
Kojto | 90:cb3d968589d8 | 2362 | /*! @brief Set the BDTBA field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2363 | #define BW_USB_BDTPAGE1_BDTBA(x, v) (HW_USB_BDTPAGE1_WR(x, (HW_USB_BDTPAGE1_RD(x) & ~BM_USB_BDTPAGE1_BDTBA) | BF_USB_BDTPAGE1_BDTBA(v))) |
Kojto | 90:cb3d968589d8 | 2364 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2365 | |
Kojto | 90:cb3d968589d8 | 2366 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 2367 | * HW_USB_FRMNUML - Frame Number register Low |
Kojto | 90:cb3d968589d8 | 2368 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 2369 | |
Kojto | 90:cb3d968589d8 | 2370 | /*! |
Kojto | 90:cb3d968589d8 | 2371 | * @brief HW_USB_FRMNUML - Frame Number register Low (RW) |
Kojto | 90:cb3d968589d8 | 2372 | * |
Kojto | 90:cb3d968589d8 | 2373 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 2374 | * |
Kojto | 90:cb3d968589d8 | 2375 | * The Frame Number registers (low and high) contain the 11-bit frame number. |
Kojto | 90:cb3d968589d8 | 2376 | * These registers are updated with the current frame number whenever a SOF TOKEN |
Kojto | 90:cb3d968589d8 | 2377 | * is received. |
Kojto | 90:cb3d968589d8 | 2378 | */ |
Kojto | 90:cb3d968589d8 | 2379 | typedef union _hw_usb_frmnuml |
Kojto | 90:cb3d968589d8 | 2380 | { |
Kojto | 90:cb3d968589d8 | 2381 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 2382 | struct _hw_usb_frmnuml_bitfields |
Kojto | 90:cb3d968589d8 | 2383 | { |
Kojto | 90:cb3d968589d8 | 2384 | uint8_t FRM : 8; /*!< [7:0] */ |
Kojto | 90:cb3d968589d8 | 2385 | } B; |
Kojto | 90:cb3d968589d8 | 2386 | } hw_usb_frmnuml_t; |
Kojto | 90:cb3d968589d8 | 2387 | |
Kojto | 90:cb3d968589d8 | 2388 | /*! |
Kojto | 90:cb3d968589d8 | 2389 | * @name Constants and macros for entire USB_FRMNUML register |
Kojto | 90:cb3d968589d8 | 2390 | */ |
Kojto | 90:cb3d968589d8 | 2391 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2392 | #define HW_USB_FRMNUML_ADDR(x) ((x) + 0xA0U) |
Kojto | 90:cb3d968589d8 | 2393 | |
Kojto | 90:cb3d968589d8 | 2394 | #define HW_USB_FRMNUML(x) (*(__IO hw_usb_frmnuml_t *) HW_USB_FRMNUML_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 2395 | #define HW_USB_FRMNUML_RD(x) (HW_USB_FRMNUML(x).U) |
Kojto | 90:cb3d968589d8 | 2396 | #define HW_USB_FRMNUML_WR(x, v) (HW_USB_FRMNUML(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 2397 | #define HW_USB_FRMNUML_SET(x, v) (HW_USB_FRMNUML_WR(x, HW_USB_FRMNUML_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 2398 | #define HW_USB_FRMNUML_CLR(x, v) (HW_USB_FRMNUML_WR(x, HW_USB_FRMNUML_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 2399 | #define HW_USB_FRMNUML_TOG(x, v) (HW_USB_FRMNUML_WR(x, HW_USB_FRMNUML_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 2400 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2401 | |
Kojto | 90:cb3d968589d8 | 2402 | /* |
Kojto | 90:cb3d968589d8 | 2403 | * Constants & macros for individual USB_FRMNUML bitfields |
Kojto | 90:cb3d968589d8 | 2404 | */ |
Kojto | 90:cb3d968589d8 | 2405 | |
Kojto | 90:cb3d968589d8 | 2406 | /*! |
Kojto | 90:cb3d968589d8 | 2407 | * @name Register USB_FRMNUML, field FRM[7:0] (RW) |
Kojto | 90:cb3d968589d8 | 2408 | * |
Kojto | 90:cb3d968589d8 | 2409 | * This 8-bit field and the 3-bit field in the Frame Number Register High are |
Kojto | 90:cb3d968589d8 | 2410 | * used to compute the address where the current Buffer Descriptor Table (BDT) |
Kojto | 90:cb3d968589d8 | 2411 | * resides in system memory. |
Kojto | 90:cb3d968589d8 | 2412 | */ |
Kojto | 90:cb3d968589d8 | 2413 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2414 | #define BP_USB_FRMNUML_FRM (0U) /*!< Bit position for USB_FRMNUML_FRM. */ |
Kojto | 90:cb3d968589d8 | 2415 | #define BM_USB_FRMNUML_FRM (0xFFU) /*!< Bit mask for USB_FRMNUML_FRM. */ |
Kojto | 90:cb3d968589d8 | 2416 | #define BS_USB_FRMNUML_FRM (8U) /*!< Bit field size in bits for USB_FRMNUML_FRM. */ |
Kojto | 90:cb3d968589d8 | 2417 | |
Kojto | 90:cb3d968589d8 | 2418 | /*! @brief Read current value of the USB_FRMNUML_FRM field. */ |
Kojto | 90:cb3d968589d8 | 2419 | #define BR_USB_FRMNUML_FRM(x) (HW_USB_FRMNUML(x).U) |
Kojto | 90:cb3d968589d8 | 2420 | |
Kojto | 90:cb3d968589d8 | 2421 | /*! @brief Format value for bitfield USB_FRMNUML_FRM. */ |
Kojto | 90:cb3d968589d8 | 2422 | #define BF_USB_FRMNUML_FRM(v) ((uint8_t)((uint8_t)(v) << BP_USB_FRMNUML_FRM) & BM_USB_FRMNUML_FRM) |
Kojto | 90:cb3d968589d8 | 2423 | |
Kojto | 90:cb3d968589d8 | 2424 | /*! @brief Set the FRM field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2425 | #define BW_USB_FRMNUML_FRM(x, v) (HW_USB_FRMNUML_WR(x, v)) |
Kojto | 90:cb3d968589d8 | 2426 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2427 | |
Kojto | 90:cb3d968589d8 | 2428 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 2429 | * HW_USB_FRMNUMH - Frame Number register High |
Kojto | 90:cb3d968589d8 | 2430 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 2431 | |
Kojto | 90:cb3d968589d8 | 2432 | /*! |
Kojto | 90:cb3d968589d8 | 2433 | * @brief HW_USB_FRMNUMH - Frame Number register High (RW) |
Kojto | 90:cb3d968589d8 | 2434 | * |
Kojto | 90:cb3d968589d8 | 2435 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 2436 | * |
Kojto | 90:cb3d968589d8 | 2437 | * The Frame Number registers (low and high) contain the 11-bit frame number. |
Kojto | 90:cb3d968589d8 | 2438 | * These registers are updated with the current frame number whenever a SOF TOKEN |
Kojto | 90:cb3d968589d8 | 2439 | * is received. |
Kojto | 90:cb3d968589d8 | 2440 | */ |
Kojto | 90:cb3d968589d8 | 2441 | typedef union _hw_usb_frmnumh |
Kojto | 90:cb3d968589d8 | 2442 | { |
Kojto | 90:cb3d968589d8 | 2443 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 2444 | struct _hw_usb_frmnumh_bitfields |
Kojto | 90:cb3d968589d8 | 2445 | { |
Kojto | 90:cb3d968589d8 | 2446 | uint8_t FRM : 3; /*!< [2:0] */ |
Kojto | 90:cb3d968589d8 | 2447 | uint8_t RESERVED0 : 5; /*!< [7:3] */ |
Kojto | 90:cb3d968589d8 | 2448 | } B; |
Kojto | 90:cb3d968589d8 | 2449 | } hw_usb_frmnumh_t; |
Kojto | 90:cb3d968589d8 | 2450 | |
Kojto | 90:cb3d968589d8 | 2451 | /*! |
Kojto | 90:cb3d968589d8 | 2452 | * @name Constants and macros for entire USB_FRMNUMH register |
Kojto | 90:cb3d968589d8 | 2453 | */ |
Kojto | 90:cb3d968589d8 | 2454 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2455 | #define HW_USB_FRMNUMH_ADDR(x) ((x) + 0xA4U) |
Kojto | 90:cb3d968589d8 | 2456 | |
Kojto | 90:cb3d968589d8 | 2457 | #define HW_USB_FRMNUMH(x) (*(__IO hw_usb_frmnumh_t *) HW_USB_FRMNUMH_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 2458 | #define HW_USB_FRMNUMH_RD(x) (HW_USB_FRMNUMH(x).U) |
Kojto | 90:cb3d968589d8 | 2459 | #define HW_USB_FRMNUMH_WR(x, v) (HW_USB_FRMNUMH(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 2460 | #define HW_USB_FRMNUMH_SET(x, v) (HW_USB_FRMNUMH_WR(x, HW_USB_FRMNUMH_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 2461 | #define HW_USB_FRMNUMH_CLR(x, v) (HW_USB_FRMNUMH_WR(x, HW_USB_FRMNUMH_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 2462 | #define HW_USB_FRMNUMH_TOG(x, v) (HW_USB_FRMNUMH_WR(x, HW_USB_FRMNUMH_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 2463 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2464 | |
Kojto | 90:cb3d968589d8 | 2465 | /* |
Kojto | 90:cb3d968589d8 | 2466 | * Constants & macros for individual USB_FRMNUMH bitfields |
Kojto | 90:cb3d968589d8 | 2467 | */ |
Kojto | 90:cb3d968589d8 | 2468 | |
Kojto | 90:cb3d968589d8 | 2469 | /*! |
Kojto | 90:cb3d968589d8 | 2470 | * @name Register USB_FRMNUMH, field FRM[2:0] (RW) |
Kojto | 90:cb3d968589d8 | 2471 | * |
Kojto | 90:cb3d968589d8 | 2472 | * This 3-bit field and the 8-bit field in the Frame Number Register Low are |
Kojto | 90:cb3d968589d8 | 2473 | * used to compute the address where the current Buffer Descriptor Table (BDT) |
Kojto | 90:cb3d968589d8 | 2474 | * resides in system memory. |
Kojto | 90:cb3d968589d8 | 2475 | */ |
Kojto | 90:cb3d968589d8 | 2476 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2477 | #define BP_USB_FRMNUMH_FRM (0U) /*!< Bit position for USB_FRMNUMH_FRM. */ |
Kojto | 90:cb3d968589d8 | 2478 | #define BM_USB_FRMNUMH_FRM (0x07U) /*!< Bit mask for USB_FRMNUMH_FRM. */ |
Kojto | 90:cb3d968589d8 | 2479 | #define BS_USB_FRMNUMH_FRM (3U) /*!< Bit field size in bits for USB_FRMNUMH_FRM. */ |
Kojto | 90:cb3d968589d8 | 2480 | |
Kojto | 90:cb3d968589d8 | 2481 | /*! @brief Read current value of the USB_FRMNUMH_FRM field. */ |
Kojto | 90:cb3d968589d8 | 2482 | #define BR_USB_FRMNUMH_FRM(x) (HW_USB_FRMNUMH(x).B.FRM) |
Kojto | 90:cb3d968589d8 | 2483 | |
Kojto | 90:cb3d968589d8 | 2484 | /*! @brief Format value for bitfield USB_FRMNUMH_FRM. */ |
Kojto | 90:cb3d968589d8 | 2485 | #define BF_USB_FRMNUMH_FRM(v) ((uint8_t)((uint8_t)(v) << BP_USB_FRMNUMH_FRM) & BM_USB_FRMNUMH_FRM) |
Kojto | 90:cb3d968589d8 | 2486 | |
Kojto | 90:cb3d968589d8 | 2487 | /*! @brief Set the FRM field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2488 | #define BW_USB_FRMNUMH_FRM(x, v) (HW_USB_FRMNUMH_WR(x, (HW_USB_FRMNUMH_RD(x) & ~BM_USB_FRMNUMH_FRM) | BF_USB_FRMNUMH_FRM(v))) |
Kojto | 90:cb3d968589d8 | 2489 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2490 | |
Kojto | 90:cb3d968589d8 | 2491 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 2492 | * HW_USB_TOKEN - Token register |
Kojto | 90:cb3d968589d8 | 2493 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 2494 | |
Kojto | 90:cb3d968589d8 | 2495 | /*! |
Kojto | 90:cb3d968589d8 | 2496 | * @brief HW_USB_TOKEN - Token register (RW) |
Kojto | 90:cb3d968589d8 | 2497 | * |
Kojto | 90:cb3d968589d8 | 2498 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 2499 | * |
Kojto | 90:cb3d968589d8 | 2500 | * Used to initiate USB transactions when in host mode (HOSTMODEEN=1). When the |
Kojto | 90:cb3d968589d8 | 2501 | * software needs to execute a USB transaction to a peripheral, it writes the |
Kojto | 90:cb3d968589d8 | 2502 | * TOKEN type and endpoint to this register. After this register has been written, |
Kojto | 90:cb3d968589d8 | 2503 | * the USB module begins the specified USB transaction to the address contained in |
Kojto | 90:cb3d968589d8 | 2504 | * the address register. The processor core must always check that the |
Kojto | 90:cb3d968589d8 | 2505 | * TOKEN_BUSY bit in the control register is not 1 before writing to the Token Register. |
Kojto | 90:cb3d968589d8 | 2506 | * This ensures that the token commands are not overwritten before they can be |
Kojto | 90:cb3d968589d8 | 2507 | * executed. The address register and endpoint control register 0 are also used when |
Kojto | 90:cb3d968589d8 | 2508 | * performing a token command and therefore must also be written before the |
Kojto | 90:cb3d968589d8 | 2509 | * Token Register. The address register is used to select the USB peripheral address |
Kojto | 90:cb3d968589d8 | 2510 | * transmitted by the token command. The endpoint control register determines the |
Kojto | 90:cb3d968589d8 | 2511 | * handshake and retry policies used during the transfer. |
Kojto | 90:cb3d968589d8 | 2512 | */ |
Kojto | 90:cb3d968589d8 | 2513 | typedef union _hw_usb_token |
Kojto | 90:cb3d968589d8 | 2514 | { |
Kojto | 90:cb3d968589d8 | 2515 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 2516 | struct _hw_usb_token_bitfields |
Kojto | 90:cb3d968589d8 | 2517 | { |
Kojto | 90:cb3d968589d8 | 2518 | uint8_t TOKENENDPT : 4; /*!< [3:0] */ |
Kojto | 90:cb3d968589d8 | 2519 | uint8_t TOKENPID : 4; /*!< [7:4] */ |
Kojto | 90:cb3d968589d8 | 2520 | } B; |
Kojto | 90:cb3d968589d8 | 2521 | } hw_usb_token_t; |
Kojto | 90:cb3d968589d8 | 2522 | |
Kojto | 90:cb3d968589d8 | 2523 | /*! |
Kojto | 90:cb3d968589d8 | 2524 | * @name Constants and macros for entire USB_TOKEN register |
Kojto | 90:cb3d968589d8 | 2525 | */ |
Kojto | 90:cb3d968589d8 | 2526 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2527 | #define HW_USB_TOKEN_ADDR(x) ((x) + 0xA8U) |
Kojto | 90:cb3d968589d8 | 2528 | |
Kojto | 90:cb3d968589d8 | 2529 | #define HW_USB_TOKEN(x) (*(__IO hw_usb_token_t *) HW_USB_TOKEN_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 2530 | #define HW_USB_TOKEN_RD(x) (HW_USB_TOKEN(x).U) |
Kojto | 90:cb3d968589d8 | 2531 | #define HW_USB_TOKEN_WR(x, v) (HW_USB_TOKEN(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 2532 | #define HW_USB_TOKEN_SET(x, v) (HW_USB_TOKEN_WR(x, HW_USB_TOKEN_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 2533 | #define HW_USB_TOKEN_CLR(x, v) (HW_USB_TOKEN_WR(x, HW_USB_TOKEN_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 2534 | #define HW_USB_TOKEN_TOG(x, v) (HW_USB_TOKEN_WR(x, HW_USB_TOKEN_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 2535 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2536 | |
Kojto | 90:cb3d968589d8 | 2537 | /* |
Kojto | 90:cb3d968589d8 | 2538 | * Constants & macros for individual USB_TOKEN bitfields |
Kojto | 90:cb3d968589d8 | 2539 | */ |
Kojto | 90:cb3d968589d8 | 2540 | |
Kojto | 90:cb3d968589d8 | 2541 | /*! |
Kojto | 90:cb3d968589d8 | 2542 | * @name Register USB_TOKEN, field TOKENENDPT[3:0] (RW) |
Kojto | 90:cb3d968589d8 | 2543 | * |
Kojto | 90:cb3d968589d8 | 2544 | * Holds the Endpoint address for the token command. The four bit value written |
Kojto | 90:cb3d968589d8 | 2545 | * must be a valid endpoint. |
Kojto | 90:cb3d968589d8 | 2546 | */ |
Kojto | 90:cb3d968589d8 | 2547 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2548 | #define BP_USB_TOKEN_TOKENENDPT (0U) /*!< Bit position for USB_TOKEN_TOKENENDPT. */ |
Kojto | 90:cb3d968589d8 | 2549 | #define BM_USB_TOKEN_TOKENENDPT (0x0FU) /*!< Bit mask for USB_TOKEN_TOKENENDPT. */ |
Kojto | 90:cb3d968589d8 | 2550 | #define BS_USB_TOKEN_TOKENENDPT (4U) /*!< Bit field size in bits for USB_TOKEN_TOKENENDPT. */ |
Kojto | 90:cb3d968589d8 | 2551 | |
Kojto | 90:cb3d968589d8 | 2552 | /*! @brief Read current value of the USB_TOKEN_TOKENENDPT field. */ |
Kojto | 90:cb3d968589d8 | 2553 | #define BR_USB_TOKEN_TOKENENDPT(x) (HW_USB_TOKEN(x).B.TOKENENDPT) |
Kojto | 90:cb3d968589d8 | 2554 | |
Kojto | 90:cb3d968589d8 | 2555 | /*! @brief Format value for bitfield USB_TOKEN_TOKENENDPT. */ |
Kojto | 90:cb3d968589d8 | 2556 | #define BF_USB_TOKEN_TOKENENDPT(v) ((uint8_t)((uint8_t)(v) << BP_USB_TOKEN_TOKENENDPT) & BM_USB_TOKEN_TOKENENDPT) |
Kojto | 90:cb3d968589d8 | 2557 | |
Kojto | 90:cb3d968589d8 | 2558 | /*! @brief Set the TOKENENDPT field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2559 | #define BW_USB_TOKEN_TOKENENDPT(x, v) (HW_USB_TOKEN_WR(x, (HW_USB_TOKEN_RD(x) & ~BM_USB_TOKEN_TOKENENDPT) | BF_USB_TOKEN_TOKENENDPT(v))) |
Kojto | 90:cb3d968589d8 | 2560 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2561 | |
Kojto | 90:cb3d968589d8 | 2562 | /*! |
Kojto | 90:cb3d968589d8 | 2563 | * @name Register USB_TOKEN, field TOKENPID[7:4] (RW) |
Kojto | 90:cb3d968589d8 | 2564 | * |
Kojto | 90:cb3d968589d8 | 2565 | * Contains the token type executed by the USB module. |
Kojto | 90:cb3d968589d8 | 2566 | * |
Kojto | 90:cb3d968589d8 | 2567 | * Values: |
Kojto | 90:cb3d968589d8 | 2568 | * - 0001 - OUT Token. USB Module performs an OUT (TX) transaction. |
Kojto | 90:cb3d968589d8 | 2569 | * - 1001 - IN Token. USB Module performs an In (RX) transaction. |
Kojto | 90:cb3d968589d8 | 2570 | * - 1101 - SETUP Token. USB Module performs a SETUP (TX) transaction |
Kojto | 90:cb3d968589d8 | 2571 | */ |
Kojto | 90:cb3d968589d8 | 2572 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2573 | #define BP_USB_TOKEN_TOKENPID (4U) /*!< Bit position for USB_TOKEN_TOKENPID. */ |
Kojto | 90:cb3d968589d8 | 2574 | #define BM_USB_TOKEN_TOKENPID (0xF0U) /*!< Bit mask for USB_TOKEN_TOKENPID. */ |
Kojto | 90:cb3d968589d8 | 2575 | #define BS_USB_TOKEN_TOKENPID (4U) /*!< Bit field size in bits for USB_TOKEN_TOKENPID. */ |
Kojto | 90:cb3d968589d8 | 2576 | |
Kojto | 90:cb3d968589d8 | 2577 | /*! @brief Read current value of the USB_TOKEN_TOKENPID field. */ |
Kojto | 90:cb3d968589d8 | 2578 | #define BR_USB_TOKEN_TOKENPID(x) (HW_USB_TOKEN(x).B.TOKENPID) |
Kojto | 90:cb3d968589d8 | 2579 | |
Kojto | 90:cb3d968589d8 | 2580 | /*! @brief Format value for bitfield USB_TOKEN_TOKENPID. */ |
Kojto | 90:cb3d968589d8 | 2581 | #define BF_USB_TOKEN_TOKENPID(v) ((uint8_t)((uint8_t)(v) << BP_USB_TOKEN_TOKENPID) & BM_USB_TOKEN_TOKENPID) |
Kojto | 90:cb3d968589d8 | 2582 | |
Kojto | 90:cb3d968589d8 | 2583 | /*! @brief Set the TOKENPID field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2584 | #define BW_USB_TOKEN_TOKENPID(x, v) (HW_USB_TOKEN_WR(x, (HW_USB_TOKEN_RD(x) & ~BM_USB_TOKEN_TOKENPID) | BF_USB_TOKEN_TOKENPID(v))) |
Kojto | 90:cb3d968589d8 | 2585 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2586 | |
Kojto | 90:cb3d968589d8 | 2587 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 2588 | * HW_USB_SOFTHLD - SOF Threshold register |
Kojto | 90:cb3d968589d8 | 2589 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 2590 | |
Kojto | 90:cb3d968589d8 | 2591 | /*! |
Kojto | 90:cb3d968589d8 | 2592 | * @brief HW_USB_SOFTHLD - SOF Threshold register (RW) |
Kojto | 90:cb3d968589d8 | 2593 | * |
Kojto | 90:cb3d968589d8 | 2594 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 2595 | * |
Kojto | 90:cb3d968589d8 | 2596 | * The SOF Threshold Register is used only in Host mode (HOSTMODEEN=1). When in |
Kojto | 90:cb3d968589d8 | 2597 | * Host mode, the 14-bit SOF counter counts the interval between SOF frames. The |
Kojto | 90:cb3d968589d8 | 2598 | * SOF must be transmitted every 1ms so therefore the SOF counter is loaded with |
Kojto | 90:cb3d968589d8 | 2599 | * a value of 12000. When the SOF counter reaches zero, a Start Of Frame (SOF) |
Kojto | 90:cb3d968589d8 | 2600 | * token is transmitted. The SOF threshold register is used to program the number |
Kojto | 90:cb3d968589d8 | 2601 | * of USB byte times before the SOF to stop initiating token packet transactions. |
Kojto | 90:cb3d968589d8 | 2602 | * This register must be set to a value that ensures that other packets are not |
Kojto | 90:cb3d968589d8 | 2603 | * actively being transmitted when the SOF time counts to zero. When the SOF |
Kojto | 90:cb3d968589d8 | 2604 | * counter reaches the threshold value, no more tokens are transmitted until after the |
Kojto | 90:cb3d968589d8 | 2605 | * SOF has been transmitted. The value programmed into the threshold register |
Kojto | 90:cb3d968589d8 | 2606 | * must reserve enough time to ensure the worst case transaction completes. In |
Kojto | 90:cb3d968589d8 | 2607 | * general the worst case transaction is an IN token followed by a data packet from |
Kojto | 90:cb3d968589d8 | 2608 | * the target followed by the response from the host. The actual time required is |
Kojto | 90:cb3d968589d8 | 2609 | * a function of the maximum packet size on the bus. Typical values for the SOF |
Kojto | 90:cb3d968589d8 | 2610 | * threshold are: 64-byte packets=74; 32-byte packets=42; 16-byte packets=26; |
Kojto | 90:cb3d968589d8 | 2611 | * 8-byte packets=18. |
Kojto | 90:cb3d968589d8 | 2612 | */ |
Kojto | 90:cb3d968589d8 | 2613 | typedef union _hw_usb_softhld |
Kojto | 90:cb3d968589d8 | 2614 | { |
Kojto | 90:cb3d968589d8 | 2615 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 2616 | struct _hw_usb_softhld_bitfields |
Kojto | 90:cb3d968589d8 | 2617 | { |
Kojto | 90:cb3d968589d8 | 2618 | uint8_t CNT : 8; /*!< [7:0] */ |
Kojto | 90:cb3d968589d8 | 2619 | } B; |
Kojto | 90:cb3d968589d8 | 2620 | } hw_usb_softhld_t; |
Kojto | 90:cb3d968589d8 | 2621 | |
Kojto | 90:cb3d968589d8 | 2622 | /*! |
Kojto | 90:cb3d968589d8 | 2623 | * @name Constants and macros for entire USB_SOFTHLD register |
Kojto | 90:cb3d968589d8 | 2624 | */ |
Kojto | 90:cb3d968589d8 | 2625 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2626 | #define HW_USB_SOFTHLD_ADDR(x) ((x) + 0xACU) |
Kojto | 90:cb3d968589d8 | 2627 | |
Kojto | 90:cb3d968589d8 | 2628 | #define HW_USB_SOFTHLD(x) (*(__IO hw_usb_softhld_t *) HW_USB_SOFTHLD_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 2629 | #define HW_USB_SOFTHLD_RD(x) (HW_USB_SOFTHLD(x).U) |
Kojto | 90:cb3d968589d8 | 2630 | #define HW_USB_SOFTHLD_WR(x, v) (HW_USB_SOFTHLD(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 2631 | #define HW_USB_SOFTHLD_SET(x, v) (HW_USB_SOFTHLD_WR(x, HW_USB_SOFTHLD_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 2632 | #define HW_USB_SOFTHLD_CLR(x, v) (HW_USB_SOFTHLD_WR(x, HW_USB_SOFTHLD_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 2633 | #define HW_USB_SOFTHLD_TOG(x, v) (HW_USB_SOFTHLD_WR(x, HW_USB_SOFTHLD_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 2634 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2635 | |
Kojto | 90:cb3d968589d8 | 2636 | /* |
Kojto | 90:cb3d968589d8 | 2637 | * Constants & macros for individual USB_SOFTHLD bitfields |
Kojto | 90:cb3d968589d8 | 2638 | */ |
Kojto | 90:cb3d968589d8 | 2639 | |
Kojto | 90:cb3d968589d8 | 2640 | /*! |
Kojto | 90:cb3d968589d8 | 2641 | * @name Register USB_SOFTHLD, field CNT[7:0] (RW) |
Kojto | 90:cb3d968589d8 | 2642 | * |
Kojto | 90:cb3d968589d8 | 2643 | * Represents the SOF count threshold in byte times. |
Kojto | 90:cb3d968589d8 | 2644 | */ |
Kojto | 90:cb3d968589d8 | 2645 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2646 | #define BP_USB_SOFTHLD_CNT (0U) /*!< Bit position for USB_SOFTHLD_CNT. */ |
Kojto | 90:cb3d968589d8 | 2647 | #define BM_USB_SOFTHLD_CNT (0xFFU) /*!< Bit mask for USB_SOFTHLD_CNT. */ |
Kojto | 90:cb3d968589d8 | 2648 | #define BS_USB_SOFTHLD_CNT (8U) /*!< Bit field size in bits for USB_SOFTHLD_CNT. */ |
Kojto | 90:cb3d968589d8 | 2649 | |
Kojto | 90:cb3d968589d8 | 2650 | /*! @brief Read current value of the USB_SOFTHLD_CNT field. */ |
Kojto | 90:cb3d968589d8 | 2651 | #define BR_USB_SOFTHLD_CNT(x) (HW_USB_SOFTHLD(x).U) |
Kojto | 90:cb3d968589d8 | 2652 | |
Kojto | 90:cb3d968589d8 | 2653 | /*! @brief Format value for bitfield USB_SOFTHLD_CNT. */ |
Kojto | 90:cb3d968589d8 | 2654 | #define BF_USB_SOFTHLD_CNT(v) ((uint8_t)((uint8_t)(v) << BP_USB_SOFTHLD_CNT) & BM_USB_SOFTHLD_CNT) |
Kojto | 90:cb3d968589d8 | 2655 | |
Kojto | 90:cb3d968589d8 | 2656 | /*! @brief Set the CNT field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2657 | #define BW_USB_SOFTHLD_CNT(x, v) (HW_USB_SOFTHLD_WR(x, v)) |
Kojto | 90:cb3d968589d8 | 2658 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2659 | |
Kojto | 90:cb3d968589d8 | 2660 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 2661 | * HW_USB_BDTPAGE2 - BDT Page Register 2 |
Kojto | 90:cb3d968589d8 | 2662 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 2663 | |
Kojto | 90:cb3d968589d8 | 2664 | /*! |
Kojto | 90:cb3d968589d8 | 2665 | * @brief HW_USB_BDTPAGE2 - BDT Page Register 2 (RW) |
Kojto | 90:cb3d968589d8 | 2666 | * |
Kojto | 90:cb3d968589d8 | 2667 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 2668 | * |
Kojto | 90:cb3d968589d8 | 2669 | * Contains an 8-bit value used to compute the address where the current Buffer |
Kojto | 90:cb3d968589d8 | 2670 | * Descriptor Table (BDT) resides in system memory. See Buffer Descriptor Table. |
Kojto | 90:cb3d968589d8 | 2671 | */ |
Kojto | 90:cb3d968589d8 | 2672 | typedef union _hw_usb_bdtpage2 |
Kojto | 90:cb3d968589d8 | 2673 | { |
Kojto | 90:cb3d968589d8 | 2674 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 2675 | struct _hw_usb_bdtpage2_bitfields |
Kojto | 90:cb3d968589d8 | 2676 | { |
Kojto | 90:cb3d968589d8 | 2677 | uint8_t BDTBA : 8; /*!< [7:0] */ |
Kojto | 90:cb3d968589d8 | 2678 | } B; |
Kojto | 90:cb3d968589d8 | 2679 | } hw_usb_bdtpage2_t; |
Kojto | 90:cb3d968589d8 | 2680 | |
Kojto | 90:cb3d968589d8 | 2681 | /*! |
Kojto | 90:cb3d968589d8 | 2682 | * @name Constants and macros for entire USB_BDTPAGE2 register |
Kojto | 90:cb3d968589d8 | 2683 | */ |
Kojto | 90:cb3d968589d8 | 2684 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2685 | #define HW_USB_BDTPAGE2_ADDR(x) ((x) + 0xB0U) |
Kojto | 90:cb3d968589d8 | 2686 | |
Kojto | 90:cb3d968589d8 | 2687 | #define HW_USB_BDTPAGE2(x) (*(__IO hw_usb_bdtpage2_t *) HW_USB_BDTPAGE2_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 2688 | #define HW_USB_BDTPAGE2_RD(x) (HW_USB_BDTPAGE2(x).U) |
Kojto | 90:cb3d968589d8 | 2689 | #define HW_USB_BDTPAGE2_WR(x, v) (HW_USB_BDTPAGE2(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 2690 | #define HW_USB_BDTPAGE2_SET(x, v) (HW_USB_BDTPAGE2_WR(x, HW_USB_BDTPAGE2_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 2691 | #define HW_USB_BDTPAGE2_CLR(x, v) (HW_USB_BDTPAGE2_WR(x, HW_USB_BDTPAGE2_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 2692 | #define HW_USB_BDTPAGE2_TOG(x, v) (HW_USB_BDTPAGE2_WR(x, HW_USB_BDTPAGE2_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 2693 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2694 | |
Kojto | 90:cb3d968589d8 | 2695 | /* |
Kojto | 90:cb3d968589d8 | 2696 | * Constants & macros for individual USB_BDTPAGE2 bitfields |
Kojto | 90:cb3d968589d8 | 2697 | */ |
Kojto | 90:cb3d968589d8 | 2698 | |
Kojto | 90:cb3d968589d8 | 2699 | /*! |
Kojto | 90:cb3d968589d8 | 2700 | * @name Register USB_BDTPAGE2, field BDTBA[7:0] (RW) |
Kojto | 90:cb3d968589d8 | 2701 | * |
Kojto | 90:cb3d968589d8 | 2702 | * Provides address bits 23 through 16 of the BDT base address that defines the |
Kojto | 90:cb3d968589d8 | 2703 | * location of Buffer Descriptor Table resides in system memory. |
Kojto | 90:cb3d968589d8 | 2704 | */ |
Kojto | 90:cb3d968589d8 | 2705 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2706 | #define BP_USB_BDTPAGE2_BDTBA (0U) /*!< Bit position for USB_BDTPAGE2_BDTBA. */ |
Kojto | 90:cb3d968589d8 | 2707 | #define BM_USB_BDTPAGE2_BDTBA (0xFFU) /*!< Bit mask for USB_BDTPAGE2_BDTBA. */ |
Kojto | 90:cb3d968589d8 | 2708 | #define BS_USB_BDTPAGE2_BDTBA (8U) /*!< Bit field size in bits for USB_BDTPAGE2_BDTBA. */ |
Kojto | 90:cb3d968589d8 | 2709 | |
Kojto | 90:cb3d968589d8 | 2710 | /*! @brief Read current value of the USB_BDTPAGE2_BDTBA field. */ |
Kojto | 90:cb3d968589d8 | 2711 | #define BR_USB_BDTPAGE2_BDTBA(x) (HW_USB_BDTPAGE2(x).U) |
Kojto | 90:cb3d968589d8 | 2712 | |
Kojto | 90:cb3d968589d8 | 2713 | /*! @brief Format value for bitfield USB_BDTPAGE2_BDTBA. */ |
Kojto | 90:cb3d968589d8 | 2714 | #define BF_USB_BDTPAGE2_BDTBA(v) ((uint8_t)((uint8_t)(v) << BP_USB_BDTPAGE2_BDTBA) & BM_USB_BDTPAGE2_BDTBA) |
Kojto | 90:cb3d968589d8 | 2715 | |
Kojto | 90:cb3d968589d8 | 2716 | /*! @brief Set the BDTBA field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2717 | #define BW_USB_BDTPAGE2_BDTBA(x, v) (HW_USB_BDTPAGE2_WR(x, v)) |
Kojto | 90:cb3d968589d8 | 2718 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2719 | |
Kojto | 90:cb3d968589d8 | 2720 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 2721 | * HW_USB_BDTPAGE3 - BDT Page Register 3 |
Kojto | 90:cb3d968589d8 | 2722 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 2723 | |
Kojto | 90:cb3d968589d8 | 2724 | /*! |
Kojto | 90:cb3d968589d8 | 2725 | * @brief HW_USB_BDTPAGE3 - BDT Page Register 3 (RW) |
Kojto | 90:cb3d968589d8 | 2726 | * |
Kojto | 90:cb3d968589d8 | 2727 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 2728 | * |
Kojto | 90:cb3d968589d8 | 2729 | * Contains an 8-bit value used to compute the address where the current Buffer |
Kojto | 90:cb3d968589d8 | 2730 | * Descriptor Table (BDT) resides in system memory. See Buffer Descriptor Table. |
Kojto | 90:cb3d968589d8 | 2731 | */ |
Kojto | 90:cb3d968589d8 | 2732 | typedef union _hw_usb_bdtpage3 |
Kojto | 90:cb3d968589d8 | 2733 | { |
Kojto | 90:cb3d968589d8 | 2734 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 2735 | struct _hw_usb_bdtpage3_bitfields |
Kojto | 90:cb3d968589d8 | 2736 | { |
Kojto | 90:cb3d968589d8 | 2737 | uint8_t BDTBA : 8; /*!< [7:0] */ |
Kojto | 90:cb3d968589d8 | 2738 | } B; |
Kojto | 90:cb3d968589d8 | 2739 | } hw_usb_bdtpage3_t; |
Kojto | 90:cb3d968589d8 | 2740 | |
Kojto | 90:cb3d968589d8 | 2741 | /*! |
Kojto | 90:cb3d968589d8 | 2742 | * @name Constants and macros for entire USB_BDTPAGE3 register |
Kojto | 90:cb3d968589d8 | 2743 | */ |
Kojto | 90:cb3d968589d8 | 2744 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2745 | #define HW_USB_BDTPAGE3_ADDR(x) ((x) + 0xB4U) |
Kojto | 90:cb3d968589d8 | 2746 | |
Kojto | 90:cb3d968589d8 | 2747 | #define HW_USB_BDTPAGE3(x) (*(__IO hw_usb_bdtpage3_t *) HW_USB_BDTPAGE3_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 2748 | #define HW_USB_BDTPAGE3_RD(x) (HW_USB_BDTPAGE3(x).U) |
Kojto | 90:cb3d968589d8 | 2749 | #define HW_USB_BDTPAGE3_WR(x, v) (HW_USB_BDTPAGE3(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 2750 | #define HW_USB_BDTPAGE3_SET(x, v) (HW_USB_BDTPAGE3_WR(x, HW_USB_BDTPAGE3_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 2751 | #define HW_USB_BDTPAGE3_CLR(x, v) (HW_USB_BDTPAGE3_WR(x, HW_USB_BDTPAGE3_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 2752 | #define HW_USB_BDTPAGE3_TOG(x, v) (HW_USB_BDTPAGE3_WR(x, HW_USB_BDTPAGE3_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 2753 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2754 | |
Kojto | 90:cb3d968589d8 | 2755 | /* |
Kojto | 90:cb3d968589d8 | 2756 | * Constants & macros for individual USB_BDTPAGE3 bitfields |
Kojto | 90:cb3d968589d8 | 2757 | */ |
Kojto | 90:cb3d968589d8 | 2758 | |
Kojto | 90:cb3d968589d8 | 2759 | /*! |
Kojto | 90:cb3d968589d8 | 2760 | * @name Register USB_BDTPAGE3, field BDTBA[7:0] (RW) |
Kojto | 90:cb3d968589d8 | 2761 | * |
Kojto | 90:cb3d968589d8 | 2762 | * Provides address bits 31 through 24 of the BDT base address that defines the |
Kojto | 90:cb3d968589d8 | 2763 | * location of Buffer Descriptor Table resides in system memory. |
Kojto | 90:cb3d968589d8 | 2764 | */ |
Kojto | 90:cb3d968589d8 | 2765 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2766 | #define BP_USB_BDTPAGE3_BDTBA (0U) /*!< Bit position for USB_BDTPAGE3_BDTBA. */ |
Kojto | 90:cb3d968589d8 | 2767 | #define BM_USB_BDTPAGE3_BDTBA (0xFFU) /*!< Bit mask for USB_BDTPAGE3_BDTBA. */ |
Kojto | 90:cb3d968589d8 | 2768 | #define BS_USB_BDTPAGE3_BDTBA (8U) /*!< Bit field size in bits for USB_BDTPAGE3_BDTBA. */ |
Kojto | 90:cb3d968589d8 | 2769 | |
Kojto | 90:cb3d968589d8 | 2770 | /*! @brief Read current value of the USB_BDTPAGE3_BDTBA field. */ |
Kojto | 90:cb3d968589d8 | 2771 | #define BR_USB_BDTPAGE3_BDTBA(x) (HW_USB_BDTPAGE3(x).U) |
Kojto | 90:cb3d968589d8 | 2772 | |
Kojto | 90:cb3d968589d8 | 2773 | /*! @brief Format value for bitfield USB_BDTPAGE3_BDTBA. */ |
Kojto | 90:cb3d968589d8 | 2774 | #define BF_USB_BDTPAGE3_BDTBA(v) ((uint8_t)((uint8_t)(v) << BP_USB_BDTPAGE3_BDTBA) & BM_USB_BDTPAGE3_BDTBA) |
Kojto | 90:cb3d968589d8 | 2775 | |
Kojto | 90:cb3d968589d8 | 2776 | /*! @brief Set the BDTBA field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2777 | #define BW_USB_BDTPAGE3_BDTBA(x, v) (HW_USB_BDTPAGE3_WR(x, v)) |
Kojto | 90:cb3d968589d8 | 2778 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2779 | |
Kojto | 90:cb3d968589d8 | 2780 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 2781 | * HW_USB_ENDPTn - Endpoint Control register |
Kojto | 90:cb3d968589d8 | 2782 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 2783 | |
Kojto | 90:cb3d968589d8 | 2784 | /*! |
Kojto | 90:cb3d968589d8 | 2785 | * @brief HW_USB_ENDPTn - Endpoint Control register (RW) |
Kojto | 90:cb3d968589d8 | 2786 | * |
Kojto | 90:cb3d968589d8 | 2787 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 2788 | * |
Kojto | 90:cb3d968589d8 | 2789 | * Contains the endpoint control bits for each of the 16 endpoints available |
Kojto | 90:cb3d968589d8 | 2790 | * within the USB module for a decoded address. The format for these registers is |
Kojto | 90:cb3d968589d8 | 2791 | * shown in the following figure. Endpoint 0 (ENDPT0) is associated with control |
Kojto | 90:cb3d968589d8 | 2792 | * pipe 0, which is required for all USB functions. Therefore, after a USBRST |
Kojto | 90:cb3d968589d8 | 2793 | * interrupt occurs the processor core should set ENDPT0 to contain 0x0D. In Host mode |
Kojto | 90:cb3d968589d8 | 2794 | * ENDPT0 is used to determine the handshake, retry and low speed |
Kojto | 90:cb3d968589d8 | 2795 | * characteristics of the host transfer. For Control, Bulk and Interrupt transfers, the EPHSHK |
Kojto | 90:cb3d968589d8 | 2796 | * bit should be 1. For Isochronous transfers it should be 0. Common values to |
Kojto | 90:cb3d968589d8 | 2797 | * use for ENDPT0 in host mode are 0x4D for Control, Bulk, and Interrupt transfers, |
Kojto | 90:cb3d968589d8 | 2798 | * and 0x4C for Isochronous transfers. The three bits EPCTLDIS, EPRXEN, and |
Kojto | 90:cb3d968589d8 | 2799 | * EPTXEN define if an endpoint is enabled and define the direction of the endpoint. |
Kojto | 90:cb3d968589d8 | 2800 | * The endpoint enable/direction control is defined in the following table. |
Kojto | 90:cb3d968589d8 | 2801 | * Endpoint enable and direction control EPCTLDIS EPRXEN EPTXEN Endpoint |
Kojto | 90:cb3d968589d8 | 2802 | * enable/direction control X 0 0 Disable endpoint X 0 1 Enable endpoint for Tx transfers only |
Kojto | 90:cb3d968589d8 | 2803 | * X 1 0 Enable endpoint for Rx transfers only 1 1 1 Enable endpoint for Rx and |
Kojto | 90:cb3d968589d8 | 2804 | * Tx transfers 0 1 1 Enable Endpoint for RX and TX as well as control (SETUP) |
Kojto | 90:cb3d968589d8 | 2805 | * transfers. |
Kojto | 90:cb3d968589d8 | 2806 | */ |
Kojto | 90:cb3d968589d8 | 2807 | typedef union _hw_usb_endptn |
Kojto | 90:cb3d968589d8 | 2808 | { |
Kojto | 90:cb3d968589d8 | 2809 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 2810 | struct _hw_usb_endptn_bitfields |
Kojto | 90:cb3d968589d8 | 2811 | { |
Kojto | 90:cb3d968589d8 | 2812 | uint8_t EPHSHK : 1; /*!< [0] */ |
Kojto | 90:cb3d968589d8 | 2813 | uint8_t EPSTALL : 1; /*!< [1] */ |
Kojto | 90:cb3d968589d8 | 2814 | uint8_t EPTXEN : 1; /*!< [2] */ |
Kojto | 90:cb3d968589d8 | 2815 | uint8_t EPRXEN : 1; /*!< [3] */ |
Kojto | 90:cb3d968589d8 | 2816 | uint8_t EPCTLDIS : 1; /*!< [4] */ |
Kojto | 90:cb3d968589d8 | 2817 | uint8_t RESERVED0 : 1; /*!< [5] */ |
Kojto | 90:cb3d968589d8 | 2818 | uint8_t RETRYDIS : 1; /*!< [6] */ |
Kojto | 90:cb3d968589d8 | 2819 | uint8_t HOSTWOHUB : 1; /*!< [7] */ |
Kojto | 90:cb3d968589d8 | 2820 | } B; |
Kojto | 90:cb3d968589d8 | 2821 | } hw_usb_endptn_t; |
Kojto | 90:cb3d968589d8 | 2822 | |
Kojto | 90:cb3d968589d8 | 2823 | /*! |
Kojto | 90:cb3d968589d8 | 2824 | * @name Constants and macros for entire USB_ENDPTn register |
Kojto | 90:cb3d968589d8 | 2825 | */ |
Kojto | 90:cb3d968589d8 | 2826 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2827 | #define HW_USB_ENDPTn_COUNT (16U) |
Kojto | 90:cb3d968589d8 | 2828 | |
Kojto | 90:cb3d968589d8 | 2829 | #define HW_USB_ENDPTn_ADDR(x, n) ((x) + 0xC0U + (0x4U * (n))) |
Kojto | 90:cb3d968589d8 | 2830 | |
Kojto | 90:cb3d968589d8 | 2831 | #define HW_USB_ENDPTn(x, n) (*(__IO hw_usb_endptn_t *) HW_USB_ENDPTn_ADDR(x, n)) |
Kojto | 90:cb3d968589d8 | 2832 | #define HW_USB_ENDPTn_RD(x, n) (HW_USB_ENDPTn(x, n).U) |
Kojto | 90:cb3d968589d8 | 2833 | #define HW_USB_ENDPTn_WR(x, n, v) (HW_USB_ENDPTn(x, n).U = (v)) |
Kojto | 90:cb3d968589d8 | 2834 | #define HW_USB_ENDPTn_SET(x, n, v) (HW_USB_ENDPTn_WR(x, n, HW_USB_ENDPTn_RD(x, n) | (v))) |
Kojto | 90:cb3d968589d8 | 2835 | #define HW_USB_ENDPTn_CLR(x, n, v) (HW_USB_ENDPTn_WR(x, n, HW_USB_ENDPTn_RD(x, n) & ~(v))) |
Kojto | 90:cb3d968589d8 | 2836 | #define HW_USB_ENDPTn_TOG(x, n, v) (HW_USB_ENDPTn_WR(x, n, HW_USB_ENDPTn_RD(x, n) ^ (v))) |
Kojto | 90:cb3d968589d8 | 2837 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2838 | |
Kojto | 90:cb3d968589d8 | 2839 | /* |
Kojto | 90:cb3d968589d8 | 2840 | * Constants & macros for individual USB_ENDPTn bitfields |
Kojto | 90:cb3d968589d8 | 2841 | */ |
Kojto | 90:cb3d968589d8 | 2842 | |
Kojto | 90:cb3d968589d8 | 2843 | /*! |
Kojto | 90:cb3d968589d8 | 2844 | * @name Register USB_ENDPTn, field EPHSHK[0] (RW) |
Kojto | 90:cb3d968589d8 | 2845 | * |
Kojto | 90:cb3d968589d8 | 2846 | * When set this bit enables an endpoint to perform handshaking during a |
Kojto | 90:cb3d968589d8 | 2847 | * transaction to this endpoint. This bit is generally 1 unless the endpoint is |
Kojto | 90:cb3d968589d8 | 2848 | * Isochronous. |
Kojto | 90:cb3d968589d8 | 2849 | */ |
Kojto | 90:cb3d968589d8 | 2850 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2851 | #define BP_USB_ENDPTn_EPHSHK (0U) /*!< Bit position for USB_ENDPTn_EPHSHK. */ |
Kojto | 90:cb3d968589d8 | 2852 | #define BM_USB_ENDPTn_EPHSHK (0x01U) /*!< Bit mask for USB_ENDPTn_EPHSHK. */ |
Kojto | 90:cb3d968589d8 | 2853 | #define BS_USB_ENDPTn_EPHSHK (1U) /*!< Bit field size in bits for USB_ENDPTn_EPHSHK. */ |
Kojto | 90:cb3d968589d8 | 2854 | |
Kojto | 90:cb3d968589d8 | 2855 | /*! @brief Read current value of the USB_ENDPTn_EPHSHK field. */ |
Kojto | 90:cb3d968589d8 | 2856 | #define BR_USB_ENDPTn_EPHSHK(x, n) (BITBAND_ACCESS8(HW_USB_ENDPTn_ADDR(x, n), BP_USB_ENDPTn_EPHSHK)) |
Kojto | 90:cb3d968589d8 | 2857 | |
Kojto | 90:cb3d968589d8 | 2858 | /*! @brief Format value for bitfield USB_ENDPTn_EPHSHK. */ |
Kojto | 90:cb3d968589d8 | 2859 | #define BF_USB_ENDPTn_EPHSHK(v) ((uint8_t)((uint8_t)(v) << BP_USB_ENDPTn_EPHSHK) & BM_USB_ENDPTn_EPHSHK) |
Kojto | 90:cb3d968589d8 | 2860 | |
Kojto | 90:cb3d968589d8 | 2861 | /*! @brief Set the EPHSHK field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2862 | #define BW_USB_ENDPTn_EPHSHK(x, n, v) (BITBAND_ACCESS8(HW_USB_ENDPTn_ADDR(x, n), BP_USB_ENDPTn_EPHSHK) = (v)) |
Kojto | 90:cb3d968589d8 | 2863 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2864 | |
Kojto | 90:cb3d968589d8 | 2865 | /*! |
Kojto | 90:cb3d968589d8 | 2866 | * @name Register USB_ENDPTn, field EPSTALL[1] (RW) |
Kojto | 90:cb3d968589d8 | 2867 | * |
Kojto | 90:cb3d968589d8 | 2868 | * When set this bit indicates that the endpoint is called. This bit has |
Kojto | 90:cb3d968589d8 | 2869 | * priority over all other control bits in the EndPoint Enable Register, but it is only |
Kojto | 90:cb3d968589d8 | 2870 | * valid if EPTXEN=1 or EPRXEN=1. Any access to this endpoint causes the USB |
Kojto | 90:cb3d968589d8 | 2871 | * Module to return a STALL handshake. After an endpoint is stalled it requires |
Kojto | 90:cb3d968589d8 | 2872 | * intervention from the Host Controller. |
Kojto | 90:cb3d968589d8 | 2873 | */ |
Kojto | 90:cb3d968589d8 | 2874 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2875 | #define BP_USB_ENDPTn_EPSTALL (1U) /*!< Bit position for USB_ENDPTn_EPSTALL. */ |
Kojto | 90:cb3d968589d8 | 2876 | #define BM_USB_ENDPTn_EPSTALL (0x02U) /*!< Bit mask for USB_ENDPTn_EPSTALL. */ |
Kojto | 90:cb3d968589d8 | 2877 | #define BS_USB_ENDPTn_EPSTALL (1U) /*!< Bit field size in bits for USB_ENDPTn_EPSTALL. */ |
Kojto | 90:cb3d968589d8 | 2878 | |
Kojto | 90:cb3d968589d8 | 2879 | /*! @brief Read current value of the USB_ENDPTn_EPSTALL field. */ |
Kojto | 90:cb3d968589d8 | 2880 | #define BR_USB_ENDPTn_EPSTALL(x, n) (BITBAND_ACCESS8(HW_USB_ENDPTn_ADDR(x, n), BP_USB_ENDPTn_EPSTALL)) |
Kojto | 90:cb3d968589d8 | 2881 | |
Kojto | 90:cb3d968589d8 | 2882 | /*! @brief Format value for bitfield USB_ENDPTn_EPSTALL. */ |
Kojto | 90:cb3d968589d8 | 2883 | #define BF_USB_ENDPTn_EPSTALL(v) ((uint8_t)((uint8_t)(v) << BP_USB_ENDPTn_EPSTALL) & BM_USB_ENDPTn_EPSTALL) |
Kojto | 90:cb3d968589d8 | 2884 | |
Kojto | 90:cb3d968589d8 | 2885 | /*! @brief Set the EPSTALL field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2886 | #define BW_USB_ENDPTn_EPSTALL(x, n, v) (BITBAND_ACCESS8(HW_USB_ENDPTn_ADDR(x, n), BP_USB_ENDPTn_EPSTALL) = (v)) |
Kojto | 90:cb3d968589d8 | 2887 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2888 | |
Kojto | 90:cb3d968589d8 | 2889 | /*! |
Kojto | 90:cb3d968589d8 | 2890 | * @name Register USB_ENDPTn, field EPTXEN[2] (RW) |
Kojto | 90:cb3d968589d8 | 2891 | * |
Kojto | 90:cb3d968589d8 | 2892 | * This bit, when set, enables the endpoint for TX transfers. |
Kojto | 90:cb3d968589d8 | 2893 | */ |
Kojto | 90:cb3d968589d8 | 2894 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2895 | #define BP_USB_ENDPTn_EPTXEN (2U) /*!< Bit position for USB_ENDPTn_EPTXEN. */ |
Kojto | 90:cb3d968589d8 | 2896 | #define BM_USB_ENDPTn_EPTXEN (0x04U) /*!< Bit mask for USB_ENDPTn_EPTXEN. */ |
Kojto | 90:cb3d968589d8 | 2897 | #define BS_USB_ENDPTn_EPTXEN (1U) /*!< Bit field size in bits for USB_ENDPTn_EPTXEN. */ |
Kojto | 90:cb3d968589d8 | 2898 | |
Kojto | 90:cb3d968589d8 | 2899 | /*! @brief Read current value of the USB_ENDPTn_EPTXEN field. */ |
Kojto | 90:cb3d968589d8 | 2900 | #define BR_USB_ENDPTn_EPTXEN(x, n) (BITBAND_ACCESS8(HW_USB_ENDPTn_ADDR(x, n), BP_USB_ENDPTn_EPTXEN)) |
Kojto | 90:cb3d968589d8 | 2901 | |
Kojto | 90:cb3d968589d8 | 2902 | /*! @brief Format value for bitfield USB_ENDPTn_EPTXEN. */ |
Kojto | 90:cb3d968589d8 | 2903 | #define BF_USB_ENDPTn_EPTXEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_ENDPTn_EPTXEN) & BM_USB_ENDPTn_EPTXEN) |
Kojto | 90:cb3d968589d8 | 2904 | |
Kojto | 90:cb3d968589d8 | 2905 | /*! @brief Set the EPTXEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2906 | #define BW_USB_ENDPTn_EPTXEN(x, n, v) (BITBAND_ACCESS8(HW_USB_ENDPTn_ADDR(x, n), BP_USB_ENDPTn_EPTXEN) = (v)) |
Kojto | 90:cb3d968589d8 | 2907 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2908 | |
Kojto | 90:cb3d968589d8 | 2909 | /*! |
Kojto | 90:cb3d968589d8 | 2910 | * @name Register USB_ENDPTn, field EPRXEN[3] (RW) |
Kojto | 90:cb3d968589d8 | 2911 | * |
Kojto | 90:cb3d968589d8 | 2912 | * This bit, when set, enables the endpoint for RX transfers. |
Kojto | 90:cb3d968589d8 | 2913 | */ |
Kojto | 90:cb3d968589d8 | 2914 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2915 | #define BP_USB_ENDPTn_EPRXEN (3U) /*!< Bit position for USB_ENDPTn_EPRXEN. */ |
Kojto | 90:cb3d968589d8 | 2916 | #define BM_USB_ENDPTn_EPRXEN (0x08U) /*!< Bit mask for USB_ENDPTn_EPRXEN. */ |
Kojto | 90:cb3d968589d8 | 2917 | #define BS_USB_ENDPTn_EPRXEN (1U) /*!< Bit field size in bits for USB_ENDPTn_EPRXEN. */ |
Kojto | 90:cb3d968589d8 | 2918 | |
Kojto | 90:cb3d968589d8 | 2919 | /*! @brief Read current value of the USB_ENDPTn_EPRXEN field. */ |
Kojto | 90:cb3d968589d8 | 2920 | #define BR_USB_ENDPTn_EPRXEN(x, n) (BITBAND_ACCESS8(HW_USB_ENDPTn_ADDR(x, n), BP_USB_ENDPTn_EPRXEN)) |
Kojto | 90:cb3d968589d8 | 2921 | |
Kojto | 90:cb3d968589d8 | 2922 | /*! @brief Format value for bitfield USB_ENDPTn_EPRXEN. */ |
Kojto | 90:cb3d968589d8 | 2923 | #define BF_USB_ENDPTn_EPRXEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_ENDPTn_EPRXEN) & BM_USB_ENDPTn_EPRXEN) |
Kojto | 90:cb3d968589d8 | 2924 | |
Kojto | 90:cb3d968589d8 | 2925 | /*! @brief Set the EPRXEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2926 | #define BW_USB_ENDPTn_EPRXEN(x, n, v) (BITBAND_ACCESS8(HW_USB_ENDPTn_ADDR(x, n), BP_USB_ENDPTn_EPRXEN) = (v)) |
Kojto | 90:cb3d968589d8 | 2927 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2928 | |
Kojto | 90:cb3d968589d8 | 2929 | /*! |
Kojto | 90:cb3d968589d8 | 2930 | * @name Register USB_ENDPTn, field EPCTLDIS[4] (RW) |
Kojto | 90:cb3d968589d8 | 2931 | * |
Kojto | 90:cb3d968589d8 | 2932 | * This bit, when set, disables control (SETUP) transfers. When cleared, control |
Kojto | 90:cb3d968589d8 | 2933 | * transfers are enabled. This applies if and only if the EPRXEN and EPTXEN bits |
Kojto | 90:cb3d968589d8 | 2934 | * are also set. |
Kojto | 90:cb3d968589d8 | 2935 | */ |
Kojto | 90:cb3d968589d8 | 2936 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2937 | #define BP_USB_ENDPTn_EPCTLDIS (4U) /*!< Bit position for USB_ENDPTn_EPCTLDIS. */ |
Kojto | 90:cb3d968589d8 | 2938 | #define BM_USB_ENDPTn_EPCTLDIS (0x10U) /*!< Bit mask for USB_ENDPTn_EPCTLDIS. */ |
Kojto | 90:cb3d968589d8 | 2939 | #define BS_USB_ENDPTn_EPCTLDIS (1U) /*!< Bit field size in bits for USB_ENDPTn_EPCTLDIS. */ |
Kojto | 90:cb3d968589d8 | 2940 | |
Kojto | 90:cb3d968589d8 | 2941 | /*! @brief Read current value of the USB_ENDPTn_EPCTLDIS field. */ |
Kojto | 90:cb3d968589d8 | 2942 | #define BR_USB_ENDPTn_EPCTLDIS(x, n) (BITBAND_ACCESS8(HW_USB_ENDPTn_ADDR(x, n), BP_USB_ENDPTn_EPCTLDIS)) |
Kojto | 90:cb3d968589d8 | 2943 | |
Kojto | 90:cb3d968589d8 | 2944 | /*! @brief Format value for bitfield USB_ENDPTn_EPCTLDIS. */ |
Kojto | 90:cb3d968589d8 | 2945 | #define BF_USB_ENDPTn_EPCTLDIS(v) ((uint8_t)((uint8_t)(v) << BP_USB_ENDPTn_EPCTLDIS) & BM_USB_ENDPTn_EPCTLDIS) |
Kojto | 90:cb3d968589d8 | 2946 | |
Kojto | 90:cb3d968589d8 | 2947 | /*! @brief Set the EPCTLDIS field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2948 | #define BW_USB_ENDPTn_EPCTLDIS(x, n, v) (BITBAND_ACCESS8(HW_USB_ENDPTn_ADDR(x, n), BP_USB_ENDPTn_EPCTLDIS) = (v)) |
Kojto | 90:cb3d968589d8 | 2949 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2950 | |
Kojto | 90:cb3d968589d8 | 2951 | /*! |
Kojto | 90:cb3d968589d8 | 2952 | * @name Register USB_ENDPTn, field RETRYDIS[6] (RW) |
Kojto | 90:cb3d968589d8 | 2953 | * |
Kojto | 90:cb3d968589d8 | 2954 | * This is a Host mode only bit and is present in the control register for |
Kojto | 90:cb3d968589d8 | 2955 | * endpoint 0 (ENDPT0) only. When set this bit causes the host to not retry NAK'ed |
Kojto | 90:cb3d968589d8 | 2956 | * (Negative Acknowledgement) transactions. When a transaction is NAKed, the BDT PID |
Kojto | 90:cb3d968589d8 | 2957 | * field is updated with the NAK PID, and the TOKEN_DNE interrupt is set. When |
Kojto | 90:cb3d968589d8 | 2958 | * this bit is cleared, NAKed transactions are retried in hardware. This bit must |
Kojto | 90:cb3d968589d8 | 2959 | * be set when the host is attempting to poll an interrupt endpoint. |
Kojto | 90:cb3d968589d8 | 2960 | */ |
Kojto | 90:cb3d968589d8 | 2961 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2962 | #define BP_USB_ENDPTn_RETRYDIS (6U) /*!< Bit position for USB_ENDPTn_RETRYDIS. */ |
Kojto | 90:cb3d968589d8 | 2963 | #define BM_USB_ENDPTn_RETRYDIS (0x40U) /*!< Bit mask for USB_ENDPTn_RETRYDIS. */ |
Kojto | 90:cb3d968589d8 | 2964 | #define BS_USB_ENDPTn_RETRYDIS (1U) /*!< Bit field size in bits for USB_ENDPTn_RETRYDIS. */ |
Kojto | 90:cb3d968589d8 | 2965 | |
Kojto | 90:cb3d968589d8 | 2966 | /*! @brief Read current value of the USB_ENDPTn_RETRYDIS field. */ |
Kojto | 90:cb3d968589d8 | 2967 | #define BR_USB_ENDPTn_RETRYDIS(x, n) (BITBAND_ACCESS8(HW_USB_ENDPTn_ADDR(x, n), BP_USB_ENDPTn_RETRYDIS)) |
Kojto | 90:cb3d968589d8 | 2968 | |
Kojto | 90:cb3d968589d8 | 2969 | /*! @brief Format value for bitfield USB_ENDPTn_RETRYDIS. */ |
Kojto | 90:cb3d968589d8 | 2970 | #define BF_USB_ENDPTn_RETRYDIS(v) ((uint8_t)((uint8_t)(v) << BP_USB_ENDPTn_RETRYDIS) & BM_USB_ENDPTn_RETRYDIS) |
Kojto | 90:cb3d968589d8 | 2971 | |
Kojto | 90:cb3d968589d8 | 2972 | /*! @brief Set the RETRYDIS field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2973 | #define BW_USB_ENDPTn_RETRYDIS(x, n, v) (BITBAND_ACCESS8(HW_USB_ENDPTn_ADDR(x, n), BP_USB_ENDPTn_RETRYDIS) = (v)) |
Kojto | 90:cb3d968589d8 | 2974 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2975 | |
Kojto | 90:cb3d968589d8 | 2976 | /*! |
Kojto | 90:cb3d968589d8 | 2977 | * @name Register USB_ENDPTn, field HOSTWOHUB[7] (RW) |
Kojto | 90:cb3d968589d8 | 2978 | * |
Kojto | 90:cb3d968589d8 | 2979 | * This is a Host mode only field and is present in the control register for |
Kojto | 90:cb3d968589d8 | 2980 | * endpoint 0 (ENDPT0) only. When set this bit allows the host to communicate to a |
Kojto | 90:cb3d968589d8 | 2981 | * directly connected low speed device. When cleared, the host produces the |
Kojto | 90:cb3d968589d8 | 2982 | * PRE_PID. It then switches to low-speed signaling when sending a token to a low speed |
Kojto | 90:cb3d968589d8 | 2983 | * device as required to communicate with a low speed device through a hub. |
Kojto | 90:cb3d968589d8 | 2984 | */ |
Kojto | 90:cb3d968589d8 | 2985 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 2986 | #define BP_USB_ENDPTn_HOSTWOHUB (7U) /*!< Bit position for USB_ENDPTn_HOSTWOHUB. */ |
Kojto | 90:cb3d968589d8 | 2987 | #define BM_USB_ENDPTn_HOSTWOHUB (0x80U) /*!< Bit mask for USB_ENDPTn_HOSTWOHUB. */ |
Kojto | 90:cb3d968589d8 | 2988 | #define BS_USB_ENDPTn_HOSTWOHUB (1U) /*!< Bit field size in bits for USB_ENDPTn_HOSTWOHUB. */ |
Kojto | 90:cb3d968589d8 | 2989 | |
Kojto | 90:cb3d968589d8 | 2990 | /*! @brief Read current value of the USB_ENDPTn_HOSTWOHUB field. */ |
Kojto | 90:cb3d968589d8 | 2991 | #define BR_USB_ENDPTn_HOSTWOHUB(x, n) (BITBAND_ACCESS8(HW_USB_ENDPTn_ADDR(x, n), BP_USB_ENDPTn_HOSTWOHUB)) |
Kojto | 90:cb3d968589d8 | 2992 | |
Kojto | 90:cb3d968589d8 | 2993 | /*! @brief Format value for bitfield USB_ENDPTn_HOSTWOHUB. */ |
Kojto | 90:cb3d968589d8 | 2994 | #define BF_USB_ENDPTn_HOSTWOHUB(v) ((uint8_t)((uint8_t)(v) << BP_USB_ENDPTn_HOSTWOHUB) & BM_USB_ENDPTn_HOSTWOHUB) |
Kojto | 90:cb3d968589d8 | 2995 | |
Kojto | 90:cb3d968589d8 | 2996 | /*! @brief Set the HOSTWOHUB field to a new value. */ |
Kojto | 90:cb3d968589d8 | 2997 | #define BW_USB_ENDPTn_HOSTWOHUB(x, n, v) (BITBAND_ACCESS8(HW_USB_ENDPTn_ADDR(x, n), BP_USB_ENDPTn_HOSTWOHUB) = (v)) |
Kojto | 90:cb3d968589d8 | 2998 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 2999 | |
Kojto | 90:cb3d968589d8 | 3000 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 3001 | * HW_USB_USBCTRL - USB Control register |
Kojto | 90:cb3d968589d8 | 3002 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 3003 | |
Kojto | 90:cb3d968589d8 | 3004 | /*! |
Kojto | 90:cb3d968589d8 | 3005 | * @brief HW_USB_USBCTRL - USB Control register (RW) |
Kojto | 90:cb3d968589d8 | 3006 | * |
Kojto | 90:cb3d968589d8 | 3007 | * Reset value: 0xC0U |
Kojto | 90:cb3d968589d8 | 3008 | */ |
Kojto | 90:cb3d968589d8 | 3009 | typedef union _hw_usb_usbctrl |
Kojto | 90:cb3d968589d8 | 3010 | { |
Kojto | 90:cb3d968589d8 | 3011 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 3012 | struct _hw_usb_usbctrl_bitfields |
Kojto | 90:cb3d968589d8 | 3013 | { |
Kojto | 90:cb3d968589d8 | 3014 | uint8_t RESERVED0 : 6; /*!< [5:0] */ |
Kojto | 90:cb3d968589d8 | 3015 | uint8_t PDE : 1; /*!< [6] */ |
Kojto | 90:cb3d968589d8 | 3016 | uint8_t SUSP : 1; /*!< [7] */ |
Kojto | 90:cb3d968589d8 | 3017 | } B; |
Kojto | 90:cb3d968589d8 | 3018 | } hw_usb_usbctrl_t; |
Kojto | 90:cb3d968589d8 | 3019 | |
Kojto | 90:cb3d968589d8 | 3020 | /*! |
Kojto | 90:cb3d968589d8 | 3021 | * @name Constants and macros for entire USB_USBCTRL register |
Kojto | 90:cb3d968589d8 | 3022 | */ |
Kojto | 90:cb3d968589d8 | 3023 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3024 | #define HW_USB_USBCTRL_ADDR(x) ((x) + 0x100U) |
Kojto | 90:cb3d968589d8 | 3025 | |
Kojto | 90:cb3d968589d8 | 3026 | #define HW_USB_USBCTRL(x) (*(__IO hw_usb_usbctrl_t *) HW_USB_USBCTRL_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 3027 | #define HW_USB_USBCTRL_RD(x) (HW_USB_USBCTRL(x).U) |
Kojto | 90:cb3d968589d8 | 3028 | #define HW_USB_USBCTRL_WR(x, v) (HW_USB_USBCTRL(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 3029 | #define HW_USB_USBCTRL_SET(x, v) (HW_USB_USBCTRL_WR(x, HW_USB_USBCTRL_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 3030 | #define HW_USB_USBCTRL_CLR(x, v) (HW_USB_USBCTRL_WR(x, HW_USB_USBCTRL_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 3031 | #define HW_USB_USBCTRL_TOG(x, v) (HW_USB_USBCTRL_WR(x, HW_USB_USBCTRL_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 3032 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3033 | |
Kojto | 90:cb3d968589d8 | 3034 | /* |
Kojto | 90:cb3d968589d8 | 3035 | * Constants & macros for individual USB_USBCTRL bitfields |
Kojto | 90:cb3d968589d8 | 3036 | */ |
Kojto | 90:cb3d968589d8 | 3037 | |
Kojto | 90:cb3d968589d8 | 3038 | /*! |
Kojto | 90:cb3d968589d8 | 3039 | * @name Register USB_USBCTRL, field PDE[6] (RW) |
Kojto | 90:cb3d968589d8 | 3040 | * |
Kojto | 90:cb3d968589d8 | 3041 | * Enables the weak pulldowns on the USB transceiver. |
Kojto | 90:cb3d968589d8 | 3042 | * |
Kojto | 90:cb3d968589d8 | 3043 | * Values: |
Kojto | 90:cb3d968589d8 | 3044 | * - 0 - Weak pulldowns are disabled on D+ and D-. |
Kojto | 90:cb3d968589d8 | 3045 | * - 1 - Weak pulldowns are enabled on D+ and D-. |
Kojto | 90:cb3d968589d8 | 3046 | */ |
Kojto | 90:cb3d968589d8 | 3047 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3048 | #define BP_USB_USBCTRL_PDE (6U) /*!< Bit position for USB_USBCTRL_PDE. */ |
Kojto | 90:cb3d968589d8 | 3049 | #define BM_USB_USBCTRL_PDE (0x40U) /*!< Bit mask for USB_USBCTRL_PDE. */ |
Kojto | 90:cb3d968589d8 | 3050 | #define BS_USB_USBCTRL_PDE (1U) /*!< Bit field size in bits for USB_USBCTRL_PDE. */ |
Kojto | 90:cb3d968589d8 | 3051 | |
Kojto | 90:cb3d968589d8 | 3052 | /*! @brief Read current value of the USB_USBCTRL_PDE field. */ |
Kojto | 90:cb3d968589d8 | 3053 | #define BR_USB_USBCTRL_PDE(x) (BITBAND_ACCESS8(HW_USB_USBCTRL_ADDR(x), BP_USB_USBCTRL_PDE)) |
Kojto | 90:cb3d968589d8 | 3054 | |
Kojto | 90:cb3d968589d8 | 3055 | /*! @brief Format value for bitfield USB_USBCTRL_PDE. */ |
Kojto | 90:cb3d968589d8 | 3056 | #define BF_USB_USBCTRL_PDE(v) ((uint8_t)((uint8_t)(v) << BP_USB_USBCTRL_PDE) & BM_USB_USBCTRL_PDE) |
Kojto | 90:cb3d968589d8 | 3057 | |
Kojto | 90:cb3d968589d8 | 3058 | /*! @brief Set the PDE field to a new value. */ |
Kojto | 90:cb3d968589d8 | 3059 | #define BW_USB_USBCTRL_PDE(x, v) (BITBAND_ACCESS8(HW_USB_USBCTRL_ADDR(x), BP_USB_USBCTRL_PDE) = (v)) |
Kojto | 90:cb3d968589d8 | 3060 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3061 | |
Kojto | 90:cb3d968589d8 | 3062 | /*! |
Kojto | 90:cb3d968589d8 | 3063 | * @name Register USB_USBCTRL, field SUSP[7] (RW) |
Kojto | 90:cb3d968589d8 | 3064 | * |
Kojto | 90:cb3d968589d8 | 3065 | * Places the USB transceiver into the suspend state. |
Kojto | 90:cb3d968589d8 | 3066 | * |
Kojto | 90:cb3d968589d8 | 3067 | * Values: |
Kojto | 90:cb3d968589d8 | 3068 | * - 0 - USB transceiver is not in suspend state. |
Kojto | 90:cb3d968589d8 | 3069 | * - 1 - USB transceiver is in suspend state. |
Kojto | 90:cb3d968589d8 | 3070 | */ |
Kojto | 90:cb3d968589d8 | 3071 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3072 | #define BP_USB_USBCTRL_SUSP (7U) /*!< Bit position for USB_USBCTRL_SUSP. */ |
Kojto | 90:cb3d968589d8 | 3073 | #define BM_USB_USBCTRL_SUSP (0x80U) /*!< Bit mask for USB_USBCTRL_SUSP. */ |
Kojto | 90:cb3d968589d8 | 3074 | #define BS_USB_USBCTRL_SUSP (1U) /*!< Bit field size in bits for USB_USBCTRL_SUSP. */ |
Kojto | 90:cb3d968589d8 | 3075 | |
Kojto | 90:cb3d968589d8 | 3076 | /*! @brief Read current value of the USB_USBCTRL_SUSP field. */ |
Kojto | 90:cb3d968589d8 | 3077 | #define BR_USB_USBCTRL_SUSP(x) (BITBAND_ACCESS8(HW_USB_USBCTRL_ADDR(x), BP_USB_USBCTRL_SUSP)) |
Kojto | 90:cb3d968589d8 | 3078 | |
Kojto | 90:cb3d968589d8 | 3079 | /*! @brief Format value for bitfield USB_USBCTRL_SUSP. */ |
Kojto | 90:cb3d968589d8 | 3080 | #define BF_USB_USBCTRL_SUSP(v) ((uint8_t)((uint8_t)(v) << BP_USB_USBCTRL_SUSP) & BM_USB_USBCTRL_SUSP) |
Kojto | 90:cb3d968589d8 | 3081 | |
Kojto | 90:cb3d968589d8 | 3082 | /*! @brief Set the SUSP field to a new value. */ |
Kojto | 90:cb3d968589d8 | 3083 | #define BW_USB_USBCTRL_SUSP(x, v) (BITBAND_ACCESS8(HW_USB_USBCTRL_ADDR(x), BP_USB_USBCTRL_SUSP) = (v)) |
Kojto | 90:cb3d968589d8 | 3084 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3085 | |
Kojto | 90:cb3d968589d8 | 3086 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 3087 | * HW_USB_OBSERVE - USB OTG Observe register |
Kojto | 90:cb3d968589d8 | 3088 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 3089 | |
Kojto | 90:cb3d968589d8 | 3090 | /*! |
Kojto | 90:cb3d968589d8 | 3091 | * @brief HW_USB_OBSERVE - USB OTG Observe register (RO) |
Kojto | 90:cb3d968589d8 | 3092 | * |
Kojto | 90:cb3d968589d8 | 3093 | * Reset value: 0x50U |
Kojto | 90:cb3d968589d8 | 3094 | * |
Kojto | 90:cb3d968589d8 | 3095 | * Provides visibility on the state of the pull-ups and pull-downs at the |
Kojto | 90:cb3d968589d8 | 3096 | * transceiver. Useful when interfacing to an external OTG control module via a serial |
Kojto | 90:cb3d968589d8 | 3097 | * interface. |
Kojto | 90:cb3d968589d8 | 3098 | */ |
Kojto | 90:cb3d968589d8 | 3099 | typedef union _hw_usb_observe |
Kojto | 90:cb3d968589d8 | 3100 | { |
Kojto | 90:cb3d968589d8 | 3101 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 3102 | struct _hw_usb_observe_bitfields |
Kojto | 90:cb3d968589d8 | 3103 | { |
Kojto | 90:cb3d968589d8 | 3104 | uint8_t RESERVED0 : 4; /*!< [3:0] */ |
Kojto | 90:cb3d968589d8 | 3105 | uint8_t DMPD : 1; /*!< [4] */ |
Kojto | 90:cb3d968589d8 | 3106 | uint8_t RESERVED1 : 1; /*!< [5] */ |
Kojto | 90:cb3d968589d8 | 3107 | uint8_t DPPD : 1; /*!< [6] */ |
Kojto | 90:cb3d968589d8 | 3108 | uint8_t DPPU : 1; /*!< [7] */ |
Kojto | 90:cb3d968589d8 | 3109 | } B; |
Kojto | 90:cb3d968589d8 | 3110 | } hw_usb_observe_t; |
Kojto | 90:cb3d968589d8 | 3111 | |
Kojto | 90:cb3d968589d8 | 3112 | /*! |
Kojto | 90:cb3d968589d8 | 3113 | * @name Constants and macros for entire USB_OBSERVE register |
Kojto | 90:cb3d968589d8 | 3114 | */ |
Kojto | 90:cb3d968589d8 | 3115 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3116 | #define HW_USB_OBSERVE_ADDR(x) ((x) + 0x104U) |
Kojto | 90:cb3d968589d8 | 3117 | |
Kojto | 90:cb3d968589d8 | 3118 | #define HW_USB_OBSERVE(x) (*(__I hw_usb_observe_t *) HW_USB_OBSERVE_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 3119 | #define HW_USB_OBSERVE_RD(x) (HW_USB_OBSERVE(x).U) |
Kojto | 90:cb3d968589d8 | 3120 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3121 | |
Kojto | 90:cb3d968589d8 | 3122 | /* |
Kojto | 90:cb3d968589d8 | 3123 | * Constants & macros for individual USB_OBSERVE bitfields |
Kojto | 90:cb3d968589d8 | 3124 | */ |
Kojto | 90:cb3d968589d8 | 3125 | |
Kojto | 90:cb3d968589d8 | 3126 | /*! |
Kojto | 90:cb3d968589d8 | 3127 | * @name Register USB_OBSERVE, field DMPD[4] (RO) |
Kojto | 90:cb3d968589d8 | 3128 | * |
Kojto | 90:cb3d968589d8 | 3129 | * Provides observability of the D- Pulldown enable at the USB transceiver. |
Kojto | 90:cb3d968589d8 | 3130 | * |
Kojto | 90:cb3d968589d8 | 3131 | * Values: |
Kojto | 90:cb3d968589d8 | 3132 | * - 0 - D- pulldown disabled. |
Kojto | 90:cb3d968589d8 | 3133 | * - 1 - D- pulldown enabled. |
Kojto | 90:cb3d968589d8 | 3134 | */ |
Kojto | 90:cb3d968589d8 | 3135 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3136 | #define BP_USB_OBSERVE_DMPD (4U) /*!< Bit position for USB_OBSERVE_DMPD. */ |
Kojto | 90:cb3d968589d8 | 3137 | #define BM_USB_OBSERVE_DMPD (0x10U) /*!< Bit mask for USB_OBSERVE_DMPD. */ |
Kojto | 90:cb3d968589d8 | 3138 | #define BS_USB_OBSERVE_DMPD (1U) /*!< Bit field size in bits for USB_OBSERVE_DMPD. */ |
Kojto | 90:cb3d968589d8 | 3139 | |
Kojto | 90:cb3d968589d8 | 3140 | /*! @brief Read current value of the USB_OBSERVE_DMPD field. */ |
Kojto | 90:cb3d968589d8 | 3141 | #define BR_USB_OBSERVE_DMPD(x) (BITBAND_ACCESS8(HW_USB_OBSERVE_ADDR(x), BP_USB_OBSERVE_DMPD)) |
Kojto | 90:cb3d968589d8 | 3142 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3143 | |
Kojto | 90:cb3d968589d8 | 3144 | /*! |
Kojto | 90:cb3d968589d8 | 3145 | * @name Register USB_OBSERVE, field DPPD[6] (RO) |
Kojto | 90:cb3d968589d8 | 3146 | * |
Kojto | 90:cb3d968589d8 | 3147 | * Provides observability of the D+ Pulldown enable at the USB transceiver. |
Kojto | 90:cb3d968589d8 | 3148 | * |
Kojto | 90:cb3d968589d8 | 3149 | * Values: |
Kojto | 90:cb3d968589d8 | 3150 | * - 0 - D+ pulldown disabled. |
Kojto | 90:cb3d968589d8 | 3151 | * - 1 - D+ pulldown enabled. |
Kojto | 90:cb3d968589d8 | 3152 | */ |
Kojto | 90:cb3d968589d8 | 3153 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3154 | #define BP_USB_OBSERVE_DPPD (6U) /*!< Bit position for USB_OBSERVE_DPPD. */ |
Kojto | 90:cb3d968589d8 | 3155 | #define BM_USB_OBSERVE_DPPD (0x40U) /*!< Bit mask for USB_OBSERVE_DPPD. */ |
Kojto | 90:cb3d968589d8 | 3156 | #define BS_USB_OBSERVE_DPPD (1U) /*!< Bit field size in bits for USB_OBSERVE_DPPD. */ |
Kojto | 90:cb3d968589d8 | 3157 | |
Kojto | 90:cb3d968589d8 | 3158 | /*! @brief Read current value of the USB_OBSERVE_DPPD field. */ |
Kojto | 90:cb3d968589d8 | 3159 | #define BR_USB_OBSERVE_DPPD(x) (BITBAND_ACCESS8(HW_USB_OBSERVE_ADDR(x), BP_USB_OBSERVE_DPPD)) |
Kojto | 90:cb3d968589d8 | 3160 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3161 | |
Kojto | 90:cb3d968589d8 | 3162 | /*! |
Kojto | 90:cb3d968589d8 | 3163 | * @name Register USB_OBSERVE, field DPPU[7] (RO) |
Kojto | 90:cb3d968589d8 | 3164 | * |
Kojto | 90:cb3d968589d8 | 3165 | * Provides observability of the D+ Pullup enable at the USB transceiver. |
Kojto | 90:cb3d968589d8 | 3166 | * |
Kojto | 90:cb3d968589d8 | 3167 | * Values: |
Kojto | 90:cb3d968589d8 | 3168 | * - 0 - D+ pullup disabled. |
Kojto | 90:cb3d968589d8 | 3169 | * - 1 - D+ pullup enabled. |
Kojto | 90:cb3d968589d8 | 3170 | */ |
Kojto | 90:cb3d968589d8 | 3171 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3172 | #define BP_USB_OBSERVE_DPPU (7U) /*!< Bit position for USB_OBSERVE_DPPU. */ |
Kojto | 90:cb3d968589d8 | 3173 | #define BM_USB_OBSERVE_DPPU (0x80U) /*!< Bit mask for USB_OBSERVE_DPPU. */ |
Kojto | 90:cb3d968589d8 | 3174 | #define BS_USB_OBSERVE_DPPU (1U) /*!< Bit field size in bits for USB_OBSERVE_DPPU. */ |
Kojto | 90:cb3d968589d8 | 3175 | |
Kojto | 90:cb3d968589d8 | 3176 | /*! @brief Read current value of the USB_OBSERVE_DPPU field. */ |
Kojto | 90:cb3d968589d8 | 3177 | #define BR_USB_OBSERVE_DPPU(x) (BITBAND_ACCESS8(HW_USB_OBSERVE_ADDR(x), BP_USB_OBSERVE_DPPU)) |
Kojto | 90:cb3d968589d8 | 3178 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3179 | |
Kojto | 90:cb3d968589d8 | 3180 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 3181 | * HW_USB_CONTROL - USB OTG Control register |
Kojto | 90:cb3d968589d8 | 3182 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 3183 | |
Kojto | 90:cb3d968589d8 | 3184 | /*! |
Kojto | 90:cb3d968589d8 | 3185 | * @brief HW_USB_CONTROL - USB OTG Control register (RW) |
Kojto | 90:cb3d968589d8 | 3186 | * |
Kojto | 90:cb3d968589d8 | 3187 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 3188 | */ |
Kojto | 90:cb3d968589d8 | 3189 | typedef union _hw_usb_control |
Kojto | 90:cb3d968589d8 | 3190 | { |
Kojto | 90:cb3d968589d8 | 3191 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 3192 | struct _hw_usb_control_bitfields |
Kojto | 90:cb3d968589d8 | 3193 | { |
Kojto | 90:cb3d968589d8 | 3194 | uint8_t RESERVED0 : 4; /*!< [3:0] */ |
Kojto | 90:cb3d968589d8 | 3195 | uint8_t DPPULLUPNONOTG : 1; /*!< [4] */ |
Kojto | 90:cb3d968589d8 | 3196 | uint8_t RESERVED1 : 3; /*!< [7:5] */ |
Kojto | 90:cb3d968589d8 | 3197 | } B; |
Kojto | 90:cb3d968589d8 | 3198 | } hw_usb_control_t; |
Kojto | 90:cb3d968589d8 | 3199 | |
Kojto | 90:cb3d968589d8 | 3200 | /*! |
Kojto | 90:cb3d968589d8 | 3201 | * @name Constants and macros for entire USB_CONTROL register |
Kojto | 90:cb3d968589d8 | 3202 | */ |
Kojto | 90:cb3d968589d8 | 3203 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3204 | #define HW_USB_CONTROL_ADDR(x) ((x) + 0x108U) |
Kojto | 90:cb3d968589d8 | 3205 | |
Kojto | 90:cb3d968589d8 | 3206 | #define HW_USB_CONTROL(x) (*(__IO hw_usb_control_t *) HW_USB_CONTROL_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 3207 | #define HW_USB_CONTROL_RD(x) (HW_USB_CONTROL(x).U) |
Kojto | 90:cb3d968589d8 | 3208 | #define HW_USB_CONTROL_WR(x, v) (HW_USB_CONTROL(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 3209 | #define HW_USB_CONTROL_SET(x, v) (HW_USB_CONTROL_WR(x, HW_USB_CONTROL_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 3210 | #define HW_USB_CONTROL_CLR(x, v) (HW_USB_CONTROL_WR(x, HW_USB_CONTROL_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 3211 | #define HW_USB_CONTROL_TOG(x, v) (HW_USB_CONTROL_WR(x, HW_USB_CONTROL_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 3212 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3213 | |
Kojto | 90:cb3d968589d8 | 3214 | /* |
Kojto | 90:cb3d968589d8 | 3215 | * Constants & macros for individual USB_CONTROL bitfields |
Kojto | 90:cb3d968589d8 | 3216 | */ |
Kojto | 90:cb3d968589d8 | 3217 | |
Kojto | 90:cb3d968589d8 | 3218 | /*! |
Kojto | 90:cb3d968589d8 | 3219 | * @name Register USB_CONTROL, field DPPULLUPNONOTG[4] (RW) |
Kojto | 90:cb3d968589d8 | 3220 | * |
Kojto | 90:cb3d968589d8 | 3221 | * Provides control of the DP Pullup in USBOTG, if USB is configured in non-OTG |
Kojto | 90:cb3d968589d8 | 3222 | * device mode. |
Kojto | 90:cb3d968589d8 | 3223 | * |
Kojto | 90:cb3d968589d8 | 3224 | * Values: |
Kojto | 90:cb3d968589d8 | 3225 | * - 0 - DP Pullup in non-OTG device mode is not enabled. |
Kojto | 90:cb3d968589d8 | 3226 | * - 1 - DP Pullup in non-OTG device mode is enabled. |
Kojto | 90:cb3d968589d8 | 3227 | */ |
Kojto | 90:cb3d968589d8 | 3228 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3229 | #define BP_USB_CONTROL_DPPULLUPNONOTG (4U) /*!< Bit position for USB_CONTROL_DPPULLUPNONOTG. */ |
Kojto | 90:cb3d968589d8 | 3230 | #define BM_USB_CONTROL_DPPULLUPNONOTG (0x10U) /*!< Bit mask for USB_CONTROL_DPPULLUPNONOTG. */ |
Kojto | 90:cb3d968589d8 | 3231 | #define BS_USB_CONTROL_DPPULLUPNONOTG (1U) /*!< Bit field size in bits for USB_CONTROL_DPPULLUPNONOTG. */ |
Kojto | 90:cb3d968589d8 | 3232 | |
Kojto | 90:cb3d968589d8 | 3233 | /*! @brief Read current value of the USB_CONTROL_DPPULLUPNONOTG field. */ |
Kojto | 90:cb3d968589d8 | 3234 | #define BR_USB_CONTROL_DPPULLUPNONOTG(x) (BITBAND_ACCESS8(HW_USB_CONTROL_ADDR(x), BP_USB_CONTROL_DPPULLUPNONOTG)) |
Kojto | 90:cb3d968589d8 | 3235 | |
Kojto | 90:cb3d968589d8 | 3236 | /*! @brief Format value for bitfield USB_CONTROL_DPPULLUPNONOTG. */ |
Kojto | 90:cb3d968589d8 | 3237 | #define BF_USB_CONTROL_DPPULLUPNONOTG(v) ((uint8_t)((uint8_t)(v) << BP_USB_CONTROL_DPPULLUPNONOTG) & BM_USB_CONTROL_DPPULLUPNONOTG) |
Kojto | 90:cb3d968589d8 | 3238 | |
Kojto | 90:cb3d968589d8 | 3239 | /*! @brief Set the DPPULLUPNONOTG field to a new value. */ |
Kojto | 90:cb3d968589d8 | 3240 | #define BW_USB_CONTROL_DPPULLUPNONOTG(x, v) (BITBAND_ACCESS8(HW_USB_CONTROL_ADDR(x), BP_USB_CONTROL_DPPULLUPNONOTG) = (v)) |
Kojto | 90:cb3d968589d8 | 3241 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3242 | |
Kojto | 90:cb3d968589d8 | 3243 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 3244 | * HW_USB_USBTRC0 - USB Transceiver Control register 0 |
Kojto | 90:cb3d968589d8 | 3245 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 3246 | |
Kojto | 90:cb3d968589d8 | 3247 | /*! |
Kojto | 90:cb3d968589d8 | 3248 | * @brief HW_USB_USBTRC0 - USB Transceiver Control register 0 (RW) |
Kojto | 90:cb3d968589d8 | 3249 | * |
Kojto | 90:cb3d968589d8 | 3250 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 3251 | * |
Kojto | 90:cb3d968589d8 | 3252 | * Includes signals for basic operation of the on-chip USB Full Speed |
Kojto | 90:cb3d968589d8 | 3253 | * transceiver and configuration of the USB data connection that are not otherwise included |
Kojto | 90:cb3d968589d8 | 3254 | * in the USB Full Speed controller registers. |
Kojto | 90:cb3d968589d8 | 3255 | */ |
Kojto | 90:cb3d968589d8 | 3256 | typedef union _hw_usb_usbtrc0 |
Kojto | 90:cb3d968589d8 | 3257 | { |
Kojto | 90:cb3d968589d8 | 3258 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 3259 | struct _hw_usb_usbtrc0_bitfields |
Kojto | 90:cb3d968589d8 | 3260 | { |
Kojto | 90:cb3d968589d8 | 3261 | uint8_t USB_RESUME_INT : 1; /*!< [0] USB Asynchronous Interrupt */ |
Kojto | 90:cb3d968589d8 | 3262 | uint8_t SYNC_DET : 1; /*!< [1] Synchronous USB Interrupt Detect */ |
Kojto | 90:cb3d968589d8 | 3263 | uint8_t USB_CLK_RECOVERY_INT : 1; /*!< [2] Combined USB Clock |
Kojto | 90:cb3d968589d8 | 3264 | * Recovery interrupt status */ |
Kojto | 90:cb3d968589d8 | 3265 | uint8_t RESERVED0 : 2; /*!< [4:3] */ |
Kojto | 90:cb3d968589d8 | 3266 | uint8_t USBRESMEN : 1; /*!< [5] Asynchronous Resume Interrupt Enable |
Kojto | 90:cb3d968589d8 | 3267 | * */ |
Kojto | 90:cb3d968589d8 | 3268 | uint8_t RESERVED1 : 1; /*!< [6] */ |
Kojto | 90:cb3d968589d8 | 3269 | uint8_t USBRESET : 1; /*!< [7] USB Reset */ |
Kojto | 90:cb3d968589d8 | 3270 | } B; |
Kojto | 90:cb3d968589d8 | 3271 | } hw_usb_usbtrc0_t; |
Kojto | 90:cb3d968589d8 | 3272 | |
Kojto | 90:cb3d968589d8 | 3273 | /*! |
Kojto | 90:cb3d968589d8 | 3274 | * @name Constants and macros for entire USB_USBTRC0 register |
Kojto | 90:cb3d968589d8 | 3275 | */ |
Kojto | 90:cb3d968589d8 | 3276 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3277 | #define HW_USB_USBTRC0_ADDR(x) ((x) + 0x10CU) |
Kojto | 90:cb3d968589d8 | 3278 | |
Kojto | 90:cb3d968589d8 | 3279 | #define HW_USB_USBTRC0(x) (*(__IO hw_usb_usbtrc0_t *) HW_USB_USBTRC0_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 3280 | #define HW_USB_USBTRC0_RD(x) (HW_USB_USBTRC0(x).U) |
Kojto | 90:cb3d968589d8 | 3281 | #define HW_USB_USBTRC0_WR(x, v) (HW_USB_USBTRC0(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 3282 | #define HW_USB_USBTRC0_SET(x, v) (HW_USB_USBTRC0_WR(x, HW_USB_USBTRC0_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 3283 | #define HW_USB_USBTRC0_CLR(x, v) (HW_USB_USBTRC0_WR(x, HW_USB_USBTRC0_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 3284 | #define HW_USB_USBTRC0_TOG(x, v) (HW_USB_USBTRC0_WR(x, HW_USB_USBTRC0_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 3285 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3286 | |
Kojto | 90:cb3d968589d8 | 3287 | /* |
Kojto | 90:cb3d968589d8 | 3288 | * Constants & macros for individual USB_USBTRC0 bitfields |
Kojto | 90:cb3d968589d8 | 3289 | */ |
Kojto | 90:cb3d968589d8 | 3290 | |
Kojto | 90:cb3d968589d8 | 3291 | /*! |
Kojto | 90:cb3d968589d8 | 3292 | * @name Register USB_USBTRC0, field USB_RESUME_INT[0] (RO) |
Kojto | 90:cb3d968589d8 | 3293 | * |
Kojto | 90:cb3d968589d8 | 3294 | * Values: |
Kojto | 90:cb3d968589d8 | 3295 | * - 0 - No interrupt was generated. |
Kojto | 90:cb3d968589d8 | 3296 | * - 1 - Interrupt was generated because of the USB asynchronous interrupt. |
Kojto | 90:cb3d968589d8 | 3297 | */ |
Kojto | 90:cb3d968589d8 | 3298 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3299 | #define BP_USB_USBTRC0_USB_RESUME_INT (0U) /*!< Bit position for USB_USBTRC0_USB_RESUME_INT. */ |
Kojto | 90:cb3d968589d8 | 3300 | #define BM_USB_USBTRC0_USB_RESUME_INT (0x01U) /*!< Bit mask for USB_USBTRC0_USB_RESUME_INT. */ |
Kojto | 90:cb3d968589d8 | 3301 | #define BS_USB_USBTRC0_USB_RESUME_INT (1U) /*!< Bit field size in bits for USB_USBTRC0_USB_RESUME_INT. */ |
Kojto | 90:cb3d968589d8 | 3302 | |
Kojto | 90:cb3d968589d8 | 3303 | /*! @brief Read current value of the USB_USBTRC0_USB_RESUME_INT field. */ |
Kojto | 90:cb3d968589d8 | 3304 | #define BR_USB_USBTRC0_USB_RESUME_INT(x) (BITBAND_ACCESS8(HW_USB_USBTRC0_ADDR(x), BP_USB_USBTRC0_USB_RESUME_INT)) |
Kojto | 90:cb3d968589d8 | 3305 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3306 | |
Kojto | 90:cb3d968589d8 | 3307 | /*! |
Kojto | 90:cb3d968589d8 | 3308 | * @name Register USB_USBTRC0, field SYNC_DET[1] (RO) |
Kojto | 90:cb3d968589d8 | 3309 | * |
Kojto | 90:cb3d968589d8 | 3310 | * Values: |
Kojto | 90:cb3d968589d8 | 3311 | * - 0 - Synchronous interrupt has not been detected. |
Kojto | 90:cb3d968589d8 | 3312 | * - 1 - Synchronous interrupt has been detected. |
Kojto | 90:cb3d968589d8 | 3313 | */ |
Kojto | 90:cb3d968589d8 | 3314 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3315 | #define BP_USB_USBTRC0_SYNC_DET (1U) /*!< Bit position for USB_USBTRC0_SYNC_DET. */ |
Kojto | 90:cb3d968589d8 | 3316 | #define BM_USB_USBTRC0_SYNC_DET (0x02U) /*!< Bit mask for USB_USBTRC0_SYNC_DET. */ |
Kojto | 90:cb3d968589d8 | 3317 | #define BS_USB_USBTRC0_SYNC_DET (1U) /*!< Bit field size in bits for USB_USBTRC0_SYNC_DET. */ |
Kojto | 90:cb3d968589d8 | 3318 | |
Kojto | 90:cb3d968589d8 | 3319 | /*! @brief Read current value of the USB_USBTRC0_SYNC_DET field. */ |
Kojto | 90:cb3d968589d8 | 3320 | #define BR_USB_USBTRC0_SYNC_DET(x) (BITBAND_ACCESS8(HW_USB_USBTRC0_ADDR(x), BP_USB_USBTRC0_SYNC_DET)) |
Kojto | 90:cb3d968589d8 | 3321 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3322 | |
Kojto | 90:cb3d968589d8 | 3323 | /*! |
Kojto | 90:cb3d968589d8 | 3324 | * @name Register USB_USBTRC0, field USB_CLK_RECOVERY_INT[2] (RO) |
Kojto | 90:cb3d968589d8 | 3325 | * |
Kojto | 90:cb3d968589d8 | 3326 | * This read-only field will be set to value high at 1'b1 when any of USB clock |
Kojto | 90:cb3d968589d8 | 3327 | * recovery interrupt conditions are detected and those interrupts are unmasked. |
Kojto | 90:cb3d968589d8 | 3328 | * For customer use the only unmasked USB clock recovery interrupt condition |
Kojto | 90:cb3d968589d8 | 3329 | * results from an overflow of the frequency trim setting values indicating that the |
Kojto | 90:cb3d968589d8 | 3330 | * frequency trim calculated is out of the adjustment range of the IRC48M output |
Kojto | 90:cb3d968589d8 | 3331 | * clock. To clear this bit after it has been set, Write 0xFF to register |
Kojto | 90:cb3d968589d8 | 3332 | * USB_CLK_RECOVER_INT_STATUS. |
Kojto | 90:cb3d968589d8 | 3333 | */ |
Kojto | 90:cb3d968589d8 | 3334 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3335 | #define BP_USB_USBTRC0_USB_CLK_RECOVERY_INT (2U) /*!< Bit position for USB_USBTRC0_USB_CLK_RECOVERY_INT. */ |
Kojto | 90:cb3d968589d8 | 3336 | #define BM_USB_USBTRC0_USB_CLK_RECOVERY_INT (0x04U) /*!< Bit mask for USB_USBTRC0_USB_CLK_RECOVERY_INT. */ |
Kojto | 90:cb3d968589d8 | 3337 | #define BS_USB_USBTRC0_USB_CLK_RECOVERY_INT (1U) /*!< Bit field size in bits for USB_USBTRC0_USB_CLK_RECOVERY_INT. */ |
Kojto | 90:cb3d968589d8 | 3338 | |
Kojto | 90:cb3d968589d8 | 3339 | /*! @brief Read current value of the USB_USBTRC0_USB_CLK_RECOVERY_INT field. */ |
Kojto | 90:cb3d968589d8 | 3340 | #define BR_USB_USBTRC0_USB_CLK_RECOVERY_INT(x) (BITBAND_ACCESS8(HW_USB_USBTRC0_ADDR(x), BP_USB_USBTRC0_USB_CLK_RECOVERY_INT)) |
Kojto | 90:cb3d968589d8 | 3341 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3342 | |
Kojto | 90:cb3d968589d8 | 3343 | /*! |
Kojto | 90:cb3d968589d8 | 3344 | * @name Register USB_USBTRC0, field USBRESMEN[5] (RW) |
Kojto | 90:cb3d968589d8 | 3345 | * |
Kojto | 90:cb3d968589d8 | 3346 | * This bit, when set, allows the USB module to send an asynchronous wakeup |
Kojto | 90:cb3d968589d8 | 3347 | * event to the MCU upon detection of resume signaling on the USB bus. The MCU then |
Kojto | 90:cb3d968589d8 | 3348 | * re-enables clocks to the USB module. It is used for low-power suspend mode when |
Kojto | 90:cb3d968589d8 | 3349 | * USB module clocks are stopped or the USB transceiver is in Suspend mode. |
Kojto | 90:cb3d968589d8 | 3350 | * Async wakeup only works in device mode. |
Kojto | 90:cb3d968589d8 | 3351 | * |
Kojto | 90:cb3d968589d8 | 3352 | * Values: |
Kojto | 90:cb3d968589d8 | 3353 | * - 0 - USB asynchronous wakeup from suspend mode disabled. |
Kojto | 90:cb3d968589d8 | 3354 | * - 1 - USB asynchronous wakeup from suspend mode enabled. The asynchronous |
Kojto | 90:cb3d968589d8 | 3355 | * resume interrupt differs from the synchronous resume interrupt in that it |
Kojto | 90:cb3d968589d8 | 3356 | * asynchronously detects K-state using the unfiltered state of the D+ and D- |
Kojto | 90:cb3d968589d8 | 3357 | * pins. This interrupt should only be enabled when the Transceiver is |
Kojto | 90:cb3d968589d8 | 3358 | * suspended. |
Kojto | 90:cb3d968589d8 | 3359 | */ |
Kojto | 90:cb3d968589d8 | 3360 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3361 | #define BP_USB_USBTRC0_USBRESMEN (5U) /*!< Bit position for USB_USBTRC0_USBRESMEN. */ |
Kojto | 90:cb3d968589d8 | 3362 | #define BM_USB_USBTRC0_USBRESMEN (0x20U) /*!< Bit mask for USB_USBTRC0_USBRESMEN. */ |
Kojto | 90:cb3d968589d8 | 3363 | #define BS_USB_USBTRC0_USBRESMEN (1U) /*!< Bit field size in bits for USB_USBTRC0_USBRESMEN. */ |
Kojto | 90:cb3d968589d8 | 3364 | |
Kojto | 90:cb3d968589d8 | 3365 | /*! @brief Read current value of the USB_USBTRC0_USBRESMEN field. */ |
Kojto | 90:cb3d968589d8 | 3366 | #define BR_USB_USBTRC0_USBRESMEN(x) (BITBAND_ACCESS8(HW_USB_USBTRC0_ADDR(x), BP_USB_USBTRC0_USBRESMEN)) |
Kojto | 90:cb3d968589d8 | 3367 | |
Kojto | 90:cb3d968589d8 | 3368 | /*! @brief Format value for bitfield USB_USBTRC0_USBRESMEN. */ |
Kojto | 90:cb3d968589d8 | 3369 | #define BF_USB_USBTRC0_USBRESMEN(v) ((uint8_t)((uint8_t)(v) << BP_USB_USBTRC0_USBRESMEN) & BM_USB_USBTRC0_USBRESMEN) |
Kojto | 90:cb3d968589d8 | 3370 | |
Kojto | 90:cb3d968589d8 | 3371 | /*! @brief Set the USBRESMEN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 3372 | #define BW_USB_USBTRC0_USBRESMEN(x, v) (BITBAND_ACCESS8(HW_USB_USBTRC0_ADDR(x), BP_USB_USBTRC0_USBRESMEN) = (v)) |
Kojto | 90:cb3d968589d8 | 3373 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3374 | |
Kojto | 90:cb3d968589d8 | 3375 | /*! |
Kojto | 90:cb3d968589d8 | 3376 | * @name Register USB_USBTRC0, field USBRESET[7] (WO) |
Kojto | 90:cb3d968589d8 | 3377 | * |
Kojto | 90:cb3d968589d8 | 3378 | * Generates a hard reset to USBOTG. After this bit is set and the reset occurs, |
Kojto | 90:cb3d968589d8 | 3379 | * this bit is automatically cleared. This bit is always read as zero. Wait two |
Kojto | 90:cb3d968589d8 | 3380 | * USB clock cycles after setting this bit. |
Kojto | 90:cb3d968589d8 | 3381 | * |
Kojto | 90:cb3d968589d8 | 3382 | * Values: |
Kojto | 90:cb3d968589d8 | 3383 | * - 0 - Normal USB module operation. |
Kojto | 90:cb3d968589d8 | 3384 | * - 1 - Returns the USB module to its reset state. |
Kojto | 90:cb3d968589d8 | 3385 | */ |
Kojto | 90:cb3d968589d8 | 3386 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3387 | #define BP_USB_USBTRC0_USBRESET (7U) /*!< Bit position for USB_USBTRC0_USBRESET. */ |
Kojto | 90:cb3d968589d8 | 3388 | #define BM_USB_USBTRC0_USBRESET (0x80U) /*!< Bit mask for USB_USBTRC0_USBRESET. */ |
Kojto | 90:cb3d968589d8 | 3389 | #define BS_USB_USBTRC0_USBRESET (1U) /*!< Bit field size in bits for USB_USBTRC0_USBRESET. */ |
Kojto | 90:cb3d968589d8 | 3390 | |
Kojto | 90:cb3d968589d8 | 3391 | /*! @brief Format value for bitfield USB_USBTRC0_USBRESET. */ |
Kojto | 90:cb3d968589d8 | 3392 | #define BF_USB_USBTRC0_USBRESET(v) ((uint8_t)((uint8_t)(v) << BP_USB_USBTRC0_USBRESET) & BM_USB_USBTRC0_USBRESET) |
Kojto | 90:cb3d968589d8 | 3393 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3394 | |
Kojto | 90:cb3d968589d8 | 3395 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 3396 | * HW_USB_USBFRMADJUST - Frame Adjust Register |
Kojto | 90:cb3d968589d8 | 3397 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 3398 | |
Kojto | 90:cb3d968589d8 | 3399 | /*! |
Kojto | 90:cb3d968589d8 | 3400 | * @brief HW_USB_USBFRMADJUST - Frame Adjust Register (RW) |
Kojto | 90:cb3d968589d8 | 3401 | * |
Kojto | 90:cb3d968589d8 | 3402 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 3403 | */ |
Kojto | 90:cb3d968589d8 | 3404 | typedef union _hw_usb_usbfrmadjust |
Kojto | 90:cb3d968589d8 | 3405 | { |
Kojto | 90:cb3d968589d8 | 3406 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 3407 | struct _hw_usb_usbfrmadjust_bitfields |
Kojto | 90:cb3d968589d8 | 3408 | { |
Kojto | 90:cb3d968589d8 | 3409 | uint8_t ADJ : 8; /*!< [7:0] Frame Adjustment */ |
Kojto | 90:cb3d968589d8 | 3410 | } B; |
Kojto | 90:cb3d968589d8 | 3411 | } hw_usb_usbfrmadjust_t; |
Kojto | 90:cb3d968589d8 | 3412 | |
Kojto | 90:cb3d968589d8 | 3413 | /*! |
Kojto | 90:cb3d968589d8 | 3414 | * @name Constants and macros for entire USB_USBFRMADJUST register |
Kojto | 90:cb3d968589d8 | 3415 | */ |
Kojto | 90:cb3d968589d8 | 3416 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3417 | #define HW_USB_USBFRMADJUST_ADDR(x) ((x) + 0x114U) |
Kojto | 90:cb3d968589d8 | 3418 | |
Kojto | 90:cb3d968589d8 | 3419 | #define HW_USB_USBFRMADJUST(x) (*(__IO hw_usb_usbfrmadjust_t *) HW_USB_USBFRMADJUST_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 3420 | #define HW_USB_USBFRMADJUST_RD(x) (HW_USB_USBFRMADJUST(x).U) |
Kojto | 90:cb3d968589d8 | 3421 | #define HW_USB_USBFRMADJUST_WR(x, v) (HW_USB_USBFRMADJUST(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 3422 | #define HW_USB_USBFRMADJUST_SET(x, v) (HW_USB_USBFRMADJUST_WR(x, HW_USB_USBFRMADJUST_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 3423 | #define HW_USB_USBFRMADJUST_CLR(x, v) (HW_USB_USBFRMADJUST_WR(x, HW_USB_USBFRMADJUST_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 3424 | #define HW_USB_USBFRMADJUST_TOG(x, v) (HW_USB_USBFRMADJUST_WR(x, HW_USB_USBFRMADJUST_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 3425 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3426 | |
Kojto | 90:cb3d968589d8 | 3427 | /* |
Kojto | 90:cb3d968589d8 | 3428 | * Constants & macros for individual USB_USBFRMADJUST bitfields |
Kojto | 90:cb3d968589d8 | 3429 | */ |
Kojto | 90:cb3d968589d8 | 3430 | |
Kojto | 90:cb3d968589d8 | 3431 | /*! |
Kojto | 90:cb3d968589d8 | 3432 | * @name Register USB_USBFRMADJUST, field ADJ[7:0] (RW) |
Kojto | 90:cb3d968589d8 | 3433 | * |
Kojto | 90:cb3d968589d8 | 3434 | * In Host mode, the frame adjustment is a twos complement number that adjusts |
Kojto | 90:cb3d968589d8 | 3435 | * the period of each USB frame in 12-MHz clock periods. A SOF is normally |
Kojto | 90:cb3d968589d8 | 3436 | * generated every 12,000 12-MHz clock cycles. The Frame Adjust Register can adjust this |
Kojto | 90:cb3d968589d8 | 3437 | * by -128 to +127 to compensate for inaccuracies in the USB 48-MHz clock. |
Kojto | 90:cb3d968589d8 | 3438 | * Changes to the ADJ bit take effect at the next start of the next frame. |
Kojto | 90:cb3d968589d8 | 3439 | */ |
Kojto | 90:cb3d968589d8 | 3440 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3441 | #define BP_USB_USBFRMADJUST_ADJ (0U) /*!< Bit position for USB_USBFRMADJUST_ADJ. */ |
Kojto | 90:cb3d968589d8 | 3442 | #define BM_USB_USBFRMADJUST_ADJ (0xFFU) /*!< Bit mask for USB_USBFRMADJUST_ADJ. */ |
Kojto | 90:cb3d968589d8 | 3443 | #define BS_USB_USBFRMADJUST_ADJ (8U) /*!< Bit field size in bits for USB_USBFRMADJUST_ADJ. */ |
Kojto | 90:cb3d968589d8 | 3444 | |
Kojto | 90:cb3d968589d8 | 3445 | /*! @brief Read current value of the USB_USBFRMADJUST_ADJ field. */ |
Kojto | 90:cb3d968589d8 | 3446 | #define BR_USB_USBFRMADJUST_ADJ(x) (HW_USB_USBFRMADJUST(x).U) |
Kojto | 90:cb3d968589d8 | 3447 | |
Kojto | 90:cb3d968589d8 | 3448 | /*! @brief Format value for bitfield USB_USBFRMADJUST_ADJ. */ |
Kojto | 90:cb3d968589d8 | 3449 | #define BF_USB_USBFRMADJUST_ADJ(v) ((uint8_t)((uint8_t)(v) << BP_USB_USBFRMADJUST_ADJ) & BM_USB_USBFRMADJUST_ADJ) |
Kojto | 90:cb3d968589d8 | 3450 | |
Kojto | 90:cb3d968589d8 | 3451 | /*! @brief Set the ADJ field to a new value. */ |
Kojto | 90:cb3d968589d8 | 3452 | #define BW_USB_USBFRMADJUST_ADJ(x, v) (HW_USB_USBFRMADJUST_WR(x, v)) |
Kojto | 90:cb3d968589d8 | 3453 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3454 | |
Kojto | 90:cb3d968589d8 | 3455 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 3456 | * HW_USB_CLK_RECOVER_CTRL - USB Clock recovery control |
Kojto | 90:cb3d968589d8 | 3457 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 3458 | |
Kojto | 90:cb3d968589d8 | 3459 | /*! |
Kojto | 90:cb3d968589d8 | 3460 | * @brief HW_USB_CLK_RECOVER_CTRL - USB Clock recovery control (RW) |
Kojto | 90:cb3d968589d8 | 3461 | * |
Kojto | 90:cb3d968589d8 | 3462 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 3463 | * |
Kojto | 90:cb3d968589d8 | 3464 | * Signals in this register control the crystal-less USB clock mode in which the |
Kojto | 90:cb3d968589d8 | 3465 | * internal IRC48M oscillator is tuned to match the clock extracted from the |
Kojto | 90:cb3d968589d8 | 3466 | * incoming USB data stream. The IRC48M internal oscillator module must be enabled |
Kojto | 90:cb3d968589d8 | 3467 | * in register USB_CLK_RECOVER_IRC_EN for this mode. |
Kojto | 90:cb3d968589d8 | 3468 | */ |
Kojto | 90:cb3d968589d8 | 3469 | typedef union _hw_usb_clk_recover_ctrl |
Kojto | 90:cb3d968589d8 | 3470 | { |
Kojto | 90:cb3d968589d8 | 3471 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 3472 | struct _hw_usb_clk_recover_ctrl_bitfields |
Kojto | 90:cb3d968589d8 | 3473 | { |
Kojto | 90:cb3d968589d8 | 3474 | uint8_t RESERVED0 : 5; /*!< [4:0] */ |
Kojto | 90:cb3d968589d8 | 3475 | uint8_t RESTART_IFRTRIM_EN : 1; /*!< [5] Restart from IFR trim value |
Kojto | 90:cb3d968589d8 | 3476 | * */ |
Kojto | 90:cb3d968589d8 | 3477 | uint8_t RESET_RESUME_ROUGH_EN : 1; /*!< [6] Reset/resume to rough |
Kojto | 90:cb3d968589d8 | 3478 | * phase enable */ |
Kojto | 90:cb3d968589d8 | 3479 | uint8_t CLOCK_RECOVER_EN : 1; /*!< [7] Crystal-less USB enable */ |
Kojto | 90:cb3d968589d8 | 3480 | } B; |
Kojto | 90:cb3d968589d8 | 3481 | } hw_usb_clk_recover_ctrl_t; |
Kojto | 90:cb3d968589d8 | 3482 | |
Kojto | 90:cb3d968589d8 | 3483 | /*! |
Kojto | 90:cb3d968589d8 | 3484 | * @name Constants and macros for entire USB_CLK_RECOVER_CTRL register |
Kojto | 90:cb3d968589d8 | 3485 | */ |
Kojto | 90:cb3d968589d8 | 3486 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3487 | #define HW_USB_CLK_RECOVER_CTRL_ADDR(x) ((x) + 0x140U) |
Kojto | 90:cb3d968589d8 | 3488 | |
Kojto | 90:cb3d968589d8 | 3489 | #define HW_USB_CLK_RECOVER_CTRL(x) (*(__IO hw_usb_clk_recover_ctrl_t *) HW_USB_CLK_RECOVER_CTRL_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 3490 | #define HW_USB_CLK_RECOVER_CTRL_RD(x) (HW_USB_CLK_RECOVER_CTRL(x).U) |
Kojto | 90:cb3d968589d8 | 3491 | #define HW_USB_CLK_RECOVER_CTRL_WR(x, v) (HW_USB_CLK_RECOVER_CTRL(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 3492 | #define HW_USB_CLK_RECOVER_CTRL_SET(x, v) (HW_USB_CLK_RECOVER_CTRL_WR(x, HW_USB_CLK_RECOVER_CTRL_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 3493 | #define HW_USB_CLK_RECOVER_CTRL_CLR(x, v) (HW_USB_CLK_RECOVER_CTRL_WR(x, HW_USB_CLK_RECOVER_CTRL_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 3494 | #define HW_USB_CLK_RECOVER_CTRL_TOG(x, v) (HW_USB_CLK_RECOVER_CTRL_WR(x, HW_USB_CLK_RECOVER_CTRL_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 3495 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3496 | |
Kojto | 90:cb3d968589d8 | 3497 | /* |
Kojto | 90:cb3d968589d8 | 3498 | * Constants & macros for individual USB_CLK_RECOVER_CTRL bitfields |
Kojto | 90:cb3d968589d8 | 3499 | */ |
Kojto | 90:cb3d968589d8 | 3500 | |
Kojto | 90:cb3d968589d8 | 3501 | /*! |
Kojto | 90:cb3d968589d8 | 3502 | * @name Register USB_CLK_RECOVER_CTRL, field RESTART_IFRTRIM_EN[5] (RW) |
Kojto | 90:cb3d968589d8 | 3503 | * |
Kojto | 90:cb3d968589d8 | 3504 | * IRC48 has a default trim fine value whose default value is factory trimmed |
Kojto | 90:cb3d968589d8 | 3505 | * (the IFR trim value). Clock recover block tracks the accuracy of the clock 48Mhz |
Kojto | 90:cb3d968589d8 | 3506 | * and keeps updating the trim fine value accordingly |
Kojto | 90:cb3d968589d8 | 3507 | * |
Kojto | 90:cb3d968589d8 | 3508 | * Values: |
Kojto | 90:cb3d968589d8 | 3509 | * - 0 - Trim fine adjustment always works based on the previous updated trim |
Kojto | 90:cb3d968589d8 | 3510 | * fine value (default) |
Kojto | 90:cb3d968589d8 | 3511 | * - 1 - Trim fine restarts from the IFR trim value whenever |
Kojto | 90:cb3d968589d8 | 3512 | * bus_reset/bus_resume is detected or module enable is desasserted |
Kojto | 90:cb3d968589d8 | 3513 | */ |
Kojto | 90:cb3d968589d8 | 3514 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3515 | #define BP_USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN (5U) /*!< Bit position for USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN. */ |
Kojto | 90:cb3d968589d8 | 3516 | #define BM_USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN (0x20U) /*!< Bit mask for USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN. */ |
Kojto | 90:cb3d968589d8 | 3517 | #define BS_USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN (1U) /*!< Bit field size in bits for USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN. */ |
Kojto | 90:cb3d968589d8 | 3518 | |
Kojto | 90:cb3d968589d8 | 3519 | /*! @brief Read current value of the USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN field. */ |
Kojto | 90:cb3d968589d8 | 3520 | #define BR_USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN(x) (BITBAND_ACCESS8(HW_USB_CLK_RECOVER_CTRL_ADDR(x), BP_USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN)) |
Kojto | 90:cb3d968589d8 | 3521 | |
Kojto | 90:cb3d968589d8 | 3522 | /*! @brief Format value for bitfield USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN. */ |
Kojto | 90:cb3d968589d8 | 3523 | #define BF_USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN(v) ((uint8_t)((uint8_t)(v) << BP_USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN) & BM_USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN) |
Kojto | 90:cb3d968589d8 | 3524 | |
Kojto | 90:cb3d968589d8 | 3525 | /*! @brief Set the RESTART_IFRTRIM_EN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 3526 | #define BW_USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN(x, v) (BITBAND_ACCESS8(HW_USB_CLK_RECOVER_CTRL_ADDR(x), BP_USB_CLK_RECOVER_CTRL_RESTART_IFRTRIM_EN) = (v)) |
Kojto | 90:cb3d968589d8 | 3527 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3528 | |
Kojto | 90:cb3d968589d8 | 3529 | /*! |
Kojto | 90:cb3d968589d8 | 3530 | * @name Register USB_CLK_RECOVER_CTRL, field RESET_RESUME_ROUGH_EN[6] (RW) |
Kojto | 90:cb3d968589d8 | 3531 | * |
Kojto | 90:cb3d968589d8 | 3532 | * The clock recovery block tracks the IRC48Mhz to get an accurate 48Mhz clock. |
Kojto | 90:cb3d968589d8 | 3533 | * It has two phases after user enables clock_recover_en bit, rough phase and |
Kojto | 90:cb3d968589d8 | 3534 | * tracking phase. The step to fine tune the IRC 48Mhz by adjusting the trim fine |
Kojto | 90:cb3d968589d8 | 3535 | * value is different during these two phases. The step in rough phase is larger |
Kojto | 90:cb3d968589d8 | 3536 | * than that in tracking phase. Switch back to rough stage whenever USB bus reset |
Kojto | 90:cb3d968589d8 | 3537 | * or bus resume occurs. |
Kojto | 90:cb3d968589d8 | 3538 | * |
Kojto | 90:cb3d968589d8 | 3539 | * Values: |
Kojto | 90:cb3d968589d8 | 3540 | * - 0 - Always works in tracking phase after the 1st time rough to track |
Kojto | 90:cb3d968589d8 | 3541 | * transition (default) |
Kojto | 90:cb3d968589d8 | 3542 | * - 1 - Go back to rough stage whenever bus reset or bus resume occurs |
Kojto | 90:cb3d968589d8 | 3543 | */ |
Kojto | 90:cb3d968589d8 | 3544 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3545 | #define BP_USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN (6U) /*!< Bit position for USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN. */ |
Kojto | 90:cb3d968589d8 | 3546 | #define BM_USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN (0x40U) /*!< Bit mask for USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN. */ |
Kojto | 90:cb3d968589d8 | 3547 | #define BS_USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN (1U) /*!< Bit field size in bits for USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN. */ |
Kojto | 90:cb3d968589d8 | 3548 | |
Kojto | 90:cb3d968589d8 | 3549 | /*! @brief Read current value of the USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN field. */ |
Kojto | 90:cb3d968589d8 | 3550 | #define BR_USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN(x) (BITBAND_ACCESS8(HW_USB_CLK_RECOVER_CTRL_ADDR(x), BP_USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN)) |
Kojto | 90:cb3d968589d8 | 3551 | |
Kojto | 90:cb3d968589d8 | 3552 | /*! @brief Format value for bitfield USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN. */ |
Kojto | 90:cb3d968589d8 | 3553 | #define BF_USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN(v) ((uint8_t)((uint8_t)(v) << BP_USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN) & BM_USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN) |
Kojto | 90:cb3d968589d8 | 3554 | |
Kojto | 90:cb3d968589d8 | 3555 | /*! @brief Set the RESET_RESUME_ROUGH_EN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 3556 | #define BW_USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN(x, v) (BITBAND_ACCESS8(HW_USB_CLK_RECOVER_CTRL_ADDR(x), BP_USB_CLK_RECOVER_CTRL_RESET_RESUME_ROUGH_EN) = (v)) |
Kojto | 90:cb3d968589d8 | 3557 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3558 | |
Kojto | 90:cb3d968589d8 | 3559 | /*! |
Kojto | 90:cb3d968589d8 | 3560 | * @name Register USB_CLK_RECOVER_CTRL, field CLOCK_RECOVER_EN[7] (RW) |
Kojto | 90:cb3d968589d8 | 3561 | * |
Kojto | 90:cb3d968589d8 | 3562 | * This bit must be enabled if user wants to use the crystal-less USB mode for |
Kojto | 90:cb3d968589d8 | 3563 | * the Full Speed USB controller and transceiver. This bit should not be set for |
Kojto | 90:cb3d968589d8 | 3564 | * USB host mode or OTG. |
Kojto | 90:cb3d968589d8 | 3565 | * |
Kojto | 90:cb3d968589d8 | 3566 | * Values: |
Kojto | 90:cb3d968589d8 | 3567 | * - 0 - Disable clock recovery block (default) |
Kojto | 90:cb3d968589d8 | 3568 | * - 1 - Enable clock recovery block |
Kojto | 90:cb3d968589d8 | 3569 | */ |
Kojto | 90:cb3d968589d8 | 3570 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3571 | #define BP_USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN (7U) /*!< Bit position for USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN. */ |
Kojto | 90:cb3d968589d8 | 3572 | #define BM_USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN (0x80U) /*!< Bit mask for USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN. */ |
Kojto | 90:cb3d968589d8 | 3573 | #define BS_USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN (1U) /*!< Bit field size in bits for USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN. */ |
Kojto | 90:cb3d968589d8 | 3574 | |
Kojto | 90:cb3d968589d8 | 3575 | /*! @brief Read current value of the USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN field. */ |
Kojto | 90:cb3d968589d8 | 3576 | #define BR_USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN(x) (BITBAND_ACCESS8(HW_USB_CLK_RECOVER_CTRL_ADDR(x), BP_USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN)) |
Kojto | 90:cb3d968589d8 | 3577 | |
Kojto | 90:cb3d968589d8 | 3578 | /*! @brief Format value for bitfield USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN. */ |
Kojto | 90:cb3d968589d8 | 3579 | #define BF_USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN(v) ((uint8_t)((uint8_t)(v) << BP_USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN) & BM_USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN) |
Kojto | 90:cb3d968589d8 | 3580 | |
Kojto | 90:cb3d968589d8 | 3581 | /*! @brief Set the CLOCK_RECOVER_EN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 3582 | #define BW_USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN(x, v) (BITBAND_ACCESS8(HW_USB_CLK_RECOVER_CTRL_ADDR(x), BP_USB_CLK_RECOVER_CTRL_CLOCK_RECOVER_EN) = (v)) |
Kojto | 90:cb3d968589d8 | 3583 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3584 | |
Kojto | 90:cb3d968589d8 | 3585 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 3586 | * HW_USB_CLK_RECOVER_IRC_EN - IRC48M oscillator enable register |
Kojto | 90:cb3d968589d8 | 3587 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 3588 | |
Kojto | 90:cb3d968589d8 | 3589 | /*! |
Kojto | 90:cb3d968589d8 | 3590 | * @brief HW_USB_CLK_RECOVER_IRC_EN - IRC48M oscillator enable register (RW) |
Kojto | 90:cb3d968589d8 | 3591 | * |
Kojto | 90:cb3d968589d8 | 3592 | * Reset value: 0x01U |
Kojto | 90:cb3d968589d8 | 3593 | * |
Kojto | 90:cb3d968589d8 | 3594 | * Controls basic operation of the on-chip IRC48M module used to produce nominal |
Kojto | 90:cb3d968589d8 | 3595 | * 48MHz clocks for USB crystal-less operation and other functions. See |
Kojto | 90:cb3d968589d8 | 3596 | * additional information about the IRC48M operation in the Clock Distribution chapter. |
Kojto | 90:cb3d968589d8 | 3597 | */ |
Kojto | 90:cb3d968589d8 | 3598 | typedef union _hw_usb_clk_recover_irc_en |
Kojto | 90:cb3d968589d8 | 3599 | { |
Kojto | 90:cb3d968589d8 | 3600 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 3601 | struct _hw_usb_clk_recover_irc_en_bitfields |
Kojto | 90:cb3d968589d8 | 3602 | { |
Kojto | 90:cb3d968589d8 | 3603 | uint8_t REG_EN : 1; /*!< [0] IRC48M regulator enable */ |
Kojto | 90:cb3d968589d8 | 3604 | uint8_t IRC_EN : 1; /*!< [1] IRC48M enable */ |
Kojto | 90:cb3d968589d8 | 3605 | uint8_t RESERVED0 : 6; /*!< [7:2] */ |
Kojto | 90:cb3d968589d8 | 3606 | } B; |
Kojto | 90:cb3d968589d8 | 3607 | } hw_usb_clk_recover_irc_en_t; |
Kojto | 90:cb3d968589d8 | 3608 | |
Kojto | 90:cb3d968589d8 | 3609 | /*! |
Kojto | 90:cb3d968589d8 | 3610 | * @name Constants and macros for entire USB_CLK_RECOVER_IRC_EN register |
Kojto | 90:cb3d968589d8 | 3611 | */ |
Kojto | 90:cb3d968589d8 | 3612 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3613 | #define HW_USB_CLK_RECOVER_IRC_EN_ADDR(x) ((x) + 0x144U) |
Kojto | 90:cb3d968589d8 | 3614 | |
Kojto | 90:cb3d968589d8 | 3615 | #define HW_USB_CLK_RECOVER_IRC_EN(x) (*(__IO hw_usb_clk_recover_irc_en_t *) HW_USB_CLK_RECOVER_IRC_EN_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 3616 | #define HW_USB_CLK_RECOVER_IRC_EN_RD(x) (HW_USB_CLK_RECOVER_IRC_EN(x).U) |
Kojto | 90:cb3d968589d8 | 3617 | #define HW_USB_CLK_RECOVER_IRC_EN_WR(x, v) (HW_USB_CLK_RECOVER_IRC_EN(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 3618 | #define HW_USB_CLK_RECOVER_IRC_EN_SET(x, v) (HW_USB_CLK_RECOVER_IRC_EN_WR(x, HW_USB_CLK_RECOVER_IRC_EN_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 3619 | #define HW_USB_CLK_RECOVER_IRC_EN_CLR(x, v) (HW_USB_CLK_RECOVER_IRC_EN_WR(x, HW_USB_CLK_RECOVER_IRC_EN_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 3620 | #define HW_USB_CLK_RECOVER_IRC_EN_TOG(x, v) (HW_USB_CLK_RECOVER_IRC_EN_WR(x, HW_USB_CLK_RECOVER_IRC_EN_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 3621 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3622 | |
Kojto | 90:cb3d968589d8 | 3623 | /* |
Kojto | 90:cb3d968589d8 | 3624 | * Constants & macros for individual USB_CLK_RECOVER_IRC_EN bitfields |
Kojto | 90:cb3d968589d8 | 3625 | */ |
Kojto | 90:cb3d968589d8 | 3626 | |
Kojto | 90:cb3d968589d8 | 3627 | /*! |
Kojto | 90:cb3d968589d8 | 3628 | * @name Register USB_CLK_RECOVER_IRC_EN, field REG_EN[0] (RW) |
Kojto | 90:cb3d968589d8 | 3629 | * |
Kojto | 90:cb3d968589d8 | 3630 | * This bit is used to enable the local analog regulator for IRC48Mhz module. |
Kojto | 90:cb3d968589d8 | 3631 | * This bit must be set if user wants to use the crystal-less USB clock |
Kojto | 90:cb3d968589d8 | 3632 | * configuration. |
Kojto | 90:cb3d968589d8 | 3633 | * |
Kojto | 90:cb3d968589d8 | 3634 | * Values: |
Kojto | 90:cb3d968589d8 | 3635 | * - 0 - IRC48M local regulator is disabled |
Kojto | 90:cb3d968589d8 | 3636 | * - 1 - IRC48M local regulator is enabled (default) |
Kojto | 90:cb3d968589d8 | 3637 | */ |
Kojto | 90:cb3d968589d8 | 3638 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3639 | #define BP_USB_CLK_RECOVER_IRC_EN_REG_EN (0U) /*!< Bit position for USB_CLK_RECOVER_IRC_EN_REG_EN. */ |
Kojto | 90:cb3d968589d8 | 3640 | #define BM_USB_CLK_RECOVER_IRC_EN_REG_EN (0x01U) /*!< Bit mask for USB_CLK_RECOVER_IRC_EN_REG_EN. */ |
Kojto | 90:cb3d968589d8 | 3641 | #define BS_USB_CLK_RECOVER_IRC_EN_REG_EN (1U) /*!< Bit field size in bits for USB_CLK_RECOVER_IRC_EN_REG_EN. */ |
Kojto | 90:cb3d968589d8 | 3642 | |
Kojto | 90:cb3d968589d8 | 3643 | /*! @brief Read current value of the USB_CLK_RECOVER_IRC_EN_REG_EN field. */ |
Kojto | 90:cb3d968589d8 | 3644 | #define BR_USB_CLK_RECOVER_IRC_EN_REG_EN(x) (BITBAND_ACCESS8(HW_USB_CLK_RECOVER_IRC_EN_ADDR(x), BP_USB_CLK_RECOVER_IRC_EN_REG_EN)) |
Kojto | 90:cb3d968589d8 | 3645 | |
Kojto | 90:cb3d968589d8 | 3646 | /*! @brief Format value for bitfield USB_CLK_RECOVER_IRC_EN_REG_EN. */ |
Kojto | 90:cb3d968589d8 | 3647 | #define BF_USB_CLK_RECOVER_IRC_EN_REG_EN(v) ((uint8_t)((uint8_t)(v) << BP_USB_CLK_RECOVER_IRC_EN_REG_EN) & BM_USB_CLK_RECOVER_IRC_EN_REG_EN) |
Kojto | 90:cb3d968589d8 | 3648 | |
Kojto | 90:cb3d968589d8 | 3649 | /*! @brief Set the REG_EN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 3650 | #define BW_USB_CLK_RECOVER_IRC_EN_REG_EN(x, v) (BITBAND_ACCESS8(HW_USB_CLK_RECOVER_IRC_EN_ADDR(x), BP_USB_CLK_RECOVER_IRC_EN_REG_EN) = (v)) |
Kojto | 90:cb3d968589d8 | 3651 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3652 | |
Kojto | 90:cb3d968589d8 | 3653 | /*! |
Kojto | 90:cb3d968589d8 | 3654 | * @name Register USB_CLK_RECOVER_IRC_EN, field IRC_EN[1] (RW) |
Kojto | 90:cb3d968589d8 | 3655 | * |
Kojto | 90:cb3d968589d8 | 3656 | * This bit is used to enable the on-chip IRC48Mhz module to generate clocks for |
Kojto | 90:cb3d968589d8 | 3657 | * crystal-less USB. It can only be used for FS USB device mode operation. This |
Kojto | 90:cb3d968589d8 | 3658 | * bit must be set before using the crystal-less USB clock configuration. |
Kojto | 90:cb3d968589d8 | 3659 | * |
Kojto | 90:cb3d968589d8 | 3660 | * Values: |
Kojto | 90:cb3d968589d8 | 3661 | * - 0 - Disable the IRC48M module (default) |
Kojto | 90:cb3d968589d8 | 3662 | * - 1 - Enable the IRC48M module |
Kojto | 90:cb3d968589d8 | 3663 | */ |
Kojto | 90:cb3d968589d8 | 3664 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3665 | #define BP_USB_CLK_RECOVER_IRC_EN_IRC_EN (1U) /*!< Bit position for USB_CLK_RECOVER_IRC_EN_IRC_EN. */ |
Kojto | 90:cb3d968589d8 | 3666 | #define BM_USB_CLK_RECOVER_IRC_EN_IRC_EN (0x02U) /*!< Bit mask for USB_CLK_RECOVER_IRC_EN_IRC_EN. */ |
Kojto | 90:cb3d968589d8 | 3667 | #define BS_USB_CLK_RECOVER_IRC_EN_IRC_EN (1U) /*!< Bit field size in bits for USB_CLK_RECOVER_IRC_EN_IRC_EN. */ |
Kojto | 90:cb3d968589d8 | 3668 | |
Kojto | 90:cb3d968589d8 | 3669 | /*! @brief Read current value of the USB_CLK_RECOVER_IRC_EN_IRC_EN field. */ |
Kojto | 90:cb3d968589d8 | 3670 | #define BR_USB_CLK_RECOVER_IRC_EN_IRC_EN(x) (BITBAND_ACCESS8(HW_USB_CLK_RECOVER_IRC_EN_ADDR(x), BP_USB_CLK_RECOVER_IRC_EN_IRC_EN)) |
Kojto | 90:cb3d968589d8 | 3671 | |
Kojto | 90:cb3d968589d8 | 3672 | /*! @brief Format value for bitfield USB_CLK_RECOVER_IRC_EN_IRC_EN. */ |
Kojto | 90:cb3d968589d8 | 3673 | #define BF_USB_CLK_RECOVER_IRC_EN_IRC_EN(v) ((uint8_t)((uint8_t)(v) << BP_USB_CLK_RECOVER_IRC_EN_IRC_EN) & BM_USB_CLK_RECOVER_IRC_EN_IRC_EN) |
Kojto | 90:cb3d968589d8 | 3674 | |
Kojto | 90:cb3d968589d8 | 3675 | /*! @brief Set the IRC_EN field to a new value. */ |
Kojto | 90:cb3d968589d8 | 3676 | #define BW_USB_CLK_RECOVER_IRC_EN_IRC_EN(x, v) (BITBAND_ACCESS8(HW_USB_CLK_RECOVER_IRC_EN_ADDR(x), BP_USB_CLK_RECOVER_IRC_EN_IRC_EN) = (v)) |
Kojto | 90:cb3d968589d8 | 3677 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3678 | |
Kojto | 90:cb3d968589d8 | 3679 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 3680 | * HW_USB_CLK_RECOVER_INT_STATUS - Clock recovery separated interrupt status |
Kojto | 90:cb3d968589d8 | 3681 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 3682 | |
Kojto | 90:cb3d968589d8 | 3683 | /*! |
Kojto | 90:cb3d968589d8 | 3684 | * @brief HW_USB_CLK_RECOVER_INT_STATUS - Clock recovery separated interrupt status (W1C) |
Kojto | 90:cb3d968589d8 | 3685 | * |
Kojto | 90:cb3d968589d8 | 3686 | * Reset value: 0x00U |
Kojto | 90:cb3d968589d8 | 3687 | * |
Kojto | 90:cb3d968589d8 | 3688 | * A Write operation with value high at 1'b1 on any combination of individual |
Kojto | 90:cb3d968589d8 | 3689 | * bits will clear those bits. |
Kojto | 90:cb3d968589d8 | 3690 | */ |
Kojto | 90:cb3d968589d8 | 3691 | typedef union _hw_usb_clk_recover_int_status |
Kojto | 90:cb3d968589d8 | 3692 | { |
Kojto | 90:cb3d968589d8 | 3693 | uint8_t U; |
Kojto | 90:cb3d968589d8 | 3694 | struct _hw_usb_clk_recover_int_status_bitfields |
Kojto | 90:cb3d968589d8 | 3695 | { |
Kojto | 90:cb3d968589d8 | 3696 | uint8_t RESERVED0 : 4; /*!< [3:0] */ |
Kojto | 90:cb3d968589d8 | 3697 | uint8_t OVF_ERROR : 1; /*!< [4] */ |
Kojto | 90:cb3d968589d8 | 3698 | uint8_t RESERVED1 : 3; /*!< [7:5] */ |
Kojto | 90:cb3d968589d8 | 3699 | } B; |
Kojto | 90:cb3d968589d8 | 3700 | } hw_usb_clk_recover_int_status_t; |
Kojto | 90:cb3d968589d8 | 3701 | |
Kojto | 90:cb3d968589d8 | 3702 | /*! |
Kojto | 90:cb3d968589d8 | 3703 | * @name Constants and macros for entire USB_CLK_RECOVER_INT_STATUS register |
Kojto | 90:cb3d968589d8 | 3704 | */ |
Kojto | 90:cb3d968589d8 | 3705 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3706 | #define HW_USB_CLK_RECOVER_INT_STATUS_ADDR(x) ((x) + 0x15CU) |
Kojto | 90:cb3d968589d8 | 3707 | |
Kojto | 90:cb3d968589d8 | 3708 | #define HW_USB_CLK_RECOVER_INT_STATUS(x) (*(__IO hw_usb_clk_recover_int_status_t *) HW_USB_CLK_RECOVER_INT_STATUS_ADDR(x)) |
Kojto | 90:cb3d968589d8 | 3709 | #define HW_USB_CLK_RECOVER_INT_STATUS_RD(x) (HW_USB_CLK_RECOVER_INT_STATUS(x).U) |
Kojto | 90:cb3d968589d8 | 3710 | #define HW_USB_CLK_RECOVER_INT_STATUS_WR(x, v) (HW_USB_CLK_RECOVER_INT_STATUS(x).U = (v)) |
Kojto | 90:cb3d968589d8 | 3711 | #define HW_USB_CLK_RECOVER_INT_STATUS_SET(x, v) (HW_USB_CLK_RECOVER_INT_STATUS_WR(x, HW_USB_CLK_RECOVER_INT_STATUS_RD(x) | (v))) |
Kojto | 90:cb3d968589d8 | 3712 | #define HW_USB_CLK_RECOVER_INT_STATUS_CLR(x, v) (HW_USB_CLK_RECOVER_INT_STATUS_WR(x, HW_USB_CLK_RECOVER_INT_STATUS_RD(x) & ~(v))) |
Kojto | 90:cb3d968589d8 | 3713 | #define HW_USB_CLK_RECOVER_INT_STATUS_TOG(x, v) (HW_USB_CLK_RECOVER_INT_STATUS_WR(x, HW_USB_CLK_RECOVER_INT_STATUS_RD(x) ^ (v))) |
Kojto | 90:cb3d968589d8 | 3714 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3715 | |
Kojto | 90:cb3d968589d8 | 3716 | /* |
Kojto | 90:cb3d968589d8 | 3717 | * Constants & macros for individual USB_CLK_RECOVER_INT_STATUS bitfields |
Kojto | 90:cb3d968589d8 | 3718 | */ |
Kojto | 90:cb3d968589d8 | 3719 | |
Kojto | 90:cb3d968589d8 | 3720 | /*! |
Kojto | 90:cb3d968589d8 | 3721 | * @name Register USB_CLK_RECOVER_INT_STATUS, field OVF_ERROR[4] (W1C) |
Kojto | 90:cb3d968589d8 | 3722 | * |
Kojto | 90:cb3d968589d8 | 3723 | * Indicates that the USB clock recovery algorithm has detected that the |
Kojto | 90:cb3d968589d8 | 3724 | * frequency trim adjustment needed for the IRC48M output clock is outside the available |
Kojto | 90:cb3d968589d8 | 3725 | * TRIM_FINE adjustment range for the IRC48M module. |
Kojto | 90:cb3d968589d8 | 3726 | * |
Kojto | 90:cb3d968589d8 | 3727 | * Values: |
Kojto | 90:cb3d968589d8 | 3728 | * - 0 - No interrupt is reported |
Kojto | 90:cb3d968589d8 | 3729 | * - 1 - Unmasked interrupt has been generated |
Kojto | 90:cb3d968589d8 | 3730 | */ |
Kojto | 90:cb3d968589d8 | 3731 | /*@{*/ |
Kojto | 90:cb3d968589d8 | 3732 | #define BP_USB_CLK_RECOVER_INT_STATUS_OVF_ERROR (4U) /*!< Bit position for USB_CLK_RECOVER_INT_STATUS_OVF_ERROR. */ |
Kojto | 90:cb3d968589d8 | 3733 | #define BM_USB_CLK_RECOVER_INT_STATUS_OVF_ERROR (0x10U) /*!< Bit mask for USB_CLK_RECOVER_INT_STATUS_OVF_ERROR. */ |
Kojto | 90:cb3d968589d8 | 3734 | #define BS_USB_CLK_RECOVER_INT_STATUS_OVF_ERROR (1U) /*!< Bit field size in bits for USB_CLK_RECOVER_INT_STATUS_OVF_ERROR. */ |
Kojto | 90:cb3d968589d8 | 3735 | |
Kojto | 90:cb3d968589d8 | 3736 | /*! @brief Read current value of the USB_CLK_RECOVER_INT_STATUS_OVF_ERROR field. */ |
Kojto | 90:cb3d968589d8 | 3737 | #define BR_USB_CLK_RECOVER_INT_STATUS_OVF_ERROR(x) (BITBAND_ACCESS8(HW_USB_CLK_RECOVER_INT_STATUS_ADDR(x), BP_USB_CLK_RECOVER_INT_STATUS_OVF_ERROR)) |
Kojto | 90:cb3d968589d8 | 3738 | |
Kojto | 90:cb3d968589d8 | 3739 | /*! @brief Format value for bitfield USB_CLK_RECOVER_INT_STATUS_OVF_ERROR. */ |
Kojto | 90:cb3d968589d8 | 3740 | #define BF_USB_CLK_RECOVER_INT_STATUS_OVF_ERROR(v) ((uint8_t)((uint8_t)(v) << BP_USB_CLK_RECOVER_INT_STATUS_OVF_ERROR) & BM_USB_CLK_RECOVER_INT_STATUS_OVF_ERROR) |
Kojto | 90:cb3d968589d8 | 3741 | |
Kojto | 90:cb3d968589d8 | 3742 | /*! @brief Set the OVF_ERROR field to a new value. */ |
Kojto | 90:cb3d968589d8 | 3743 | #define BW_USB_CLK_RECOVER_INT_STATUS_OVF_ERROR(x, v) (BITBAND_ACCESS8(HW_USB_CLK_RECOVER_INT_STATUS_ADDR(x), BP_USB_CLK_RECOVER_INT_STATUS_OVF_ERROR) = (v)) |
Kojto | 90:cb3d968589d8 | 3744 | /*@}*/ |
Kojto | 90:cb3d968589d8 | 3745 | |
Kojto | 90:cb3d968589d8 | 3746 | /******************************************************************************* |
Kojto | 90:cb3d968589d8 | 3747 | * hw_usb_t - module struct |
Kojto | 90:cb3d968589d8 | 3748 | ******************************************************************************/ |
Kojto | 90:cb3d968589d8 | 3749 | /*! |
Kojto | 90:cb3d968589d8 | 3750 | * @brief All USB module registers. |
Kojto | 90:cb3d968589d8 | 3751 | */ |
Kojto | 90:cb3d968589d8 | 3752 | #pragma pack(1) |
Kojto | 90:cb3d968589d8 | 3753 | typedef struct _hw_usb |
Kojto | 90:cb3d968589d8 | 3754 | { |
Kojto | 90:cb3d968589d8 | 3755 | __I hw_usb_perid_t PERID; /*!< [0x0] Peripheral ID register */ |
Kojto | 90:cb3d968589d8 | 3756 | uint8_t _reserved0[3]; |
Kojto | 90:cb3d968589d8 | 3757 | __I hw_usb_idcomp_t IDCOMP; /*!< [0x4] Peripheral ID Complement register */ |
Kojto | 90:cb3d968589d8 | 3758 | uint8_t _reserved1[3]; |
Kojto | 90:cb3d968589d8 | 3759 | __I hw_usb_rev_t REV; /*!< [0x8] Peripheral Revision register */ |
Kojto | 90:cb3d968589d8 | 3760 | uint8_t _reserved2[3]; |
Kojto | 90:cb3d968589d8 | 3761 | __I hw_usb_addinfo_t ADDINFO; /*!< [0xC] Peripheral Additional Info register */ |
Kojto | 90:cb3d968589d8 | 3762 | uint8_t _reserved3[3]; |
Kojto | 90:cb3d968589d8 | 3763 | __IO hw_usb_otgistat_t OTGISTAT; /*!< [0x10] OTG Interrupt Status register */ |
Kojto | 90:cb3d968589d8 | 3764 | uint8_t _reserved4[3]; |
Kojto | 90:cb3d968589d8 | 3765 | __IO hw_usb_otgicr_t OTGICR; /*!< [0x14] OTG Interrupt Control register */ |
Kojto | 90:cb3d968589d8 | 3766 | uint8_t _reserved5[3]; |
Kojto | 90:cb3d968589d8 | 3767 | __IO hw_usb_otgstat_t OTGSTAT; /*!< [0x18] OTG Status register */ |
Kojto | 90:cb3d968589d8 | 3768 | uint8_t _reserved6[3]; |
Kojto | 90:cb3d968589d8 | 3769 | __IO hw_usb_otgctl_t OTGCTL; /*!< [0x1C] OTG Control register */ |
Kojto | 90:cb3d968589d8 | 3770 | uint8_t _reserved7[99]; |
Kojto | 90:cb3d968589d8 | 3771 | __IO hw_usb_istat_t ISTAT; /*!< [0x80] Interrupt Status register */ |
Kojto | 90:cb3d968589d8 | 3772 | uint8_t _reserved8[3]; |
Kojto | 90:cb3d968589d8 | 3773 | __IO hw_usb_inten_t INTEN; /*!< [0x84] Interrupt Enable register */ |
Kojto | 90:cb3d968589d8 | 3774 | uint8_t _reserved9[3]; |
Kojto | 90:cb3d968589d8 | 3775 | __IO hw_usb_errstat_t ERRSTAT; /*!< [0x88] Error Interrupt Status register */ |
Kojto | 90:cb3d968589d8 | 3776 | uint8_t _reserved10[3]; |
Kojto | 90:cb3d968589d8 | 3777 | __IO hw_usb_erren_t ERREN; /*!< [0x8C] Error Interrupt Enable register */ |
Kojto | 90:cb3d968589d8 | 3778 | uint8_t _reserved11[3]; |
Kojto | 90:cb3d968589d8 | 3779 | __I hw_usb_stat_t STAT; /*!< [0x90] Status register */ |
Kojto | 90:cb3d968589d8 | 3780 | uint8_t _reserved12[3]; |
Kojto | 90:cb3d968589d8 | 3781 | __IO hw_usb_ctl_t CTL; /*!< [0x94] Control register */ |
Kojto | 90:cb3d968589d8 | 3782 | uint8_t _reserved13[3]; |
Kojto | 90:cb3d968589d8 | 3783 | __IO hw_usb_addr_t ADDR; /*!< [0x98] Address register */ |
Kojto | 90:cb3d968589d8 | 3784 | uint8_t _reserved14[3]; |
Kojto | 90:cb3d968589d8 | 3785 | __IO hw_usb_bdtpage1_t BDTPAGE1; /*!< [0x9C] BDT Page register 1 */ |
Kojto | 90:cb3d968589d8 | 3786 | uint8_t _reserved15[3]; |
Kojto | 90:cb3d968589d8 | 3787 | __IO hw_usb_frmnuml_t FRMNUML; /*!< [0xA0] Frame Number register Low */ |
Kojto | 90:cb3d968589d8 | 3788 | uint8_t _reserved16[3]; |
Kojto | 90:cb3d968589d8 | 3789 | __IO hw_usb_frmnumh_t FRMNUMH; /*!< [0xA4] Frame Number register High */ |
Kojto | 90:cb3d968589d8 | 3790 | uint8_t _reserved17[3]; |
Kojto | 90:cb3d968589d8 | 3791 | __IO hw_usb_token_t TOKEN; /*!< [0xA8] Token register */ |
Kojto | 90:cb3d968589d8 | 3792 | uint8_t _reserved18[3]; |
Kojto | 90:cb3d968589d8 | 3793 | __IO hw_usb_softhld_t SOFTHLD; /*!< [0xAC] SOF Threshold register */ |
Kojto | 90:cb3d968589d8 | 3794 | uint8_t _reserved19[3]; |
Kojto | 90:cb3d968589d8 | 3795 | __IO hw_usb_bdtpage2_t BDTPAGE2; /*!< [0xB0] BDT Page Register 2 */ |
Kojto | 90:cb3d968589d8 | 3796 | uint8_t _reserved20[3]; |
Kojto | 90:cb3d968589d8 | 3797 | __IO hw_usb_bdtpage3_t BDTPAGE3; /*!< [0xB4] BDT Page Register 3 */ |
Kojto | 90:cb3d968589d8 | 3798 | uint8_t _reserved21[11]; |
Kojto | 90:cb3d968589d8 | 3799 | struct { |
Kojto | 90:cb3d968589d8 | 3800 | __IO hw_usb_endptn_t ENDPTn; /*!< [0xC0] Endpoint Control register */ |
Kojto | 90:cb3d968589d8 | 3801 | uint8_t _reserved0[3]; |
Kojto | 90:cb3d968589d8 | 3802 | } ENDPOINT[16]; |
Kojto | 90:cb3d968589d8 | 3803 | __IO hw_usb_usbctrl_t USBCTRL; /*!< [0x100] USB Control register */ |
Kojto | 90:cb3d968589d8 | 3804 | uint8_t _reserved22[3]; |
Kojto | 90:cb3d968589d8 | 3805 | __I hw_usb_observe_t OBSERVE; /*!< [0x104] USB OTG Observe register */ |
Kojto | 90:cb3d968589d8 | 3806 | uint8_t _reserved23[3]; |
Kojto | 90:cb3d968589d8 | 3807 | __IO hw_usb_control_t CONTROL; /*!< [0x108] USB OTG Control register */ |
Kojto | 90:cb3d968589d8 | 3808 | uint8_t _reserved24[3]; |
Kojto | 90:cb3d968589d8 | 3809 | __IO hw_usb_usbtrc0_t USBTRC0; /*!< [0x10C] USB Transceiver Control register 0 */ |
Kojto | 90:cb3d968589d8 | 3810 | uint8_t _reserved25[7]; |
Kojto | 90:cb3d968589d8 | 3811 | __IO hw_usb_usbfrmadjust_t USBFRMADJUST; /*!< [0x114] Frame Adjust Register */ |
Kojto | 90:cb3d968589d8 | 3812 | uint8_t _reserved26[43]; |
Kojto | 90:cb3d968589d8 | 3813 | __IO hw_usb_clk_recover_ctrl_t CLK_RECOVER_CTRL; /*!< [0x140] USB Clock recovery control */ |
Kojto | 90:cb3d968589d8 | 3814 | uint8_t _reserved27[3]; |
Kojto | 90:cb3d968589d8 | 3815 | __IO hw_usb_clk_recover_irc_en_t CLK_RECOVER_IRC_EN; /*!< [0x144] IRC48M oscillator enable register */ |
Kojto | 90:cb3d968589d8 | 3816 | uint8_t _reserved28[23]; |
Kojto | 90:cb3d968589d8 | 3817 | __IO hw_usb_clk_recover_int_status_t CLK_RECOVER_INT_STATUS; /*!< [0x15C] Clock recovery separated interrupt status */ |
Kojto | 90:cb3d968589d8 | 3818 | } hw_usb_t; |
Kojto | 90:cb3d968589d8 | 3819 | #pragma pack() |
Kojto | 90:cb3d968589d8 | 3820 | |
Kojto | 90:cb3d968589d8 | 3821 | /*! @brief Macro to access all USB registers. */ |
Kojto | 90:cb3d968589d8 | 3822 | /*! @param x USB module instance base address. */ |
Kojto | 90:cb3d968589d8 | 3823 | /*! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct, |
Kojto | 90:cb3d968589d8 | 3824 | * use the '&' operator, like <code>&HW_USB(USB0_BASE)</code>. */ |
Kojto | 90:cb3d968589d8 | 3825 | #define HW_USB(x) (*(hw_usb_t *)(x)) |
Kojto | 90:cb3d968589d8 | 3826 | |
Kojto | 90:cb3d968589d8 | 3827 | #endif /* __HW_USB_REGISTERS_H__ */ |
Kojto | 90:cb3d968589d8 | 3828 | /* EOF */ |