@@ -206,8 +206,8 @@ in voltage and temperature.*/
206
206
207
207
/* Section 2: PHY configuration section */
208
208
209
- /* DP83848 PHY Address*/
210
- #define DP83848_PHY_ADDRESS 0x01U
209
+ /* LAN8742A PHY Address*/
210
+ #define LAN8742A_PHY_ADDRESS 0x00U
211
211
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
212
212
#define PHY_RESET_DELAY 0x000000FFU
213
213
/* PHY Configuration delay */
@@ -218,39 +218,35 @@ in voltage and temperature.*/
218
218
219
219
/* Section 3: Common PHY Registers */
220
220
221
- #define PHY_BCR ((uint16_t)0x0000) /*!< Transceiver Basic Control Register */
222
- #define PHY_BSR ((uint16_t)0x0001) /*!< Transceiver Basic Status Register */
221
+ #define PHY_BCR ((uint16_t)0x00U) /*!< Transceiver Basic Control Register */
222
+ #define PHY_BSR ((uint16_t)0x01U) /*!< Transceiver Basic Status Register */
223
223
224
- #define PHY_RESET ((uint16_t)0x8000 ) /*!< PHY Reset */
225
- #define PHY_LOOPBACK ((uint16_t)0x4000 ) /*!< Select loop-back mode */
226
- #define PHY_FULLDUPLEX_100M ((uint16_t)0x2100 ) /*!< Set the full-duplex mode at 100 Mb/s */
227
- #define PHY_HALFDUPLEX_100M ((uint16_t)0x2000 ) /*!< Set the half-duplex mode at 100 Mb/s */
228
- #define PHY_FULLDUPLEX_10M ((uint16_t)0x0100 ) /*!< Set the full-duplex mode at 10 Mb/s */
229
- #define PHY_HALFDUPLEX_10M ((uint16_t)0x0000 ) /*!< Set the half-duplex mode at 10 Mb/s */
230
- #define PHY_AUTONEGOTIATION ((uint16_t)0x1000 ) /*!< Enable auto-negotiation function */
231
- #define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200 ) /*!< Restart auto-negotiation function */
232
- #define PHY_POWERDOWN ((uint16_t)0x0800 ) /*!< Select the power down mode */
233
- #define PHY_ISOLATE ((uint16_t)0x0400 ) /*!< Isolate PHY from MII */
224
+ #define PHY_RESET ((uint16_t)0x8000U ) /*!< PHY Reset */
225
+ #define PHY_LOOPBACK ((uint16_t)0x4000U ) /*!< Select loop-back mode */
226
+ #define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U ) /*!< Set the full-duplex mode at 100 Mb/s */
227
+ #define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U ) /*!< Set the half-duplex mode at 100 Mb/s */
228
+ #define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U ) /*!< Set the full-duplex mode at 10 Mb/s */
229
+ #define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U ) /*!< Set the half-duplex mode at 10 Mb/s */
230
+ #define PHY_AUTONEGOTIATION ((uint16_t)0x1000U ) /*!< Enable auto-negotiation function */
231
+ #define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U ) /*!< Restart auto-negotiation function */
232
+ #define PHY_POWERDOWN ((uint16_t)0x0800U ) /*!< Select the power down mode */
233
+ #define PHY_ISOLATE ((uint16_t)0x0400U ) /*!< Isolate PHY from MII */
234
234
235
- #define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020 ) /*!< Auto-Negotiation process completed */
236
- #define PHY_LINKED_STATUS ((uint16_t)0x0004 ) /*!< Valid link established */
237
- #define PHY_JABBER_DETECTION ((uint16_t)0x0002 ) /*!< Jabber condition detected */
235
+ #define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U ) /*!< Auto-Negotiation process completed */
236
+ #define PHY_LINKED_STATUS ((uint16_t)0x0004U ) /*!< Valid link established */
237
+ #define PHY_JABBER_DETECTION ((uint16_t)0x0002U ) /*!< Jabber condition detected */
238
238
239
239
/* Section 4: Extended PHY Registers */
240
240
241
- #define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */
242
- #define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */
243
- #define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */
241
+ #define PHY_SR ((uint16_t)0x1FU) /*!< PHY special control/ status register Offset */
244
242
245
- #define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */
246
- #define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */
247
- #define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */
243
+ #define PHY_SPEED_STATUS ((uint16_t)0x0004U) /*!< PHY Speed mask */
244
+ #define PHY_DUPLEX_STATUS ((uint16_t)0x0010U) /*!< PHY Duplex mask */
248
245
249
- #define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */
250
- #define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */
251
246
252
- #define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */
253
- #define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */
247
+ #define PHY_ISFR ((uint16_t)0x01DU) /*!< PHY Interrupt Source Flag register Offset */
248
+ #define PHY_IMR ((uint16_t)0x001E) /*!< PHY Interrupt Mask register Offset */
249
+ #define PHY_ISFR_INT4 ((uint16_t)0x0010U) /*!< PHY Link down inturrupt */
254
250
255
251
/* ################## SPI peripheral configuration ########################## */
256
252
0 commit comments