mirror of
				https://github.com/espressif/esp-idf.git
				synced 2025-11-04 06:11:06 +00:00 
			
		
		
		
	example: update led strip example with new rmt driver
This commit is contained in:
		
							
								
								
									
										36
									
								
								examples/peripherals/rmt/led_strip/main/led_strip_encoder.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								examples/peripherals/rmt/led_strip/main/led_strip_encoder.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,36 @@
 | 
			
		||||
/*
 | 
			
		||||
 * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
 | 
			
		||||
 *
 | 
			
		||||
 * SPDX-License-Identifier: Apache-2.0
 | 
			
		||||
 */
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
#include "driver/rmt_encoder.h"
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Type of led strip encoder configuration
 | 
			
		||||
 */
 | 
			
		||||
typedef struct {
 | 
			
		||||
    uint32_t resolution; /*!< Encoder resolution, in Hz */
 | 
			
		||||
} led_strip_encoder_config_t;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Create RMT encoder for encoding LED strip pixels into RMT symbols
 | 
			
		||||
 *
 | 
			
		||||
 * @param[in] config Encoder configuration
 | 
			
		||||
 * @param[out] ret_encoder Returned encoder handle
 | 
			
		||||
 * @return
 | 
			
		||||
 *      - ESP_ERR_INVALID_ARG for any invalid arguments
 | 
			
		||||
 *      - ESP_ERR_NO_MEM out of memory when creating led strip encoder
 | 
			
		||||
 *      - ESP_OK if creating encoder successfully
 | 
			
		||||
 */
 | 
			
		||||
esp_err_t rmt_new_led_strip_encoder(const led_strip_encoder_config_t *config, rmt_encoder_handle_t *ret_encoder);
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
		Reference in New Issue
	
	Block a user