Merge branch 'docs/ulp_lp_core' into 'master'

ulp: add lp core docs

Closes IDF-5816

See merge request espressif/esp-idf!24013
This commit is contained in:
Marius Vikhammer
2023-06-07 10:43:23 +08:00
9 changed files with 228 additions and 28 deletions

View File

@@ -16,21 +16,32 @@ extern "C" {
#include "hal/gpio_types.h"
#include "esp_err.h"
/**
* @brief LP Core I2C pin config parameters
*/
typedef struct {
gpio_num_t sda_io_num; // GPIO pin for SDA signal. Only GPIO#6 can be used as the SDA pin.
gpio_num_t scl_io_num; // GPIO pin for SCL signal. Only GPIO#7 can be used as the SCL pin.
bool sda_pullup_en; // SDA line enable internal pullup. Can be configured if external pullup is not used.
bool scl_pullup_en; // SCL line enable internal pullup. Can be configured if external pullup is not used.
gpio_num_t sda_io_num; /*!< GPIO pin for SDA signal. Only GPIO#6 can be used as the SDA pin. */
gpio_num_t scl_io_num; /*!< GPIO pin for SCL signal. Only GPIO#7 can be used as the SCL pin. */
bool sda_pullup_en; /*!< SDA line enable internal pullup. Can be configured if external pullup is not used. */
bool scl_pullup_en; /*!< SCL line enable internal pullup. Can be configured if external pullup is not used. */
} lp_core_i2c_pin_cfg_t;
/**
* @brief LP Core I2C timing config parameters
*/
typedef struct {
uint32_t clk_speed_hz; // LP I2C clock speed for master mode
uint32_t clk_speed_hz; /*!< LP I2C clock speed for master mode */
} lp_core_i2c_timing_cfg_t;
/**
* @brief LP Core I2C config parameters
*/
typedef struct {
lp_core_i2c_pin_cfg_t i2c_pin_cfg; // LP I2C pin configuration
lp_core_i2c_timing_cfg_t i2c_timing_cfg; // LP I2C timing configuration
soc_periph_lp_i2c_clk_src_t i2c_src_clk; // LP I2C source clock type
lp_core_i2c_pin_cfg_t i2c_pin_cfg; /*!< LP I2C pin configuration */
lp_core_i2c_timing_cfg_t i2c_timing_cfg; /*!< LP I2C timing configuration */
soc_periph_lp_i2c_clk_src_t i2c_src_clk; /*!< LP I2C source clock type */
} lp_core_i2c_cfg_t;
/* Default LP I2C GPIO settings */
@@ -63,6 +74,7 @@ typedef struct {
* @brief Initialize and configure the LP I2C for use by the LP core
* Currently LP I2C can only be used in master mode
*
* @param lp_i2c_num LP I2C port number
* @param cfg Configuration parameters
* @return esp_err_t ESP_OK when successful
*

View File

@@ -27,8 +27,8 @@ extern "C" {
*
*/
typedef struct {
uint32_t wakeup_source; // Wakeup source flags
uint32_t lp_timer_sleep_duration_us; // Sleep duration when ULP_LP_CORE_WAKEUP_SOURCE_LP_TIMER is specified.
uint32_t wakeup_source; /*!< Wakeup source flags */
uint32_t lp_timer_sleep_duration_us; /*!< Sleep duration when ULP_LP_CORE_WAKEUP_SOURCE_LP_TIMER is specified. Measurement unit: us */
} ulp_lp_core_cfg_t;
/**

View File

@@ -21,11 +21,11 @@ extern "C" {
* @note The LP I2C must have been initialized from the HP core using the lp_core_i2c_master_init() API
* before invoking this API.
*
* @param lp_i2c_num LP I2C port number
* @param device_addr I2C device address (7-bit)
* @param data_rd Buffer to hold data to be read
* @param size Size of data to be read in bytes
* @param timeout Operation timeout in CPU cycles. Set to -1 to wait forever.
* @param lp_i2c_num LP I2C port number
* @param device_addr I2C device address (7-bit)
* @param data_rd Buffer to hold data to be read
* @param size Size of data to be read in bytes
* @param ticks_to_wait Operation timeout in CPU cycles. Set to -1 to wait forever.
*
* @return esp_err_t ESP_OK when successful
*
@@ -33,7 +33,7 @@ extern "C" {
* @note the LP I2C port number is ignored at the moment.
*/
esp_err_t lp_core_i2c_master_read_from_device(i2c_port_t lp_i2c_num, uint16_t device_addr,
uint8_t *data_rs, size_t size,
uint8_t *data_rd, size_t size,
int32_t ticks_to_wait);
/**
@@ -42,11 +42,11 @@ esp_err_t lp_core_i2c_master_read_from_device(i2c_port_t lp_i2c_num, uint16_t de
* @note The LP I2C must have been initialized from the HP core using the lp_core_i2c_master_init() API
* before invoking this API.
*
* @param lp_i2c_num LP I2C port number
* @param device_addr I2C device address (7-bit)
* @param data_wr Buffer which holds the data to be written
* @param size Size of data to be written in bytes
* @param timeout Operation timeout in CPU cycles. Set to -1 to wait forever.
* @param lp_i2c_num LP I2C port number
* @param device_addr I2C device address (7-bit)
* @param data_wr Buffer which holds the data to be written
* @param size Size of data to be written in bytes
* @param ticks_to_wait Operation timeout in CPU cycles. Set to -1 to wait forever.
*
* @return esp_err_t ESP_OK when successful
*
@@ -63,13 +63,13 @@ esp_err_t lp_core_i2c_master_write_to_device(i2c_port_t lp_i2c_num, uint16_t dev
* @note The LP I2C must have been initialized from the HP core using the lp_core_i2c_master_init() API
* before invoking this API.
*
* @param lp_i2c_num LP I2C port number
* @param device_addr I2C device address (7-bit)
* @param data_wr Buffer which holds the data to be written
* @param write_size Size of data to be written in bytes
* @param data_rd Buffer to hold data to be read
* @param read_size Size of data to be read in bytes
* @param timeout Operation timeout in CPU cycles. Set to -1 to wait forever.
* @param lp_i2c_num LP I2C port number
* @param device_addr I2C device address (7-bit)
* @param data_wr Buffer which holds the data to be written
* @param write_size Size of data to be written in bytes
* @param data_rd Buffer to hold data to be read
* @param read_size Size of data to be read in bytes
* @param ticks_to_wait Operation timeout in CPU cycles. Set to -1 to wait forever.
*
* @return esp_err_t ESP_OK when successful
*