mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-07-01 04:50:58 +02:00
Update IDF to abea9e4c0 (#2458)
* Update IDF to abea9e4c0 * Update esptool * Enable PSRAM for PICO D4 * Enable APP_ROLLBACK_ENABLE
This commit is contained in:
@ -76,6 +76,7 @@
|
||||
#define CONFIG_CONSOLE_UART_BAUDRATE 115200
|
||||
#define CONFIG_SPIRAM_SUPPORT 1
|
||||
#define CONFIG_LWIP_MAX_SOCKETS 10
|
||||
#define CONFIG_APP_ROLLBACK_ENABLE 1
|
||||
#define CONFIG_LWIP_NETIF_LOOPBACK 1
|
||||
#define CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT "pthread"
|
||||
#define CONFIG_EMAC_TASK_PRIORITY 20
|
||||
@ -198,6 +199,7 @@
|
||||
#define CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN 0
|
||||
#define CONFIG_LWIP_DHCP_RESTORE_LAST_IP 1
|
||||
#define CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN 2
|
||||
#define CONFIG_PICO_PSRAM_CS_IO 10
|
||||
#define CONFIG_EMAC_TASK_STACK_SIZE 3072
|
||||
#define CONFIG_MB_QUEUE_LENGTH 20
|
||||
#define CONFIG_SW_COEXIST_PREFERENCE_VALUE 0
|
||||
@ -334,7 +336,6 @@
|
||||
#define CONFIG_MONITOR_BAUD_OTHER_VAL 115200
|
||||
#define CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF 1
|
||||
#define CONFIG_ESPTOOLPY_PORT "/dev/cu.usbserial-DO00EAB0"
|
||||
#define CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS 1
|
||||
#define CONFIG_TASK_WDT_PANIC 1
|
||||
#define CONFIG_UNITY_ENABLE_DOUBLE 1
|
||||
#define CONFIG_BLUEDROID_PINNED_TO_CORE 0
|
||||
|
@ -260,10 +260,25 @@ void esp_tls_conn_delete(esp_tls_t *tls);
|
||||
size_t esp_tls_get_bytes_avail(esp_tls_t *tls);
|
||||
|
||||
/**
|
||||
* @brief Create a global CA store with the buffer provided in cfg.
|
||||
* @brief Create a global CA store, initially empty.
|
||||
*
|
||||
* This function should be called if the application wants to use the same CA store for
|
||||
* multiple connections. The application must call this function before calling esp_tls_conn_new().
|
||||
* This function should be called if the application wants to use the same CA store for multiple connections.
|
||||
* This function initialises the global CA store which can be then set by calling esp_tls_set_global_ca_store().
|
||||
* To be effective, this function must be called before any call to esp_tls_set_global_ca_store().
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK if creating global CA store was successful.
|
||||
* - ESP_ERR_NO_MEM if an error occured when allocating the mbedTLS resources.
|
||||
*/
|
||||
esp_err_t esp_tls_init_global_ca_store();
|
||||
|
||||
/**
|
||||
* @brief Set the global CA store with the buffer provided in pem format.
|
||||
*
|
||||
* This function should be called if the application wants to set the global CA store for
|
||||
* multiple connections i.e. to add the certificates in the provided buffer to the certificate chain.
|
||||
* This function implicitly calls esp_tls_init_global_ca_store() if it has not already been called.
|
||||
* The application must call this function before calling esp_tls_conn_new().
|
||||
*
|
||||
* @param[in] cacert_pem_buf Buffer which has certificates in pem format. This buffer
|
||||
* is used for creating a global CA store, which can be used
|
||||
@ -271,7 +286,7 @@ size_t esp_tls_get_bytes_avail(esp_tls_t *tls);
|
||||
* @param[in] cacert_pem_bytes Length of the buffer.
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK if creating global CA store was successful.
|
||||
* - ESP_OK if adding certificates was successful.
|
||||
* - Other if an error occured or an action must be taken by the calling process.
|
||||
*/
|
||||
esp_err_t esp_tls_set_global_ca_store(const unsigned char *cacert_pem_buf, const unsigned int cacert_pem_bytes);
|
||||
|
@ -94,7 +94,7 @@ typedef struct {
|
||||
int pin_href; /*!< GPIO pin for camera HREF line */
|
||||
int pin_pclk; /*!< GPIO pin for camera PCLK line */
|
||||
|
||||
int xclk_freq_hz; /*!< Frequency of XCLK signal, in Hz. Either 10KHz or 20KHz */
|
||||
int xclk_freq_hz; /*!< Frequency of XCLK signal, in Hz. Either 20KHz or 10KHz for OV2640 double FPS (Experimental) */
|
||||
|
||||
ledc_timer_t ledc_timer; /*!< LEDC timer to be used for generating XCLK */
|
||||
ledc_channel_t ledc_channel; /*!< LEDC channel to be used for generating XCLK */
|
||||
|
@ -86,6 +86,7 @@ typedef struct _sensor {
|
||||
uint8_t slv_addr; // Sensor I2C slave address.
|
||||
pixformat_t pixformat;
|
||||
camera_status_t status;
|
||||
int xclk_freq_hz;
|
||||
|
||||
// Sensor function pointers
|
||||
int (*init_status) (sensor_t *sensor);
|
||||
|
@ -1044,9 +1044,10 @@ esp_err_t esp_mesh_set_vote_percentage(float percentage);
|
||||
float esp_mesh_get_vote_percentage(void);
|
||||
|
||||
/**
|
||||
* @brief Set mesh softAP associate expired time
|
||||
* @brief Set mesh softAP associate expired time (default:10 seconds)
|
||||
* - If mesh softAP hasn't received any data from an associated child within this time,
|
||||
* mesh softAP will take this child inactive and disassociate it.
|
||||
* - If mesh softAP is encrypted, this value should be set a greater value, such as 30 seconds.
|
||||
*
|
||||
* @param[in] seconds the expired time
|
||||
*
|
||||
@ -1227,7 +1228,7 @@ esp_err_t esp_mesh_get_group_list(mesh_addr_t *addr, int num);
|
||||
bool esp_mesh_is_my_group(const mesh_addr_t *addr);
|
||||
|
||||
/**
|
||||
* @brief Set mesh network capacity
|
||||
* @brief Set mesh network capacity (max:1000, default:300)
|
||||
*
|
||||
* @attention This API shall be called before mesh is started.
|
||||
*
|
||||
|
@ -22,8 +22,9 @@
|
||||
#include "esp_err.h"
|
||||
|
||||
typedef enum {
|
||||
ESP_SPIRAM_SIZE_32MBITS = 0, /*!< SPI RAM size is 32 MBits */
|
||||
ESP_SPIRAM_SIZE_64MBITS = 1, /*!< SPI RAM size is 64 MBits */
|
||||
ESP_SPIRAM_SIZE_16MBITS = 0, /*!< SPI RAM size is 16 MBits */
|
||||
ESP_SPIRAM_SIZE_32MBITS = 1, /*!< SPI RAM size is 32 MBits */
|
||||
ESP_SPIRAM_SIZE_64MBITS = 2, /*!< SPI RAM size is 64 MBits */
|
||||
ESP_SPIRAM_SIZE_INVALID, /*!< SPI RAM size is invalid */
|
||||
} esp_spiram_size_t;
|
||||
|
||||
|
@ -405,7 +405,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
wifi_pkt_rx_ctrl_t rx_ctrl;/**< received packet radio metadata header of the CSI data */
|
||||
uint8_t mac[6]; /**< source MAC address of the CSI data */
|
||||
bool last_word_invalid; /**< last four bytes of the CSI data is invalid or not */
|
||||
bool first_word_invalid; /**< first four bytes of the CSI data is invalid or not */
|
||||
int8_t *buf; /**< buffer of CSI data */
|
||||
uint16_t len; /**< length of CSI data */
|
||||
} wifi_csi_info_t;
|
||||
|
@ -166,6 +166,8 @@ void esp_sha_unlock_engine(esp_sha_type sha_type);
|
||||
* while it is in use by the SHA engine. Caller should use esp_sha_wait_idle()
|
||||
* to ensure the SHA engine is not reading from the memory block in hardware.
|
||||
*
|
||||
* @note This function enters a critical section. Do not block while holding this lock.
|
||||
*
|
||||
* @note You do not need to lock the memory block before calling esp_sha_block() or esp_sha_read_digest_state(), these functions handle memory block locking internally.
|
||||
*
|
||||
* Call esp_sha_unlock_memory_block() when done.
|
||||
@ -177,6 +179,8 @@ void esp_sha_lock_memory_block(void);
|
||||
*
|
||||
* Caller should have already locked a SHA engine before calling this function.
|
||||
*
|
||||
* This function releases the critical section entered by esp_sha_lock_memory_block().
|
||||
*
|
||||
* Call following esp_sha_lock_memory_block().
|
||||
*/
|
||||
void esp_sha_unlock_memory_block(void);
|
||||
|
@ -105,7 +105,9 @@ typedef struct {
|
||||
esp_http_client_auth_type_t auth_type; /*!< Http authentication type, see `esp_http_client_auth_type_t` */
|
||||
const char *path; /*!< HTTP Path, if not set, default is `/` */
|
||||
const char *query; /*!< HTTP query */
|
||||
const char *cert_pem; /*!< SSL Certification, PEM format as string, if the client requires to verify server */
|
||||
const char *cert_pem; /*!< SSL server certification, PEM format as string, if the client requires to verify server */
|
||||
const char *client_cert_pem; /*!< SSL client certification, PEM format as string, if the server requires to verify client */
|
||||
const char *client_key_pem; /*!< SSL client key, PEM format as string, if the server requires to verify client */
|
||||
esp_http_client_method_t method; /*!< HTTP Method */
|
||||
int timeout_ms; /*!< Network timeout in milliseconds */
|
||||
bool disable_auto_redirect; /*!< Disable HTTP automatic redirects */
|
||||
|
@ -49,6 +49,7 @@ initializer that should be kept in sync
|
||||
.global_transport_ctx_free_fn = NULL, \
|
||||
.open_fn = NULL, \
|
||||
.close_fn = NULL, \
|
||||
.uri_match_fn = NULL \
|
||||
}
|
||||
|
||||
#define ESP_ERR_HTTPD_BASE (0x8000) /*!< Starting number of HTTPD error codes */
|
||||
@ -61,6 +62,10 @@ initializer that should be kept in sync
|
||||
#define ESP_ERR_HTTPD_ALLOC_MEM (ESP_ERR_HTTPD_BASE + 7) /*!< Failed to dynamically allocate memory for resource */
|
||||
#define ESP_ERR_HTTPD_TASK (ESP_ERR_HTTPD_BASE + 8) /*!< Failed to launch server task/thread */
|
||||
|
||||
/* Symbol to be used as length parameter in httpd_resp_send APIs
|
||||
* for setting buffer length to string length */
|
||||
#define HTTPD_RESP_USE_STRLEN -1
|
||||
|
||||
/* ************** Group: Initialization ************** */
|
||||
/** @name Initialization
|
||||
* APIs related to the Initialization of the web server
|
||||
@ -82,7 +87,7 @@ typedef enum http_method httpd_method_t;
|
||||
|
||||
/**
|
||||
* @brief Prototype for freeing context data (if any)
|
||||
* @param[in] ctx : object to free
|
||||
* @param[in] ctx object to free
|
||||
*/
|
||||
typedef void (*httpd_free_ctx_fn_t)(void *ctx);
|
||||
|
||||
@ -92,8 +97,8 @@ typedef void (*httpd_free_ctx_fn_t)(void *ctx);
|
||||
* Called immediately after the socket was opened to set up the send/recv functions and
|
||||
* other parameters of the socket.
|
||||
*
|
||||
* @param[in] hd : server instance
|
||||
* @param[in] sockfd : session socket file descriptor
|
||||
* @param[in] hd server instance
|
||||
* @param[in] sockfd session socket file descriptor
|
||||
* @return status
|
||||
*/
|
||||
typedef esp_err_t (*httpd_open_func_t)(httpd_handle_t hd, int sockfd);
|
||||
@ -104,11 +109,26 @@ typedef esp_err_t (*httpd_open_func_t)(httpd_handle_t hd, int sockfd);
|
||||
* @note It's possible that the socket descriptor is invalid at this point, the function
|
||||
* is called for all terminated sessions. Ensure proper handling of return codes.
|
||||
*
|
||||
* @param[in] hd : server instance
|
||||
* @param[in] sockfd : session socket file descriptor
|
||||
* @param[in] hd server instance
|
||||
* @param[in] sockfd session socket file descriptor
|
||||
*/
|
||||
typedef void (*httpd_close_func_t)(httpd_handle_t hd, int sockfd);
|
||||
|
||||
/**
|
||||
* @brief Function prototype for URI matching.
|
||||
*
|
||||
* @param[in] reference_uri URI/template with respect to which the other URI is matched
|
||||
* @param[in] uri_to_match URI/template being matched to the reference URI/template
|
||||
* @param[in] match_upto For specifying the actual length of `uri_to_match` up to
|
||||
* which the matching algorithm is to be applied (The maximum
|
||||
* value is `strlen(uri_to_match)`, independent of the length
|
||||
* of `reference_uri`)
|
||||
* @return true on match
|
||||
*/
|
||||
typedef bool (*httpd_uri_match_func_t)(const char *reference_uri,
|
||||
const char *uri_to_match,
|
||||
size_t match_upto);
|
||||
|
||||
/**
|
||||
* @brief HTTP Server Configuration Structure
|
||||
*
|
||||
@ -195,6 +215,24 @@ typedef struct httpd_config {
|
||||
* was closed by the network stack - that is, the file descriptor may not be valid anymore.
|
||||
*/
|
||||
httpd_close_func_t close_fn;
|
||||
|
||||
/**
|
||||
* URI matcher function.
|
||||
*
|
||||
* Called when searching for a matching URI:
|
||||
* 1) whose request handler is to be executed right
|
||||
* after an HTTP request is successfully parsed
|
||||
* 2) in order to prevent duplication while registering
|
||||
* a new URI handler using `httpd_register_uri_handler()`
|
||||
*
|
||||
* Available options are:
|
||||
* 1) NULL : Internally do basic matching using `strncmp()`
|
||||
* 2) `httpd_uri_match_wildcard()` : URI wildcard matcher
|
||||
*
|
||||
* Users can implement their own matching functions (See description
|
||||
* of the `httpd_uri_match_func_t` function prototype)
|
||||
*/
|
||||
httpd_uri_match_func_t uri_match_fn;
|
||||
} httpd_config_t;
|
||||
|
||||
/**
|
||||
@ -227,8 +265,8 @@ typedef struct httpd_config {
|
||||
*
|
||||
* @endcode
|
||||
*
|
||||
* @param[in] config : Configuration for new instance of the server
|
||||
* @param[out] handle : Handle to newly created instance of the server. NULL on error
|
||||
* @param[in] config Configuration for new instance of the server
|
||||
* @param[out] handle Handle to newly created instance of the server. NULL on error
|
||||
* @return
|
||||
* - ESP_OK : Instance created successfully
|
||||
* - ESP_ERR_INVALID_ARG : Null argument(s)
|
||||
@ -451,11 +489,11 @@ esp_err_t httpd_unregister_uri(httpd_handle_t handle, const char* uri);
|
||||
* HTTPD_SOCK_ERR_ codes, which will eventually be conveyed as
|
||||
* return value of httpd_send() function
|
||||
*
|
||||
* @param[in] hd : server instance
|
||||
* @param[in] sockfd : session socket file descriptor
|
||||
* @param[in] buf : buffer with bytes to send
|
||||
* @param[in] buf_len : data size
|
||||
* @param[in] flags : flags for the send() function
|
||||
* @param[in] hd server instance
|
||||
* @param[in] sockfd session socket file descriptor
|
||||
* @param[in] buf buffer with bytes to send
|
||||
* @param[in] buf_len data size
|
||||
* @param[in] flags flags for the send() function
|
||||
* @return
|
||||
* - Bytes : The number of bytes sent successfully
|
||||
* - HTTPD_SOCK_ERR_INVALID : Invalid arguments
|
||||
@ -472,11 +510,11 @@ typedef int (*httpd_send_func_t)(httpd_handle_t hd, int sockfd, const char *buf,
|
||||
* HTTPD_SOCK_ERR_ codes, which will eventually be conveyed as
|
||||
* return value of httpd_req_recv() function
|
||||
*
|
||||
* @param[in] hd : server instance
|
||||
* @param[in] sockfd : session socket file descriptor
|
||||
* @param[in] buf : buffer with bytes to send
|
||||
* @param[in] buf_len : data size
|
||||
* @param[in] flags : flags for the send() function
|
||||
* @param[in] hd server instance
|
||||
* @param[in] sockfd session socket file descriptor
|
||||
* @param[in] buf buffer with bytes to send
|
||||
* @param[in] buf_len data size
|
||||
* @param[in] flags flags for the send() function
|
||||
* @return
|
||||
* - Bytes : The number of bytes received successfully
|
||||
* - 0 : Buffer length parameter is zero / connection closed by peer
|
||||
@ -494,8 +532,8 @@ typedef int (*httpd_recv_func_t)(httpd_handle_t hd, int sockfd, char *buf, size_
|
||||
* HTTPD_SOCK_ERR_ codes, which will be handled accordingly in
|
||||
* the server task.
|
||||
*
|
||||
* @param[in] hd : server instance
|
||||
* @param[in] sockfd : session socket file descriptor
|
||||
* @param[in] hd server instance
|
||||
* @param[in] sockfd session socket file descriptor
|
||||
* @return
|
||||
* - Bytes : The number of bytes waiting to be received
|
||||
* - HTTPD_SOCK_ERR_INVALID : Invalid arguments
|
||||
@ -744,6 +782,30 @@ esp_err_t httpd_req_get_url_query_str(httpd_req_t *r, char *buf, size_t buf_len)
|
||||
*/
|
||||
esp_err_t httpd_query_key_value(const char *qry, const char *key, char *val, size_t val_size);
|
||||
|
||||
/**
|
||||
* @brief Test if a URI matches the given wildcard template.
|
||||
*
|
||||
* Template may end with "?" to make the previous character optional (typically a slash),
|
||||
* "*" for a wildcard match, and "?*" to make the previous character optional, and if present,
|
||||
* allow anything to follow.
|
||||
*
|
||||
* Example:
|
||||
* - * matches everything
|
||||
* - /foo/? matches /foo and /foo/
|
||||
* - /foo/\* (sans the backslash) matches /foo/ and /foo/bar, but not /foo or /fo
|
||||
* - /foo/?* or /foo/\*? (sans the backslash) matches /foo/, /foo/bar, and also /foo, but not /foox or /fo
|
||||
*
|
||||
* The special characters "?" and "*" anywhere else in the template will be taken literally.
|
||||
*
|
||||
* @param[in] uri_template URI template (pattern)
|
||||
* @param[in] uri_to_match URI to be matched
|
||||
* @param[in] match_upto how many characters of the URI buffer to test
|
||||
* (there may be trailing query string etc.)
|
||||
*
|
||||
* @return true if a match was found
|
||||
*/
|
||||
bool httpd_uri_match_wildcard(const char *uri_template, const char *uri_to_match, size_t match_upto);
|
||||
|
||||
/**
|
||||
* @brief API to send a complete HTTP response.
|
||||
*
|
||||
@ -772,7 +834,7 @@ esp_err_t httpd_query_key_value(const char *qry, const char *key, char *val, siz
|
||||
*
|
||||
* @param[in] r The request being responded to
|
||||
* @param[in] buf Buffer from where the content is to be fetched
|
||||
* @param[in] buf_len Length of the buffer, -1 to use strlen()
|
||||
* @param[in] buf_len Length of the buffer, HTTPD_RESP_USE_STRLEN to use strlen()
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK : On successfully sending the response packet
|
||||
@ -811,7 +873,7 @@ esp_err_t httpd_resp_send(httpd_req_t *r, const char *buf, ssize_t buf_len);
|
||||
*
|
||||
* @param[in] r The request being responded to
|
||||
* @param[in] buf Pointer to a buffer that stores the data
|
||||
* @param[in] buf_len Length of the data from the buffer that should be sent out, -1 to use strlen()
|
||||
* @param[in] buf_len Length of the buffer, HTTPD_RESP_USE_STRLEN to use strlen()
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK : On successfully sending the response packet chunk
|
||||
@ -822,6 +884,48 @@ esp_err_t httpd_resp_send(httpd_req_t *r, const char *buf, ssize_t buf_len);
|
||||
*/
|
||||
esp_err_t httpd_resp_send_chunk(httpd_req_t *r, const char *buf, ssize_t buf_len);
|
||||
|
||||
/**
|
||||
* @brief API to send a complete string as HTTP response.
|
||||
*
|
||||
* This API simply calls http_resp_send with buffer length
|
||||
* set to string length assuming the buffer contains a null
|
||||
* terminated string
|
||||
*
|
||||
* @param[in] r The request being responded to
|
||||
* @param[in] str String to be sent as response body
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK : On successfully sending the response packet
|
||||
* - ESP_ERR_INVALID_ARG : Null request pointer
|
||||
* - ESP_ERR_HTTPD_RESP_HDR : Essential headers are too large for internal buffer
|
||||
* - ESP_ERR_HTTPD_RESP_SEND : Error in raw send
|
||||
* - ESP_ERR_HTTPD_INVALID_REQ : Invalid request
|
||||
*/
|
||||
inline esp_err_t httpd_resp_sendstr(httpd_req_t *r, const char *str) {
|
||||
return httpd_resp_send(r, str, (str == NULL) ? 0 : strlen(str));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief API to send a string as an HTTP response chunk.
|
||||
*
|
||||
* This API simply calls http_resp_send_chunk with buffer length
|
||||
* set to string length assuming the buffer contains a null
|
||||
* terminated string
|
||||
*
|
||||
* @param[in] r The request being responded to
|
||||
* @param[in] str String to be sent as response body (NULL to finish response packet)
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK : On successfully sending the response packet
|
||||
* - ESP_ERR_INVALID_ARG : Null request pointer
|
||||
* - ESP_ERR_HTTPD_RESP_HDR : Essential headers are too large for internal buffer
|
||||
* - ESP_ERR_HTTPD_RESP_SEND : Error in raw send
|
||||
* - ESP_ERR_HTTPD_INVALID_REQ : Invalid request
|
||||
*/
|
||||
inline esp_err_t httpd_resp_sendstr_chunk(httpd_req_t *r, const char *str) {
|
||||
return httpd_resp_send_chunk(r, str, (str == NULL) ? 0 : strlen(str));
|
||||
}
|
||||
|
||||
/* Some commonly used status codes */
|
||||
#define HTTPD_200 "200 OK" /*!< HTTP Response 200 */
|
||||
#define HTTPD_204 "204 No Content" /*!< HTTP Response 204 */
|
||||
|
@ -33,6 +33,7 @@ extern "C" {
|
||||
* @return
|
||||
* - ESP_OK: OTA data updated, next reboot will use specified partition.
|
||||
* - ESP_FAIL: For generic failure.
|
||||
* - ESP_ERR_INVALID_ARG: Invalid argument
|
||||
* - ESP_ERR_OTA_VALIDATE_FAILED: Invalid app image
|
||||
* - ESP_ERR_NO_MEM: Cannot allocate memory for OTA operation.
|
||||
* - ESP_ERR_FLASH_OP_TIMEOUT or ESP_ERR_FLASH_OP_FAIL: Flash write failed.
|
||||
|
@ -15,68 +15,88 @@
|
||||
#ifndef __ESP_ETH_H__
|
||||
#define __ESP_ETH_H__
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "esp_err.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "esp_types.h"
|
||||
#include "esp_err.h"
|
||||
|
||||
/**
|
||||
* @brief Ethernet interface mode
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
ETH_MODE_RMII = 0,
|
||||
ETH_MODE_MII,
|
||||
ETH_MODE_RMII = 0, /*!< RMII mode */
|
||||
ETH_MODE_MII, /*!< MII mode */
|
||||
} eth_mode_t;
|
||||
|
||||
/**
|
||||
* @brief Ethernet clock mode
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
ETH_CLOCK_GPIO0_IN = 0,
|
||||
ETH_CLOCK_GPIO16_OUT = 2,
|
||||
ETH_CLOCK_GPIO17_OUT = 3
|
||||
ETH_CLOCK_GPIO0_IN = 0, /*!< RMII clock input to GPIO0 */
|
||||
ETH_CLOCK_GPIO0_OUT = 1, /*!< RMII clock output from GPIO0 */
|
||||
ETH_CLOCK_GPIO16_OUT = 2, /*!< RMII clock output from GPIO16 */
|
||||
ETH_CLOCK_GPIO17_OUT = 3 /*!< RMII clock output from GPIO17 */
|
||||
} eth_clock_mode_t;
|
||||
|
||||
/**
|
||||
* @brief Ethernet Speed
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
ETH_SPEED_MODE_10M = 0,
|
||||
ETH_SPEED_MODE_100M,
|
||||
ETH_SPEED_MODE_10M = 0, /*!< Ethernet speed: 10Mbps */
|
||||
ETH_SPEED_MODE_100M, /*!< Ethernet speed: 100Mbps */
|
||||
} eth_speed_mode_t;
|
||||
|
||||
/**
|
||||
* @brief Ethernet Duplex
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
ETH_MODE_HALFDUPLEX = 0,
|
||||
ETH_MODE_FULLDUPLEX,
|
||||
ETH_MODE_HALFDUPLEX = 0, /*!< Ethernet half duplex */
|
||||
ETH_MODE_FULLDUPLEX, /*!< Ethernet full duplex */
|
||||
} eth_duplex_mode_t;
|
||||
|
||||
/**
|
||||
* @brief Ethernet PHY address
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
PHY0 = 0,
|
||||
PHY1,
|
||||
PHY2,
|
||||
PHY3,
|
||||
PHY4,
|
||||
PHY5,
|
||||
PHY6,
|
||||
PHY7,
|
||||
PHY8,
|
||||
PHY9,
|
||||
PHY10,
|
||||
PHY11,
|
||||
PHY12,
|
||||
PHY13,
|
||||
PHY14,
|
||||
PHY15,
|
||||
PHY16,
|
||||
PHY17,
|
||||
PHY18,
|
||||
PHY19,
|
||||
PHY20,
|
||||
PHY21,
|
||||
PHY22,
|
||||
PHY23,
|
||||
PHY24,
|
||||
PHY25,
|
||||
PHY26,
|
||||
PHY27,
|
||||
PHY28,
|
||||
PHY29,
|
||||
PHY30,
|
||||
PHY31,
|
||||
PHY0 = 0, /*!< PHY address 0 */
|
||||
PHY1, /*!< PHY address 1 */
|
||||
PHY2, /*!< PHY address 2 */
|
||||
PHY3, /*!< PHY address 3 */
|
||||
PHY4, /*!< PHY address 4 */
|
||||
PHY5, /*!< PHY address 5 */
|
||||
PHY6, /*!< PHY address 6 */
|
||||
PHY7, /*!< PHY address 7 */
|
||||
PHY8, /*!< PHY address 8 */
|
||||
PHY9, /*!< PHY address 9 */
|
||||
PHY10, /*!< PHY address 10 */
|
||||
PHY11, /*!< PHY address 11 */
|
||||
PHY12, /*!< PHY address 12 */
|
||||
PHY13, /*!< PHY address 13 */
|
||||
PHY14, /*!< PHY address 14 */
|
||||
PHY15, /*!< PHY address 15 */
|
||||
PHY16, /*!< PHY address 16 */
|
||||
PHY17, /*!< PHY address 17 */
|
||||
PHY18, /*!< PHY address 18 */
|
||||
PHY19, /*!< PHY address 19 */
|
||||
PHY20, /*!< PHY address 20 */
|
||||
PHY21, /*!< PHY address 21 */
|
||||
PHY22, /*!< PHY address 22 */
|
||||
PHY23, /*!< PHY address 23 */
|
||||
PHY24, /*!< PHY address 24 */
|
||||
PHY25, /*!< PHY address 25 */
|
||||
PHY26, /*!< PHY address 26 */
|
||||
PHY27, /*!< PHY address 27 */
|
||||
PHY28, /*!< PHY address 28 */
|
||||
PHY29, /*!< PHY address 29 */
|
||||
PHY30, /*!< PHY address 30 */
|
||||
PHY31 /*!< PHY address 31 */
|
||||
} eth_phy_base_t;
|
||||
|
||||
typedef bool (*eth_phy_check_link_func)(void);
|
||||
@ -94,15 +114,15 @@ typedef void (*eth_phy_power_enable_func)(bool enable);
|
||||
*
|
||||
*/
|
||||
typedef struct {
|
||||
eth_phy_base_t phy_addr; /*!< phy base addr (0~31) */
|
||||
eth_mode_t mac_mode; /*!< mac mode only support RMII now */
|
||||
eth_clock_mode_t clock_mode; /*!< external/internal clock mode selecton */
|
||||
eth_tcpip_input_func tcpip_input; /*!< tcpip input func */
|
||||
eth_phy_func phy_init; /*!< phy init func */
|
||||
eth_phy_check_link_func phy_check_link; /*!< phy check link func */
|
||||
eth_phy_check_init_func phy_check_init; /*!< phy check init func */
|
||||
eth_phy_get_speed_mode_func phy_get_speed_mode; /*!< phy check init func */
|
||||
eth_phy_get_duplex_mode_func phy_get_duplex_mode; /*!< phy check init func */
|
||||
eth_phy_base_t phy_addr; /*!< PHY address (0~31) */
|
||||
eth_mode_t mac_mode; /*!< MAC mode: only support RMII now */
|
||||
eth_clock_mode_t clock_mode; /*!< external/internal clock mode selection */
|
||||
eth_tcpip_input_func tcpip_input; /*!< tcpip input func */
|
||||
eth_phy_func phy_init; /*!< phy init func */
|
||||
eth_phy_check_link_func phy_check_link; /*!< phy check link func */
|
||||
eth_phy_check_init_func phy_check_init; /*!< phy check init func */
|
||||
eth_phy_get_speed_mode_func phy_get_speed_mode; /*!< phy check init func */
|
||||
eth_phy_get_duplex_mode_func phy_get_duplex_mode; /*!< phy check init func */
|
||||
eth_gpio_config_func gpio_config; /*!< gpio config func */
|
||||
bool flow_ctrl_enable; /*!< flag of flow ctrl enable */
|
||||
eth_phy_get_partner_pause_enable_func phy_get_partner_pause_enable; /*!< get partner pause enable */
|
||||
|
@ -20,38 +20,55 @@ extern "C" {
|
||||
|
||||
#include "esp_eth.h"
|
||||
|
||||
/** Common PHY-management functions.
|
||||
/**
|
||||
* @brief Common PHY-management functions.
|
||||
*
|
||||
* @note These are not enough to drive any particular Ethernet PHY.
|
||||
* They provide a common configuration structure and management functions.
|
||||
*
|
||||
*/
|
||||
|
||||
These are not enough to drive any particular Ethernet PHY, but they provide a common configuration structure and
|
||||
management functions.
|
||||
*/
|
||||
|
||||
/** Configure fixed pins for RMII data interface.
|
||||
|
||||
This configures GPIOs 0, 19, 22, 25, 26, 27 for use with RMII
|
||||
data interface. These pins cannot be changed, and must be wired to
|
||||
ethernet functions.
|
||||
|
||||
This is not sufficient to fully configure the Ethernet PHY,
|
||||
MDIO configuration interface pins (such as SMI MDC, MDO, MDI)
|
||||
must also be configured correctly in the GPIO matrix.
|
||||
*/
|
||||
/**
|
||||
* @brief Configure fixed pins for RMII data interface.
|
||||
*
|
||||
* @note This configures GPIOs 0, 19, 22, 25, 26, 27 for use with RMII data interface.
|
||||
* These pins cannot be changed, and must be wired to ethernet functions.
|
||||
* This is not sufficient to fully configure the Ethernet PHY.
|
||||
* MDIO configuration interface pins (such as SMI MDC, MDO, MDI) must also be configured correctly in the GPIO matrix.
|
||||
*
|
||||
*/
|
||||
void phy_rmii_configure_data_interface_pins(void);
|
||||
|
||||
/** Configure variable pins for SMI (MDIO) ethernet functions.
|
||||
|
||||
Calling this function along with mii_configure_default_pins() will
|
||||
fully configure the GPIOs for the ethernet PHY.
|
||||
/**
|
||||
* @brief Configure variable pins for SMI ethernet functions.
|
||||
*
|
||||
* @param mdc_gpio MDC GPIO Pin number
|
||||
* @param mdio_gpio MDIO GPIO Pin number
|
||||
*
|
||||
* @note Calling this function along with mii_configure_default_pins() will fully configure the GPIOs for the ethernet PHY.
|
||||
*/
|
||||
void phy_rmii_smi_configure_pins(uint8_t mdc_gpio, uint8_t mdio_gpio);
|
||||
|
||||
|
||||
/** Enable flow control in standard PHY MII register.
|
||||
/**
|
||||
* @brief Enable flow control in standard PHY MII register.
|
||||
*
|
||||
*/
|
||||
void phy_mii_enable_flow_ctrl(void);
|
||||
|
||||
/**
|
||||
* @brief Check Ethernet link status via MII interface
|
||||
*
|
||||
* @return true Link is on
|
||||
* @return false Link is off
|
||||
*/
|
||||
bool phy_mii_check_link_status(void);
|
||||
|
||||
/**
|
||||
* @brief Check pause frame ability of partner via MII interface
|
||||
*
|
||||
* @return true Partner is able to process pause frame
|
||||
* @return false Partner can not process pause frame
|
||||
*/
|
||||
bool phy_mii_get_partner_pause_enable(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
75
tools/sdk/include/ethernet/eth_phy/phy_ip101.h
Normal file
75
tools/sdk/include/ethernet/eth_phy/phy_ip101.h
Normal file
@ -0,0 +1,75 @@
|
||||
// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "phy.h"
|
||||
|
||||
/**
|
||||
* @brief Dump IP101 PHY SMI configuration registers
|
||||
*
|
||||
*/
|
||||
void phy_ip101_dump_registers();
|
||||
|
||||
/**
|
||||
* @brief Default IP101 phy_check_init function
|
||||
*
|
||||
*/
|
||||
void phy_ip101_check_phy_init(void);
|
||||
|
||||
/**
|
||||
* @brief Default IP101 phy_get_speed_mode function
|
||||
*
|
||||
* @return eth_speed_mode_t Ethernet speed mode
|
||||
*/
|
||||
eth_speed_mode_t phy_ip101_get_speed_mode(void);
|
||||
|
||||
/**
|
||||
* @brief Default IP101 phy_get_duplex_mode function
|
||||
*
|
||||
* @return eth_duplex_mode_t Ethernet duplex mode
|
||||
*/
|
||||
eth_duplex_mode_t phy_ip101_get_duplex_mode(void);
|
||||
|
||||
/**
|
||||
* @brief Default IP101 phy_power_enable function
|
||||
*
|
||||
*/
|
||||
void phy_ip101_power_enable(bool);
|
||||
|
||||
/**
|
||||
* @brief Default IP101 phy_init function
|
||||
*
|
||||
* @return esp_err_t
|
||||
* - ESP_OK on success
|
||||
* - ESP_FAIL on error
|
||||
*/
|
||||
esp_err_t phy_ip101_init(void);
|
||||
|
||||
/**
|
||||
* @brief Default IP101 PHY configuration
|
||||
*
|
||||
* @note This configuration is not suitable for use as-is,
|
||||
* it will need to be modified for your particular PHY hardware setup.
|
||||
*
|
||||
*/
|
||||
extern const eth_config_t phy_ip101_default_ethernet_config;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@ -20,45 +20,53 @@ extern "C" {
|
||||
|
||||
#include "phy.h"
|
||||
|
||||
|
||||
/** @brief Dump all LAN8720 PHY SMI configuration registers
|
||||
/**
|
||||
* @brief Dump LAN8720 PHY SMI configuration registers
|
||||
*
|
||||
* @note These registers are dumped at 'debug' level, so output
|
||||
* may not be visible depending on default log levels.
|
||||
*/
|
||||
void phy_lan8720_dump_registers();
|
||||
|
||||
/** @brief Default LAN8720 phy_check_init function.
|
||||
/**
|
||||
* @brief Default LAN8720 phy_check_init function
|
||||
*
|
||||
*/
|
||||
void phy_lan8720_check_phy_init(void);
|
||||
|
||||
/** @brief Default LAN8720 phy_get_speed_mode function.
|
||||
/**
|
||||
* @brief Default LAN8720 phy_get_speed_mode function
|
||||
*
|
||||
* @return eth_speed_mode_t Ethernet speed mode
|
||||
*/
|
||||
eth_speed_mode_t phy_lan8720_get_speed_mode(void);
|
||||
|
||||
/** @brief Default LAN8720 phy_get_duplex_mode function.
|
||||
/**
|
||||
* @brief Default LAN8720 phy_get_duplex_mode function
|
||||
*
|
||||
* @return eth_duplex_mode_t Ethernet duplex mode
|
||||
*/
|
||||
eth_duplex_mode_t phy_lan8720_get_duplex_mode(void);
|
||||
|
||||
/** @brief Default LAN8720 phy_power_enable function.
|
||||
/**
|
||||
* @brief Default LAN8720 phy_power_enable function
|
||||
*
|
||||
* @note This function may need to be replaced with a custom function
|
||||
* if the PHY has a GPIO to enable power or start a clock.
|
||||
*
|
||||
* Consult the ethernet example to see how this is done.
|
||||
*/
|
||||
void phy_lan8720_power_enable(bool);
|
||||
|
||||
/** @brief Default LAN8720 phy_init function.
|
||||
/**
|
||||
* @brief Default LAN8720 phy_init function
|
||||
*
|
||||
* @return esp_err_t
|
||||
* - ESP_OK on success
|
||||
* - ESP_FAIL on error
|
||||
*/
|
||||
esp_err_t phy_lan8720_init(void);
|
||||
|
||||
/** @brief Default LAN8720 PHY configuration
|
||||
/**
|
||||
* @brief Default LAN8720 PHY configuration
|
||||
*
|
||||
* This configuration is not suitable for use as-is, it will need
|
||||
* to be modified for your particular PHY hardware setup.
|
||||
* @note This configuration is not suitable for use as-is,
|
||||
* it will need to be modified for your particular PHY hardware setup.
|
||||
*
|
||||
* Consult the Ethernet example to see how this is done.
|
||||
*/
|
||||
extern const eth_config_t phy_lan8720_default_ethernet_config;
|
||||
|
||||
|
@ -18,9 +18,10 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* This header contains register/bit masks for the standard
|
||||
PHY MII registers that should be supported by all PHY models.
|
||||
*/
|
||||
/**
|
||||
* @brief This header contains register/bit masks for the standard PHY MII registers that should be supported by all PHY models.
|
||||
*
|
||||
*/
|
||||
|
||||
#define MII_BASIC_MODE_CONTROL_REG (0x0)
|
||||
#define MII_SOFTWARE_RESET BIT(15)
|
||||
|
@ -20,44 +20,53 @@ extern "C" {
|
||||
|
||||
#include "phy.h"
|
||||
|
||||
/** @brief Dump all TLK110 PHY SMI configuration registers
|
||||
/**
|
||||
* @brief Dump TLK110 PHY SMI configuration registers
|
||||
*
|
||||
* @note These registers are dumped at 'debug' level, so output
|
||||
* may not be visible depending on default log levels.
|
||||
*/
|
||||
void phy_tlk110_dump_registers();
|
||||
|
||||
/** @brief Default TLK110 phy_check_init function.
|
||||
/**
|
||||
* @brief Default TLK110 phy_check_init function
|
||||
*
|
||||
*/
|
||||
void phy_tlk110_check_phy_init(void);
|
||||
|
||||
/** @brief Default TLK110 phy_get_speed_mode function.
|
||||
/**
|
||||
* @brief Default TLK110 phy_get_speed_mode function
|
||||
*
|
||||
* @return eth_speed_mode_t Ethernet speed mode
|
||||
*/
|
||||
eth_speed_mode_t phy_tlk110_get_speed_mode(void);
|
||||
|
||||
/** @brief Default TLK110 phy_get_duplex_mode function.
|
||||
/**
|
||||
* @brief Default TLK110 phy_get_duplex_mode function
|
||||
*
|
||||
* @return eth_duplex_mode_t Ethernet duplex mode
|
||||
*/
|
||||
eth_duplex_mode_t phy_tlk110_get_duplex_mode(void);
|
||||
|
||||
/** @brief Default TLK110 phy_power_enable function.
|
||||
/**
|
||||
* @brief Default TLK110 phy_power_enable function
|
||||
*
|
||||
* @note This function may need to be replaced with a custom function
|
||||
* if the PHY has a GPIO to enable power or start a clock.
|
||||
*
|
||||
* Consult the ethernet example to see how this is done.
|
||||
*/
|
||||
void phy_tlk110_power_enable(bool);
|
||||
|
||||
/** @brief Default TLK110 phy_init function.
|
||||
/**
|
||||
* @brief Default TLK110 phy_init function
|
||||
*
|
||||
* @return esp_err_t
|
||||
* - ESP_OK on success
|
||||
* - ESP_FAIL on error
|
||||
*/
|
||||
esp_err_t phy_tlk110_init(void);
|
||||
|
||||
/** @brief Default TLK110 PHY configuration
|
||||
/**
|
||||
* @brief Default TLK110 PHY configuration
|
||||
*
|
||||
* This configuration is not suitable for use as-is, it will need
|
||||
* to be modified for your particular PHY hardware setup.
|
||||
* @note This configuration is not suitable for use as-is,
|
||||
* it will need to be modified for your particular PHY hardware setup.
|
||||
*
|
||||
* Consult the Ethernet example to see how this is done.
|
||||
*/
|
||||
extern const eth_config_t phy_tlk110_default_ethernet_config;
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
/* ----------------------- Defines ------------------------------------------*/
|
||||
#define MB_INST_MIN_SIZE (2) // The minimal size of Modbus registers area in bytes
|
||||
#define MB_INST_MAX_SIZE (2048) // The maximum size of Modbus area in bytes
|
||||
#define MB_INST_MAX_SIZE (65535 * 2) // The maximum size of Modbus area in bytes
|
||||
|
||||
#define MB_CONTROLLER_STACK_SIZE (CONFIG_MB_CONTROLLER_STACK_SIZE) // Stack size for Modbus controller
|
||||
#define MB_CONTROLLER_PRIORITY (CONFIG_MB_SERIAL_TASK_PRIO - 1) // priority of MB controller task
|
||||
|
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
@ -11,21 +11,21 @@
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
* OF SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the lwIP TCP/IP stack.
|
||||
*
|
||||
*
|
||||
* Author: Simon Goldschmidt
|
||||
*
|
||||
*/
|
||||
@ -316,7 +316,7 @@
|
||||
* scenario happens: 192.168.0.2 -> 0.0.0.0 -> 192.168.0.2 or 192.168.0.2 -> 0.0.0.0
|
||||
*/
|
||||
|
||||
#define ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES
|
||||
#define ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES
|
||||
/*
|
||||
* LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all
|
||||
* events (accept, sent, etc) that happen in the system.
|
||||
@ -576,6 +576,11 @@
|
||||
|
||||
#if PPP_SUPPORT
|
||||
|
||||
/**
|
||||
* PPP_NOTIFY_PHASE==1: Support PPP notify phase.
|
||||
*/
|
||||
#define PPP_NOTIFY_PHASE CONFIG_PPP_NOTIFY_PHASE_SUPPORT
|
||||
|
||||
/**
|
||||
* PAP_SUPPORT==1: Support PAP.
|
||||
*/
|
||||
@ -759,7 +764,7 @@
|
||||
#if CONFIG_LWIP_IRAM_OPTIMIZATION
|
||||
#define ESP_IRAM_ATTR IRAM_ATTR
|
||||
#else
|
||||
#define ESP_IRAM_ATTR
|
||||
#define ESP_IRAM_ATTR
|
||||
#endif
|
||||
|
||||
#if ESP_PERF
|
||||
@ -782,7 +787,7 @@ enum {
|
||||
};
|
||||
|
||||
#else
|
||||
#define DBG_PERF_PATH_SET(dir, point)
|
||||
#define DBG_PERF_PATH_SET(dir, point)
|
||||
#define DBG_PERF_FILTER_LEN 1000
|
||||
#endif
|
||||
|
||||
|
@ -45,6 +45,7 @@ typedef enum {
|
||||
- current_data_offset offset of the current data for this event
|
||||
- total_data_len total length of the data received
|
||||
*/
|
||||
MQTT_EVENT_BEFORE_CONNECT, /*!< The event occurs before connecting */
|
||||
} esp_mqtt_event_id_t;
|
||||
|
||||
typedef enum {
|
||||
@ -103,6 +104,7 @@ typedef struct {
|
||||
const char *client_cert_pem; /*!< Pointer to certificate data in PEM format for SSL mutual authentication, default is NULL, not required if mutual authentication is not needed. If it is not NULL, also `client_key_pem` has to be provided. */
|
||||
const char *client_key_pem; /*!< Pointer to private key data in PEM format for SSL mutual authentication, default is NULL, not required if mutual authentication is not needed. If it is not NULL, also `client_cert_pem` has to be provided. */
|
||||
esp_mqtt_transport_t transport; /*!< overrides URI transport */
|
||||
int refresh_connection_after_ms; /*!< Refresh connection after this value (in milliseconds) */
|
||||
} esp_mqtt_client_config_t;
|
||||
|
||||
esp_mqtt_client_handle_t esp_mqtt_client_init(const esp_mqtt_client_config_t *config);
|
||||
@ -113,6 +115,7 @@ esp_err_t esp_mqtt_client_subscribe(esp_mqtt_client_handle_t client, const char
|
||||
esp_err_t esp_mqtt_client_unsubscribe(esp_mqtt_client_handle_t client, const char *topic);
|
||||
int esp_mqtt_client_publish(esp_mqtt_client_handle_t client, const char *topic, const char *data, int len, int qos, int retain);
|
||||
esp_err_t esp_mqtt_client_destroy(esp_mqtt_client_handle_t client);
|
||||
esp_err_t esp_mqtt_set_config(esp_mqtt_client_handle_t client, const esp_mqtt_client_config_t *config);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -65,6 +65,20 @@ typedef enum {
|
||||
NVS_READWRITE /*!< Read and write */
|
||||
} nvs_open_mode;
|
||||
|
||||
typedef enum {
|
||||
NVS_TYPE_U8 = 0x01,
|
||||
NVS_TYPE_I8 = 0x11,
|
||||
NVS_TYPE_U16 = 0x02,
|
||||
NVS_TYPE_I16 = 0x12,
|
||||
NVS_TYPE_U32 = 0x04,
|
||||
NVS_TYPE_I32 = 0x14,
|
||||
NVS_TYPE_U64 = 0x08,
|
||||
NVS_TYPE_I64 = 0x18,
|
||||
NVS_TYPE_STR = 0x21,
|
||||
NVS_TYPE_BLOB = 0x42,
|
||||
NVS_TYPE_ANY = 0xff // Must be last
|
||||
} nvs_type_t;
|
||||
|
||||
/**
|
||||
* @brief Open non-volatile storage with a given namespace from the default NVS partition
|
||||
*
|
||||
|
@ -205,12 +205,28 @@
|
||||
#define EFUSE_RD_FLASH_CRYPT_CONFIG_M ((EFUSE_RD_FLASH_CRYPT_CONFIG_V)<<(EFUSE_RD_FLASH_CRYPT_CONFIG_S))
|
||||
#define EFUSE_RD_FLASH_CRYPT_CONFIG_V 0xF
|
||||
#define EFUSE_RD_FLASH_CRYPT_CONFIG_S 28
|
||||
/* EFUSE_RD_DIG_VOL_L6: RO; bitpos:[27:24]; */
|
||||
/*descritpion: This field stores the difference between the digital regulator voltage at level6 and 1.2 V. (RO)
|
||||
BIT[27] is the sign bit, 0: + , 1: -
|
||||
BIT[26:24] is the difference value, unit: 0.017V
|
||||
volt_lv6 = BIT[27] ? 1.2 - BIT[26:24] * 0.017 : 1.2 + BIT[26:24] * 0.017 */
|
||||
#define EFUSE_RD_DIG_VOL_L6 0x0F
|
||||
#define EFUSE_RD_DIG_VOL_L6_M ((EFUSE_RD_DIG_VOL_L6_V)<<(EFUSE_RD_DIG_VOL_L6_S))
|
||||
#define EFUSE_RD_DIG_VOL_L6_V 0x0F
|
||||
#define EFUSE_RD_DIG_VOL_L6_S 24
|
||||
/* EFUSE_RD_VOL_LEVEL_HP_INV: RO; bitpos:[23:22] */
|
||||
/*description: This field stores the voltage level for CPU to run at 240 MHz, or for flash/PSRAM to run at 80 MHz.
|
||||
0x0: level 7; 0x1: level 6; 0x2: level 5; 0x3: level 4. (RO)*/
|
||||
#define EFUSE_RD_VOL_LEVEL_HP_INV 0x03
|
||||
#define EFUSE_RD_VOL_LEVEL_HP_INV_M ((EFUSE_RD_VOL_LEVEL_HP_INV_V)<<(EFUSE_RD_VOL_LEVEL_HP_INV_S))
|
||||
#define EFUSE_RD_VOL_LEVEL_HP_INV_V 0x03
|
||||
#define EFUSE_RD_VOL_LEVEL_HP_INV_S 22
|
||||
/* EFUSE_RD_INST_CONFIG : RO ;bitpos:[27:20] ;default: 8'b0 ; */
|
||||
/*description: */
|
||||
#define EFUSE_RD_INST_CONFIG 0x000000FF
|
||||
#define EFUSE_RD_INST_CONFIG_M ((EFUSE_RD_INST_CONFIG_V)<<(EFUSE_RD_INST_CONFIG_S))
|
||||
#define EFUSE_RD_INST_CONFIG_V 0xFF
|
||||
#define EFUSE_RD_INST_CONFIG_S 20
|
||||
/* Deprecated */
|
||||
#define EFUSE_RD_INST_CONFIG 0x000000FF /** Deprecated **/
|
||||
#define EFUSE_RD_INST_CONFIG_M ((EFUSE_RD_INST_CONFIG_V)<<(EFUSE_RD_INST_CONFIG_S)) /** Deprecated **/
|
||||
#define EFUSE_RD_INST_CONFIG_V 0xFF /** Deprecated **/
|
||||
#define EFUSE_RD_INST_CONFIG_S 20 /** Deprecated **/
|
||||
/* EFUSE_RD_SPI_PAD_CONFIG_CS0 : RO ;bitpos:[19:15] ;default: 5'b0 ; */
|
||||
/*description: read for SPI_pad_config_cs0*/
|
||||
#define EFUSE_RD_SPI_PAD_CONFIG_CS0 0x0000001F
|
||||
@ -464,12 +480,28 @@
|
||||
#define EFUSE_FLASH_CRYPT_CONFIG_M ((EFUSE_FLASH_CRYPT_CONFIG_V)<<(EFUSE_FLASH_CRYPT_CONFIG_S))
|
||||
#define EFUSE_FLASH_CRYPT_CONFIG_V 0xF
|
||||
#define EFUSE_FLASH_CRYPT_CONFIG_S 28
|
||||
/* EFUSE_DIG_VOL_L6: R/W; bitpos:[27:24]; */
|
||||
/*descritpion: This field stores the difference between the digital regulator voltage at level6 and 1.2 V. (R/W)
|
||||
BIT[27] is the sign bit, 0: + , 1: -
|
||||
BIT[26:24] is the difference value, unit: 0.017V
|
||||
volt_lv6 = BIT[27] ? 1.2 - BIT[26:24] * 0.017 : 1.2 + BIT[26:24] * 0.017 */
|
||||
#define EFUSE_DIG_VOL_L6 0x0F
|
||||
#define EFUSE_DIG_VOL_L6_M ((EFUSE_RD_DIG_VOL_L6_V)<<(EFUSE_RD_DIG_VOL_L6_S))
|
||||
#define EFUSE_DIG_VOL_L6_V 0x0F
|
||||
#define EFUSE_DIG_VOL_L6_S 24
|
||||
/* EFUSE_VOL_LEVEL_HP_INV: R/W; bitpos:[23:22] */
|
||||
/*description: This field stores the voltage level for CPU to run at 240 MHz, or for flash/PSRAM to run at 80 MHz.
|
||||
0x0: level 7; 0x1: level 6; 0x2: level 5; 0x3: level 4. (R/W)*/
|
||||
#define EFUSE_VOL_LEVEL_HP_INV 0x03
|
||||
#define EFUSE_VOL_LEVEL_HP_INV_M ((EFUSE_RD_VOL_LEVEL_HP_INV_V)<<(EFUSE_RD_VOL_LEVEL_HP_INV_S))
|
||||
#define EFUSE_VOL_LEVEL_HP_INV_V 0x03
|
||||
#define EFUSE_VOL_LEVEL_HP_INV_S 22
|
||||
/* EFUSE_INST_CONFIG : R/W ;bitpos:[27:20] ;default: 8'b0 ; */
|
||||
/*description: */
|
||||
#define EFUSE_INST_CONFIG 0x000000FF
|
||||
#define EFUSE_INST_CONFIG_M ((EFUSE_INST_CONFIG_V)<<(EFUSE_INST_CONFIG_S))
|
||||
#define EFUSE_INST_CONFIG_V 0xFF
|
||||
#define EFUSE_INST_CONFIG_S 20
|
||||
/* Deprecated */
|
||||
#define EFUSE_INST_CONFIG 0x000000FF /** Deprecated **/
|
||||
#define EFUSE_INST_CONFIG_M ((EFUSE_INST_CONFIG_V)<<(EFUSE_INST_CONFIG_S)) /** Deprecated **/
|
||||
#define EFUSE_INST_CONFIG_V 0xFF /** Deprecated **/
|
||||
#define EFUSE_INST_CONFIG_S 20 /** Deprecated **/
|
||||
/* EFUSE_SPI_PAD_CONFIG_CS0 : R/W ;bitpos:[19:15] ;default: 5'b0 ; */
|
||||
/*description: program for SPI_pad_config_cs0*/
|
||||
#define EFUSE_SPI_PAD_CONFIG_CS0 0x0000001F
|
||||
|
Reference in New Issue
Block a user