Skip to content

Commit cdeb14d

Browse files
committed
IDF release/v5.1 d3c99ed3b8
1 parent 6f53f22 commit cdeb14d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+708
-90
lines changed

esp32/flags/defines

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
-DESP_PLATFORM -DIDF_VER=\"v5.1.1-1-gd3c99ed3b8\" -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DUNITY_INCLUDE_CONFIG_H -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -DconfigENABLE_FREERTOS_DEBUG_OCDAWARE=1 -DTF_LITE_STATIC_MEMORY
1+
-DESP_PLATFORM -DIDF_VER=\"v5.1.1-1-gd3c99ed3b8-dirty\" -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DUNITY_INCLUDE_CONFIG_H -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -DconfigENABLE_FREERTOS_DEBUG_OCDAWARE=1 -DTF_LITE_STATIC_MEMORY

esp32/include/esp_eth/include/esp_eth_mac.h

Lines changed: 116 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -470,15 +470,113 @@ typedef struct {
470470
esp_eth_mac_t *esp_eth_mac_new_esp32(const eth_esp32_emac_config_t *esp32_config, const eth_mac_config_t *config);
471471
#endif // CONFIG_ETH_USE_ESP32_EMAC
472472

473+
#if CONFIG_ETH_USE_SPI_ETHERNET
474+
/**
475+
* @brief Custom SPI Driver Configuration.
476+
* This structure declares configuration and callback functions to access Ethernet SPI module via
477+
* user's custom SPI driver.
478+
*
479+
*/
480+
typedef struct
481+
{
482+
/**
483+
* @brief Custom driver specific configuration structure used by `init()` function.
484+
*
485+
* @note Type and its content is fully under user's control
486+
*
487+
*/
488+
void *config;
489+
490+
/**
491+
* @brief Custom driver SPI Initialization
492+
*
493+
* @param[in] spi_config: Custom driver specific configuration
494+
*
495+
* @return
496+
* - spi_ctx: when initialization is successful, a pointer to context structure holding all variables
497+
* needed for subsequent SPI access operations (e.g. SPI bus identification, mutexes, etc.)
498+
* - NULL: driver initialization failed
499+
*
500+
* @note return type and its content is fully under user's control
501+
*/
502+
void *(*init)(const void *spi_config);
503+
504+
/**
505+
* @brief Custom driver De-initialization
506+
*
507+
* @param[in] spi_ctx: a pointer to driver specific context structure
508+
*
509+
* @return
510+
* - ESP_OK: driver de-initialization was successful
511+
* - ESP_FAIL: driver de-initialization failed
512+
* - any other failure codes are allowed to be used to provide failure isolation
513+
*/
514+
esp_err_t (*deinit)(void *spi_ctx);
515+
516+
/**
517+
* @brief Custom driver SPI read
518+
*
519+
* @note The read function is responsible to construct command, address and data fields
520+
* of the SPI frame in format expected by particular SPI Ethernet module
521+
*
522+
* @param[in] spi_ctx: a pointer to driver specific context structure
523+
* @param[in] cmd: command
524+
* @param[in] addr: register address
525+
* @param[out] data: read data
526+
* @param[in] data_len: read data length in bytes
527+
*
528+
* @return
529+
* - ESP_OK: read was successful
530+
* - ESP_FAIL: read failed
531+
* - any other failure codes are allowed to be used to provide failure isolation
532+
*/
533+
esp_err_t (*read)(void *spi_ctx, uint32_t cmd, uint32_t addr, void *data, uint32_t data_len);
534+
535+
/**
536+
* @brief Custom driver SPI write
537+
*
538+
* @note The write function is responsible to construct command, address and data fields
539+
* of the SPI frame in format expected by particular SPI Ethernet module
540+
*
541+
* @param[in] spi_ctx: a pointer to driver specific context structure
542+
* @param[in] cmd: command
543+
* @param[in] addr: register address
544+
* @param[in] data: data to write
545+
* @param[in] data_len: length of data to write in bytes
546+
*
547+
* @return
548+
* - ESP_OK: write was successful
549+
* - ESP_FAIL: write failed
550+
* - any other failure codes are allowed to be used to provide failure isolation
551+
*/
552+
esp_err_t (*write)(void *spi_ctx, uint32_t cmd, uint32_t addr, const void *data, uint32_t data_len);
553+
} eth_spi_custom_driver_t;
554+
555+
/**
556+
* @brief Default configuration of the custom SPI driver.
557+
* Internal ESP-IDF SPI Master driver is used by default.
558+
*
559+
*/
560+
#define ETH_NO_CUSTOM_SPI \
561+
{ \
562+
.config = NULL, \
563+
.init = NULL, \
564+
.deinit = NULL, \
565+
.read = NULL, \
566+
.write = NULL \
567+
}
568+
#endif // CONFIG_ETH_USE_SPI_ETHERNET
569+
473570
#if CONFIG_ETH_SPI_ETHERNET_DM9051
474571
/**
475572
* @brief DM9051 specific configuration
476573
*
477574
*/
478575
typedef struct {
479-
spi_host_device_t spi_host_id; /*!< SPI peripheral */
480-
spi_device_interface_config_t *spi_devcfg; /*!< SPI device configuration */
481576
int int_gpio_num; /*!< Interrupt GPIO number */
577+
spi_host_device_t spi_host_id; /*!< SPI peripheral (this field is invalid when custom SPI driver is defined) */
578+
spi_device_interface_config_t *spi_devcfg; /*!< SPI device configuration (this field is invalid when custom SPI driver is defined) */
579+
eth_spi_custom_driver_t custom_spi_driver; /*!< Custom SPI driver definitions */
482580
} eth_dm9051_config_t;
483581

484582
/**
@@ -487,9 +585,10 @@ typedef struct {
487585
*/
488586
#define ETH_DM9051_DEFAULT_CONFIG(spi_host, spi_devcfg_p) \
489587
{ \
588+
.int_gpio_num = 4, \
490589
.spi_host_id = spi_host, \
491590
.spi_devcfg = spi_devcfg_p, \
492-
.int_gpio_num = 4, \
591+
.custom_spi_driver = ETH_NO_CUSTOM_SPI, \
493592
}
494593

495594
/**
@@ -511,20 +610,22 @@ esp_eth_mac_t *esp_eth_mac_new_dm9051(const eth_dm9051_config_t *dm9051_config,
511610
*
512611
*/
513612
typedef struct {
514-
spi_host_device_t spi_host_id; /*!< SPI peripheral */
515-
spi_device_interface_config_t *spi_devcfg; /*!< SPI device configuration */
516613
int int_gpio_num; /*!< Interrupt GPIO number */
614+
spi_host_device_t spi_host_id; /*!< SPI peripheral (this field is invalid when custom SPI driver is defined)*/
615+
spi_device_interface_config_t *spi_devcfg; /*!< SPI device configuration (this field is invalid when custom SPI driver is defined)*/
616+
eth_spi_custom_driver_t custom_spi_driver; /*!< Custom SPI driver definitions */
517617
} eth_w5500_config_t;
518618

519619
/**
520620
* @brief Default W5500 specific configuration
521621
*
522622
*/
523623
#define ETH_W5500_DEFAULT_CONFIG(spi_host, spi_devcfg_p) \
524-
{ \
525-
.spi_host_id = spi_host, \
526-
.spi_devcfg = spi_devcfg_p, \
527-
.int_gpio_num = 4, \
624+
{ \
625+
.int_gpio_num = 4, \
626+
.spi_host_id = spi_host, \
627+
.spi_devcfg = spi_devcfg_p, \
628+
.custom_spi_driver = ETH_NO_CUSTOM_SPI, \
528629
}
529630

530631
/**
@@ -546,9 +647,10 @@ esp_eth_mac_t *esp_eth_mac_new_w5500(const eth_w5500_config_t *w5500_config, con
546647
*
547648
*/
548649
typedef struct {
549-
spi_host_device_t spi_host_id; /*!< SPI peripheral */
550-
spi_device_interface_config_t *spi_devcfg; /*!< SPI device configuration */
551650
int int_gpio_num; /*!< Interrupt GPIO number */
651+
spi_host_device_t spi_host_id; /*!< SPI peripheral (this field is invalid when custom SPI driver is defined) */
652+
spi_device_interface_config_t *spi_devcfg; /*!< SPI device configuration (this field is invalid when custom SPI driver is defined) */
653+
eth_spi_custom_driver_t custom_spi_driver; /*!< Custom SPI driver definitions */
552654
} eth_ksz8851snl_config_t;
553655

554656
/**
@@ -557,9 +659,10 @@ typedef struct {
557659
*/
558660
#define ETH_KSZ8851SNL_DEFAULT_CONFIG(spi_host, spi_devcfg_p) \
559661
{ \
662+
.int_gpio_num = 4, \
560663
.spi_host_id = spi_host, \
561664
.spi_devcfg = spi_devcfg_p, \
562-
.int_gpio_num = 14, \
665+
.custom_spi_driver = ETH_NO_CUSTOM_SPI, \
563666
}
564667

565668
/**

esp32/lib/libesp_app_format.a

0 Bytes
Binary file not shown.

esp32/lib/libesp_eth.a

17.7 KB
Binary file not shown.

esp32/lib/libesp_system.a

8 Bytes
Binary file not shown.

esp32/platformio-build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@
369369

370370
CPPDEFINES=[
371371
"ESP_PLATFORM",
372-
("IDF_VER", '\\"v5.1.1-1-gd3c99ed3b8\\"'),
372+
("IDF_VER", '\\"v5.1.1-1-gd3c99ed3b8-dirty\\"'),
373373
("MBEDTLS_CONFIG_FILE", '\\"mbedtls/esp_config.h\\"'),
374374
("SOC_MMU_PAGE_SIZE", 'CONFIG_MMU_PAGE_SIZE'),
375375
"UNITY_INCLUDE_CONFIG_H",

esp32c3/flags/defines

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
-DESP_PLATFORM -DIDF_VER=\"v5.1.1-1-gd3c99ed3b8\" -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DUNITY_INCLUDE_CONFIG_H -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -DconfigENABLE_FREERTOS_DEBUG_OCDAWARE=1 -DTF_LITE_STATIC_MEMORY
1+
-DESP_PLATFORM -DIDF_VER=\"v5.1.1-1-gd3c99ed3b8-dirty\" -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DUNITY_INCLUDE_CONFIG_H -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -DconfigENABLE_FREERTOS_DEBUG_OCDAWARE=1 -DTF_LITE_STATIC_MEMORY

esp32c3/include/esp_eth/include/esp_eth_mac.h

Lines changed: 116 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -470,15 +470,113 @@ typedef struct {
470470
esp_eth_mac_t *esp_eth_mac_new_esp32(const eth_esp32_emac_config_t *esp32_config, const eth_mac_config_t *config);
471471
#endif // CONFIG_ETH_USE_ESP32_EMAC
472472

473+
#if CONFIG_ETH_USE_SPI_ETHERNET
474+
/**
475+
* @brief Custom SPI Driver Configuration.
476+
* This structure declares configuration and callback functions to access Ethernet SPI module via
477+
* user's custom SPI driver.
478+
*
479+
*/
480+
typedef struct
481+
{
482+
/**
483+
* @brief Custom driver specific configuration structure used by `init()` function.
484+
*
485+
* @note Type and its content is fully under user's control
486+
*
487+
*/
488+
void *config;
489+
490+
/**
491+
* @brief Custom driver SPI Initialization
492+
*
493+
* @param[in] spi_config: Custom driver specific configuration
494+
*
495+
* @return
496+
* - spi_ctx: when initialization is successful, a pointer to context structure holding all variables
497+
* needed for subsequent SPI access operations (e.g. SPI bus identification, mutexes, etc.)
498+
* - NULL: driver initialization failed
499+
*
500+
* @note return type and its content is fully under user's control
501+
*/
502+
void *(*init)(const void *spi_config);
503+
504+
/**
505+
* @brief Custom driver De-initialization
506+
*
507+
* @param[in] spi_ctx: a pointer to driver specific context structure
508+
*
509+
* @return
510+
* - ESP_OK: driver de-initialization was successful
511+
* - ESP_FAIL: driver de-initialization failed
512+
* - any other failure codes are allowed to be used to provide failure isolation
513+
*/
514+
esp_err_t (*deinit)(void *spi_ctx);
515+
516+
/**
517+
* @brief Custom driver SPI read
518+
*
519+
* @note The read function is responsible to construct command, address and data fields
520+
* of the SPI frame in format expected by particular SPI Ethernet module
521+
*
522+
* @param[in] spi_ctx: a pointer to driver specific context structure
523+
* @param[in] cmd: command
524+
* @param[in] addr: register address
525+
* @param[out] data: read data
526+
* @param[in] data_len: read data length in bytes
527+
*
528+
* @return
529+
* - ESP_OK: read was successful
530+
* - ESP_FAIL: read failed
531+
* - any other failure codes are allowed to be used to provide failure isolation
532+
*/
533+
esp_err_t (*read)(void *spi_ctx, uint32_t cmd, uint32_t addr, void *data, uint32_t data_len);
534+
535+
/**
536+
* @brief Custom driver SPI write
537+
*
538+
* @note The write function is responsible to construct command, address and data fields
539+
* of the SPI frame in format expected by particular SPI Ethernet module
540+
*
541+
* @param[in] spi_ctx: a pointer to driver specific context structure
542+
* @param[in] cmd: command
543+
* @param[in] addr: register address
544+
* @param[in] data: data to write
545+
* @param[in] data_len: length of data to write in bytes
546+
*
547+
* @return
548+
* - ESP_OK: write was successful
549+
* - ESP_FAIL: write failed
550+
* - any other failure codes are allowed to be used to provide failure isolation
551+
*/
552+
esp_err_t (*write)(void *spi_ctx, uint32_t cmd, uint32_t addr, const void *data, uint32_t data_len);
553+
} eth_spi_custom_driver_t;
554+
555+
/**
556+
* @brief Default configuration of the custom SPI driver.
557+
* Internal ESP-IDF SPI Master driver is used by default.
558+
*
559+
*/
560+
#define ETH_NO_CUSTOM_SPI \
561+
{ \
562+
.config = NULL, \
563+
.init = NULL, \
564+
.deinit = NULL, \
565+
.read = NULL, \
566+
.write = NULL \
567+
}
568+
#endif // CONFIG_ETH_USE_SPI_ETHERNET
569+
473570
#if CONFIG_ETH_SPI_ETHERNET_DM9051
474571
/**
475572
* @brief DM9051 specific configuration
476573
*
477574
*/
478575
typedef struct {
479-
spi_host_device_t spi_host_id; /*!< SPI peripheral */
480-
spi_device_interface_config_t *spi_devcfg; /*!< SPI device configuration */
481576
int int_gpio_num; /*!< Interrupt GPIO number */
577+
spi_host_device_t spi_host_id; /*!< SPI peripheral (this field is invalid when custom SPI driver is defined) */
578+
spi_device_interface_config_t *spi_devcfg; /*!< SPI device configuration (this field is invalid when custom SPI driver is defined) */
579+
eth_spi_custom_driver_t custom_spi_driver; /*!< Custom SPI driver definitions */
482580
} eth_dm9051_config_t;
483581

484582
/**
@@ -487,9 +585,10 @@ typedef struct {
487585
*/
488586
#define ETH_DM9051_DEFAULT_CONFIG(spi_host, spi_devcfg_p) \
489587
{ \
588+
.int_gpio_num = 4, \
490589
.spi_host_id = spi_host, \
491590
.spi_devcfg = spi_devcfg_p, \
492-
.int_gpio_num = 4, \
591+
.custom_spi_driver = ETH_NO_CUSTOM_SPI, \
493592
}
494593

495594
/**
@@ -511,20 +610,22 @@ esp_eth_mac_t *esp_eth_mac_new_dm9051(const eth_dm9051_config_t *dm9051_config,
511610
*
512611
*/
513612
typedef struct {
514-
spi_host_device_t spi_host_id; /*!< SPI peripheral */
515-
spi_device_interface_config_t *spi_devcfg; /*!< SPI device configuration */
516613
int int_gpio_num; /*!< Interrupt GPIO number */
614+
spi_host_device_t spi_host_id; /*!< SPI peripheral (this field is invalid when custom SPI driver is defined)*/
615+
spi_device_interface_config_t *spi_devcfg; /*!< SPI device configuration (this field is invalid when custom SPI driver is defined)*/
616+
eth_spi_custom_driver_t custom_spi_driver; /*!< Custom SPI driver definitions */
517617
} eth_w5500_config_t;
518618

519619
/**
520620
* @brief Default W5500 specific configuration
521621
*
522622
*/
523623
#define ETH_W5500_DEFAULT_CONFIG(spi_host, spi_devcfg_p) \
524-
{ \
525-
.spi_host_id = spi_host, \
526-
.spi_devcfg = spi_devcfg_p, \
527-
.int_gpio_num = 4, \
624+
{ \
625+
.int_gpio_num = 4, \
626+
.spi_host_id = spi_host, \
627+
.spi_devcfg = spi_devcfg_p, \
628+
.custom_spi_driver = ETH_NO_CUSTOM_SPI, \
528629
}
529630

530631
/**
@@ -546,9 +647,10 @@ esp_eth_mac_t *esp_eth_mac_new_w5500(const eth_w5500_config_t *w5500_config, con
546647
*
547648
*/
548649
typedef struct {
549-
spi_host_device_t spi_host_id; /*!< SPI peripheral */
550-
spi_device_interface_config_t *spi_devcfg; /*!< SPI device configuration */
551650
int int_gpio_num; /*!< Interrupt GPIO number */
651+
spi_host_device_t spi_host_id; /*!< SPI peripheral (this field is invalid when custom SPI driver is defined) */
652+
spi_device_interface_config_t *spi_devcfg; /*!< SPI device configuration (this field is invalid when custom SPI driver is defined) */
653+
eth_spi_custom_driver_t custom_spi_driver; /*!< Custom SPI driver definitions */
552654
} eth_ksz8851snl_config_t;
553655

554656
/**
@@ -557,9 +659,10 @@ typedef struct {
557659
*/
558660
#define ETH_KSZ8851SNL_DEFAULT_CONFIG(spi_host, spi_devcfg_p) \
559661
{ \
662+
.int_gpio_num = 4, \
560663
.spi_host_id = spi_host, \
561664
.spi_devcfg = spi_devcfg_p, \
562-
.int_gpio_num = 14, \
665+
.custom_spi_driver = ETH_NO_CUSTOM_SPI, \
563666
}
564667

565668
/**

esp32c3/lib/libesp_app_format.a

0 Bytes
Binary file not shown.

esp32c3/lib/libesp_eth.a

31.5 KB
Binary file not shown.

esp32c3/lib/libesp_system.a

4 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)