42 #define CHIP_NAME "Microchip LAN8720"
43 #define MANUFACTURER_NAME "Microchip"
44 #define SUPPLY_VOLTAGE_MIN 3.0f
45 #define SUPPLY_VOLTAGE_MAX 3.6f
46 #define MAX_CURRENT 60.0f
47 #define TEMPERATURE_MIN -40.0f
48 #define TEMPERATURE_MAX 85.0f
49 #define DRIVER_VERSION 1000
54 #define LAN8720_REG_BASIC_CONTROL 0x00
55 #define LAN8720_REG_BASIC_STATUS 0x01
56 #define LAN8720_REG_PHY_IDENTIFIER_1 0x02
57 #define LAN8720_REG_PHY_IDENTIFIER_2 0x03
58 #define LAN8720_REG_AUTO_NEGOTIATION_ADVERTISEMENT 0x04
59 #define LAN8720_REG_AUTO_NEGOTIATION_LINK_PARTNER_ABILITY 0x05
60 #define LAN8720_REG_AUTO_NEGOTIATION_EXPANSION 0x06
61 #define LAN8720_REG_MODE_CONTROL_STATUS 0x11
62 #define LAN8720_REG_SPECIAL_MODES 0x12
63 #define LAN8720_REG_SYMBOL_ERROR_COUNTER_REGISTER 0x1A
64 #define LAN8720_REG_SPECIAL_CONTROL_STATUS_INDICATIONS 0x1B
65 #define LAN8720_REG_INTERRUPT_SOURCE_FLAG 0x1D
66 #define LAN8720_REG_INTERRUPT_MASK 0x1E
67 #define LAN8720_REG_PHY_SPECIAL_CONTROL_STATUS 0x1F
79 static uint8_t a_lan8720_smi_read(
lan8720_handle_t *handle, uint8_t reg, uint16_t *data)
99 static uint8_t a_lan8720_smi_write(
lan8720_handle_t *handle, uint8_t reg, uint16_t data)
183 handle->
debug_print(
"lan8720: smi_init is null.\n");
189 handle->
debug_print(
"lan8720: smi_deinit is null.\n");
195 handle->
debug_print(
"lan8720: smi_read is null.\n");
201 handle->
debug_print(
"lan8720: smi_write is null.\n");
207 handle->
debug_print(
"lan8720: reset_gpio_init is null.\n");
213 handle->
debug_print(
"lan8720: reset_gpio_deinit is null.\n");
219 handle->
debug_print(
"lan8720: reset_gpio_write is null.\n");
225 handle->
debug_print(
"lan8720: delay_ms is null.\n");
232 handle->
debug_print(
"lan8720: reset gpio init failed.\n");
238 handle->
debug_print(
"lan8720: reset gpio write failed.\n");
246 handle->
debug_print(
"lan8720: reset gpio write failed.\n");
254 handle->
debug_print(
"lan8720: smi init failed.\n");
268 config &= ~(1 << 15);
287 if ((config & (1 <<15)) != 0)
331 config &= ~(1 << 11);
342 handle->
debug_print(
"lan8720: smi deinit failed.\n");
349 handle->
debug_print(
"lan8720: reset gpio deinit failed.\n");
386 handle->
debug_print(
"lan8720: read basic control failed.\n");
390 config &= ~(1 << 15);
391 config |= enable << 15;
395 handle->
debug_print(
"lan8720: write basic control failed.\n");
431 handle->
debug_print(
"lan8720: read basic control failed.\n");
468 handle->
debug_print(
"lan8720: read basic control failed.\n");
472 config &= ~(1 << 14);
473 config |= enable << 14;
477 handle->
debug_print(
"lan8720: write basic control failed.\n");
513 handle->
debug_print(
"lan8720: read basic control failed.\n");
550 handle->
debug_print(
"lan8720: read basic control failed.\n");
554 config &= ~(1 << 13);
555 config |= speed << 13;
559 handle->
debug_print(
"lan8720: write basic control failed.\n");
595 handle->
debug_print(
"lan8720: read basic control failed.\n");
632 handle->
debug_print(
"lan8720: read basic control failed.\n");
636 config &= ~(1 << 12);
637 config |= enable << 12;
641 handle->
debug_print(
"lan8720: write basic control failed.\n");
677 handle->
debug_print(
"lan8720: read basic control failed.\n");
714 handle->
debug_print(
"lan8720: read basic control failed.\n");
718 config &= ~(1 << 11);
719 config |= enable << 11;
723 handle->
debug_print(
"lan8720: write basic control failed.\n");
759 handle->
debug_print(
"lan8720: read basic control failed.\n");
796 handle->
debug_print(
"lan8720: read basic control failed.\n");
800 config &= ~(1 << 10);
801 config |= enable << 10;
805 handle->
debug_print(
"lan8720: write basic control failed.\n");
841 handle->
debug_print(
"lan8720: read basic control failed.\n");
878 handle->
debug_print(
"lan8720: read basic control failed.\n");
883 config |= enable << 9;
887 handle->
debug_print(
"lan8720: write basic control failed.\n");
923 handle->
debug_print(
"lan8720: read basic control failed.\n");
960 handle->
debug_print(
"lan8720: read basic control failed.\n");
969 handle->
debug_print(
"lan8720: write basic control failed.\n");
1005 handle->
debug_print(
"lan8720: read basic control failed.\n");
1042 handle->
debug_print(
"lan8720: read status control failed.\n");
1079 handle->
debug_print(
"lan8720: read status control failed.\n");
1116 handle->
debug_print(
"lan8720: read status control failed.\n");
1153 handle->
debug_print(
"lan8720: read status control failed.\n");
1190 handle->
debug_print(
"lan8720: read status control failed.\n");
1227 handle->
debug_print(
"lan8720: read status control failed.\n");
1264 handle->
debug_print(
"lan8720: read status control failed.\n");
1301 handle->
debug_print(
"lan8720: read status control failed.\n");
1338 handle->
debug_print(
"lan8720: read status control failed.\n");
1375 handle->
debug_print(
"lan8720: read status control failed.\n");
1412 handle->
debug_print(
"lan8720: read status control failed.\n");
1449 handle->
debug_print(
"lan8720: read status control failed.\n");
1486 handle->
debug_print(
"lan8720: read status control failed.\n");
1523 handle->
debug_print(
"lan8720: read status control failed.\n");
1549 uint8_t model_number, uint8_t revision_number)
1562 if (phy_id > 0x3FFFFF)
1564 handle->
debug_print(
"lan8720: phy_id > 0x3FFFFF.\n");
1568 if (model_number > 0x3F)
1570 handle->
debug_print(
"lan8720: model_number > 0x3F.\n");
1574 if (revision_number > 0xF)
1576 handle->
debug_print(
"lan8720: revision_number > 0xF.\n");
1581 config = phy_id & 0xFFFFL;
1585 handle->
debug_print(
"lan8720: write phy identifier 1 failed.\n");
1590 config = (((phy_id >> 16) & 0x3F) << 10)
1591 | ((model_number & 0x3F) << 4) | (revision_number & 0xF);
1595 handle->
debug_print(
"lan8720: write phy identifier 2 failed.\n");
1617 uint8_t *model_number, uint8_t *revision_number)
1635 handle->
debug_print(
"lan8720: read phy identifier 1 failed.\n");
1642 handle->
debug_print(
"lan8720: read phy identifier 2 failed.\n");
1646 *phy_id = config1 | (uint32_t)((config2 >> 10) & 0x3F) << 16;
1647 *model_number = (config2 >> 4) & 0x3F;
1648 *revision_number = (config2 >> 0) & 0xF;
1681 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
1685 config &= ~(1 << 13);
1686 config |= enable << 13;
1690 handle->
debug_print(
"lan8720: write auto negotiation advertisement failed.\n");
1726 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
1763 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
1767 config &= ~(3 << 10);
1768 config |= pause << 10;
1772 handle->
debug_print(
"lan8720: write auto negotiation advertisement failed.\n");
1808 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
1845 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
1849 config &= ~(1 << 8);
1850 config |= enable << 8;
1854 handle->
debug_print(
"lan8720: write auto negotiation advertisement failed.\n");
1890 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
1927 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
1931 config &= ~(1 << 7);
1932 config |= enable << 7;
1936 handle->
debug_print(
"lan8720: write auto negotiation advertisement failed.\n");
1972 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
2009 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
2013 config &= ~(1 << 6);
2014 config |= enable << 6;
2018 handle->
debug_print(
"lan8720: write auto negotiation advertisement failed.\n");
2054 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
2091 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
2095 config &= ~(1 << 5);
2096 config |= enable << 5;
2100 handle->
debug_print(
"lan8720: write auto negotiation advertisement failed.\n");
2136 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
2170 if (selector > 0x1F)
2172 handle->
debug_print(
"lan8720: selector > 0x1F.\n");
2180 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
2184 config &= ~(0x1F << 0);
2185 config |= selector << 0;
2189 handle->
debug_print(
"lan8720: write auto negotiation advertisement failed.\n");
2225 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
2229 *selector = (config) & 0x1F;
2262 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2299 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2336 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2373 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2410 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2447 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2484 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2521 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2558 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2595 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2599 *selector = config & 0x1F;
2632 handle->
debug_print(
"lan8720: read auto negotiation expansion failed.\n");
2669 handle->
debug_print(
"lan8720: read auto negotiation expansion failed.\n");
2706 handle->
debug_print(
"lan8720: read auto negotiation expansion failed.\n");
2743 handle->
debug_print(
"lan8720: read auto negotiation expansion failed.\n");
2780 handle->
debug_print(
"lan8720: read auto negotiation expansion failed.\n");
2817 handle->
debug_print(
"lan8720: read mode control status failed.\n");
2821 config &= ~(1 << 13);
2822 config |= enable << 13;
2826 handle->
debug_print(
"lan8720: write mode control status failed.\n");
2862 handle->
debug_print(
"lan8720: read mode control status failed.\n");
2899 handle->
debug_print(
"lan8720: read mode control status failed.\n");
2903 config &= ~(1 << 9);
2904 config |= enable << 9;
2908 handle->
debug_print(
"lan8720: write mode control status failed.\n");
2944 handle->
debug_print(
"lan8720: read mode control status failed.\n");
2981 handle->
debug_print(
"lan8720: read mode control status failed.\n");
2985 config &= ~(1 << 6);
2986 config |= enable << 6;
2990 handle->
debug_print(
"lan8720: write mode control status failed.\n");
3026 handle->
debug_print(
"lan8720: read mode control status failed.\n");
3063 handle->
debug_print(
"lan8720: read mode control status failed.\n");
3100 handle->
debug_print(
"lan8720: read special modes failed.\n");
3104 config &= ~(0x07 << 5);
3105 config |= mode << 5;
3109 handle->
debug_print(
"lan8720: write special modes failed.\n");
3145 handle->
debug_print(
"lan8720: read special modes failed.\n");
3189 handle->
debug_print(
"lan8720: read special modes failed.\n");
3193 config &= ~(0x1F << 0);
3194 config |= addr << 0;
3198 handle->
debug_print(
"lan8720: write special modes failed.\n");
3234 handle->
debug_print(
"lan8720: read special modes failed.\n");
3238 *addr = config & 0x1F;
3271 handle->
debug_print(
"lan8720: read symbol error counter failed.\n");
3308 handle->
debug_print(
"lan8720: read control status indication failed.\n");
3312 config &= ~(1 << 15);
3313 config |= enable << 15;
3317 handle->
debug_print(
"lan8720: write control status indication failed.\n");
3353 handle->
debug_print(
"lan8720: read control status indication failed.\n");
3390 handle->
debug_print(
"lan8720: read control status indication failed.\n");
3394 config &= ~(1 << 13);
3395 config |= select << 13;
3399 handle->
debug_print(
"lan8720: write control status indication failed.\n");
3435 handle->
debug_print(
"lan8720: read control status indication failed.\n");
3472 handle->
debug_print(
"lan8720: read control status indication failed.\n");
3476 config &= ~(1 << 11);
3477 config |= enable << 11;
3481 handle->
debug_print(
"lan8720: write control status indication failed.\n");
3517 handle->
debug_print(
"lan8720: read control status indication failed.\n");
3554 handle->
debug_print(
"lan8720: read control status indication failed.\n");
3592 handle->
debug_print(
"lan8720: read interrupt source failed.\n");
3630 handle->
debug_print(
"lan8720: read interrupt mask failed.\n");
3634 config &= ~(1 << interrupt);
3635 config |= enable << interrupt;
3639 handle->
debug_print(
"lan8720: write interrupt mask failed.\n");
3676 handle->
debug_print(
"lan8720: read interrupt mask failed.\n");
3713 handle->
debug_print(
"lan8720: read phy special control status failed.\n");
3750 handle->
debug_print(
"lan8720: read phy special control status failed.\n");
3789 return a_lan8720_smi_write(handle, reg, value);
3822 return a_lan8720_smi_read(handle, reg, value);
3843 strncpy(info->
interface,
"SMI RMII", 16);
#define LAN8720_REG_SPECIAL_MODES
#define LAN8720_REG_PHY_IDENTIFIER_2
#define LAN8720_REG_SPECIAL_CONTROL_STATUS_INDICATIONS
#define LAN8720_REG_AUTO_NEGOTIATION_LINK_PARTNER_ABILITY
#define LAN8720_REG_PHY_SPECIAL_CONTROL_STATUS
#define SUPPLY_VOLTAGE_MAX
#define LAN8720_REG_BASIC_STATUS
#define LAN8720_REG_INTERRUPT_MASK
#define LAN8720_REG_AUTO_NEGOTIATION_EXPANSION
#define LAN8720_REG_BASIC_CONTROL
chip register definition
#define MANUFACTURER_NAME
#define LAN8720_REG_MODE_CONTROL_STATUS
#define SUPPLY_VOLTAGE_MIN
#define LAN8720_REG_PHY_IDENTIFIER_1
#define LAN8720_REG_AUTO_NEGOTIATION_ADVERTISEMENT
#define CHIP_NAME
chip information definition
#define LAN8720_REG_SYMBOL_ERROR_COUNTER_REGISTER
#define LAN8720_REG_INTERRUPT_SOURCE_FLAG
driver lan8720 header file
uint8_t lan8720_get_auto_negotiation_expansion_link_partner_auto_negotiation_able(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation expansion link partner auto negotiation able status
uint8_t lan8720_get_auto_negotiation_link_partner_ability_remote_fault(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation link partner ability remote fault status
uint8_t lan8720_get_auto_negotiation_done(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation done status
uint8_t lan8720_set_energy_detect_power_down_mode(lan8720_handle_t *handle, lan8720_bool_t enable)
enable or disable energy detect power down mode
uint8_t lan8720_get_auto_negotiation_advertisement_100base_tx_full_duplex(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation advertisement 100base tx full duplex status
uint8_t lan8720_get_auto_negotiation_link_partner_ability_selector_field(lan8720_handle_t *handle, uint8_t *selector)
get auto negotiation link partner ability selector field
uint8_t lan8720_get_auto_mdix(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto mdix status
uint8_t lan8720_get_auto_negotiation_advertisement_10base_t_full_duplex(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation advertisement 10base t full duplex status
uint8_t lan8720_get_interrupt_mask(lan8720_handle_t *handle, lan8720_interrupt_t interrupt, lan8720_bool_t *enable)
get interrupt mask status
uint8_t lan8720_get_energy_detected(lan8720_handle_t *handle, lan8720_bool_t *enable)
get energy detected status
uint8_t lan8720_get_phy_address(lan8720_handle_t *handle, uint8_t *addr)
get phy address
uint8_t lan8720_get_auto_negotiation_link_partner_ability_100base_tx(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation link partner ability 100base tx status
uint8_t lan8720_get_auto_negotiation_advertisement_remote_fault(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation advertisement remote fault status
uint8_t lan8720_set_interrupt_mask(lan8720_handle_t *handle, lan8720_interrupt_t interrupt, lan8720_bool_t enable)
set interrupt mask
uint8_t lan8720_set_auto_negotiation_advertisement_pause(lan8720_handle_t *handle, lan8720_pause_t pause)
set auto negotiation advertisement pause
uint8_t lan8720_set_auto_negotiation_advertisement_10base_t(lan8720_handle_t *handle, lan8720_bool_t enable)
enable or disable auto negotiation advertisement 10base t
lan8720_polarity_t
lan8720 polarity enumeration definition
uint8_t lan8720_get_symbol_error_counter(lan8720_handle_t *handle, uint16_t *cnt)
get symbol error counter
uint8_t lan8720_get_auto_negotiation_advertisement_100base_tx(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation advertisement 100base tx status
uint8_t lan8720_get_energy_detect_power_down_mode(lan8720_handle_t *handle, lan8720_bool_t *enable)
get energy detect power down mode status
uint8_t lan8720_get_auto_negotiation_advertisement_selector_field(lan8720_handle_t *handle, uint8_t *selector)
get auto negotiation advertisement selector field
uint8_t lan8720_set_auto_negotiation_advertisement_100base_tx_full_duplex(lan8720_handle_t *handle, lan8720_bool_t enable)
enable or disable auto negotiation advertisement 100base tx full duplex
lan8720_mode_t
lan8720 mode enumeration definition
uint8_t lan8720_get_auto_negotiation_link_partner_ability_next_page(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation link partner ability next page status
uint8_t lan8720_get_auto_negotiation_link_partner_ability_10base_t(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation link partner ability 10base t status
uint8_t lan8720_get_auto_negotiation_link_partner_ability_10base_t_full_duplex(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation link partner ability 10base t full duplex status
uint8_t lan8720_get_polarity(lan8720_handle_t *handle, lan8720_polarity_t *polarity)
get polarity
uint8_t lan8720_set_auto_negotiation_advertisement_100base_tx(lan8720_handle_t *handle, lan8720_bool_t enable)
enable or disable auto negotiation advertisement 100base tx
lan8720_manual_channel_select_t
lan8720 manual channel select enumeration definition
uint8_t lan8720_get_auto_negotiation_expansion_page_received(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation expansion page received status
uint8_t lan8720_get_auto_negotiation_expansion_link_partner_next_page_able(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation expansion link partner next page able status
uint8_t lan8720_set_phy_address(lan8720_handle_t *handle, uint8_t addr)
set phy address
lan8720_interrupt_t
lan8720 interrupt enumeration definition
uint8_t lan8720_set_auto_negotiation_advertisement_selector_field(lan8720_handle_t *handle, uint8_t selector)
set auto negotiation advertisement selector field
uint8_t lan8720_get_far_loop_back(lan8720_handle_t *handle, lan8720_bool_t *enable)
get far loop back status
uint8_t lan8720_set_identifier(lan8720_handle_t *handle, uint32_t phy_id, uint8_t model_number, uint8_t revision_number)
set identifier
uint8_t lan8720_get_auto_negotiation_link_partner_ability_100base_t4(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation link partner ability 100base t4 status
uint8_t lan8720_set_far_loop_back(lan8720_handle_t *handle, lan8720_bool_t enable)
enable or disable far loop back
uint8_t lan8720_get_identifier(lan8720_handle_t *handle, uint32_t *phy_id, uint8_t *model_number, uint8_t *revision_number)
get identifier
uint8_t lan8720_set_mode(lan8720_handle_t *handle, lan8720_mode_t mode)
set mode
uint8_t lan8720_set_manual_channel_select(lan8720_handle_t *handle, lan8720_manual_channel_select_t select)
set manual channel select
uint8_t lan8720_get_auto_negotiation_link_partner_ability_100base_tx_full_duplex(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation link partner ability 100base tx full duplex status
uint8_t lan8720_get_auto_negotiation_link_partner_ability_acknowledge(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation link partner ability acknowledge status
uint8_t lan8720_set_auto_negotiation_advertisement_remote_fault(lan8720_handle_t *handle, lan8720_bool_t enable)
enable or disable auto negotiation advertisement remote fault
uint8_t lan8720_get_interrupt_flag(lan8720_handle_t *handle, lan8720_interrupt_t interrupt, lan8720_bool_t *enable)
get interrupt flag status
uint8_t lan8720_get_speed_indication(lan8720_handle_t *handle, lan8720_speed_indication_t *speed)
get speed indication
uint8_t lan8720_get_auto_negotiation_link_partner_ability_pause(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation link partner ability pause status
uint8_t lan8720_get_auto_negotiation_expansion_parallel_detection_fault(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation expansion parallel detection fault status
uint8_t lan8720_get_auto_negotiation_advertisement_pause(lan8720_handle_t *handle, lan8720_pause_t *pause)
get auto negotiation advertisement pause
uint8_t lan8720_set_auto_negotiation_advertisement_10base_t_full_duplex(lan8720_handle_t *handle, lan8720_bool_t enable)
enable or disable auto negotiation advertisement 10base t full duplex
uint8_t lan8720_get_sqe_test_off(lan8720_handle_t *handle, lan8720_bool_t *enable)
get sqe test off status
lan8720_speed_indication_t
lan8720 speed indication enumeration definition
uint8_t lan8720_get_manual_channel_select(lan8720_handle_t *handle, lan8720_manual_channel_select_t *select)
get manual channel select
uint8_t lan8720_get_alternate_interrupt_mode(lan8720_handle_t *handle, lan8720_bool_t *enable)
get alternate interrupt mode status
uint8_t lan8720_set_auto_mdix(lan8720_handle_t *handle, lan8720_bool_t enable)
enable or disable auto mdix
uint8_t lan8720_set_alternate_interrupt_mode(lan8720_handle_t *handle, lan8720_bool_t enable)
enable or disable alternate interrupt mode
uint8_t lan8720_get_auto_negotiation_expansion_next_page_able(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation expansion next page able status
uint8_t lan8720_get_mode(lan8720_handle_t *handle, lan8720_mode_t *mode)
get mode
uint8_t lan8720_get_auto_negotiation_advertisement_10base_t(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation advertisement 10base t status
lan8720_pause_t
lan8720 pause enumeration definition
uint8_t lan8720_set_sqe_test_off(lan8720_handle_t *handle, lan8720_bool_t enable)
enable or disable sqe test off
uint8_t lan8720_set_duplex_mode(lan8720_handle_t *handle, lan8720_duplex_t mode)
set duplex mode
uint8_t lan8720_get_auto_negotiate_ability(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiate ability status
uint8_t lan8720_get_extended_status_information(lan8720_handle_t *handle, lan8720_bool_t *enable)
get extended status information status
uint8_t lan8720_get_electrical_isolation(lan8720_handle_t *handle, lan8720_bool_t *enable)
get electrical isolation status
uint8_t lan8720_get_100base_t4(lan8720_handle_t *handle, lan8720_bool_t *enable)
get 100base t4 status
uint8_t lan8720_set_loop_back(lan8720_handle_t *handle, lan8720_bool_t enable)
enable or disable loop back
uint8_t lan8720_get_address(lan8720_handle_t *handle, uint8_t *addr)
get the chip address
uint8_t lan8720_get_link_status(lan8720_handle_t *handle, lan8720_link_t *status)
get link status
uint8_t lan8720_set_speed_select(lan8720_handle_t *handle, lan8720_speed_t speed)
set speed select
uint8_t lan8720_get_restart_auto_negotiate(lan8720_handle_t *handle, lan8720_bool_t *enable)
get restart auto negotiate status
uint8_t lan8720_init(lan8720_handle_t *handle)
initialize the chip
uint8_t lan8720_get_duplex_mode(lan8720_handle_t *handle, lan8720_duplex_t *mode)
get duplex mode
uint8_t lan8720_get_100base_tx_full_duplex(lan8720_handle_t *handle, lan8720_bool_t *enable)
get 100base tx full duplex status
lan8720_bool_t
lan8720 bool enumeration definition
uint8_t lan8720_deinit(lan8720_handle_t *handle)
close the chip
uint8_t lan8720_get_auto_negotiation(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiation status
uint8_t lan8720_get_remote_fault(lan8720_handle_t *handle, lan8720_bool_t *enable)
get remote fault status
lan8720_duplex_t
lan8720 duplex enumeration definition
uint8_t lan8720_set_restart_auto_negotiate(lan8720_handle_t *handle, lan8720_bool_t enable)
enable or disable restart auto negotiate
uint8_t lan8720_get_100base_t2_half_duplex(lan8720_handle_t *handle, lan8720_bool_t *enable)
get 100base t2 half duplex status
uint8_t lan8720_get_100base_tx_half_duplex(lan8720_handle_t *handle, lan8720_bool_t *enable)
get 100base tx half duplex status
uint8_t lan8720_get_loop_back(lan8720_handle_t *handle, lan8720_bool_t *enable)
get loop back status
uint8_t lan8720_get_10base_t_full_duplex(lan8720_handle_t *handle, lan8720_bool_t *enable)
get 10base t full duplex status
uint8_t lan8720_set_soft_reset(lan8720_handle_t *handle, lan8720_bool_t enable)
enable or disable soft reset
uint8_t lan8720_get_speed_select(lan8720_handle_t *handle, lan8720_speed_t *speed)
get speed select status
lan8720_link_t
lan8720 link enumeration definition
uint8_t lan8720_set_auto_negotiation(lan8720_handle_t *handle, lan8720_bool_t enable)
enable or disable auto negotiation
uint8_t lan8720_get_soft_reset(lan8720_handle_t *handle, lan8720_bool_t *enable)
get soft reset status
uint8_t lan8720_get_auto_negotiate_complete(lan8720_handle_t *handle, lan8720_bool_t *enable)
get auto negotiate complete status
uint8_t lan8720_get_100base_t2_full_duplex(lan8720_handle_t *handle, lan8720_bool_t *enable)
get 100base t2 full duplex status
uint8_t lan8720_get_10base_t_half_duplex(lan8720_handle_t *handle, lan8720_bool_t *enable)
get 10base t half duplex status
uint8_t lan8720_info(lan8720_info_t *info)
get chip's information
uint8_t lan8720_set_power_down(lan8720_handle_t *handle, lan8720_bool_t enable)
enable or disable power down
uint8_t lan8720_get_extended_capabilities(lan8720_handle_t *handle, lan8720_bool_t *enable)
get extended capabilities status
uint8_t lan8720_get_jabber_detect(lan8720_handle_t *handle, lan8720_bool_t *enable)
get jabber detect status
lan8720_speed_t
lan8720 speed enumeration definition
uint8_t lan8720_set_address(lan8720_handle_t *handle, uint8_t addr)
set the chip address
uint8_t lan8720_get_power_down(lan8720_handle_t *handle, lan8720_bool_t *enable)
get power down status
uint8_t lan8720_set_electrical_isolation(lan8720_handle_t *handle, lan8720_bool_t enable)
enable or disable electrical isolation
uint8_t lan8720_set_reg(lan8720_handle_t *handle, uint8_t reg, uint16_t value)
set the chip register
uint8_t lan8720_get_reg(lan8720_handle_t *handle, uint8_t reg, uint16_t *value)
get the chip register
lan8720 handle structure definition
uint8_t(* smi_deinit)(void)
uint8_t(* smi_write)(uint8_t addr, uint8_t reg, uint16_t data)
void(* delay_ms)(uint32_t ms)
uint8_t(* smi_init)(void)
uint8_t(* reset_gpio_deinit)(void)
void(* debug_print)(const char *const fmt,...)
uint8_t(* reset_gpio_init)(void)
uint8_t(* smi_read)(uint8_t addr, uint8_t reg, uint16_t *data)
uint8_t(* reset_gpio_write)(uint8_t level)
lan8720 information structure definition
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v