LAN8742 Part Drivers API Documentation - Custom IO

This page documents the API of the “Custom” IO component of the LAN8742 Part Drivers.

An overview of the driver is also available here: main_doc .

Documentation for the Core component is also availabe here: LAN8742 Part Drivers API Documentation - Core.

Functions

Functions

int32_t lan8742_io_init ( lan8742_io_t * pio )
int32_t lan8742_io_write_c22_reg ( lan8742_io_t * pio , uint8_t reg , uint16_t value )
int32_t lan8742_io_read_c22_reg ( lan8742_io_t * pio , uint8_t reg , uint16_t * pvalue )
int32_t lan8742_io_enable_irq ( lan8742_io_t * pio )

Enables the IRQ line and starts the EXTI.

Parameters :

pio – : Pointer to io interface object

Return values :

error – status (0=success, -1=error)

int32_t lan8742_io_disable_irq ( lan8742_io_t * pio )

Disables the IRQ line and clears the interrupt pending bit.

Parameters :

pio – Pointer to io interface object

Return values :

error – status (0=success, -1=error)

int32_t lan8742_io_register_callback ( lan8742_io_t * pio , lan8742_io_callback_t io_cb , void * arg )

Registers a callback on the IT pin of the LAN8742.

Parameters :
  • pio – : Pointer to io interface object

  • io_cb – : Callback function to be registered

  • arg – : Optional argument given to the callback

Return values :

error – status (0=success, -1=error)

Types

Typedefs

typedef struct lan8742_io_s lan8742_io_t

IO callback function pointer definition

typedef void ( * lan8742_io_callback_t ) ( lan8742_io_t * pio , void * arg )
struct lan8742_io_s

CUSTOM IO object structure.

Note

Add fields as needed to store HAL handles and other resources.

Public Members

uint32_t id

Device ID

uint32_t addr

PHY address on the MDIO bus

lan8742_io_cb_ctx_t exti_cb_ctx

Callback context storing the function pointer and argument

struct lan8742_io_cb_ctx_t

Constants and macros

Defines

LAN8742_CALLBACKS 1