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
79static uint8_t a_lan8720_smi_read(
lan8720_handle_t *handle, uint8_t reg, uint16_t *data)
99static 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 << 12);
338 config &= ~(1 << 11);
349 handle->
debug_print(
"lan8720: smi deinit failed.\n");
356 handle->
debug_print(
"lan8720: reset gpio deinit failed.\n");
393 handle->
debug_print(
"lan8720: read basic control failed.\n");
397 config &= ~(1 << 15);
398 config |= enable << 15;
406 handle->
debug_print(
"lan8720: write basic control failed.\n");
442 handle->
debug_print(
"lan8720: read basic control failed.\n");
479 handle->
debug_print(
"lan8720: read basic control failed.\n");
483 config &= ~(1 << 14);
484 config |= enable << 14;
488 handle->
debug_print(
"lan8720: write basic control failed.\n");
524 handle->
debug_print(
"lan8720: read basic control failed.\n");
561 handle->
debug_print(
"lan8720: read basic control failed.\n");
565 config &= ~(1 << 13);
566 config |= speed << 13;
570 handle->
debug_print(
"lan8720: write basic control failed.\n");
606 handle->
debug_print(
"lan8720: read basic control failed.\n");
643 handle->
debug_print(
"lan8720: read basic control failed.\n");
647 config &= ~(1 << 12);
648 config |= enable << 12;
652 handle->
debug_print(
"lan8720: write basic control failed.\n");
688 handle->
debug_print(
"lan8720: read basic control failed.\n");
725 handle->
debug_print(
"lan8720: read basic control failed.\n");
730 config &= ~(1 << 12);
734 handle->
debug_print(
"lan8720: write basic control failed.\n");
739 config &= ~(1 << 11);
740 config |= enable << 11;
744 handle->
debug_print(
"lan8720: write basic control failed.\n");
780 handle->
debug_print(
"lan8720: read basic control failed.\n");
817 handle->
debug_print(
"lan8720: read basic control failed.\n");
821 config &= ~(1 << 10);
822 config |= enable << 10;
826 handle->
debug_print(
"lan8720: write basic control failed.\n");
862 handle->
debug_print(
"lan8720: read basic control failed.\n");
899 handle->
debug_print(
"lan8720: read basic control failed.\n");
904 config |= enable << 9;
908 handle->
debug_print(
"lan8720: write basic control failed.\n");
944 handle->
debug_print(
"lan8720: read basic control failed.\n");
981 handle->
debug_print(
"lan8720: read basic control failed.\n");
990 handle->
debug_print(
"lan8720: write basic control failed.\n");
1026 handle->
debug_print(
"lan8720: read basic control failed.\n");
1063 handle->
debug_print(
"lan8720: read status control failed.\n");
1100 handle->
debug_print(
"lan8720: read status control failed.\n");
1137 handle->
debug_print(
"lan8720: read status control failed.\n");
1174 handle->
debug_print(
"lan8720: read status control failed.\n");
1211 handle->
debug_print(
"lan8720: read status control failed.\n");
1248 handle->
debug_print(
"lan8720: read status control failed.\n");
1285 handle->
debug_print(
"lan8720: read status control failed.\n");
1322 handle->
debug_print(
"lan8720: read status control failed.\n");
1359 handle->
debug_print(
"lan8720: read status control failed.\n");
1396 handle->
debug_print(
"lan8720: read status control failed.\n");
1433 handle->
debug_print(
"lan8720: read status control failed.\n");
1470 handle->
debug_print(
"lan8720: read status control failed.\n");
1507 handle->
debug_print(
"lan8720: read status control failed.\n");
1544 handle->
debug_print(
"lan8720: read status control failed.\n");
1570 uint8_t model_number, uint8_t revision_number)
1583 if (phy_id > 0x3FFFFF)
1585 handle->
debug_print(
"lan8720: phy_id > 0x3FFFFF.\n");
1589 if (model_number > 0x3F)
1591 handle->
debug_print(
"lan8720: model_number > 0x3F.\n");
1595 if (revision_number > 0xF)
1597 handle->
debug_print(
"lan8720: revision_number > 0xF.\n");
1602 config = phy_id & 0xFFFFL;
1606 handle->
debug_print(
"lan8720: write phy identifier 1 failed.\n");
1611 config = (((phy_id >> 16) & 0x3F) << 10)
1612 | ((model_number & 0x3F) << 4) | (revision_number & 0xF);
1616 handle->
debug_print(
"lan8720: write phy identifier 2 failed.\n");
1638 uint8_t *model_number, uint8_t *revision_number)
1656 handle->
debug_print(
"lan8720: read phy identifier 1 failed.\n");
1663 handle->
debug_print(
"lan8720: read phy identifier 2 failed.\n");
1667 *phy_id = config1 | (uint32_t)((config2 >> 10) & 0x3F) << 16;
1668 *model_number = (config2 >> 4) & 0x3F;
1669 *revision_number = (config2 >> 0) & 0xF;
1702 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
1706 config &= ~(1 << 13);
1707 config |= enable << 13;
1711 handle->
debug_print(
"lan8720: write auto negotiation advertisement failed.\n");
1747 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
1784 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
1788 config &= ~(3 << 10);
1789 config |= pause << 10;
1793 handle->
debug_print(
"lan8720: write auto negotiation advertisement failed.\n");
1829 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
1866 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
1870 config &= ~(1 << 8);
1871 config |= enable << 8;
1875 handle->
debug_print(
"lan8720: write auto negotiation advertisement failed.\n");
1911 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
1948 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
1952 config &= ~(1 << 7);
1953 config |= enable << 7;
1957 handle->
debug_print(
"lan8720: write auto negotiation advertisement failed.\n");
1993 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
2030 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
2034 config &= ~(1 << 6);
2035 config |= enable << 6;
2039 handle->
debug_print(
"lan8720: write auto negotiation advertisement failed.\n");
2075 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
2112 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
2116 config &= ~(1 << 5);
2117 config |= enable << 5;
2121 handle->
debug_print(
"lan8720: write auto negotiation advertisement failed.\n");
2157 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
2191 if (selector > 0x1F)
2193 handle->
debug_print(
"lan8720: selector > 0x1F.\n");
2201 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
2205 config &= ~(0x1F << 0);
2206 config |= selector << 0;
2210 handle->
debug_print(
"lan8720: write auto negotiation advertisement failed.\n");
2246 handle->
debug_print(
"lan8720: read auto negotiation advertisement failed.\n");
2250 *selector = (config) & 0x1F;
2283 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2320 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2357 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2394 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2431 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2468 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2505 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2542 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2579 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2616 handle->
debug_print(
"lan8720: read auto negotiation link partner ability failed.\n");
2620 *selector = config & 0x1F;
2653 handle->
debug_print(
"lan8720: read auto negotiation expansion failed.\n");
2690 handle->
debug_print(
"lan8720: read auto negotiation expansion failed.\n");
2727 handle->
debug_print(
"lan8720: read auto negotiation expansion failed.\n");
2764 handle->
debug_print(
"lan8720: read auto negotiation expansion failed.\n");
2801 handle->
debug_print(
"lan8720: read auto negotiation expansion failed.\n");
2838 handle->
debug_print(
"lan8720: read mode control status failed.\n");
2842 config &= ~(1 << 13);
2843 config |= enable << 13;
2847 handle->
debug_print(
"lan8720: write mode control status failed.\n");
2883 handle->
debug_print(
"lan8720: read mode control status failed.\n");
2920 handle->
debug_print(
"lan8720: read mode control status failed.\n");
2924 config &= ~(1 << 9);
2925 config |= enable << 9;
2929 handle->
debug_print(
"lan8720: write mode control status failed.\n");
2965 handle->
debug_print(
"lan8720: read mode control status failed.\n");
3002 handle->
debug_print(
"lan8720: read mode control status failed.\n");
3006 config &= ~(1 << 6);
3007 config |= enable << 6;
3011 handle->
debug_print(
"lan8720: write mode control status failed.\n");
3047 handle->
debug_print(
"lan8720: read mode control status failed.\n");
3084 handle->
debug_print(
"lan8720: read mode control status failed.\n");
3121 handle->
debug_print(
"lan8720: read special modes failed.\n");
3125 config &= ~(0x07 << 5);
3126 config |= mode << 5;
3130 handle->
debug_print(
"lan8720: write special modes failed.\n");
3166 handle->
debug_print(
"lan8720: read special modes failed.\n");
3210 handle->
debug_print(
"lan8720: read special modes failed.\n");
3214 config &= ~(0x1F << 0);
3215 config |= addr << 0;
3219 handle->
debug_print(
"lan8720: write special modes failed.\n");
3255 handle->
debug_print(
"lan8720: read special modes failed.\n");
3259 *addr = config & 0x1F;
3292 handle->
debug_print(
"lan8720: read symbol error counter failed.\n");
3329 handle->
debug_print(
"lan8720: read control status indication failed.\n");
3333 config &= ~(1 << 15);
3334 config |= (!enable) << 15;
3338 handle->
debug_print(
"lan8720: write control status indication failed.\n");
3374 handle->
debug_print(
"lan8720: read control status indication failed.\n");
3411 handle->
debug_print(
"lan8720: read control status indication failed.\n");
3415 config &= ~(1 << 13);
3416 config |= select << 13;
3420 handle->
debug_print(
"lan8720: write control status indication failed.\n");
3456 handle->
debug_print(
"lan8720: read control status indication failed.\n");
3493 handle->
debug_print(
"lan8720: read control status indication failed.\n");
3497 config &= ~(1 << 11);
3498 config |= enable << 11;
3502 handle->
debug_print(
"lan8720: write control status indication failed.\n");
3538 handle->
debug_print(
"lan8720: read control status indication failed.\n");
3575 handle->
debug_print(
"lan8720: read control status indication failed.\n");
3613 handle->
debug_print(
"lan8720: read interrupt source failed.\n");
3651 handle->
debug_print(
"lan8720: read interrupt mask failed.\n");
3655 config &= ~(1 << interrupt);
3656 config |= enable << interrupt;
3660 handle->
debug_print(
"lan8720: write interrupt mask failed.\n");
3697 handle->
debug_print(
"lan8720: read interrupt mask failed.\n");
3734 handle->
debug_print(
"lan8720: read phy special control status failed.\n");
3771 handle->
debug_print(
"lan8720: read phy special control status failed.\n");
3810 return a_lan8720_smi_write(handle, reg, value);
3843 return a_lan8720_smi_read(handle, reg, value);
3864 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
struct lan8720_info_s lan8720_info_t
lan8720 information structure definition
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
struct lan8720_handle_s lan8720_handle_t
lan8720 handle structure definition
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
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)
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v