Merge branch 'master' into feature/esp32s2beta_update

This commit is contained in:
Angus Gratton
2019-08-08 15:26:58 +10:00
committed by Angus Gratton
657 changed files with 6814 additions and 7534 deletions
+4 -4
View File
@@ -235,13 +235,13 @@ int adc1_get_voltage(adc1_channel_t channel) __attribute__((deprecated));
/**
* @brief Enable ADC power
*/
void adc_power_on();
void adc_power_on(void);
/**
* @brief Power off SAR ADC
* This function will force power down for ADC
*/
void adc_power_off();
void adc_power_off(void);
/**
* @brief Initialize ADC pad
@@ -298,7 +298,7 @@ esp_err_t adc_i2s_mode_init(adc_unit_t adc_unit, adc_channel_t channel);
* Note that adc1_config_channel_atten, adc1_config_width functions need
* to be called to configure ADC1 channels, before ADC1 is used by the ULP.
*/
void adc1_ulp_enable();
void adc1_ulp_enable(void);
/**
* @brief Read Hall Sensor
@@ -319,7 +319,7 @@ void adc1_ulp_enable();
*
* @return The hall sensor reading.
*/
int hall_sensor_read();
int hall_sensor_read(void);
/**
* @brief Get the gpio number of a specific ADC2 channel.
@@ -31,7 +31,7 @@ extern "C" {
* - ESP_OK success
* - ESP_ERR_TIMEOUT reserved for future use. Currently the function will wait until success.
*/
esp_err_t adc2_wifi_acquire();
esp_err_t adc2_wifi_acquire(void);
/**
@@ -42,7 +42,7 @@ esp_err_t adc2_wifi_acquire();
*
* @return always return ESP_OK.
*/
esp_err_t adc2_wifi_release();
esp_err_t adc2_wifi_release(void);
#ifdef __cplusplus
}
+6 -6
View File
@@ -238,7 +238,7 @@ esp_err_t can_driver_install(const can_general_config_t *g_config, const can_tim
* - ESP_OK: Successfully uninstalled CAN driver
* - ESP_ERR_INVALID_STATE: Driver is not in stopped/bus-off state, or is not installed
*/
esp_err_t can_driver_uninstall();
esp_err_t can_driver_uninstall(void);
/**
* @brief Start the CAN driver
@@ -253,7 +253,7 @@ esp_err_t can_driver_uninstall();
* - ESP_OK: CAN driver is now running
* - ESP_ERR_INVALID_STATE: Driver is not in stopped state, or is not installed
*/
esp_err_t can_start();
esp_err_t can_start(void);
/**
* @brief Stop the CAN driver
@@ -272,7 +272,7 @@ esp_err_t can_start();
* - ESP_OK: CAN driver is now Stopped
* - ESP_ERR_INVALID_STATE: Driver is not in running state, or is not installed
*/
esp_err_t can_stop();
esp_err_t can_stop(void);
/**
* @brief Transmit a CAN message
@@ -379,7 +379,7 @@ esp_err_t can_reconfigure_alerts(uint32_t alerts_enabled, uint32_t *current_aler
* - ESP_OK: Bus recovery started
* - ESP_ERR_INVALID_STATE: CAN driver is not in the bus-off state, or is not installed
*/
esp_err_t can_initiate_recovery();
esp_err_t can_initiate_recovery(void);
/**
* @brief Get current status information of the CAN driver
@@ -405,7 +405,7 @@ esp_err_t can_get_status_info(can_status_info_t *status_info);
* - ESP_OK: Transmit queue cleared
* - ESP_ERR_INVALID_STATE: CAN driver is not installed or TX queue is disabled
*/
esp_err_t can_clear_transmit_queue();
esp_err_t can_clear_transmit_queue(void);
/**
* @brief Clear the receive queue
@@ -419,7 +419,7 @@ esp_err_t can_clear_transmit_queue();
* - ESP_OK: Transmit queue cleared
* - ESP_ERR_INVALID_STATE: CAN driver is not installed
*/
esp_err_t can_clear_receive_queue();
esp_err_t can_clear_receive_queue(void);
#ifdef __cplusplus
}
+2 -2
View File
@@ -99,12 +99,12 @@ esp_err_t dac_output_disable(dac_channel_t channel);
/**
* @brief Enable DAC output data from I2S
*/
esp_err_t dac_i2s_enable();
esp_err_t dac_i2s_enable(void);
/**
* @brief Disable DAC output data from I2S
*/
esp_err_t dac_i2s_disable();
esp_err_t dac_i2s_disable(void);
#ifdef __cplusplus
}
#endif
+1 -1
View File
@@ -637,7 +637,7 @@ esp_err_t gpio_install_isr_service(int intr_alloc_flags);
/**
* @brief Uninstall the driver's GPIO ISR service, freeing related resources.
*/
void gpio_uninstall_isr_service();
void gpio_uninstall_isr_service(void);
/**
* @brief Add ISR handler for the corresponding GPIO pin.
+1 -1
View File
@@ -224,7 +224,7 @@ esp_err_t i2c_set_pin(i2c_port_t i2c_num, int sda_io_num, int scl_io_num,
*
* @return i2c command link handler
*/
i2c_cmd_handle_t i2c_cmd_link_create();
i2c_cmd_handle_t i2c_cmd_link_create(void);
/**
* @brief Free I2C command link
+1 -1
View File
@@ -439,7 +439,7 @@ esp_err_t ledc_fade_func_install(int intr_alloc_flags);
* @brief Uninstall LEDC fade function.
*
*/
void ledc_fade_func_uninstall();
void ledc_fade_func_uninstall(void);
/**
* @brief Start LEDC fading.
+1 -1
View File
@@ -230,7 +230,7 @@ esp_err_t rtc_gpio_isolate(gpio_num_t gpio_num);
* Force hold signal is enabled before going into deep sleep for pins which
* are used for EXT1 wakeup.
*/
void rtc_gpio_force_hold_dis_all();
void rtc_gpio_force_hold_dis_all(void);
/**
* @brief Set RTC GPIO pad drive capability
@@ -111,7 +111,7 @@ esp_err_t sdio_slave_initialize(sdio_slave_config_t *config);
/** De-initialize the sdio slave driver to release the resources.
*/
void sdio_slave_deinit();
void sdio_slave_deinit(void);
/** Start hardware for sending and receiving, as well as set the IOREADY1 to 1.
*
@@ -122,19 +122,19 @@ void sdio_slave_deinit();
* - ESP_ERR_INVALID_STATE if already started.
* - ESP_OK otherwise.
*/
esp_err_t sdio_slave_start();
esp_err_t sdio_slave_start(void);
/** Stop hardware from sending and receiving, also set IOREADY1 to 0.
*
* @note this will not clear the data already in the driver, and also not reset the PKT_LEN and TOKEN1 counting. Call ``sdio_slave_reset`` to do that.
*/
void sdio_slave_stop();
void sdio_slave_stop(void);
/** Clear the data still in the driver, as well as reset the PKT_LEN and TOKEN1 counting.
*
* @return always return ESP_OK.
*/
esp_err_t sdio_slave_reset();
esp_err_t sdio_slave_reset(void);
/*---------------------------------------------------------------------------
* Receive
@@ -263,7 +263,7 @@ esp_err_t sdio_slave_write_reg(int pos, uint8_t reg);
*
* @return the interrupt mask.
*/
sdio_slave_hostint_t sdio_slave_get_host_intena();
sdio_slave_hostint_t sdio_slave_get_host_intena(void);
/** Set the interrupt enable for host.
*
@@ -91,7 +91,7 @@ typedef struct {
* - ESP_ERR_INVALID_STATE if sdmmc_host_init was already called
* - ESP_ERR_NO_MEM if memory can not be allocated
*/
esp_err_t sdmmc_host_init();
esp_err_t sdmmc_host_init(void);
/**
* @brief Initialize given slot of SDMMC peripheral
@@ -218,7 +218,7 @@ esp_err_t sdmmc_host_io_int_wait(int slot, TickType_t timeout_ticks);
* - ESP_OK on success
* - ESP_ERR_INVALID_STATE if sdmmc_host_init function has not been called
*/
esp_err_t sdmmc_host_deinit();
esp_err_t sdmmc_host_deinit(void);
/**
* @brief Enable the pull-ups of sd pins.
@@ -91,7 +91,7 @@ typedef struct {
* - ESP_OK on success
* - other error codes may be returned in future versions
*/
esp_err_t sdspi_host_init();
esp_err_t sdspi_host_init(void);
/**
* @brief Initialize SD SPI driver for the specific SPI controller
@@ -159,7 +159,7 @@ esp_err_t sdspi_host_set_card_clk(int slot, uint32_t freq_khz);
* - ESP_OK on success
* - ESP_ERR_INVALID_STATE if sdspi_host_init function has not been called
*/
esp_err_t sdspi_host_deinit();
esp_err_t sdspi_host_deinit(void);
/**
* @brief Enable SDIO interrupt.
+1 -13
View File
@@ -143,18 +143,6 @@ esp_err_t spi_bus_free(spi_host_device_t host);
*/
bool spicommon_periph_claim(spi_host_device_t host, const char* source);
// The macro is to keep the back-compatibility of IDF v3.2 and before
// In this way we can call spicommon_periph_claim with two arguments, or the host with the source set to the calling function name
// When two arguments (host, func) are given, __spicommon_periph_claim2 is called
// or if only one arguments (host) is given, __spicommon_periph_claim1 is called
#define spicommon_periph_claim(host...) __spicommon_periph_claim(host, 2, 1)
#define __spicommon_periph_claim(host, source, n, ...) __spicommon_periph_claim ## n(host, source)
#define __spicommon_periph_claim1(host, _) ({ \
char* warning_str = "calling spicommon_periph_claim without source string is deprecated.";\
spicommon_periph_claim(host, __FUNCTION__); })
#define __spicommon_periph_claim2(host, func) spicommon_periph_claim(host, func)
/**
* @brief Check whether the spi periph is in use.
*
@@ -390,7 +378,7 @@ bool spicommon_dmaworkaround_req_reset(int dmachan, dmaworkaround_cb_t cb, void
*
* @return True when a DMA reset is requested but hasn't completed yet. False otherwise.
*/
bool spicommon_dmaworkaround_reset_in_progress();
bool spicommon_dmaworkaround_reset_in_progress(void);
/**
+99 -100
View File
@@ -278,7 +278,7 @@ typedef intr_handle_t touch_isr_handle_t;
* - ESP_OK Success
* - ESP_ERR_NO_MEM Touch pad init error
*/
esp_err_t touch_pad_init();
esp_err_t touch_pad_init(void);
/**
* @brief Un-install touch pad driver.
@@ -287,7 +287,7 @@ esp_err_t touch_pad_init();
* - ESP_OK Success
* - ESP_FAIL Touch pad driver not initialized
*/
esp_err_t touch_pad_deinit();
esp_err_t touch_pad_deinit(void);
/**
* @brief Deregister the handler previously registered using touch_pad_isr_handler_register
@@ -300,99 +300,6 @@ esp_err_t touch_pad_deinit();
*/
esp_err_t touch_pad_isr_deregister(void(*fn)(void *), void *arg);
/**
* @brief Set touch sensor reference voltage, if the voltage gap between high and low reference voltage get less,
* the charging and discharging time would be faster, accordingly, the counter value would be larger.
* In the case of detecting very slight change of capacitance, we can narrow down the gap so as to increase
* the sensitivity. On the other hand, narrow voltage gap would also introduce more noise, but we can use a
* software filter to pre-process the counter value.
* @param refh the value of DREFH
* @param refl the value of DREFL
* @param atten the attenuation on DREFH
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if argument is wrong
*/
esp_err_t touch_pad_set_voltage(touch_high_volt_t refh, touch_low_volt_t refl, touch_volt_atten_t atten);
/**
* @brief Get touch sensor reference voltage,
* @param refh pointer to accept DREFH value
* @param refl pointer to accept DREFL value
* @param atten pointer to accept the attenuation on DREFH
* @return
* - ESP_OK on success
*/
esp_err_t touch_pad_get_voltage(touch_high_volt_t *refh, touch_low_volt_t *refl, touch_volt_atten_t *atten);
/**
* @brief Set touch sensor charge/discharge speed for each pad.
* If the slope is 0, the counter would always be zero.
* If the slope is 1, the charging and discharging would be slow, accordingly, the counter value would be small.
* If the slope is set 7, which is the maximum value, the charging and discharging would be fast, accordingly, the
* counter value would be larger.
* @param touch_num touch pad index
* @param slope touch pad charge/discharge speed
* @param opt the initial voltage
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if argument is wrong
*/
esp_err_t touch_pad_set_cnt_mode(touch_pad_t touch_num, touch_cnt_slope_t slope, touch_tie_opt_t opt);
/**
* @brief Get touch sensor charge/discharge speed for each pad
* @param touch_num touch pad index
* @param slope pointer to accept touch pad charge/discharge slope
* @param opt pointer to accept the initial voltage
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if argument is wrong
*/
esp_err_t touch_pad_get_cnt_mode(touch_pad_t touch_num, touch_cnt_slope_t *slope, touch_tie_opt_t *opt);
/**
* @brief Initialize touch pad GPIO
* @param touch_num touch pad index
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if argument is wrong
*/
esp_err_t touch_pad_io_init(touch_pad_t touch_num);
/**
* @brief Set touch sensor FSM mode, the test action can be triggered by the timer,
* as well as by the software.
* @param mode FSM mode
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if argument is wrong
*/
esp_err_t touch_pad_set_fsm_mode(touch_fsm_mode_t mode);
/**
* @brief Get touch sensor FSM mode
* @param mode pointer to accept FSM mode
* @return
* - ESP_OK on success
*/
esp_err_t touch_pad_get_fsm_mode(touch_fsm_mode_t *mode);
/**
* @brief Trigger a touch sensor measurement, only support in SW mode of FSM
* @return
* - ESP_OK on success
*/
esp_err_t touch_pad_sw_start();
/**
* @brief Get the touch sensor status bit mask. usually used in ISR to decide which pads are 'touched'.
* If status bit is 1, this pad is be touched, else, this pad is released.
* @return
* - touch status
*/
uint32_t touch_pad_get_status();
/**
* @brief Get the touch pad which caused wakeup from sleep
* @param pad_num pointer to touch pad which caused wakeup
@@ -546,6 +453,91 @@ esp_err_t touch_pad_set_meas_time(uint16_t sleep_cycle, uint16_t meas_cycle);
*/
esp_err_t touch_pad_get_meas_time(uint16_t *sleep_cycle, uint16_t *meas_cycle);
/**
* @brief Set touch sensor reference voltage, if the voltage gap between high and low reference voltage get less,
* the charging and discharging time would be faster, accordingly, the counter value would be larger.
* In the case of detecting very slight change of capacitance, we can narrow down the gap so as to increase
* the sensitivity. On the other hand, narrow voltage gap would also introduce more noise, but we can use a
* software filter to pre-process the counter value.
* @param refh the value of DREFH
* @param refl the value of DREFL
* @param atten the attenuation on DREFH
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if argument is wrong
*/
esp_err_t touch_pad_set_voltage(touch_high_volt_t refh, touch_low_volt_t refl, touch_volt_atten_t atten);
/**
* @brief Get touch sensor reference voltage,
* @param refh pointer to accept DREFH value
* @param refl pointer to accept DREFL value
* @param atten pointer to accept the attenuation on DREFH
* @return
* - ESP_OK on success
*/
esp_err_t touch_pad_get_voltage(touch_high_volt_t *refh, touch_low_volt_t *refl, touch_volt_atten_t *atten);
/**
* @brief Set touch sensor charge/discharge speed for each pad.
* If the slope is 0, the counter would always be zero.
* If the slope is 1, the charging and discharging would be slow, accordingly, the counter value would be small.
* If the slope is set 7, which is the maximum value, the charging and discharging would be fast, accordingly, the
* counter value would be larger.
* @param touch_num touch pad index
* @param slope touch pad charge/discharge speed
* @param opt the initial voltage
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if argument is wrong
*/
esp_err_t touch_pad_set_cnt_mode(touch_pad_t touch_num, touch_cnt_slope_t slope, touch_tie_opt_t opt);
/**
* @brief Get touch sensor charge/discharge speed for each pad
* @param touch_num touch pad index
* @param slope pointer to accept touch pad charge/discharge slope
* @param opt pointer to accept the initial voltage
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if argument is wrong
*/
esp_err_t touch_pad_get_cnt_mode(touch_pad_t touch_num, touch_cnt_slope_t *slope, touch_tie_opt_t *opt);
/**
* @brief Initialize touch pad GPIO
* @param touch_num touch pad index
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if argument is wrong
*/
esp_err_t touch_pad_io_init(touch_pad_t touch_num);
/**
* @brief Set touch sensor FSM mode, the test action can be triggered by the timer,
* as well as by the software.
* @param mode FSM mode
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if argument is wrong
*/
esp_err_t touch_pad_set_fsm_mode(touch_fsm_mode_t mode);
/**
* @brief Get touch sensor FSM mode
* @param mode pointer to accept FSM mode
* @return
* - ESP_OK on success
*/
esp_err_t touch_pad_get_fsm_mode(touch_fsm_mode_t *mode);
/**
* @brief Trigger a touch sensor measurement, only support in SW mode of FSM
* @return
* - ESP_OK on success
*/
esp_err_t touch_pad_sw_start(void);
/**
* @brief Set touch sensor interrupt threshold
* @param touch_num touch pad index
@@ -648,21 +640,28 @@ esp_err_t touch_pad_clear_group_mask(uint16_t set1_mask, uint16_t set2_mask, uin
* @return
* - ESP_OK on success
*/
esp_err_t touch_pad_clear_status();
esp_err_t touch_pad_clear_status(void);
/**
* @brief Get the touch sensor status, usually used in ISR to decide which pads are 'touched'.
* @return
* - touch status
*/
uint32_t touch_pad_get_status(void);
/**
* @brief To enable touch pad interrupt
* @return
* - ESP_OK on success
*/
esp_err_t touch_pad_intr_enable();
esp_err_t touch_pad_intr_enable(void);
/**
* @brief To disable touch pad interrupt
* @return
* - ESP_OK on success
*/
esp_err_t touch_pad_intr_disable();
esp_err_t touch_pad_intr_disable(void);
/**
* @brief set touch pad filter calibration period, in ms.
@@ -712,7 +711,7 @@ esp_err_t touch_pad_filter_start(uint32_t filter_period_ms);
* - ESP_OK Success
* - ESP_ERR_INVALID_STATE driver state error
*/
esp_err_t touch_pad_filter_stop();
esp_err_t touch_pad_filter_stop(void);
/**
* @brief delete touch pad filter driver and release the memory
@@ -721,7 +720,7 @@ esp_err_t touch_pad_filter_stop();
* - ESP_OK Success
* - ESP_ERR_INVALID_STATE driver state error
*/
esp_err_t touch_pad_filter_delete();
esp_err_t touch_pad_filter_delete(void);
#elif CONFIG_IDF_TARGET_ESP32S2BETA
@@ -40,7 +40,7 @@ void uart_set_select_notif_callback(uart_port_t uart_num, uart_select_notif_call
/**
* @brief Get mutex guarding select() notifications
*/
portMUX_TYPE *uart_get_selectlock();
portMUX_TYPE *uart_get_selectlock(void);
#ifdef __cplusplus
}