@@ -61,6 +61,7 @@ struct rmt_obj_s {
6161 bool rmt_ch_is_looping ; // Is this RMT TX Channel in LOOPING MODE?
6262 size_t * num_symbols_read ; // Pointer to the number of RMT symbol read by IDF RMT RX Done
6363 uint32_t frequency_Hz ; // RMT Frequency
64+ uint8_t rmt_EOT_Level ; // RMT End of Transmission Level - default is LOW
6465
6566#if !CONFIG_DISABLE_HAL_LOCKS
6667 SemaphoreHandle_t g_rmt_objlocks ; // Channel Semaphore Lock
@@ -185,6 +186,20 @@ static bool _rmtDetachBus(void *busptr)
185186 Public method definitions
186187*/
187188
189+ bool rmtSetEOT (int pin , uint8_t EOT_Level )
190+ {
191+ rmt_bus_handle_t bus = _rmtGetBus (pin , __FUNCTION__ );
192+ if (bus == NULL ) {
193+ return false;
194+ }
195+ if (!_rmtCheckDirection (pin , RMT_TX_MODE , __FUNCTION__ )) {
196+ return false;
197+ }
198+
199+ bus -> rmt_EOT_Level = EOT_Level > 0 ? 1 : 0 ;
200+ return true;
201+ }
202+
188203bool rmtSetCarrier (int pin , bool carrier_en , bool carrier_level , uint32_t frequency_Hz , float duty_percent )
189204{
190205 rmt_bus_handle_t bus = _rmtGetBus (pin , __FUNCTION__ );
@@ -316,6 +331,10 @@ static bool _rmtWrite(int pin, rmt_data_t* data, size_t num_rmt_symbols, bool bl
316331 rmt_enable (bus -> rmt_channel_h );
317332 bus -> rmt_ch_is_looping = false; // not looping anymore
318333 }
334+ // sets the End of Transmission level to HIGH if the user has requested so
335+ if (bus -> rmt_EOT_Level ) {
336+ transmit_cfg .flags .eot_level = 1 ; // EOT is HIGH
337+ }
319338 if (loopCancel ) {
320339 // just resets and releases the channel, maybe, already done above, then exits
321340 bus -> rmt_ch_is_looping = false;
@@ -487,7 +506,7 @@ bool rmtInit(int pin, rmt_ch_dir_t channel_direction, rmt_reserve_memsize_t mem_
487506 // store the RMT Freq to check Filter and Idle valid values in the RMT API
488507 bus -> frequency_Hz = frequency_Hz ;
489508 // pulses with width smaller than min_ns will be ignored (as a glitch)
490- bus -> signal_range_min_ns = 0 ; // disabled
509+ // bus->signal_range_min_ns = 0; // disabled --> not necessary CALLOC set all to ZERO.
491510 // RMT stops reading if the input stays idle for longer than max_ns
492511 bus -> signal_range_max_ns = (1000000000 / frequency_Hz ) * RMT_LL_MAX_IDLE_VALUE ; // maximum possible
493512 // creates the event group to control read_done and write_done
0 commit comments