mbed library sources, include can_api for nucleo-f091rc

Dependents:   CanNucleoF0_example

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Fri Sep 25 11:45:09 2015 +0100
Revision:
624:83778a75d1b4
Synchronized with git revision b290644b9cdd33d24fc3f629368795b3d9c386fe

Full URL: https://github.com/mbedmicro/mbed/commit/b290644b9cdd33d24fc3f629368795b3d9c386fe/

changes for adding IoT Subsystem for Cortex-M target

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 624:83778a75d1b4 1 /*
mbed_official 624:83778a75d1b4 2 * Copyright:
mbed_official 624:83778a75d1b4 3 * ----------------------------------------------------------------
mbed_official 624:83778a75d1b4 4 * This confidential and proprietary software may be used only as
mbed_official 624:83778a75d1b4 5 * authorised by a licensing agreement from ARM Limited
mbed_official 624:83778a75d1b4 6 * (C) COPYRIGHT 2014 ARM Limited
mbed_official 624:83778a75d1b4 7 * ALL RIGHTS RESERVED
mbed_official 624:83778a75d1b4 8 * The entire notice above must be reproduced on all authorised
mbed_official 624:83778a75d1b4 9 * copies and copies may only be made to the extent permitted
mbed_official 624:83778a75d1b4 10 * by a licensing agreement from ARM Limited.
mbed_official 624:83778a75d1b4 11 * ----------------------------------------------------------------
mbed_official 624:83778a75d1b4 12 * File: smm_mps2.h
mbed_official 624:83778a75d1b4 13 * Release: Version 1.0
mbed_official 624:83778a75d1b4 14 * ----------------------------------------------------------------
mbed_official 624:83778a75d1b4 15 */
mbed_official 624:83778a75d1b4 16
mbed_official 624:83778a75d1b4 17 #ifndef __SMM_MPS2_H
mbed_official 624:83778a75d1b4 18 #define __SMM_MPS2_H
mbed_official 624:83778a75d1b4 19
mbed_official 624:83778a75d1b4 20 #include "peripherallink.h" /* device specific header file */
mbed_official 624:83778a75d1b4 21
mbed_official 624:83778a75d1b4 22 #if defined ( __CC_ARM )
mbed_official 624:83778a75d1b4 23 #pragma anon_unions
mbed_official 624:83778a75d1b4 24 #endif
mbed_official 624:83778a75d1b4 25
mbed_official 624:83778a75d1b4 26 /******************************************************************************/
mbed_official 624:83778a75d1b4 27 /* FPGA System Register declaration */
mbed_official 624:83778a75d1b4 28 /******************************************************************************/
mbed_official 624:83778a75d1b4 29
mbed_official 624:83778a75d1b4 30 typedef struct
mbed_official 624:83778a75d1b4 31 {
mbed_official 624:83778a75d1b4 32 __IO uint32_t LED; // Offset: 0x000 (R/W) LED connections
mbed_official 624:83778a75d1b4 33 // [31:2] : Reserved
mbed_official 624:83778a75d1b4 34 // [1:0] : LEDs
mbed_official 624:83778a75d1b4 35 uint32_t RESERVED1[1];
mbed_official 624:83778a75d1b4 36 __IO uint32_t BUTTON; // Offset: 0x008 (R/W) Buttons
mbed_official 624:83778a75d1b4 37 // [31:2] : Reserved
mbed_official 624:83778a75d1b4 38 // [1:0] : Buttons
mbed_official 624:83778a75d1b4 39 uint32_t RESERVED2[1];
mbed_official 624:83778a75d1b4 40 __IO uint32_t CLK1HZ; // Offset: 0x010 (R/W) 1Hz up counter
mbed_official 624:83778a75d1b4 41 __IO uint32_t CLK100HZ; // Offset: 0x014 (R/W) 100Hz up counter
mbed_official 624:83778a75d1b4 42 __IO uint32_t COUNTER; // Offset: 0x018 (R/W) Cycle Up Counter
mbed_official 624:83778a75d1b4 43 // Increments when 32-bit prescale counter reach zero
mbed_official 624:83778a75d1b4 44 uint32_t RESERVED3[1];
mbed_official 624:83778a75d1b4 45 __IO uint32_t PRESCALE; // Offset: 0x020 (R/W) Prescaler
mbed_official 624:83778a75d1b4 46 // Bit[31:0] : reload value for prescale counter
mbed_official 624:83778a75d1b4 47 __IO uint32_t PSCNTR; // Offset: 0x024 (R/W) 32-bit Prescale counter
mbed_official 624:83778a75d1b4 48 // current value of the pre-scaler counter
mbed_official 624:83778a75d1b4 49 // The Cycle Up Counter increment when the prescale down counter reach 0
mbed_official 624:83778a75d1b4 50 // The pre-scaler counter is reloaded with PRESCALE after reaching 0.
mbed_official 624:83778a75d1b4 51 uint32_t RESERVED4[9];
mbed_official 624:83778a75d1b4 52 __IO uint32_t MISC; // Offset: 0x04C (R/W) Misc control */
mbed_official 624:83778a75d1b4 53 // [31:10] : Reserved
mbed_official 624:83778a75d1b4 54 // [9] : SHIELD_1_SPI_nCS
mbed_official 624:83778a75d1b4 55 // [8] : SHIELD_0_SPI_nCS
mbed_official 624:83778a75d1b4 56 // [7] : ADC_SPI_nCS
mbed_official 624:83778a75d1b4 57 // [6] : CLCD_BL_CTRL
mbed_official 624:83778a75d1b4 58 // [5] : CLCD_RD
mbed_official 624:83778a75d1b4 59 // [4] : CLCD_RS
mbed_official 624:83778a75d1b4 60 // [3] : CLCD_RESET
mbed_official 624:83778a75d1b4 61 // [2] : RESERVED
mbed_official 624:83778a75d1b4 62 // [1] : SPI_nSS
mbed_official 624:83778a75d1b4 63 // [0] : CLCD_CS
mbed_official 624:83778a75d1b4 64 } MPS2_FPGAIO_TypeDef;
mbed_official 624:83778a75d1b4 65
mbed_official 624:83778a75d1b4 66 // MISC register bit definitions
mbed_official 624:83778a75d1b4 67
mbed_official 624:83778a75d1b4 68 #define CLCD_CS_Pos 0
mbed_official 624:83778a75d1b4 69 #define CLCD_CS_Msk (1UL<<CLCD_CS_Pos)
mbed_official 624:83778a75d1b4 70 #define SPI_nSS_Pos 1
mbed_official 624:83778a75d1b4 71 #define SPI_nSS_Msk (1UL<<SPI_nSS_Pos)
mbed_official 624:83778a75d1b4 72 #define CLCD_RESET_Pos 3
mbed_official 624:83778a75d1b4 73 #define CLCD_RESET_Msk (1UL<<CLCD_RESET_Pos)
mbed_official 624:83778a75d1b4 74 #define CLCD_RS_Pos 4
mbed_official 624:83778a75d1b4 75 #define CLCD_RS_Msk (1UL<<CLCD_RS_Pos)
mbed_official 624:83778a75d1b4 76 #define CLCD_RD_Pos 5
mbed_official 624:83778a75d1b4 77 #define CLCD_RD_Msk (1UL<<CLCD_RD_Pos)
mbed_official 624:83778a75d1b4 78 #define CLCD_BL_Pos 6
mbed_official 624:83778a75d1b4 79 #define CLCD_BL_Msk (1UL<<CLCD_BL_Pos)
mbed_official 624:83778a75d1b4 80 #define ADC_nCS_Pos 7
mbed_official 624:83778a75d1b4 81 #define ADC_nCS_Msk (1UL<<ADC_nCS_Pos)
mbed_official 624:83778a75d1b4 82 #define SHIELD_0_nCS_Pos 8
mbed_official 624:83778a75d1b4 83 #define SHIELD_0_nCS_Msk (1UL<<SHIELD_0_nCS_Pos)
mbed_official 624:83778a75d1b4 84 #define SHIELD_1_nCS_Pos 9
mbed_official 624:83778a75d1b4 85 #define SHIELD_1_nCS_Msk (1UL<<SHIELD_1_nCS_Pos)
mbed_official 624:83778a75d1b4 86
mbed_official 624:83778a75d1b4 87 /******************************************************************************/
mbed_official 624:83778a75d1b4 88 /* SCC Register declaration */
mbed_official 624:83778a75d1b4 89 /******************************************************************************/
mbed_official 624:83778a75d1b4 90
mbed_official 624:83778a75d1b4 91 typedef struct //
mbed_official 624:83778a75d1b4 92 {
mbed_official 624:83778a75d1b4 93 __IO uint32_t CFG_REG0; // Offset: 0x000 (R/W) Remaps block RAM to ZBT
mbed_official 624:83778a75d1b4 94 // [31:1] : Reserved
mbed_official 624:83778a75d1b4 95 // [0] 1 : REMAP BlockRam to ZBT
mbed_official 624:83778a75d1b4 96 __IO uint32_t LEDS; // Offset: 0x004 (R/W) Controls the MCC user LEDs
mbed_official 624:83778a75d1b4 97 // [31:8] : Reserved
mbed_official 624:83778a75d1b4 98 // [7:0] : MCC LEDs
mbed_official 624:83778a75d1b4 99 uint32_t RESERVED0[1];
mbed_official 624:83778a75d1b4 100 __I uint32_t SWITCHES; // Offset: 0x00C (R/ ) Denotes the state of the MCC user switches
mbed_official 624:83778a75d1b4 101 // [31:8] : Reserved
mbed_official 624:83778a75d1b4 102 // [7:0] : These bits indicate state of the MCC switches
mbed_official 624:83778a75d1b4 103 __I uint32_t CFG_REG4; // Offset: 0x010 (R/ ) Denotes the board revision
mbed_official 624:83778a75d1b4 104 // [31:4] : Reserved
mbed_official 624:83778a75d1b4 105 // [3:0] : Used by the MCC to pass PCB revision. 0 = A 1 = B
mbed_official 624:83778a75d1b4 106 uint32_t RESERVED1[35];
mbed_official 624:83778a75d1b4 107 __IO uint32_t SYS_CFGDATA_RTN; // Offset: 0x0A0 (R/W) User data register
mbed_official 624:83778a75d1b4 108 // [31:0] : Data
mbed_official 624:83778a75d1b4 109 __IO uint32_t SYS_CFGDATA_OUT; // Offset: 0x0A4 (R/W) User data register
mbed_official 624:83778a75d1b4 110 // [31:0] : Data
mbed_official 624:83778a75d1b4 111 __IO uint32_t SYS_CFGCTRL; // Offset: 0x0A8 (R/W) Control register
mbed_official 624:83778a75d1b4 112 // [31] : Start (generates interrupt on write to this bit)
mbed_official 624:83778a75d1b4 113 // [30] : R/W access
mbed_official 624:83778a75d1b4 114 // [29:26] : Reserved
mbed_official 624:83778a75d1b4 115 // [25:20] : Function value
mbed_official 624:83778a75d1b4 116 // [19:12] : Reserved
mbed_official 624:83778a75d1b4 117 // [11:0] : Device (value of 0/1/2 for supported clocks)
mbed_official 624:83778a75d1b4 118 __IO uint32_t SYS_CFGSTAT; // Offset: 0x0AC (R/W) Contains status information
mbed_official 624:83778a75d1b4 119 // [31:2] : Reserved
mbed_official 624:83778a75d1b4 120 // [1] : Error
mbed_official 624:83778a75d1b4 121 // [0] : Complete
mbed_official 624:83778a75d1b4 122 __IO uint32_t RESERVED2[20];
mbed_official 624:83778a75d1b4 123 __IO uint32_t SCC_DLL; // Offset: 0x100 (R/W) DLL Lock Register
mbed_official 624:83778a75d1b4 124 // [31:24] : DLL LOCK MASK[7:0] - Indicate if the DLL locked is masked
mbed_official 624:83778a75d1b4 125 // [23:16] : DLL LOCK MASK[7:0] - Indicate if the DLLs are locked or unlocked
mbed_official 624:83778a75d1b4 126 // [15:1] : Reserved
mbed_official 624:83778a75d1b4 127 // [0] : This bit indicates if all enabled DLLs are locked
mbed_official 624:83778a75d1b4 128 uint32_t RESERVED3[957];
mbed_official 624:83778a75d1b4 129 __I uint32_t SCC_AID; // Offset: 0xFF8 (R/ ) SCC AID Register
mbed_official 624:83778a75d1b4 130 // [31:24] : FPGA build number
mbed_official 624:83778a75d1b4 131 // [23:20] : V2M-MPS2 target board revision (A = 0, B = 1)
mbed_official 624:83778a75d1b4 132 // [19:11] : Reserved
mbed_official 624:83778a75d1b4 133 // [10] : if “1” SCC_SW register has been implemented
mbed_official 624:83778a75d1b4 134 // [9] : if “1” SCC_LED register has been implemented
mbed_official 624:83778a75d1b4 135 // [8] : if “1” DLL lock register has been implemented
mbed_official 624:83778a75d1b4 136 // [7:0] : number of SCC configuration register
mbed_official 624:83778a75d1b4 137 __I uint32_t SCC_ID; // Offset: 0xFFC (R/ ) Contains information about the FPGA image
mbed_official 624:83778a75d1b4 138 // [31:24] : Implementer ID: 0x41 = ARM
mbed_official 624:83778a75d1b4 139 // [23:20] : Application note IP variant number
mbed_official 624:83778a75d1b4 140 // [19:16] : IP Architecture: 0x4 =AHB
mbed_official 624:83778a75d1b4 141 // [15:4] : Primary part number: 386 = AN386
mbed_official 624:83778a75d1b4 142 // [3:0] : Application note IP revision number
mbed_official 624:83778a75d1b4 143 } MPS2_SCC_TypeDef;
mbed_official 624:83778a75d1b4 144
mbed_official 624:83778a75d1b4 145
mbed_official 624:83778a75d1b4 146 /******************************************************************************/
mbed_official 624:83778a75d1b4 147 /* SSP Peripheral declaration */
mbed_official 624:83778a75d1b4 148 /******************************************************************************/
mbed_official 624:83778a75d1b4 149
mbed_official 624:83778a75d1b4 150 typedef struct // Document DDI0194G_ssp_pl022_r1p3_trm.pdf
mbed_official 624:83778a75d1b4 151 {
mbed_official 624:83778a75d1b4 152 __IO uint32_t CR0; // Offset: 0x000 (R/W) Control register 0
mbed_official 624:83778a75d1b4 153 // [31:16] : Reserved
mbed_official 624:83778a75d1b4 154 // [15:8] : Serial clock rate
mbed_official 624:83778a75d1b4 155 // [7] : SSPCLKOUT phase, applicable to Motorola SPI frame format only
mbed_official 624:83778a75d1b4 156 // [6] : SSPCLKOUT polarity, applicable to Motorola SPI frame format only
mbed_official 624:83778a75d1b4 157 // [5:4] : Frame format
mbed_official 624:83778a75d1b4 158 // [3:0] : Data Size Select
mbed_official 624:83778a75d1b4 159 __IO uint32_t CR1; // Offset: 0x004 (R/W) Control register 1
mbed_official 624:83778a75d1b4 160 // [31:4] : Reserved
mbed_official 624:83778a75d1b4 161 // [3] : Slave-mode output disable
mbed_official 624:83778a75d1b4 162 // [2] : Master or slave mode select
mbed_official 624:83778a75d1b4 163 // [1] : Synchronous serial port enable
mbed_official 624:83778a75d1b4 164 // [0] : Loop back mode
mbed_official 624:83778a75d1b4 165 __IO uint32_t DR; // Offset: 0x008 (R/W) Data register
mbed_official 624:83778a75d1b4 166 // [31:16] : Reserved
mbed_official 624:83778a75d1b4 167 // [15:0] : Transmit/Receive FIFO
mbed_official 624:83778a75d1b4 168 __I uint32_t SR; // Offset: 0x00C (R/ ) Status register
mbed_official 624:83778a75d1b4 169 // [31:5] : Reserved
mbed_official 624:83778a75d1b4 170 // [4] : PrimeCell SSP busy flag
mbed_official 624:83778a75d1b4 171 // [3] : Receive FIFO full
mbed_official 624:83778a75d1b4 172 // [2] : Receive FIFO not empty
mbed_official 624:83778a75d1b4 173 // [1] : Transmit FIFO not full
mbed_official 624:83778a75d1b4 174 // [0] : Transmit FIFO empty
mbed_official 624:83778a75d1b4 175 __IO uint32_t CPSR; // Offset: 0x010 (R/W) Clock prescale register
mbed_official 624:83778a75d1b4 176 // [31:8] : Reserved
mbed_official 624:83778a75d1b4 177 // [8:0] : Clock prescale divisor
mbed_official 624:83778a75d1b4 178 __IO uint32_t IMSC; // Offset: 0x014 (R/W) Interrupt mask set or clear register
mbed_official 624:83778a75d1b4 179 // [31:4] : Reserved
mbed_official 624:83778a75d1b4 180 // [3] : Transmit FIFO interrupt mask
mbed_official 624:83778a75d1b4 181 // [2] : Receive FIFO interrupt mask
mbed_official 624:83778a75d1b4 182 // [1] : Receive timeout interrupt mask
mbed_official 624:83778a75d1b4 183 // [0] : Receive overrun interrupt mask
mbed_official 624:83778a75d1b4 184 __I uint32_t RIS; // Offset: 0x018 (R/ ) Raw interrupt status register
mbed_official 624:83778a75d1b4 185 // [31:4] : Reserved
mbed_official 624:83778a75d1b4 186 // [3] : raw interrupt state, prior to masking, of the SSPTXINTR interrupt
mbed_official 624:83778a75d1b4 187 // [2] : raw interrupt state, prior to masking, of the SSPRXINTR interrupt
mbed_official 624:83778a75d1b4 188 // [1] : raw interrupt state, prior to masking, of the SSPRTINTR interrupt
mbed_official 624:83778a75d1b4 189 // [0] : raw interrupt state, prior to masking, of the SSPRORINTR interrupt
mbed_official 624:83778a75d1b4 190 __I uint32_t MIS; // Offset: 0x01C (R/ ) Masked interrupt status register
mbed_official 624:83778a75d1b4 191 // [31:4] : Reserved
mbed_official 624:83778a75d1b4 192 // [3] : transmit FIFO masked interrupt state, after masking, of the SSPTXINTR interrupt
mbed_official 624:83778a75d1b4 193 // [2] : receive FIFO masked interrupt state, after masking, of the SSPRXINTR interrupt
mbed_official 624:83778a75d1b4 194 // [1] : receive timeout masked interrupt state, after masking, of the SSPRTINTR interrupt
mbed_official 624:83778a75d1b4 195 // [0] : receive over run masked interrupt status, after masking, of the SSPRORINTR interrupt
mbed_official 624:83778a75d1b4 196 __O uint32_t ICR; // Offset: 0x020 ( /W) Interrupt clear register
mbed_official 624:83778a75d1b4 197 // [31:2] : Reserved
mbed_official 624:83778a75d1b4 198 // [1] : Clears the SSPRTINTR interrupt
mbed_official 624:83778a75d1b4 199 // [0] : Clears the SSPRORINTR interrupt
mbed_official 624:83778a75d1b4 200 __IO uint32_t DMACR; // Offset: 0x024 (R/W) DMA control register
mbed_official 624:83778a75d1b4 201 // [31:2] : Reserved
mbed_official 624:83778a75d1b4 202 // [1] : Transmit DMA Enable
mbed_official 624:83778a75d1b4 203 // [0] : Receive DMA Enable
mbed_official 624:83778a75d1b4 204 } MPS2_SSP_TypeDef;
mbed_official 624:83778a75d1b4 205
mbed_official 624:83778a75d1b4 206
mbed_official 624:83778a75d1b4 207 // SSP_CR0 Control register 0
mbed_official 624:83778a75d1b4 208 #define SSP_CR0_DSS_Pos 0 // Data Size Select
mbed_official 624:83778a75d1b4 209 #define SSP_CR0_DSS_Msk (0xF<<SSP_CR0_DSS_Pos)
mbed_official 624:83778a75d1b4 210 #define SSP_CR0_FRF_Pos 4 // Frame Format Select
mbed_official 624:83778a75d1b4 211 #define SSP_CR0_FRF_Msk (3UL<<SSP_CR0_FRM_Pos)
mbed_official 624:83778a75d1b4 212 #define SSP_CR0_SPO_Pos 6 // SSPCLKOUT polarity
mbed_official 624:83778a75d1b4 213 #define SSP_CR0_SPO_Msk (1UL<<SSP_CR0_SPO_Pos)
mbed_official 624:83778a75d1b4 214 #define SSP_CR0_SPH_Pos 7 // SSPCLKOUT phase
mbed_official 624:83778a75d1b4 215 #define SSP_CR0_SPH_Msk (1UL<<SSP_CR0_SPH_Pos)
mbed_official 624:83778a75d1b4 216 #define SSP_CR0_SCR_Pos 8 // Serial Clock Rate (divide)
mbed_official 624:83778a75d1b4 217 #define SSP_CR0_SCR_Msk (0xFF<<SSP_CR0_SCR_Pos)
mbed_official 624:83778a75d1b4 218
mbed_official 624:83778a75d1b4 219 #define SSP_CR0_SCR_DFLT 0x0300 // Serial Clock Rate (divide), default set at 3
mbed_official 624:83778a75d1b4 220 #define SSP_CR0_FRF_MOT 0x0000 // Frame format, Motorola
mbed_official 624:83778a75d1b4 221 #define SSP_CR0_DSS_8 0x0007 // Data packet size, 8bits
mbed_official 624:83778a75d1b4 222 #define SSP_CR0_DSS_16 0x000F // Data packet size, 16bits
mbed_official 624:83778a75d1b4 223
mbed_official 624:83778a75d1b4 224 // SSP_CR1 Control register 1
mbed_official 624:83778a75d1b4 225 #define SSP_CR1_LBM_Pos 0 // Loop Back Mode
mbed_official 624:83778a75d1b4 226 #define SSP_CR1_LBM_Msk (1UL<<SSP_CR1_LBM_Pos)
mbed_official 624:83778a75d1b4 227 #define SSP_CR1_SSE_Pos 1 // Serial port enable
mbed_official 624:83778a75d1b4 228 #define SSP_CR1_SSE_Msk (1UL<<SSP_CR1_SSE_Pos)
mbed_official 624:83778a75d1b4 229 #define SSP_CR1_MS_Pos 2 // Master or Slave mode
mbed_official 624:83778a75d1b4 230 #define SSP_CR1_MS_Msk (1UL<<SSP_CR1_MS_Pos)
mbed_official 624:83778a75d1b4 231 #define SSP_CR1_SOD_Pos 3 // Slave Output mode Disable
mbed_official 624:83778a75d1b4 232 #define SSP_CR1_SOD_Msk (1UL<<SSP_CR1_SOD_Pos)
mbed_official 624:83778a75d1b4 233
mbed_official 624:83778a75d1b4 234 // SSP_SR Status register
mbed_official 624:83778a75d1b4 235 #define SSP_SR_TFE_Pos 0 // Transmit FIFO empty
mbed_official 624:83778a75d1b4 236 #define SSP_SR_TFE_Msk (1UL<<SSP_SR_TFE_Pos)
mbed_official 624:83778a75d1b4 237 #define SSP_SR_TNF_Pos 1 // Transmit FIFO not full
mbed_official 624:83778a75d1b4 238 #define SSP_SR_TNF_Msk (1UL<<SSP_SR_TNF_Pos)
mbed_official 624:83778a75d1b4 239 #define SSP_SR_RNE_Pos 2 // Receive FIFO not empty
mbed_official 624:83778a75d1b4 240 #define SSP_SR_RNE_Msk (1UL<<SSP_SR_RNE_Pos)
mbed_official 624:83778a75d1b4 241 #define SSP_SR_RFF_Pos 3 // Receive FIFO full
mbed_official 624:83778a75d1b4 242 #define SSP_SR_RFF_Msk (1UL<<SSP_SR_RFF_Pos)
mbed_official 624:83778a75d1b4 243 #define SSP_SR_BSY_Pos 4 // Busy
mbed_official 624:83778a75d1b4 244 #define SSP_SR_BSY_Msk (1UL<<SSP_SR_BSY_Pos)
mbed_official 624:83778a75d1b4 245
mbed_official 624:83778a75d1b4 246 // SSP_CPSR Clock prescale register
mbed_official 624:83778a75d1b4 247 #define SSP_CPSR_CPD_Pos 0 // Clock prescale divisor
mbed_official 624:83778a75d1b4 248 #define SSP_CPSR_CPD_Msk (0xFF<<SSP_CPSR_CDP_Pos)
mbed_official 624:83778a75d1b4 249
mbed_official 624:83778a75d1b4 250 #define SSP_CPSR_DFLT 0x0008 // Clock prescale (use with SCR), default set at 8
mbed_official 624:83778a75d1b4 251
mbed_official 624:83778a75d1b4 252 // SSPIMSC Interrupt mask set and clear register
mbed_official 624:83778a75d1b4 253 #define SSP_IMSC_RORIM_Pos 0 // Receive overrun not Masked
mbed_official 624:83778a75d1b4 254 #define SSP_IMSC_RORIM_Msk (1UL<<SSP_IMSC_RORIM_Pos)
mbed_official 624:83778a75d1b4 255 #define SSP_IMSC_RTIM_Pos 1 // Receive timeout not Masked
mbed_official 624:83778a75d1b4 256 #define SSP_IMSC_RTIM_Msk (1UL<<SSP_IMSC_RTIM_Pos)
mbed_official 624:83778a75d1b4 257 #define SSP_IMSC_RXIM_Pos 2 // Receive FIFO not Masked
mbed_official 624:83778a75d1b4 258 #define SSP_IMSC_RXIM_Msk (1UL<<SSP_IMSC_RXIM_Pos)
mbed_official 624:83778a75d1b4 259 #define SSP_IMSC_TXIM_Pos 3 // Transmit FIFO not Masked
mbed_official 624:83778a75d1b4 260 #define SSP_IMSC_TXIM_Msk (1UL<<SSP_IMSC_TXIM_Pos)
mbed_official 624:83778a75d1b4 261
mbed_official 624:83778a75d1b4 262 // SSPRIS Raw interrupt status register
mbed_official 624:83778a75d1b4 263 #define SSP_RIS_RORRIS_Pos 0 // Raw Overrun interrupt flag
mbed_official 624:83778a75d1b4 264 #define SSP_RIS_RORRIS_Msk (1UL<<SSP_RIS_RORRIS_Pos)
mbed_official 624:83778a75d1b4 265 #define SSP_RIS_RTRIS_Pos 1 // Raw Timemout interrupt flag
mbed_official 624:83778a75d1b4 266 #define SSP_RIS_RTRIS_Msk (1UL<<SSP_RIS_RTRIS_Pos)
mbed_official 624:83778a75d1b4 267 #define SSP_RIS_RXRIS_Pos 2 // Raw Receive interrupt flag
mbed_official 624:83778a75d1b4 268 #define SSP_RIS_RXRIS_Msk (1UL<<SSP_RIS_RXRIS_Pos)
mbed_official 624:83778a75d1b4 269 #define SSP_RIS_TXRIS_Pos 3 // Raw Transmit interrupt flag
mbed_official 624:83778a75d1b4 270 #define SSP_RIS_TXRIS_Msk (1UL<<SSP_RIS_TXRIS_Pos)
mbed_official 624:83778a75d1b4 271
mbed_official 624:83778a75d1b4 272 // SSPMIS Masked interrupt status register
mbed_official 624:83778a75d1b4 273 #define SSP_MIS_RORMIS_Pos 0 // Masked Overrun interrupt flag
mbed_official 624:83778a75d1b4 274 #define SSP_MIS_RORMIS_Msk (1UL<<SSP_MIS_RORMIS_Pos)
mbed_official 624:83778a75d1b4 275 #define SSP_MIS_RTMIS_Pos 1 // Masked Timemout interrupt flag
mbed_official 624:83778a75d1b4 276 #define SSP_MIS_RTMIS_Msk (1UL<<SSP_MIS_RTMIS_Pos)
mbed_official 624:83778a75d1b4 277 #define SSP_MIS_RXMIS_Pos 2 // Masked Receive interrupt flag
mbed_official 624:83778a75d1b4 278 #define SSP_MIS_RXMIS_Msk (1UL<<SSP_MIS_RXMIS_Pos)
mbed_official 624:83778a75d1b4 279 #define SSP_MIS_TXMIS_Pos 3 // Masked Transmit interrupt flag
mbed_official 624:83778a75d1b4 280 #define SSP_MIS_TXMIS_Msk (1UL<<SSP_MIS_TXMIS_Pos)
mbed_official 624:83778a75d1b4 281
mbed_official 624:83778a75d1b4 282 // SSPICR Interrupt clear register
mbed_official 624:83778a75d1b4 283 #define SSP_ICR_RORIC_Pos 0 // Clears Overrun interrupt flag
mbed_official 624:83778a75d1b4 284 #define SSP_ICR_RORIC_Msk (1UL<<SSP_ICR_RORIC_Pos)
mbed_official 624:83778a75d1b4 285 #define SSP_ICR_RTIC_Pos 1 // Clears Timemout interrupt flag
mbed_official 624:83778a75d1b4 286 #define SSP_ICR_RTIC_Msk (1UL<<SSP_ICR_RTIC_Pos)
mbed_official 624:83778a75d1b4 287
mbed_official 624:83778a75d1b4 288 // SSPDMACR DMA control register
mbed_official 624:83778a75d1b4 289 #define SSP_DMACR_RXDMAE_Pos 0 // Enable Receive FIFO DMA
mbed_official 624:83778a75d1b4 290 #define SSP_DMACR_RXDMAE_Msk (1UL<<SSP_DMACR_RXDMAE_Pos)
mbed_official 624:83778a75d1b4 291 #define SSP_DMACR_TXDMAE_Pos 1 // Enable Transmit FIFO DMA
mbed_official 624:83778a75d1b4 292 #define SSP_DMACR_TXDMAE_Msk (1UL<<SSP_DMACR_TXDMAE_Pos)
mbed_official 624:83778a75d1b4 293
mbed_official 624:83778a75d1b4 294 /******************************************************************************/
mbed_official 624:83778a75d1b4 295 /* Audio and Touch Screen (I2C) Peripheral declaration */
mbed_official 624:83778a75d1b4 296 /******************************************************************************/
mbed_official 624:83778a75d1b4 297
mbed_official 624:83778a75d1b4 298 typedef struct
mbed_official 624:83778a75d1b4 299 {
mbed_official 624:83778a75d1b4 300 union {
mbed_official 624:83778a75d1b4 301 __O uint32_t CONTROLS; // Offset: 0x000 CONTROL Set Register ( /W)
mbed_official 624:83778a75d1b4 302 __I uint32_t CONTROL; // Offset: 0x000 CONTROL Status Register (R/ )
mbed_official 624:83778a75d1b4 303 };
mbed_official 624:83778a75d1b4 304 __O uint32_t CONTROLC; // Offset: 0x004 CONTROL Clear Register ( /W)
mbed_official 624:83778a75d1b4 305 } MPS2_I2C_TypeDef;
mbed_official 624:83778a75d1b4 306
mbed_official 624:83778a75d1b4 307 #define SDA 1 << 1
mbed_official 624:83778a75d1b4 308 #define SCL 1 << 0
mbed_official 624:83778a75d1b4 309
mbed_official 624:83778a75d1b4 310
mbed_official 624:83778a75d1b4 311 /******************************************************************************/
mbed_official 624:83778a75d1b4 312 /* Audio I2S Peripheral declaration */
mbed_official 624:83778a75d1b4 313 /******************************************************************************/
mbed_official 624:83778a75d1b4 314
mbed_official 624:83778a75d1b4 315 typedef struct
mbed_official 624:83778a75d1b4 316 {
mbed_official 624:83778a75d1b4 317 /*!< Offset: 0x000 CONTROL Register (R/W) */
mbed_official 624:83778a75d1b4 318 __IO uint32_t CONTROL; // <h> CONTROL </h>
mbed_official 624:83778a75d1b4 319 // <o.0> TX Enable
mbed_official 624:83778a75d1b4 320 // <0=> TX disabled
mbed_official 624:83778a75d1b4 321 // <1=> TX enabled
mbed_official 624:83778a75d1b4 322 // <o.1> TX IRQ Enable
mbed_official 624:83778a75d1b4 323 // <0=> TX IRQ disabled
mbed_official 624:83778a75d1b4 324 // <1=> TX IRQ enabled
mbed_official 624:83778a75d1b4 325 // <o.2> RX Enable
mbed_official 624:83778a75d1b4 326 // <0=> RX disabled
mbed_official 624:83778a75d1b4 327 // <1=> RX enabled
mbed_official 624:83778a75d1b4 328 // <o.3> RX IRQ Enable
mbed_official 624:83778a75d1b4 329 // <0=> RX IRQ disabled
mbed_official 624:83778a75d1b4 330 // <1=> RX IRQ enabled
mbed_official 624:83778a75d1b4 331 // <o.10..8> TX Buffer Water Level
mbed_official 624:83778a75d1b4 332 // <0=> / IRQ triggers when any space available
mbed_official 624:83778a75d1b4 333 // <1=> / IRQ triggers when more than 1 space available
mbed_official 624:83778a75d1b4 334 // <2=> / IRQ triggers when more than 2 space available
mbed_official 624:83778a75d1b4 335 // <3=> / IRQ triggers when more than 3 space available
mbed_official 624:83778a75d1b4 336 // <4=> Undefined!
mbed_official 624:83778a75d1b4 337 // <5=> Undefined!
mbed_official 624:83778a75d1b4 338 // <6=> Undefined!
mbed_official 624:83778a75d1b4 339 // <7=> Undefined!
mbed_official 624:83778a75d1b4 340 // <o.14..12> RX Buffer Water Level
mbed_official 624:83778a75d1b4 341 // <0=> Undefined!
mbed_official 624:83778a75d1b4 342 // <1=> / IRQ triggers when less than 1 space available
mbed_official 624:83778a75d1b4 343 // <2=> / IRQ triggers when less than 2 space available
mbed_official 624:83778a75d1b4 344 // <3=> / IRQ triggers when less than 3 space available
mbed_official 624:83778a75d1b4 345 // <4=> / IRQ triggers when less than 4 space available
mbed_official 624:83778a75d1b4 346 // <5=> Undefined!
mbed_official 624:83778a75d1b4 347 // <6=> Undefined!
mbed_official 624:83778a75d1b4 348 // <7=> Undefined!
mbed_official 624:83778a75d1b4 349 // <o.16> FIFO reset
mbed_official 624:83778a75d1b4 350 // <0=> Normal operation
mbed_official 624:83778a75d1b4 351 // <1=> FIFO reset
mbed_official 624:83778a75d1b4 352 // <o.17> Audio Codec reset
mbed_official 624:83778a75d1b4 353 // <0=> Normal operation
mbed_official 624:83778a75d1b4 354 // <1=> Assert audio Codec reset
mbed_official 624:83778a75d1b4 355 /*!< Offset: 0x004 STATUS Register (R/ ) */
mbed_official 624:83778a75d1b4 356 __I uint32_t STATUS; // <h> STATUS </h>
mbed_official 624:83778a75d1b4 357 // <o.0> TX Buffer alert
mbed_official 624:83778a75d1b4 358 // <0=> TX buffer don't need service yet
mbed_official 624:83778a75d1b4 359 // <1=> TX buffer need service
mbed_official 624:83778a75d1b4 360 // <o.1> RX Buffer alert
mbed_official 624:83778a75d1b4 361 // <0=> RX buffer don't need service yet
mbed_official 624:83778a75d1b4 362 // <1=> RX buffer need service
mbed_official 624:83778a75d1b4 363 // <o.2> TX Buffer Empty
mbed_official 624:83778a75d1b4 364 // <0=> TX buffer have data
mbed_official 624:83778a75d1b4 365 // <1=> TX buffer empty
mbed_official 624:83778a75d1b4 366 // <o.3> TX Buffer Full
mbed_official 624:83778a75d1b4 367 // <0=> TX buffer not full
mbed_official 624:83778a75d1b4 368 // <1=> TX buffer full
mbed_official 624:83778a75d1b4 369 // <o.4> RX Buffer Empty
mbed_official 624:83778a75d1b4 370 // <0=> RX buffer have data
mbed_official 624:83778a75d1b4 371 // <1=> RX buffer empty
mbed_official 624:83778a75d1b4 372 // <o.5> RX Buffer Full
mbed_official 624:83778a75d1b4 373 // <0=> RX buffer not full
mbed_official 624:83778a75d1b4 374 // <1=> RX buffer full
mbed_official 624:83778a75d1b4 375 union {
mbed_official 624:83778a75d1b4 376 /*!< Offset: 0x008 Error Status Register (R/ ) */
mbed_official 624:83778a75d1b4 377 __I uint32_t ERROR; // <h> ERROR </h>
mbed_official 624:83778a75d1b4 378 // <o.0> TX error
mbed_official 624:83778a75d1b4 379 // <0=> Okay
mbed_official 624:83778a75d1b4 380 // <1=> TX overrun/underrun
mbed_official 624:83778a75d1b4 381 // <o.1> RX error
mbed_official 624:83778a75d1b4 382 // <0=> Okay
mbed_official 624:83778a75d1b4 383 // <1=> RX overrun/underrun
mbed_official 624:83778a75d1b4 384 /*!< Offset: 0x008 Error Clear Register ( /W) */
mbed_official 624:83778a75d1b4 385 __O uint32_t ERRORCLR; // <h> ERRORCLR </h>
mbed_official 624:83778a75d1b4 386 // <o.0> TX error
mbed_official 624:83778a75d1b4 387 // <0=> Okay
mbed_official 624:83778a75d1b4 388 // <1=> Clear TX error
mbed_official 624:83778a75d1b4 389 // <o.1> RX error
mbed_official 624:83778a75d1b4 390 // <0=> Okay
mbed_official 624:83778a75d1b4 391 // <1=> Clear RX error
mbed_official 624:83778a75d1b4 392 };
mbed_official 624:83778a75d1b4 393 /*!< Offset: 0x00C Divide ratio Register (R/W) */
mbed_official 624:83778a75d1b4 394 __IO uint32_t DIVIDE; // <h> Divide ratio for Left/Right clock </h>
mbed_official 624:83778a75d1b4 395 // <o.9..0> TX error (default 0x80)
mbed_official 624:83778a75d1b4 396 /*!< Offset: 0x010 Transmit Buffer ( /W) */
mbed_official 624:83778a75d1b4 397 __O uint32_t TXBUF; // <h> Transmit buffer </h>
mbed_official 624:83778a75d1b4 398 // <o.15..0> Right channel
mbed_official 624:83778a75d1b4 399 // <o.31..16> Left channel
mbed_official 624:83778a75d1b4 400 /*!< Offset: 0x014 Receive Buffer (R/ ) */
mbed_official 624:83778a75d1b4 401 __I uint32_t RXBUF; // <h> Receive buffer </h>
mbed_official 624:83778a75d1b4 402 // <o.15..0> Right channel
mbed_official 624:83778a75d1b4 403 // <o.31..16> Left channel
mbed_official 624:83778a75d1b4 404 uint32_t RESERVED1[186];
mbed_official 624:83778a75d1b4 405 __IO uint32_t ITCR; // <h> Integration Test Control Register </h>
mbed_official 624:83778a75d1b4 406 // <o.0> ITEN
mbed_official 624:83778a75d1b4 407 // <0=> Normal operation
mbed_official 624:83778a75d1b4 408 // <1=> Integration Test mode enable
mbed_official 624:83778a75d1b4 409 __O uint32_t ITIP1; // <h> Integration Test Input Register 1</h>
mbed_official 624:83778a75d1b4 410 // <o.0> SDIN
mbed_official 624:83778a75d1b4 411 __O uint32_t ITOP1; // <h> Integration Test Output Register 1</h>
mbed_official 624:83778a75d1b4 412 // <o.0> SDOUT
mbed_official 624:83778a75d1b4 413 // <o.1> SCLK
mbed_official 624:83778a75d1b4 414 // <o.2> LRCK
mbed_official 624:83778a75d1b4 415 // <o.3> IRQOUT
mbed_official 624:83778a75d1b4 416 } MPS2_I2S_TypeDef;
mbed_official 624:83778a75d1b4 417
mbed_official 624:83778a75d1b4 418 #define I2S_CONTROL_TXEN_Pos 0
mbed_official 624:83778a75d1b4 419 #define I2S_CONTROL_TXEN_Msk (1UL<<I2S_CONTROL_TXEN_Pos)
mbed_official 624:83778a75d1b4 420
mbed_official 624:83778a75d1b4 421 #define I2S_CONTROL_TXIRQEN_Pos 1
mbed_official 624:83778a75d1b4 422 #define I2S_CONTROL_TXIRQEN_Msk (1UL<<I2S_CONTROL_TXIRQEN_Pos)
mbed_official 624:83778a75d1b4 423
mbed_official 624:83778a75d1b4 424 #define I2S_CONTROL_RXEN_Pos 2
mbed_official 624:83778a75d1b4 425 #define I2S_CONTROL_RXEN_Msk (1UL<<I2S_CONTROL_RXEN_Pos)
mbed_official 624:83778a75d1b4 426
mbed_official 624:83778a75d1b4 427 #define I2S_CONTROL_RXIRQEN_Pos 3
mbed_official 624:83778a75d1b4 428 #define I2S_CONTROL_RXIRQEN_Msk (1UL<<I2S_CONTROL_RXIRQEN_Pos)
mbed_official 624:83778a75d1b4 429
mbed_official 624:83778a75d1b4 430 #define I2S_CONTROL_TXWLVL_Pos 8
mbed_official 624:83778a75d1b4 431 #define I2S_CONTROL_TXWLVL_Msk (7UL<<I2S_CONTROL_TXWLVL_Pos)
mbed_official 624:83778a75d1b4 432
mbed_official 624:83778a75d1b4 433 #define I2S_CONTROL_RXWLVL_Pos 12
mbed_official 624:83778a75d1b4 434 #define I2S_CONTROL_RXWLVL_Msk (7UL<<I2S_CONTROL_RXWLVL_Pos)
mbed_official 624:83778a75d1b4 435 /* FIFO reset*/
mbed_official 624:83778a75d1b4 436 #define I2S_CONTROL_FIFORST_Pos 16
mbed_official 624:83778a75d1b4 437 #define I2S_CONTROL_FIFORST_Msk (1UL<<I2S_CONTROL_FIFORST_Pos)
mbed_official 624:83778a75d1b4 438 /* Codec reset*/
mbed_official 624:83778a75d1b4 439 #define I2S_CONTROL_CODECRST_Pos 17
mbed_official 624:83778a75d1b4 440 #define I2S_CONTROL_CODECRST_Msk (1UL<<I2S_CONTROL_CODECRST_Pos)
mbed_official 624:83778a75d1b4 441
mbed_official 624:83778a75d1b4 442 #define I2S_STATUS_TXIRQ_Pos 0
mbed_official 624:83778a75d1b4 443 #define I2S_STATUS_TXIRQ_Msk (1UL<<I2S_STATUS_TXIRQ_Pos)
mbed_official 624:83778a75d1b4 444
mbed_official 624:83778a75d1b4 445 #define I2S_STATUS_RXIRQ_Pos 1
mbed_official 624:83778a75d1b4 446 #define I2S_STATUS_RXIRQ_Msk (1UL<<I2S_STATUS_RXIRQ_Pos)
mbed_official 624:83778a75d1b4 447
mbed_official 624:83778a75d1b4 448 #define I2S_STATUS_TXEmpty_Pos 2
mbed_official 624:83778a75d1b4 449 #define I2S_STATUS_TXEmpty_Msk (1UL<<I2S_STATUS_TXEmpty_Pos)
mbed_official 624:83778a75d1b4 450
mbed_official 624:83778a75d1b4 451 #define I2S_STATUS_TXFull_Pos 3
mbed_official 624:83778a75d1b4 452 #define I2S_STATUS_TXFull_Msk (1UL<<I2S_STATUS_TXFull_Pos)
mbed_official 624:83778a75d1b4 453
mbed_official 624:83778a75d1b4 454 #define I2S_STATUS_RXEmpty_Pos 4
mbed_official 624:83778a75d1b4 455 #define I2S_STATUS_RXEmpty_Msk (1UL<<I2S_STATUS_RXEmpty_Pos)
mbed_official 624:83778a75d1b4 456
mbed_official 624:83778a75d1b4 457 #define I2S_STATUS_RXFull_Pos 5
mbed_official 624:83778a75d1b4 458 #define I2S_STATUS_RXFull_Msk (1UL<<I2S_STATUS_RXFull_Pos)
mbed_official 624:83778a75d1b4 459
mbed_official 624:83778a75d1b4 460 #define I2S_ERROR_TXERR_Pos 0
mbed_official 624:83778a75d1b4 461 #define I2S_ERROR_TXERR_Msk (1UL<<I2S_ERROR_TXERR_Pos)
mbed_official 624:83778a75d1b4 462
mbed_official 624:83778a75d1b4 463 #define I2S_ERROR_RXERR_Pos 1
mbed_official 624:83778a75d1b4 464 #define I2S_ERROR_RXERR_Msk (1UL<<I2S_ERROR_RXERR_Pos)
mbed_official 624:83778a75d1b4 465
mbed_official 624:83778a75d1b4 466 /******************************************************************************/
mbed_official 624:83778a75d1b4 467 /* SMSC9220 Register Definitions */
mbed_official 624:83778a75d1b4 468 /******************************************************************************/
mbed_official 624:83778a75d1b4 469
mbed_official 624:83778a75d1b4 470 typedef struct // SMSC LAN9220
mbed_official 624:83778a75d1b4 471 {
mbed_official 624:83778a75d1b4 472 __I uint32_t RX_DATA_PORT; // Receive FIFO Ports (offset 0x0)
mbed_official 624:83778a75d1b4 473 uint32_t RESERVED1[0x7];
mbed_official 624:83778a75d1b4 474 __O uint32_t TX_DATA_PORT; // Transmit FIFO Ports (offset 0x20)
mbed_official 624:83778a75d1b4 475 uint32_t RESERVED2[0x7];
mbed_official 624:83778a75d1b4 476
mbed_official 624:83778a75d1b4 477 __I uint32_t RX_STAT_PORT; // Receive FIFO status port (offset 0x40)
mbed_official 624:83778a75d1b4 478 __I uint32_t RX_STAT_PEEK; // Receive FIFO status peek (offset 0x44)
mbed_official 624:83778a75d1b4 479 __I uint32_t TX_STAT_PORT; // Transmit FIFO status port (offset 0x48)
mbed_official 624:83778a75d1b4 480 __I uint32_t TX_STAT_PEEK; // Transmit FIFO status peek (offset 0x4C)
mbed_official 624:83778a75d1b4 481
mbed_official 624:83778a75d1b4 482 __I uint32_t ID_REV; // Chip ID and Revision (offset 0x50)
mbed_official 624:83778a75d1b4 483 __IO uint32_t IRQ_CFG; // Main Interrupt Configuration (offset 0x54)
mbed_official 624:83778a75d1b4 484 __IO uint32_t INT_STS; // Interrupt Status (offset 0x58)
mbed_official 624:83778a75d1b4 485 __IO uint32_t INT_EN; // Interrupt Enable Register (offset 0x5C)
mbed_official 624:83778a75d1b4 486 uint32_t RESERVED3; // Reserved for future use (offset 0x60)
mbed_official 624:83778a75d1b4 487 __I uint32_t BYTE_TEST; // Read-only byte order testing register 87654321h (offset 0x64)
mbed_official 624:83778a75d1b4 488 __IO uint32_t FIFO_INT; // FIFO Level Interrupts (offset 0x68)
mbed_official 624:83778a75d1b4 489 __IO uint32_t RX_CFG; // Receive Configuration (offset 0x6C)
mbed_official 624:83778a75d1b4 490 __IO uint32_t TX_CFG; // Transmit Configuration (offset 0x70)
mbed_official 624:83778a75d1b4 491 __IO uint32_t HW_CFG; // Hardware Configuration (offset 0x74)
mbed_official 624:83778a75d1b4 492 __IO uint32_t RX_DP_CTL; // RX Datapath Control (offset 0x78)
mbed_official 624:83778a75d1b4 493 __I uint32_t RX_FIFO_INF; // Receive FIFO Information (offset 0x7C)
mbed_official 624:83778a75d1b4 494 __I uint32_t TX_FIFO_INF; // Transmit FIFO Information (offset 0x80)
mbed_official 624:83778a75d1b4 495 __IO uint32_t PMT_CTRL; // Power Management Control (offset 0x84)
mbed_official 624:83778a75d1b4 496 __IO uint32_t GPIO_CFG; // General Purpose IO Configuration (offset 0x88)
mbed_official 624:83778a75d1b4 497 __IO uint32_t GPT_CFG; // General Purpose Timer Configuration (offset 0x8C)
mbed_official 624:83778a75d1b4 498 __I uint32_t GPT_CNT; // General Purpose Timer Count (offset 0x90)
mbed_official 624:83778a75d1b4 499 uint32_t RESERVED4; // Reserved for future use (offset 0x94)
mbed_official 624:83778a75d1b4 500 __IO uint32_t ENDIAN; // WORD SWAP Register (offset 0x98)
mbed_official 624:83778a75d1b4 501 __I uint32_t FREE_RUN; // Free Run Counter (offset 0x9C)
mbed_official 624:83778a75d1b4 502 __I uint32_t RX_DROP; // RX Dropped Frames Counter (offset 0xA0)
mbed_official 624:83778a75d1b4 503 __IO uint32_t MAC_CSR_CMD; // MAC CSR Synchronizer Command (offset 0xA4)
mbed_official 624:83778a75d1b4 504 __IO uint32_t MAC_CSR_DATA; // MAC CSR Synchronizer Data (offset 0xA8)
mbed_official 624:83778a75d1b4 505 __IO uint32_t AFC_CFG; // Automatic Flow Control Configuration (offset 0xAC)
mbed_official 624:83778a75d1b4 506 __IO uint32_t E2P_CMD; // EEPROM Command (offset 0xB0)
mbed_official 624:83778a75d1b4 507 __IO uint32_t E2P_DATA; // EEPROM Data (offset 0xB4)
mbed_official 624:83778a75d1b4 508
mbed_official 624:83778a75d1b4 509 } SMSC9220_TypeDef;
mbed_official 624:83778a75d1b4 510
mbed_official 624:83778a75d1b4 511 // SMSC9220 MAC Registers Indices
mbed_official 624:83778a75d1b4 512 #define SMSC9220_MAC_CR 0x1
mbed_official 624:83778a75d1b4 513 #define SMSC9220_MAC_ADDRH 0x2
mbed_official 624:83778a75d1b4 514 #define SMSC9220_MAC_ADDRL 0x3
mbed_official 624:83778a75d1b4 515 #define SMSC9220_MAC_HASHH 0x4
mbed_official 624:83778a75d1b4 516 #define SMSC9220_MAC_HASHL 0x5
mbed_official 624:83778a75d1b4 517 #define SMSC9220_MAC_MII_ACC 0x6
mbed_official 624:83778a75d1b4 518 #define SMSC9220_MAC_MII_DATA 0x7
mbed_official 624:83778a75d1b4 519 #define SMSC9220_MAC_FLOW 0x8
mbed_official 624:83778a75d1b4 520 #define SMSC9220_MAC_VLAN1 0x9
mbed_official 624:83778a75d1b4 521 #define SMSC9220_MAC_VLAN2 0xA
mbed_official 624:83778a75d1b4 522 #define SMSC9220_MAC_WUFF 0xB
mbed_official 624:83778a75d1b4 523 #define SMSC9220_MAC_WUCSR 0xC
mbed_official 624:83778a75d1b4 524
mbed_official 624:83778a75d1b4 525 // SMSC9220 PHY Registers Indices
mbed_official 624:83778a75d1b4 526 #define SMSC9220_PHY_BCONTROL 0x0
mbed_official 624:83778a75d1b4 527 #define SMSC9220_PHY_BSTATUS 0x1
mbed_official 624:83778a75d1b4 528 #define SMSC9220_PHY_ID1 0x2
mbed_official 624:83778a75d1b4 529 #define SMSC9220_PHY_ID2 0x3
mbed_official 624:83778a75d1b4 530 #define SMSC9220_PHY_ANEG_ADV 0x4
mbed_official 624:83778a75d1b4 531 #define SMSC9220_PHY_ANEG_LPA 0x5
mbed_official 624:83778a75d1b4 532 #define SMSC9220_PHY_ANEG_EXP 0x6
mbed_official 624:83778a75d1b4 533 #define SMSC9220_PHY_MCONTROL 0x17
mbed_official 624:83778a75d1b4 534 #define SMSC9220_PHY_MSTATUS 0x18
mbed_official 624:83778a75d1b4 535 #define SMSC9220_PHY_CSINDICATE 0x27
mbed_official 624:83778a75d1b4 536 #define SMSC9220_PHY_INTSRC 0x29
mbed_official 624:83778a75d1b4 537 #define SMSC9220_PHY_INTMASK 0x30
mbed_official 624:83778a75d1b4 538 #define SMSC9220_PHY_CS 0x31
mbed_official 624:83778a75d1b4 539
mbed_official 624:83778a75d1b4 540 /******************************************************************************/
mbed_official 624:83778a75d1b4 541 /* Peripheral memory map */
mbed_official 624:83778a75d1b4 542 /******************************************************************************/
mbed_official 624:83778a75d1b4 543
mbed_official 624:83778a75d1b4 544 #define MPS2_SSP0_BASE (0x40020000ul) /* User SSP Base Address */
mbed_official 624:83778a75d1b4 545 #define MPS2_SSP1_BASE (0x40021000ul) /* CLCD SSP Base Address */
mbed_official 624:83778a75d1b4 546 #define MPS2_TSC_I2C_BASE (0x40022000ul) /* Touch Screen I2C Base Address */
mbed_official 624:83778a75d1b4 547 #define MPS2_AAIC_I2C_BASE (0x40023000ul) /* Audio Interface I2C Base Address */
mbed_official 624:83778a75d1b4 548 #define MPS2_AAIC_I2S_BASE (0x40024000ul) /* Audio Interface I2S Base Address */
mbed_official 624:83778a75d1b4 549 #define MPS2_SSP2_BASE (0x40025000ul) /* adc SSP Base Address */
mbed_official 624:83778a75d1b4 550 #define MPS2_SSP3_BASE (0x40026000ul) /* shield 0 SSP Base Address */
mbed_official 624:83778a75d1b4 551 #define MPS2_SSP4_BASE (0x40027000ul) /* shield 1 SSP Base Address */
mbed_official 624:83778a75d1b4 552 #define MPS2_FPGAIO_BASE (0x40028000ul) /* FPGAIO Base Address */
mbed_official 624:83778a75d1b4 553 #define MPS2_SHIELD0_I2C_BASE (0x40029000ul) /* Audio Interface I2C Base Address */
mbed_official 624:83778a75d1b4 554 #define MPS2_SHIELD1_I2C_BASE (0x4002A000ul) /* Audio Interface I2C Base Address */
mbed_official 624:83778a75d1b4 555 #define MPS2_SCC_BASE (0x4002F000ul) /* SCC Base Address */
mbed_official 624:83778a75d1b4 556
mbed_official 624:83778a75d1b4 557 #ifdef CORTEX_M7
mbed_official 624:83778a75d1b4 558 #define SMSC9220_BASE (0xA0000000ul) /* Ethernet SMSC9220 Base Address */
mbed_official 624:83778a75d1b4 559 #else
mbed_official 624:83778a75d1b4 560 #define SMSC9220_BASE (0x40200000ul) /* Ethernet SMSC9220 Base Address */
mbed_official 624:83778a75d1b4 561 #endif
mbed_official 624:83778a75d1b4 562
mbed_official 624:83778a75d1b4 563 #define MPS2_VGA_BUFFER (0x41100000ul) /* VGA Buffer Base Address */
mbed_official 624:83778a75d1b4 564 #define MPS2_VGA_TEXT_BUFFER (0x41000000ul) /* VGA Text Buffer Address */
mbed_official 624:83778a75d1b4 565
mbed_official 624:83778a75d1b4 566 /******************************************************************************/
mbed_official 624:83778a75d1b4 567 /* Peripheral declaration */
mbed_official 624:83778a75d1b4 568 /******************************************************************************/
mbed_official 624:83778a75d1b4 569
mbed_official 624:83778a75d1b4 570 #define SMSC9220 ((SMSC9220_TypeDef *) SMSC9220_BASE )
mbed_official 624:83778a75d1b4 571 #define MPS2_TS_I2C ((MPS2_I2C_TypeDef *) MPS2_TSC_I2C_BASE )
mbed_official 624:83778a75d1b4 572 #define MPS2_AAIC_I2C ((MPS2_I2C_TypeDef *) MPS2_AAIC_I2C_BASE )
mbed_official 624:83778a75d1b4 573 #define MPS2_SHIELD0_I2C ((MPS2_I2C_TypeDef *) MPS2_SHIELD0_I2C_BASE )
mbed_official 624:83778a75d1b4 574 #define MPS2_SHIELD1_I2C ((MPS2_I2C_TypeDef *) MPS2_SHIELD1_I2C_BASE )
mbed_official 624:83778a75d1b4 575 #define MPS2_AAIC_I2S ((MPS2_I2S_TypeDef *) MPS2_AAIC_I2S_BASE )
mbed_official 624:83778a75d1b4 576 #define MPS2_FPGAIO ((MPS2_FPGAIO_TypeDef *) MPS2_FPGAIO_BASE )
mbed_official 624:83778a75d1b4 577 #define MPS2_SCC ((MPS2_SCC_TypeDef *) MPS2_SCC_BASE )
mbed_official 624:83778a75d1b4 578 #define MPS2_SSP0 ((MPS2_SSP_TypeDef *) MPS2_SSP0_BASE )
mbed_official 624:83778a75d1b4 579 #define MPS2_SSP1 ((MPS2_SSP_TypeDef *) MPS2_SSP1_BASE )
mbed_official 624:83778a75d1b4 580 #define MPS2_SSP2 ((MPS2_SSP_TypeDef *) MPS2_SSP2_BASE )
mbed_official 624:83778a75d1b4 581 #define MPS2_SSP3 ((MPS2_SSP_TypeDef *) MPS2_SSP3_BASE )
mbed_official 624:83778a75d1b4 582 #define MPS2_SSP4 ((MPS2_SSP_TypeDef *) MPS2_SSP4_BASE )
mbed_official 624:83778a75d1b4 583
mbed_official 624:83778a75d1b4 584 //******************************************************************************/
mbed_official 624:83778a75d1b4 585 /* General MACRO Definitions */
mbed_official 624:83778a75d1b4 586 /******************************************************************************/
mbed_official 624:83778a75d1b4 587
mbed_official 624:83778a75d1b4 588 //#define DEBUG
mbed_official 624:83778a75d1b4 589 //#ifdef DEBUG
mbed_official 624:83778a75d1b4 590 // #define debug(...) printf(__VA_ARGS__)
mbed_official 624:83778a75d1b4 591 //#else
mbed_official 624:83778a75d1b4 592 // #define debug(...)
mbed_official 624:83778a75d1b4 593 //#endif // ifdef DEBUG
mbed_official 624:83778a75d1b4 594
mbed_official 624:83778a75d1b4 595 // Bit control macros
mbed_official 624:83778a75d1b4 596 //#define HW_REG(base,offset) *((volatile unsigned int *)((base) + (offset)))
mbed_official 624:83778a75d1b4 597
mbed_official 624:83778a75d1b4 598 #define CREATE_MASK(msb, lsb) (((1U << ((msb) - (lsb) + 1)) - 1) << (lsb))
mbed_official 624:83778a75d1b4 599 #define MASK_BITS(arg, msb, lsb) ((arg) & CREATE_MASK(msb, lsb))
mbed_official 624:83778a75d1b4 600 #define EXTRACT_BITS(arg, msb, lsb) (MASK_BITS(arg, msb, lsb) >> (lsb))
mbed_official 624:83778a75d1b4 601 #define INSERT_BITS(arg, msb, lsb, value) \
mbed_official 624:83778a75d1b4 602 ((arg) = ((arg) & ~CREATE_MASK(msb, lsb)) | (((value) << (lsb)) & CREATE_MASK(msb, lsb)))
mbed_official 624:83778a75d1b4 603
mbed_official 624:83778a75d1b4 604 #define MASK_FIELD(arg, field) MASK_BITS(arg, field##_MSB, field##_LSB)
mbed_official 624:83778a75d1b4 605 #define EXTRACT_FIELD(arg, field) EXTRACT_BITS(arg, field##_MSB, field##_LSB)
mbed_official 624:83778a75d1b4 606 #define INSERT_FIELD(arg, field, value) INSERT_BITS(arg, field##_MSB, field##_LSB, value)
mbed_official 624:83778a75d1b4 607
mbed_official 624:83778a75d1b4 608 #define SET_BIT(arg, bit) ((arg) |= (1 << (bit)))
mbed_official 624:83778a75d1b4 609 #define CLEAR_BIT(arg, bit) ((arg) &= ~(1 << (bit)))
mbed_official 624:83778a75d1b4 610 #define TEST_BIT(arg, bit) ((arg) & (1 << (bit)))
mbed_official 624:83778a75d1b4 611
mbed_official 624:83778a75d1b4 612 #ifndef NoOfElements
mbed_official 624:83778a75d1b4 613 #define NoOfElements(array) (sizeof(array) / sizeof(array[0]))
mbed_official 624:83778a75d1b4 614 #endif
mbed_official 624:83778a75d1b4 615
mbed_official 624:83778a75d1b4 616 #endif /* __SMM_MPS2_H */