mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-12 15:42:52 +00:00
rmt: move RMT item definition from soc to driver
This commit is contained in:
@@ -1,18 +1,9 @@
|
||||
// Copyright 2020 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 _SOC_RMT_STRUCT_H_
|
||||
#define _SOC_RMT_STRUCT_H_
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -20,9 +11,9 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef volatile struct rmt_dev_s {
|
||||
uint32_t data_ch[4]; /**/
|
||||
union {
|
||||
typedef struct rmt_dev_t {
|
||||
volatile uint32_t data_ch[4];
|
||||
volatile union {
|
||||
struct {
|
||||
uint32_t tx_start: 1;
|
||||
uint32_t mem_rd_rst: 1;
|
||||
@@ -44,7 +35,7 @@ typedef volatile struct rmt_dev_s {
|
||||
};
|
||||
uint32_t val;
|
||||
} tx_conf[2];
|
||||
struct {
|
||||
volatile struct {
|
||||
union {
|
||||
struct {
|
||||
uint32_t div_cnt: 8;
|
||||
@@ -73,7 +64,7 @@ typedef volatile struct rmt_dev_s {
|
||||
uint32_t val;
|
||||
} conf1;
|
||||
} rx_conf[2];
|
||||
union {
|
||||
volatile union {
|
||||
struct {
|
||||
uint32_t mem_raddr_ex: 9;
|
||||
uint32_t state: 3;
|
||||
@@ -85,7 +76,7 @@ typedef volatile struct rmt_dev_s {
|
||||
};
|
||||
uint32_t val;
|
||||
} tx_status[2];
|
||||
union {
|
||||
volatile union {
|
||||
struct {
|
||||
uint32_t mem_waddr_ex: 9;
|
||||
uint32_t reserved9: 3;
|
||||
@@ -99,7 +90,7 @@ typedef volatile struct rmt_dev_s {
|
||||
};
|
||||
uint32_t val;
|
||||
} rx_status[2];
|
||||
union {
|
||||
volatile union {
|
||||
struct {
|
||||
uint32_t ch0_tx_end: 1;
|
||||
uint32_t ch1_tx_end: 1;
|
||||
@@ -119,7 +110,7 @@ typedef volatile struct rmt_dev_s {
|
||||
};
|
||||
uint32_t val;
|
||||
} int_raw;
|
||||
union {
|
||||
volatile union {
|
||||
struct {
|
||||
uint32_t ch0_tx_end: 1;
|
||||
uint32_t ch1_tx_end: 1;
|
||||
@@ -139,7 +130,7 @@ typedef volatile struct rmt_dev_s {
|
||||
};
|
||||
uint32_t val;
|
||||
} int_st;
|
||||
union {
|
||||
volatile union {
|
||||
struct {
|
||||
uint32_t ch0_tx_end: 1;
|
||||
uint32_t ch1_tx_end: 1;
|
||||
@@ -159,7 +150,7 @@ typedef volatile struct rmt_dev_s {
|
||||
};
|
||||
uint32_t val;
|
||||
} int_ena;
|
||||
union {
|
||||
volatile union {
|
||||
struct {
|
||||
uint32_t ch0_tx_end: 1;
|
||||
uint32_t ch1_tx_end: 1;
|
||||
@@ -179,21 +170,21 @@ typedef volatile struct rmt_dev_s {
|
||||
};
|
||||
uint32_t val;
|
||||
} int_clr;
|
||||
union {
|
||||
volatile union {
|
||||
struct {
|
||||
uint32_t low: 16;
|
||||
uint32_t high: 16;
|
||||
};
|
||||
uint32_t val;
|
||||
} tx_carrier[2];
|
||||
union {
|
||||
volatile union {
|
||||
struct {
|
||||
uint32_t low_thres: 16;
|
||||
uint32_t high_thres: 16;
|
||||
};
|
||||
uint32_t val;
|
||||
} rx_carrier[2];
|
||||
union {
|
||||
volatile union {
|
||||
struct {
|
||||
uint32_t limit: 9;
|
||||
uint32_t tx_loop_num: 10;
|
||||
@@ -203,14 +194,14 @@ typedef volatile struct rmt_dev_s {
|
||||
};
|
||||
uint32_t val;
|
||||
} tx_lim[2];
|
||||
union {
|
||||
volatile union {
|
||||
struct {
|
||||
uint32_t rx_lim: 9;
|
||||
uint32_t reserved9: 23;
|
||||
};
|
||||
uint32_t val;
|
||||
} rx_lim[2];
|
||||
union {
|
||||
volatile union {
|
||||
struct {
|
||||
uint32_t fifo_mask: 1;
|
||||
uint32_t mem_clk_force_on: 1;
|
||||
@@ -226,7 +217,7 @@ typedef volatile struct rmt_dev_s {
|
||||
};
|
||||
uint32_t val;
|
||||
} sys_conf;
|
||||
union {
|
||||
volatile union {
|
||||
struct {
|
||||
uint32_t ch0: 1;
|
||||
uint32_t ch1: 1;
|
||||
@@ -235,7 +226,7 @@ typedef volatile struct rmt_dev_s {
|
||||
};
|
||||
uint32_t val;
|
||||
} tx_sim;
|
||||
union {
|
||||
volatile union {
|
||||
struct {
|
||||
uint32_t ch0: 1;
|
||||
uint32_t ch1: 1;
|
||||
@@ -267,7 +258,7 @@ typedef volatile struct rmt_dev_s {
|
||||
uint32_t reserved_c0;
|
||||
uint32_t reserved_c4;
|
||||
uint32_t reserved_c8;
|
||||
union {
|
||||
volatile union {
|
||||
struct {
|
||||
uint32_t date: 28;
|
||||
uint32_t reserved28: 4;
|
||||
@@ -278,29 +269,6 @@ typedef volatile struct rmt_dev_s {
|
||||
|
||||
extern rmt_dev_t RMT;
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
struct {
|
||||
uint32_t duration0 : 15;
|
||||
uint32_t level0 : 1;
|
||||
uint32_t duration1 : 15;
|
||||
uint32_t level1 : 1;
|
||||
};
|
||||
uint32_t val;
|
||||
};
|
||||
} rmt_item32_t;
|
||||
|
||||
//Allow access to RMT memory using RMTMEM.chan[0].data32[8]
|
||||
typedef volatile struct rmt_mem_s {
|
||||
struct {
|
||||
rmt_item32_t data32[48];
|
||||
} chan[4];
|
||||
} rmt_mem_t;
|
||||
|
||||
extern rmt_mem_t RMTMEM;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _SOC_RMT_STRUCT_H_ */
|
||||
|
Reference in New Issue
Block a user