![]() |
no-OS
|
Source file of the ADIN1320 driver. More...
#include <errno.h>#include "no_os_alloc.h"#include "no_os_delay.h"#include "no_os_gpio.h"#include "adin1320.h"Functions | |
| int | adin1320_init (struct adin1320_desc **dev, struct adin1320_init_param *param) |
| Initialize the Device. | |
| int | adin1320_hard_reset (struct adin1320_desc *dev) |
| Perform Device Hard Reset. | |
| int | adin1320_remove (struct adin1320_desc *dev) |
| Remove Initialization of the Device. | |
| int | adin1320_write (struct adin1320_desc *dev, uint32_t addr, uint16_t val) |
| MDIO Write with Clause22 or Clause45. | |
| int | adin1320_read (struct adin1320_desc *dev, uint32_t addr, uint16_t *val) |
| MDIO Read with Clause22 or Clause45. | |
| int | adin1320_write_bits (struct adin1320_desc *dev, uint32_t addr, uint16_t val, uint16_t bitmask) |
| MDIO Write with Clause22 or Clause45 on a Specific Bit. | |
| int | adin1320_config_rgmii (struct adin1320_desc *dev, struct adin1320_rgmii_config rgmii) |
| Configure RGMII Tx and Rx Delays. | |
| int | adin1320_config_gp_clk (struct adin1320_desc *dev, enum adin1320_gp_clk_source source) |
| Configure GP Clock. | |
| int | adin1320_config_clk25_ref (struct adin1320_desc *dev, enum adin1320_clk25_ref_enable enable) |
| Enable/disable GE Clock 25MHz Reference. | |
| int | adin1320_cu_autoneg (struct adin1320_desc *dev, enum adin1320_autoneg_enable enable) |
| Enable/disable and Reset Autonegotiation for Copper Media. | |
| int | adin1320_sd_autoneg (struct adin1320_desc *dev, enum adin1320_autoneg_enable enable) |
| Enable/disable and Reset Autonegotiation for SerDes Media. | |
| int | adin1320_cu_resolved_speed (struct adin1320_desc *dev, enum adin1320_cu_speed *resolved_speed) |
| Get Resolved Speed for Copper Media. | |
| int | adin1320_sd_resolved_speed (struct adin1320_desc *dev, enum adin1320_sd_speed *resolved_speed) |
| Get Resolved Speed for SerDes Media. | |
| int | adin1320_soft_reset (struct adin1320_desc *dev, enum adin1320_soft_reset_option reset_cfg) |
| Select and Perform Device Reset. | |
| int | adin1320_cu_read_irq_status (struct adin1320_desc *dev, bool *val_irq_pending, uint16_t *val_irq_status) |
| Read interrupt status for copper media. | |
| int | adin1320_sd_read_irq_status (struct adin1320_desc *dev, bool *val_irq_pending, uint16_t *val_irq_status) |
| Read interrupt status for serdes media. | |
| int | adin1320_set_software_powerdown (struct adin1320_desc *dev, enum adin1320_software_powerdown val) |
| Enter/exit Software Powerdown. | |
| int | adin1320_get_software_powerdown (struct adin1320_desc *dev, enum adin1320_software_powerdown *val) |
| Get Software Powerdown Status. | |
| int | adin1320_get_device_id (struct adin1320_desc *dev, uint32_t *device_id) |
| Get Device ID. | |
| int | adin1320_reset_rmii_fifo (struct adin1320_desc *dev) |
| Allows the RMII FIFO to be Reset. | |
| int | adin1320_select_mac_interface (struct adin1320_desc *dev, enum adin1320_mac_interface val) |
| MAC Interface Configuration. | |
| int | adin1320_cu_link_cfg (struct adin1320_desc *dev, enum adin1320_link_cfg_enable val) |
| Enables/Disables the Link. | |
| int | adin1320_cu_get_mii_status (struct adin1320_desc *dev, struct adin1320_mii_status *mii_status) |
| Get Different Status from Copper Media MII Status Register. | |
| int | adin1320_sd_get_mii_status (struct adin1320_desc *dev, struct adin1320_mii_status *mii_status) |
| Get Different Status from SerDes Media MII Status Register. | |
| int | adin1320_cu_autoneg_adv_cfg (struct adin1320_desc *dev, uint16_t autoneg_adv_speeds) |
| Configure Autonegotiation Advertisement Speeds for Copper Media. | |
| int | adin1320_sd_autoneg_adv_cfg (struct adin1320_desc *dev, uint16_t autoneg_adv_speeds) |
| Configure Autonegotiation Advertisement Speeds for SerDes Media. | |
| int | adin1320_cu_get_autoneg_adv (struct adin1320_desc *dev, uint16_t *autoneg_adv_speeds) |
| Get Enabled Autonegotiation Advertised Speeds for Copper Media. | |
| int | adin1320_sd_get_autoneg_adv (struct adin1320_desc *dev, uint16_t *autoneg_adv_speeds) |
| Get Enabled Autonegotiation Advertised Speeds for SerDes Media. | |
| int | adin1320_auto_mdix_cfg (struct adin1320_desc *dev, enum adin1320_auto_mdix val) |
| Auto MDIX Config. | |
| int | adin1320_energy_detect_pwd_cfg (struct adin1320_desc *dev, enum adin1320_energy_detect_pwd val) |
| Energy Detect Power Down mode Config. | |
| int | adin1320_get_energy_detect_pwd_stat (struct adin1320_desc *dev, enum adin1320_edpd_stat *val) |
| Get Energy Detect Power Down mode Status. | |
| int | adin1320_downspeed_cfg (struct adin1320_desc *dev, uint8_t downspeeds) |
| Configure Downspeed. | |
| int | adin1320_set_downspeed_retries (struct adin1320_desc *dev, uint16_t val) |
| Downspeed - Number of retries. | |
| int | adin1320_cu_forced_speed (struct adin1320_desc *dev, enum adin1320_cu_speed val) |
| Set Force Speed for Copper Media. | |
| int | adin1320_sd_forced_speed (struct adin1320_desc *dev, enum adin1320_sd_speed forced_speed) |
| Set Force Speed for SerDes Media. | |
| int | adin1320_set_eee (struct adin1320_desc *dev, uint8_t eee_speeds) |
| Set Energy Efficient Ethernet speeds. | |
| int | adin1320_get_eee (struct adin1320_desc *dev, uint8_t *eee_speeds) |
| Get Energy Efficient Ethernet Status. | |
| int | adin1320_get_master_slave_status (struct adin1320_desc *dev, enum adin1320_master_slave_status *val) |
| Get Master Slave Status. | |
| int | adin1320_master_slave_config (struct adin1320_desc *dev, enum adin1320_adv_master_slave_cfg val) |
| Configure PHY as Master or Slave for 1 Gb speed only. | |
| int | adin1320_cu_config_interrupt (struct adin1320_desc *dev, uint32_t callback_events) |
| Configure the interrupt mask register for copper media. | |
| int | adin1320_sd_config_interrupt (struct adin1320_desc *dev, uint32_t callback_events) |
| Configure the interrupt mask register for serdes media. | |
| int | adin1320_led_cfg (struct adin1320_desc *dev, enum adin1320_led_output_enable enable_led_output, enum adin1320_led_pul_str_dur_select pulse_stretch) |
| Configure general LED settings. | |
| int | adin1320_cu_led_ctrl (struct adin1320_desc *dev, enum adin1320_led_sel led_sel, uint8_t led_pat, uint8_t led_pause, enum adin1320_cu_led_cfg led_cfg, enum adin1320_led_inv_state led_inv_state) |
| Configure LED settings for Copper Media. | |
| int | adin1320_sd_led_ctrl (struct adin1320_desc *dev, enum adin1320_led_sel led_sel, enum adin1320_sd_led_cfg led_cfg, enum adin1320_led_inv_state led_inv_state) |
| Configure LED settings for SerDes Media. | |
| int | adin1320_mgc_match_cfg (struct adin1320_desc *dev, uint16_t enabled_matches) |
| Configure Magic Packet Address Matchings. | |
| int | adin1320_mgc_check_cfg (struct adin1320_desc *dev, uint16_t enabled_checks) |
| Configure Magic Packet Checks. | |
| int | adin1320_mgc_key_cfg (struct adin1320_desc *dev, enum adin1320_mgc_key_byte key_byte, uint8_t key[6]) |
| Configure Magic Packet SecureOn Key. | |
| int | adin1320_wol_address (struct adin1320_desc *dev, uint8_t mac_address[6]) |
| Configure Wake-on-LAN Station Address. | |
| int | adin1320_wol_sys_cfg (struct adin1320_desc *dev, enum adin1320_wol_fi_en enable_fi, enum adin1320_wol_inv active_signal) |
| Configure Wake-on-LAN System Settings. | |
| int | adin1320_wol_sig_cfg (struct adin1320_desc *dev, enum adin1320_wol_sig signal_type, uint8_t pulse_length) |
| Configure Wake-on-LAN Signal Settings. | |
| int | adin1320_wol_wake_cfg (struct adin1320_desc *dev, enum adin1320_wol_wake_key_enable wake_on_key, enum adin1320_wol_wake_link_enable wake_on_link_change) |
| Configure Wake-on-LAN Wake-up Events. | |
| int | adin1320_wol_en_cfg (struct adin1320_desc *dev, enum adin1320_wol_enable enable) |
| Enable/Disable Wake-on-LAN. | |
| int | adin1320_get_active_media (struct adin1320_desc *dev, enum adin1320_active_media *media) |
| Get Auto Media Selected as Active Media. | |
Source file of the ADIN1320 driver.
Copyright 2026(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
| int adin1320_auto_mdix_cfg | ( | struct adin1320_desc * | dev, |
| enum adin1320_auto_mdix | val ) |
Auto MDIX Config.
| dev | - The device structure |
| val | - MDIX configuration |
| int adin1320_config_clk25_ref | ( | struct adin1320_desc * | dev, |
| enum adin1320_clk25_ref_enable | enable ) |
Enable/disable GE Clock 25MHz Reference.
| dev | - The device structure |
| enable | - Enable/disable 25MHz Ref Clock |
| int adin1320_config_gp_clk | ( | struct adin1320_desc * | dev, |
| enum adin1320_gp_clk_source | source ) |
Configure GP Clock.
| dev | - The device structure |
| source | - GP Clock to Select |
| int adin1320_config_rgmii | ( | struct adin1320_desc * | dev, |
| struct adin1320_rgmii_config | rgmii ) |
Configure RGMII Tx and Rx Delays.
| dev | - The device structure |
| rgmii | - Struct container for RGMII configurations |
| int adin1320_cu_autoneg | ( | struct adin1320_desc * | dev, |
| enum adin1320_autoneg_enable | enable ) |
Enable/disable and Reset Autonegotiation for Copper Media.
| dev | - The device structure |
| enable | - Enable and reset autonegotiation, or disable autonegotiation |
| int adin1320_cu_autoneg_adv_cfg | ( | struct adin1320_desc * | dev, |
| uint16_t | autoneg_adv_speeds ) |
Configure Autonegotiation Advertisement Speeds for Copper Media.
| dev | - The device structure |
| autoneg_adv_speeds | - Autoneg Adv speeds to enable (masked with adin1320_cu_speed) |
| int adin1320_cu_config_interrupt | ( | struct adin1320_desc * | dev, |
| uint32_t | callback_events ) |
Configure the interrupt mask register for copper media.
| dev | - The device structure |
| callback_events | - Bitmask of interrupt events to enable |
| int adin1320_cu_forced_speed | ( | struct adin1320_desc * | dev, |
| enum adin1320_cu_speed | val ) |
Set Force Speed for Copper Media.
| dev | - The device structure |
| val | - Forced speed to select |
| int adin1320_cu_get_autoneg_adv | ( | struct adin1320_desc * | dev, |
| uint16_t * | autoneg_adv_speeds ) |
Get Enabled Autonegotiation Advertised Speeds for Copper Media.
| dev | - The device structure |
| autoneg_adv_speeds | - Enabled Autoneg Adv speeds (masked with adin1320_cu_speed) |
| int adin1320_cu_get_mii_status | ( | struct adin1320_desc * | dev, |
| struct adin1320_mii_status * | mii_status ) |
Get Different Status from Copper Media MII Status Register.
| dev | - The device structure |
| mii_status | - Initialized struct container for MII status to be filled |
| int adin1320_cu_led_ctrl | ( | struct adin1320_desc * | dev, |
| enum adin1320_led_sel | led_sel, | ||
| uint8_t | led_pat, | ||
| uint8_t | led_pause, | ||
| enum adin1320_cu_led_cfg | led_cfg, | ||
| enum adin1320_led_inv_state | led_inv_state ) |
Configure LED settings for Copper Media.
| dev | - The device structure |
| led_sel | - LED to configure |
| led_pat | - LED pattern selection |
| led_pause | - Pause duration between patterns |
| led_cfg | - LED configuration |
| led_inv_state | - LED invert state |
| int adin1320_cu_link_cfg | ( | struct adin1320_desc * | dev, |
| enum adin1320_link_cfg_enable | val ) |
Enables/Disables the Link.
| dev | - The device structure |
| val | - Enable/disable link |
| int adin1320_cu_read_irq_status | ( | struct adin1320_desc * | dev, |
| bool * | val_irq_pending, | ||
| uint16_t * | val_irq_status ) |
Read interrupt status for copper media.
| dev | - The device structure |
| val_irq_pending | - Set to true if any IRQ is pending, false otherwise |
| val_irq_status | - The complete IRQ status register value showing status of all IRQs |
| int adin1320_cu_resolved_speed | ( | struct adin1320_desc * | dev, |
| enum adin1320_cu_speed * | resolved_speed ) |
Get Resolved Speed for Copper Media.
| dev | - The device structure |
| resolved_speed | - Resolved speed read from HCD_TECH |
| int adin1320_downspeed_cfg | ( | struct adin1320_desc * | dev, |
| uint8_t | downspeeds ) |
Configure Downspeed.
| dev | - The device structure |
| downspeeds | - Downspeeds to enable (masked with adin1320_downspeed) |
| int adin1320_energy_detect_pwd_cfg | ( | struct adin1320_desc * | dev, |
| enum adin1320_energy_detect_pwd | val ) |
Energy Detect Power Down mode Config.
| dev | - The device structure |
| val | - Energy power down mode |
| int adin1320_get_active_media | ( | struct adin1320_desc * | dev, |
| enum adin1320_active_media * | media ) |
Get Auto Media Selected as Active Media.
| dev | - The device structure |
| media | - Active media selected |
| int adin1320_get_device_id | ( | struct adin1320_desc * | dev, |
| uint32_t * | device_id ) |
Get Device ID.
| dev | - The device structure |
| device_id | - Combined device ID (upper 16 bits: PHY ID 1, lower 16 bits: PHY ID 2) |
| int adin1320_get_eee | ( | struct adin1320_desc * | dev, |
| uint8_t * | eee_speeds ) |
Get Energy Efficient Ethernet Status.
| dev | - The device structure |
| eee_speeds | - Enabled EEE speeds (masked with adin1320_eee_speeds) |
| int adin1320_get_energy_detect_pwd_stat | ( | struct adin1320_desc * | dev, |
| enum adin1320_edpd_stat * | val ) |
Get Energy Detect Power Down mode Status.
| dev | - The device structure |
| val | - Energy Detect Status |
| int adin1320_get_master_slave_status | ( | struct adin1320_desc * | dev, |
| enum adin1320_master_slave_status * | val ) |
Get Master Slave Status.
| dev | - The device structure |
| val | - Master slave status |
| int adin1320_get_software_powerdown | ( | struct adin1320_desc * | dev, |
| enum adin1320_software_powerdown * | val ) |
Get Software Powerdown Status.
| dev | - The device structure |
| val | - Software Powerdown Status |
| int adin1320_hard_reset | ( | struct adin1320_desc * | dev | ) |
Perform Device Hard Reset.
| dev | - The device structure |
| int adin1320_init | ( | struct adin1320_desc ** | dev, |
| struct adin1320_init_param * | param ) |
Initialize the Device.
| dev | - The device structure |
| param | - Initialization parameter containing information about the device to be initialized. |
| int adin1320_led_cfg | ( | struct adin1320_desc * | dev, |
| enum adin1320_led_output_enable | enable_led_output, | ||
| enum adin1320_led_pul_str_dur_select | pulse_stretch ) |
Configure general LED settings.
| dev | - The device structure |
| enable_led_output | - Enable/Disable LED output |
| pulse_stretch | - Pulse stretch duration selection |
| int adin1320_master_slave_config | ( | struct adin1320_desc * | dev, |
| enum adin1320_adv_master_slave_cfg | val ) |
Configure PHY as Master or Slave for 1 Gb speed only.
| dev | - The device structure |
| val | - Config as Master or Slave |
| int adin1320_mgc_check_cfg | ( | struct adin1320_desc * | dev, |
| uint16_t | enabled_checks ) |
Configure Magic Packet Checks.
| dev | - The device structure |
| enabled_checks | - Magic packet checks to enable (masked with adin1320_mgc_chk_en) |
| int adin1320_mgc_key_cfg | ( | struct adin1320_desc * | dev, |
| enum adin1320_mgc_key_byte | key_byte, | ||
| uint8_t | key[6] ) |
Configure Magic Packet SecureOn Key.
| dev | - The device structure |
| key_byte | - Select 6 or 4 byte key |
| key | - Key bytes (array of 6 bytes, only first 4 used for 4-byte key) |
| int adin1320_mgc_match_cfg | ( | struct adin1320_desc * | dev, |
| uint16_t | enabled_matches ) |
Configure Magic Packet Address Matchings.
| dev | - The device structure |
| enabled_matches | - Magic packet address matchings to enable (masked with adin1320_mgc_match_en) |
| int adin1320_read | ( | struct adin1320_desc * | dev, |
| uint32_t | addr, | ||
| uint16_t * | val ) |
MDIO Read with Clause22 or Clause45.
| dev | - The device structure |
| addr | - Register Address |
| val | - Read value from the register |
| int adin1320_remove | ( | struct adin1320_desc * | dev | ) |
Remove Initialization of the Device.
| dev | - The device structure |
| int adin1320_reset_rmii_fifo | ( | struct adin1320_desc * | dev | ) |
Allows the RMII FIFO to be Reset.
| dev | - The device structure |
| int adin1320_sd_autoneg | ( | struct adin1320_desc * | dev, |
| enum adin1320_autoneg_enable | enable ) |
Enable/disable and Reset Autonegotiation for SerDes Media.
| dev | - The device structure |
| enable | - Enable and reset autonegotiation, or disable autonegotiation |
| int adin1320_sd_autoneg_adv_cfg | ( | struct adin1320_desc * | dev, |
| uint16_t | autoneg_adv_speeds ) |
Configure Autonegotiation Advertisement Speeds for SerDes Media.
| dev | - The device structure |
| autoneg_adv_speeds | - Autoneg Adv speeds to enable (masked with adin1320_fi_speed) |
| int adin1320_sd_config_interrupt | ( | struct adin1320_desc * | dev, |
| uint32_t | callback_events ) |
Configure the interrupt mask register for serdes media.
| dev | - The device structure |
| callback_events | - Bitmask of interrupt events to enable |
| int adin1320_sd_forced_speed | ( | struct adin1320_desc * | dev, |
| enum adin1320_sd_speed | forced_speed ) |
Set Force Speed for SerDes Media.
| dev | - The device structure |
| forced_speed | - Forced speed to select |
| int adin1320_sd_get_autoneg_adv | ( | struct adin1320_desc * | dev, |
| uint16_t * | autoneg_adv_speeds ) |
Get Enabled Autonegotiation Advertised Speeds for SerDes Media.
| dev | - The device structure |
| autoneg_adv_speeds | - Enabled Autoneg Adv speeds (masked with adin1320_fi_speed) |
| int adin1320_sd_get_mii_status | ( | struct adin1320_desc * | dev, |
| struct adin1320_mii_status * | mii_status ) |
Get Different Status from SerDes Media MII Status Register.
| dev | - The device structure |
| mii_status | - Initialized struct container for MII status to be filled |
| int adin1320_sd_led_ctrl | ( | struct adin1320_desc * | dev, |
| enum adin1320_led_sel | led_sel, | ||
| enum adin1320_sd_led_cfg | led_cfg, | ||
| enum adin1320_led_inv_state | led_inv_state ) |
Configure LED settings for SerDes Media.
| dev | - The device structure |
| led_sel | - LED to configure |
| led_cfg | - LED configuration |
| led_inv_state | - LED invert state |
| int adin1320_sd_read_irq_status | ( | struct adin1320_desc * | dev, |
| bool * | val_irq_pending, | ||
| uint16_t * | val_irq_status ) |
Read interrupt status for serdes media.
| dev | - The device structure |
| val_irq_pending | - Set to true if any IRQ is pending, false otherwise |
| val_irq_status | - The complete IRQ status register value showing status of all IRQs |
| int adin1320_sd_resolved_speed | ( | struct adin1320_desc * | dev, |
| enum adin1320_sd_speed * | resolved_speed ) |
Get Resolved Speed for SerDes Media.
| dev | - The device structure |
| resolved_speed | - Resolved speed read from SD_LINK_TYPE_CFG |
| int adin1320_select_mac_interface | ( | struct adin1320_desc * | dev, |
| enum adin1320_mac_interface | val ) |
MAC Interface Configuration.
| dev | - The device structure |
| val | - Select MAC Interface |
| int adin1320_set_downspeed_retries | ( | struct adin1320_desc * | dev, |
| uint16_t | val ) |
Downspeed - Number of retries.
| dev | - The device structure |
| val | - Number of retries |
| int adin1320_set_eee | ( | struct adin1320_desc * | dev, |
| uint8_t | eee_speeds ) |
Set Energy Efficient Ethernet speeds.
| dev | - The device structure |
| eee_speeds | - EEE speeds to enable (masked with adin1320_eee_speeds) |
| int adin1320_set_software_powerdown | ( | struct adin1320_desc * | dev, |
| enum adin1320_software_powerdown | val ) |
Enter/exit Software Powerdown.
| dev | - The device structure |
| val | - Enter/exit Software Powerdown |
| int adin1320_soft_reset | ( | struct adin1320_desc * | dev, |
| enum adin1320_soft_reset_option | reset_cfg ) |
Select and Perform Device Reset.
| dev | - The device structure |
| reset_cfg | - Type of soft reset to perform |
| int adin1320_wol_address | ( | struct adin1320_desc * | dev, |
| uint8_t | mac_address[6] ) |
Configure Wake-on-LAN Station Address.
| dev | - The device structure |
| mac_address | - Station MAC address (6 bytes) |
| int adin1320_wol_en_cfg | ( | struct adin1320_desc * | dev, |
| enum adin1320_wol_enable | enable ) |
Enable/Disable Wake-on-LAN.
| dev | - The device structure |
| enable | - Enable/disable Wake-on-LAN |
| int adin1320_wol_sig_cfg | ( | struct adin1320_desc * | dev, |
| enum adin1320_wol_sig | signal_type, | ||
| uint8_t | pulse_length ) |
Configure Wake-on-LAN Signal Settings.
| dev | - The device structure |
| signal_type | - Select the type of signal for wake-up |
| pulse_length | - Pulse length duration selection |
| int adin1320_wol_sys_cfg | ( | struct adin1320_desc * | dev, |
| enum adin1320_wol_fi_en | enable_fi, | ||
| enum adin1320_wol_inv | active_signal ) |
Configure Wake-on-LAN System Settings.
| dev | - The device structure |
| enable_fi | - Enable/disable wake-on-LAN detection from serdes interface |
| active_signal | - Set active signal polarity |
| int adin1320_wol_wake_cfg | ( | struct adin1320_desc * | dev, |
| enum adin1320_wol_wake_key_enable | wake_on_key, | ||
| enum adin1320_wol_wake_link_enable | wake_on_link_change ) |
Configure Wake-on-LAN Wake-up Events.
| dev | - The device structure |
| wake_on_key | - Enable/disable wake on Magic Packet key error |
| wake_on_link_change | - Enable/disable wake on link status change |
| int adin1320_write | ( | struct adin1320_desc * | dev, |
| uint32_t | addr, | ||
| uint16_t | val ) |
MDIO Write with Clause22 or Clause45.
| dev | - The device structure |
| addr | - Register Address |
| val | - Value to write in the register |
| int adin1320_write_bits | ( | struct adin1320_desc * | dev, |
| uint32_t | addr, | ||
| uint16_t | val, | ||
| uint16_t | bitmask ) |
MDIO Write with Clause22 or Clause45 on a Specific Bit.
| dev | - The device structure |
| addr | - Register Address |
| val | - Masked value to write on the bitmask |
| bitmask | - Mask for the bits to be written on |