Skip to content

Commit 9e6dcd7

Browse files
committed
feat(eth): Ethernet - enc28j60 driver custom SPI and polling
1 parent adaf46d commit 9e6dcd7

File tree

2 files changed

+240
-159
lines changed

2 files changed

+240
-159
lines changed

libraries/Ethernet/src/utility/enc28j60/esp_eth_enc28j60.h

+9-6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ extern "C" {
2323
typedef struct {
2424
spi_host_device_t spi_host_id; /*!< SPI peripheral */
2525
spi_device_interface_config_t *spi_devcfg; /*!< SPI device configuration */
26+
eth_spi_custom_driver_config_t custom_spi_driver; /*!< Custom SPI driver definitions */
2627
int int_gpio_num; /*!< Interrupt GPIO number */
28+
uint32_t poll_period_ms; /*!< Period in ms to poll rx status when interrupt mode is not used */
2729
} eth_enc28j60_config_t;
2830

2931
/**
@@ -41,12 +43,13 @@ typedef enum {
4143
* @brief Default ENC28J60 specific configuration
4244
*
4345
*/
44-
#define ETH_ENC28J60_DEFAULT_CONFIG(spi_host, spi_devcfg_p) \
45-
{ \
46-
.spi_host_id = spi_host, \
47-
.spi_devcfg = spi_devcfg_p, \
48-
.int_gpio_num = 4, \
49-
}
46+
#define ETH_ENC28J60_DEFAULT_CONFIG(spi_host, spi_devcfg_p) { \
47+
.spi_host_id = spi_host, \
48+
.spi_devcfg = spi_devcfg_p, \
49+
.custom_spi_driver = ETH_DEFAULT_SPI, \
50+
.int_gpio_num = 4, \
51+
.poll_period_ms = 0, \
52+
}
5053

5154
/**
5255
* @brief Compute amount of SPI bit-cycles the CS should stay active after the transmission

0 commit comments

Comments
 (0)