@@ -61,6 +61,7 @@ struct rmt_obj_s {
61
61
bool rmt_ch_is_looping ; // Is this RMT TX Channel in LOOPING MODE?
62
62
size_t * num_symbols_read ; // Pointer to the number of RMT symbol read by IDF RMT RX Done
63
63
uint32_t frequency_Hz ; // RMT Frequency
64
+ uint8_t rmt_EOT_Level ; // RMT End of Transmission Level - default is LOW
64
65
65
66
#if !CONFIG_DISABLE_HAL_LOCKS
66
67
SemaphoreHandle_t g_rmt_objlocks ; // Channel Semaphore Lock
@@ -185,6 +186,20 @@ static bool _rmtDetachBus(void *busptr)
185
186
Public method definitions
186
187
*/
187
188
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
+
188
203
bool rmtSetCarrier (int pin , bool carrier_en , bool carrier_level , uint32_t frequency_Hz , float duty_percent )
189
204
{
190
205
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
316
331
rmt_enable (bus -> rmt_channel_h );
317
332
bus -> rmt_ch_is_looping = false; // not looping anymore
318
333
}
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
+ }
319
338
if (loopCancel ) {
320
339
// just resets and releases the channel, maybe, already done above, then exits
321
340
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_
487
506
// store the RMT Freq to check Filter and Idle valid values in the RMT API
488
507
bus -> frequency_Hz = frequency_Hz ;
489
508
// 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.
491
510
// RMT stops reading if the input stays idle for longer than max_ns
492
511
bus -> signal_range_max_ns = (1000000000 / frequency_Hz ) * RMT_LL_MAX_IDLE_VALUE ; // maximum possible
493
512
// creates the event group to control read_done and write_done
0 commit comments