unit_config = { .low_limit = EXAMPLE_PCNT_LOW_LIMIT, .high_limit = EXAMPLE_PCNT_HIGH_LIMIT, }; pcnt_unit_handle_t pcnt_unit = NULL; ESP_ERROR_CHECK(pcnt_new_unit(&unit_config, &pcnt_unit)); ESP_LOGI(TAG, "install pcnt channel")...
@@ -194,7 +200,9 @@ esp_err_t pcnt_new_unit(const pcnt_unit_config_t *config, pcnt_unit_handle_t *re 194 200 ESP_GOTO_ON_FALSE(1 << (config->intr_priority) & PCNT_ALLOW_INTR_PRIORITY_MASK, ESP_ERR_INVALID_ARG, err, 195 201 TAG, "invalid interrupt priority:%d", config-...
_pcnt_set_event_value(pcnt_port, unit, PCNT_EVT_L_LIM, pcnt_config->counter_l_lim); @@ -504,7 +493,7 @@ esp_err_t pcnt_isr_register(void (*fun)(void *), void *arg, int intr_alloc_flags esp_err_t ret = ESP_FAIL; PCNT_CHECK(fun != NULL, PCNT_ADDRESS_ERR_STR, ESP_ER...
第一个实验最简单,直接连接 因为要设置PWM引脚,这里就是使用16引脚 PWM的初始化 可以使用的PW...
int16_t counter_h_lim; /*!< Maximum counter value */ int16_t counter_l_lim; /*!< Minimum counter value */ pcnt_unit_t unit; /*!< PCNT unit number */ pcnt_channel_t channel; /*!< the PCNT channel */ } pcnt_config_t;#ifdef __cplusplus ...
esp_err_tpcnt_unit_config(constpcnt_config_t*pcnt_config); /** * @brief Get pulse counter value * * @param pcnt_unit Pulse Counter unit number * @param count Pointer to accept counter value * * @return * - ESP_OK Success
esp_err_t pcnt_unit_config(const pcnt_config_t *pcnt_config); /** * @brief Get pulse counter value * * @param pcnt_unit Pulse Counter unit number * @param count Pointer to accept counter value * * @return * - ESP_OK Success * - ESP_ERR_INVALID_STATE pcnt driver has not been ...