From 5cd3bd5c4be0d1a63ed45c2dc0499b98daa1a89f Mon Sep 17 00:00:00 2001 From: Jeroen Domburg Date: Sat, 8 Oct 2016 13:15:06 +0800 Subject: [PATCH] Add data memory for RMT peripheral --- components/esp32/include/soc/rmt_struct.h | 18 ++++++++++++++++++ components/esp32/ld/esp32.peripherals.ld | 1 + 2 files changed, 19 insertions(+) diff --git a/components/esp32/include/soc/rmt_struct.h b/components/esp32/include/soc/rmt_struct.h index 15beb8c6d6..fb4c21055e 100644 --- a/components/esp32/include/soc/rmt_struct.h +++ b/components/esp32/include/soc/rmt_struct.h @@ -225,4 +225,22 @@ typedef volatile struct { uint32_t date; /*This is the version register.*/ } rmt_dev_t; extern rmt_dev_t RMT; + +//Allow access to RMT memory using RMTMEM.chan[0].data[8] +typedef volatile struct { + struct { + union { + struct { + uint32_t level1: 1; + uint32_t duration1: 15; + uint32_t level0: 1; + uint32_t duration0: 15; + + }; + uint32_t val; + } data[64]; + } chan[8]; +} rmt_mem_t; +extern rmt_mem_t RMTMEM; + #endif /* _SOC_RMT_STRUCT_H_ */ diff --git a/components/esp32/ld/esp32.peripherals.ld b/components/esp32/ld/esp32.peripherals.ld index aaadedce49..95aaadcbcc 100644 --- a/components/esp32/ld/esp32.peripherals.ld +++ b/components/esp32/ld/esp32.peripherals.ld @@ -9,6 +9,7 @@ PROVIDE ( UART1 = 0x3ff50000 ); PROVIDE ( I2C0 = 0x3ff53000 ); PROVIDE ( UHCI0 = 0x3ff54000 ); PROVIDE ( RMT = 0x3ff56000 ); +PROVIDE ( RMTMEM = 0x3ff56800 ); PROVIDE ( PCNT = 0x3ff57000 ); PROVIDE ( LEDC = 0x3ff59000 ); PROVIDE ( TIMERG0 = 0x3ff5F000 );