You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/09/12 09:44:51 UTC
[nuttx] 02/04: esp32/rmt: Improve comments in ESP32's RMT peripheral
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 103270be1d44e7984f4815ee9d32b0782d4f5c68
Author: Tomáš Pilný <to...@espressif.com>
AuthorDate: Fri Sep 1 10:31:36 2023 +0200
esp32/rmt: Improve comments in ESP32's RMT peripheral
---
arch/xtensa/src/esp32/esp32_rmt.c | 4 ++--
arch/xtensa/src/esp32/esp32_rmt.h | 28 ++++++++++++++--------------
boards/xtensa/esp32/common/src/esp32_rmt.c | 2 +-
3 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/arch/xtensa/src/esp32/esp32_rmt.c b/arch/xtensa/src/esp32/esp32_rmt.c
index d14f8d83c2..84af7f191f 100644
--- a/arch/xtensa/src/esp32/esp32_rmt.c
+++ b/arch/xtensa/src/esp32/esp32_rmt.c
@@ -191,7 +191,7 @@ static int rmt_setup(struct rmt_dev_s *dev)
*
* Description:
* Copies chunks of data from the buffer to the RMT device memory
- * This function can also be called on the first transmition data chunk
+ * This function can also be called on the first transmission data chunk
*
* Input Parameters:
* channel - Pointer to the channel to be reloaded
@@ -298,7 +298,7 @@ IRAM_ATTR static int rmt_interrupt(int irq, void *context, void *arg)
}
else if (regval & RMT_CHN_TX_END_INT_ST(ch_idx))
{
- /* end of transmition */
+ /* end of transmission */
modifyreg32(RMT_INT_ENA_REG,
RMT_CHN_TX_END_INT_ENA(ch_idx) |
diff --git a/arch/xtensa/src/esp32/esp32_rmt.h b/arch/xtensa/src/esp32/esp32_rmt.h
index a9391aa103..a762533957 100644
--- a/arch/xtensa/src/esp32/esp32_rmt.h
+++ b/arch/xtensa/src/esp32/esp32_rmt.h
@@ -42,19 +42,19 @@ struct rmt_dev_channel_s
{
/* Parameters for each RMT channel */
- int open_count;
- int ch_idx;
- int output_pin;
- int next_buffer;
- sem_t tx_sem;
-
- uint32_t *src;
- uint32_t src_offset;
- size_t words_to_send;
- uint32_t available_words;
- uint32_t start_address;
- uint32_t reload_thresh;
- void *parent_dev;
+ int open_count; /* Unused */
+ int ch_idx; /* RMT channel number (0-7) */
+ int output_pin; /* GPIO pin number attached to the RMT */
+ int next_buffer; /* Tracking buffer (0 or 1) used next reload */
+ sem_t tx_sem; /* Semaphore structure */
+
+ uint32_t *src; /* Data to be copied to the internal buffer */
+ uint32_t src_offset; /* Offset pointer to the src */
+ size_t words_to_send; /* Number of 32-bit words to be sent */
+ uint32_t available_words; /* Counter of available words in the src */
+ uint32_t start_address; /* Current RMT register buffer address */
+ uint32_t reload_thresh; /* Threshold for reloading the internal buffer */
+ void *parent_dev; /* Pointer to the parent RMT device structure */
};
struct rmt_dev_s
@@ -91,7 +91,7 @@ extern "C"
*
* Description:
* Copies chunks of data from the buffer to the RMT device memory
- * This function can also be called on the first transmition data chunk
+ * This function can also be called on the first transmission data chunk
*
* Input Parameters:
* channel - Pointer to the channel to be reloaded
diff --git a/boards/xtensa/esp32/common/src/esp32_rmt.c b/boards/xtensa/esp32/common/src/esp32_rmt.c
index 86bf860197..0339721eee 100644
--- a/boards/xtensa/esp32/common/src/esp32_rmt.c
+++ b/boards/xtensa/esp32/common/src/esp32_rmt.c
@@ -262,7 +262,7 @@ int board_rmt_initialize(int channel, int output_pin)
struct rmt_dev_channel_s *channel_data = &(rmt_dev->channels[channel]);
- /* Register the WS2812 driver at the specified location. */
+ /* Register the RMT driver at the specified location. */
snprintf(devpath, sizeof(devpath), "/dev/rmt%d", channel);