31static const char*
s_tag =
"EPHY";
33typedef enum : uint8_t {
38typedef enum : uint16_t {
171 const uint16_t bmcr =
static const char * s_tag
Logging / check tag.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Validation and Error-Checking Macros for ra8-firmware.
#define RA8_CHECK_NULL_PTR(ptr, tag, message)
Reject nullptr pointer, returning k_ra8_err_null_ptr.
Error Code Definitions for ra8-firmware.
@ k_ra8_err_invalid_arg
Invalid function argument.
@ k_ra8_err_exists
Item already exists – cannot create again.
@ k_ra8_err_invalid_state
Module in wrong state for requested operation.
@ k_ra8_err_hw_timeout
Hardware timed out waiting for a flag or handshake.
@ k_ra8_err_not_initialized
Module not initialized – _init() not yet called successfully.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
static ra8_err_t internal_reset_and_wait(void)
Issue BMCR.RESET to the PHY and poll until it self-clears.
ra8_err_t ra8_ether_phy_open(const ra8_ether_phy_cfg_t *cfg)
Open and reset a PHY.
ra8_err_t ra8_ether_phy_auto_negotiate_start(void)
Kick off auto-negotiation by re-arming BMCR.
@ k_ra8_ether_phy_reset_poll_max
RA8 ether PHY reset poll maximum.
@ k_ra8_ether_phy_reg_max
RA8 ether PHY register maximum.
ra8_err_t ra8_ether_phy_link_status_get(ra8_ether_phy_link_t *out)
Poll the BMSR for auto-negotiation completion + link-up.
ra8_err_t ra8_ether_phy_close(void)
Close the driver.
@ k_ra8_ether_phy_bmcr_an_enable
RA8 ether PHY bmcr an enable.
@ k_ra8_ether_phy_bmsr_an_complete
RA8 ether PHY bmsr an complete.
@ k_ra8_ether_phy_anar_10full
RA8 ether PHY anar 10full.
@ k_ra8_ether_phy_anar_100half
RA8 ether PHY anar 100half.
@ k_ra8_ether_phy_anar_10half
RA8 ether PHY anar 10half.
@ k_ra8_ether_phy_bmsr_link_up
RA8 ether PHY bmsr link up.
@ k_ra8_ether_phy_bmcr_reset
RA8 ether PHY bmcr reset.
@ k_ra8_ether_phy_anar_100full
RA8 ether PHY anar 100full.
@ k_ra8_ether_phy_bmcr_an_restart
RA8 ether PHY bmcr an restart.
ra8_err_t ra8_ether_phy_mdio_write(uint8_t reg_addr, uint16_t data)
Write a Clause-22 PHY register.
ra8_err_t ra8_ether_phy_mdio_read(uint8_t reg_addr, uint16_t *out_data)
Read a Clause-22 PHY register.
Generic Ethernet PHY abstraction (MDIO Clause-22 + auto-neg).
@ k_ra8_ether_phy_speed_10h
RA8 ether PHY speed 10h.
@ k_ra8_ether_phy_speed_no_link
RA8 ether PHY speed no link.
@ k_ra8_ether_phy_speed_100f
RA8 ether PHY speed 100f.
@ k_ra8_ether_phy_speed_10f
RA8 ether PHY speed 10f.
@ k_ra8_ether_phy_speed_100h
RA8 ether PHY speed 100h.
@ k_ra8_ether_phy_reg_an_partner
Link Partner Ability.
@ k_ra8_ether_phy_reg_status
BMSR.
@ k_ra8_ether_phy_reg_control
BMCR.
ra8_ether_phy_mii_t
Media-independent interface type seen on the MAC side.
@ k_ra8_ether_phy_addr_max
RA8 ether PHY address maximum.
Lightweight Logging Interface for ra8-firmware.
#define ra8_log_info_val(tag, message, value)
RA8 log info val.
Configuration descriptor for ra8_ether_phy_open.
ra8_ether_phy_io_t io
Pluggable MDIO bus.
ra8_ether_phy_mii_t mii_type
Interface type.
uint16_t reset_wait_us
Wait after reset.
uint8_t phy_address
5-bit MDIO PHY address.
uint16_t reset_wait_us
Reset wait us.
ra8_ether_phy_mii_t mii_type
Mii type.
uint8_t phy_address
PHY address.
uint16_t last_bmsr
Last bmsr.
Pluggable MDIO bus interface.
ra8_err_t(* write)(void *ctx, uint8_t phy_addr, uint8_t reg_addr, uint16_t data)
Write a 16-bit Clause-22 register.
ra8_err_t(* read)(void *ctx, uint8_t phy_addr, uint8_t reg_addr, uint16_t *out_data)
Read a 16-bit Clause-22 register.
uint8_t auto_neg_done
1 if AN completed.
uint8_t link_up
1 if link is up.
uint16_t bmsr
Last raw BMSR snapshot.
ra8_ether_phy_speed_t speed
Speed / duplex (if up).