|
104 | 104 | * (when HSE is used as system clock source, directly or through the PLL).
|
105 | 105 | */
|
106 | 106 | #if !defined (HSE_VALUE)
|
107 |
| - #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ |
| 107 | + #define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ |
108 | 108 | #endif /* HSE_VALUE */
|
109 | 109 |
|
110 | 110 | #if !defined (HSE_STARTUP_TIMEOUT)
|
111 |
| - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ |
| 111 | + #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */ |
112 | 112 | #endif /* HSE_STARTUP_TIMEOUT */
|
113 | 113 |
|
114 | 114 | /**
|
|
117 | 117 | * (when HSI is used as system clock source, directly or through the PLL).
|
118 | 118 | */
|
119 | 119 | #if !defined (HSI_VALUE)
|
120 |
| - #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ |
| 120 | + #define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz */ |
121 | 121 | #endif /* HSI_VALUE */
|
122 | 122 |
|
123 | 123 | /**
|
124 | 124 | * @brief Internal Low Speed oscillator (LSI) value.
|
125 | 125 | */
|
126 | 126 | #if !defined (LSI_VALUE)
|
127 |
| - #define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ |
| 127 | + #define LSI_VALUE 32000U /*!< LSI Typical Value in Hz */ |
128 | 128 | #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
129 | 129 | The real value may vary depending on the variations
|
130 | 130 | in voltage and temperature.*/
|
131 | 131 | /**
|
132 | 132 | * @brief External Low Speed oscillator (LSE) value.
|
133 | 133 | */
|
134 | 134 | #if !defined (LSE_VALUE)
|
135 |
| - #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ |
| 135 | + #define LSE_VALUE 32768U /*!< Value of the External Low Speed oscillator in Hz */ |
136 | 136 | #endif /* LSE_VALUE */
|
137 | 137 |
|
138 | 138 | #if !defined (LSE_STARTUP_TIMEOUT)
|
139 |
| - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ |
| 139 | + #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ |
140 | 140 | #endif /* LSE_STARTUP_TIMEOUT */
|
141 | 141 |
|
142 | 142 | /**
|
|
145 | 145 | * frequency, this source is inserted directly through I2S_CKIN pad.
|
146 | 146 | */
|
147 | 147 | #if !defined (EXTERNAL_CLOCK_VALUE)
|
148 |
| - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ |
| 148 | + #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External oscillator in Hz*/ |
149 | 149 | #endif /* EXTERNAL_CLOCK_VALUE */
|
150 | 150 |
|
151 | 151 | /* Tip: To avoid modifying this file each time you need to use different HSE,
|
|
155 | 155 | /**
|
156 | 156 | * @brief This is the HAL system configuration section
|
157 | 157 | */
|
158 |
| -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ |
159 |
| -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ |
| 158 | +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ |
| 159 | +#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */ |
160 | 160 | #define USE_RTOS 0U
|
161 | 161 | #define PREFETCH_ENABLE 1U
|
162 | 162 | #define INSTRUCTION_CACHE_ENABLE 1U
|
|
184 | 184 | /* Definition of the Ethernet driver buffers size and count */
|
185 | 185 | #define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
|
186 | 186 | #define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
|
187 |
| -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ |
188 |
| -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ |
| 187 | +#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ |
| 188 | +#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ |
189 | 189 |
|
190 | 190 | /* Section 2: PHY configuration section */
|
191 | 191 |
|
192 |
| -/* DP83848_PHY_ADDRESS Address*/ |
| 192 | +/* DP83848 PHY Address*/ |
193 | 193 | #define DP83848_PHY_ADDRESS 0x01U
|
194 | 194 | /* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
|
195 |
| -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) |
| 195 | +#define PHY_RESET_DELAY 0x000000FFU |
196 | 196 | /* PHY Configuration delay */
|
197 |
| -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) |
| 197 | +#define PHY_CONFIG_DELAY 0x00000FFFU |
198 | 198 |
|
199 |
| -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) |
200 |
| -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) |
| 199 | +#define PHY_READ_TO 0x0000FFFFU |
| 200 | +#define PHY_WRITE_TO 0x0000FFFFU |
201 | 201 |
|
202 | 202 | /* Section 3: Common PHY Registers */
|
203 | 203 |
|
204 |
| -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ |
205 |
| -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ |
| 204 | +#define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */ |
| 205 | +#define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */ |
206 | 206 |
|
207 |
| -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ |
208 |
| -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ |
209 |
| -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ |
210 |
| -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ |
211 |
| -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ |
212 |
| -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ |
213 |
| -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ |
214 |
| -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ |
215 |
| -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ |
216 |
| -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ |
217 |
| - |
218 |
| -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ |
219 |
| -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ |
220 |
| -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ |
| 207 | +#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */ |
| 208 | +#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */ |
| 209 | +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */ |
| 210 | +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */ |
| 211 | +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */ |
| 212 | +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */ |
| 213 | +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */ |
| 214 | +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */ |
| 215 | +#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */ |
| 216 | +#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */ |
| 217 | + |
| 218 | +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */ |
| 219 | +#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */ |
| 220 | +#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */ |
221 | 221 |
|
222 | 222 | /* Section 4: Extended PHY Registers */
|
223 |
| -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ |
224 | 223 |
|
225 |
| -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ |
226 |
| -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ |
| 224 | +#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */ |
| 225 | +#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */ |
| 226 | +#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */ |
| 227 | + |
| 228 | +#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */ |
| 229 | +#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */ |
| 230 | +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */ |
| 231 | + |
| 232 | +#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */ |
| 233 | +#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */ |
| 234 | + |
| 235 | +#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */ |
| 236 | +#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */ |
227 | 237 |
|
228 | 238 | /* ################## SPI peripheral configuration ########################## */
|
229 | 239 |
|
|
0 commit comments