// Copyright 2015-2016 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. #ifndef _DRIVER_RMT_CTRL_H_ #define _DRIVER_RMT_CTRL_H_ #include "esp_err.h" #include "soc/rmt_reg.h" #include "soc/dport_reg.h" #include "soc/rmt_struct.h" #include "freertos/FreeRTOS.h" #include "freertos/semphr.h" #include "freertos/xtensa_api.h" #include "freertos/ringbuf.h" #include "driver/gpio.h" #include "driver/periph_ctrl.h" #ifdef __cplusplus extern "C" { #endif #define RMT_MEM_BLOCK_BYTE_NUM (256) #define RMT_MEM_ITEM_NUM (RMT_MEM_BLOCK_BYTE_NUM/4) typedef enum { RMT_CHANNEL_0=0, /*!< RMT Channel0 */ RMT_CHANNEL_1, /*!< RMT Channel1 */ RMT_CHANNEL_2, /*!< RMT Channel2 */ RMT_CHANNEL_3, /*!< RMT Channel3 */ RMT_CHANNEL_4, /*!< RMT Channel4 */ RMT_CHANNEL_5, /*!< RMT Channel5 */ RMT_CHANNEL_6, /*!< RMT Channel6 */ RMT_CHANNEL_7, /*!< RMT Channel7 */ RMT_CHANNEL_MAX } rmt_channel_t; typedef enum { RMT_MEM_OWNER_TX = 0, /*!< RMT RX mode, RMT transmitter owns the memory block*/ RMT_MEM_OWNER_RX = 1, /*!< RMT RX mode, RMT receiver owns the memory block*/ RMT_MEM_OWNER_MAX, }rmt_mem_owner_t; typedef enum { RMT_BASECLK_REF = 0, /*!< RMT source clock system reference tick, 1MHz by default(Not supported in this version) */ RMT_BASECLK_APB, /*!< RMT source clock is APB CLK, 80Mhz by default */ RMT_BASECLK_MAX, } rmt_source_clk_t; typedef enum { RMT_DATA_MODE_FIFO = 0, /*