ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_rmac_phy.h
Go to the documentation of this file.
1
27
28#pragma once
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include <stdint.h>
35
36#include "ra8_err.h"
37
53
67
76
81typedef struct {
82 ra8_err_t (*read)(void* ctx,
83 uint8_t phy_addr,
84 uint8_t reg_addr,
85 uint16_t* out_data);
86 ra8_err_t (*write)(void* ctx, uint8_t phy_addr, uint8_t reg_addr, uint16_t data);
87 void* ctx;
89
94typedef struct {
95 uint8_t link_up;
96 uint8_t auto_neg_done;
98 uint16_t bmsr;
99 uint16_t partner_ability;
101
114
138[[nodiscard]] ra8_err_t ra8_rmac_phy_open(const ra8_rmac_phy_cfg_t* cfg);
139
153[[nodiscard]] ra8_err_t ra8_rmac_phy_close(void);
154
173[[nodiscard]] ra8_err_t ra8_rmac_phy_mdio_read(uint8_t reg_addr, uint16_t* out_data);
174
191[[nodiscard]] ra8_err_t ra8_rmac_phy_mdio_write(uint8_t reg_addr, uint16_t data);
192
207
225
243
244#ifdef __cplusplus
245}
246#endif
-proof
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
ra8_rmac_phy_speed_t
Resolved PHY link speed/duplex.
Definition ra8_rmac.h:160
ra8_err_t ra8_rmac_phy_mdio_read(uint8_t reg_addr, uint16_t *out_data)
Read a Clause-22 register on the off-chip PHY.
ra8_err_t ra8_rmac_phy_close(void)
Close the driver.
ra8_err_t ra8_rmac_phy_link_status_get(ra8_rmac_phy_link_t *out)
Read BMSR + partner ability and resolve speed/duplex.
ra8_rmac_phy_speed_t
Negotiated link speed.
@ k_ra8_rmac_phy_speed_no_link
RA8 rmac PHY speed no link.
@ k_ra8_rmac_phy_speed_100f
RA8 rmac PHY speed 100f.
@ k_ra8_rmac_phy_speed_10h
RA8 rmac PHY speed 10h.
@ k_ra8_rmac_phy_speed_1000f
RA8 rmac PHY speed 1000f.
@ k_ra8_rmac_phy_speed_10f
RA8 rmac PHY speed 10f.
@ k_ra8_rmac_phy_speed_100h
RA8 rmac PHY speed 100h.
@ k_ra8_rmac_phy_speed_1000h
RA8 rmac PHY speed 1000h.
ra8_err_t ra8_rmac_phy_mdio_write(uint8_t reg_addr, uint16_t data)
Write a Clause-22 register on the off-chip PHY.
ra8_err_t ra8_rmac_phy_lsi_get(ra8_rmac_phy_lsi_t *out)
Get the currently-bound PHY-LSI identifier.
ra8_rmac_phy_addr_limit_t
MDIO address constraints.
@ k_ra8_rmac_phy_addr_max
RA8 rmac PHY address maximum.
@ k_ra8_rmac_phy_reg_max
RA8 rmac PHY register maximum.
ra8_rmac_phy_lsi_t
Supported PHY-LSI identifiers.
@ k_ra8_rmac_phy_lsi_ksz8091rnb
RA8 rmac PHY lsi ksz8091rnb.
@ k_ra8_rmac_phy_lsi_default
RA8 rmac PHY lsi default.
@ k_ra8_rmac_phy_lsi_ksz8041
RA8 rmac PHY lsi ksz8041.
@ k_ra8_rmac_phy_lsi_gpy111
RA8 rmac PHY lsi gpy111.
@ k_ra8_rmac_phy_lsi_dp83620
RA8 rmac PHY lsi dp83620.
@ k_ra8_rmac_phy_lsi_ics1894
RA8 rmac PHY lsi ics1894.
@ k_ra8_rmac_phy_lsi_count
RA8 rmac PHY lsi count.
@ k_ra8_rmac_phy_lsi_custom
RA8 rmac PHY lsi custom.
@ k_ra8_rmac_phy_lsi_vsc8541
RA8 rmac PHY lsi vsc8541.
ra8_err_t ra8_rmac_phy_open(const ra8_rmac_phy_cfg_t *cfg)
Open the PHY and run a soft-reset sequence.
ra8_err_t ra8_rmac_phy_auto_negotiate_start(void)
Restart auto-negotiation on the PHY.
Configuration descriptor.
uint16_t local_advertise
Clause-22 reg 4 advertised.
uint16_t reset_poll_max
Reset poll maximum.
ra8_rmac_phy_lsi_t lsi_type
Lsi type.
uint16_t gbit_advertise
Clause-22 reg 9 (1000T).
uint8_t phy_address
PHY address.
ra8_rmac_phy_io_t io
Io.
Pluggable MDIO bus.
ra8_err_t(* read)(void *ctx, uint8_t phy_addr, uint8_t reg_addr, uint16_t *out_data)
Read.