Class ReceiverChannel
A class used to Receive RMT symbols on ESP32.
public class ReceiverChannel : RmtChannel, IDisposable
- Inheritance
-
ReceiverChannel
- Implements
- Inherited Members
- Extension Methods
Remarks
For detailed explanation of ESP32 RMT Module, please check the Espressif official documentation here: https://docs.espressif.com/projects/esp-idf/en/v4.4.3/esp32/api-reference/peripherals/rmt.html
Constructors
ReceiverChannel(ReceiverChannelSettings)
Initializes a new instance of the ReceiverChannel class.
public ReceiverChannel(ReceiverChannelSettings settings)
Parameters
settingsReceiverChannelSettingsThe channel settings to use.
Exceptions
- ArgumentNullException
settingscannot be null.
Properties
FilterThreshold
Gets or sets the threshold, in nanoseconds of the filter. It will ignore pulses shorter than the specified threshold.
public uint FilterThreshold { get; set; }
Property Value
Remarks
Setting FilterThreshold to a value like 100000 will cause the receiver channel to ignore any pulses that are shorter than 100 microseconds.
IdleThreshold
Gets or sets the idle threshold after which the receiver will go into idle mode and the receive will complete.
public uint IdleThreshold { get; set; }
Property Value
Remarks
The receive process finishes(goes idle) when no edges have been detected for the specified IdleThreshold nanoseconds. So setting this property to a value of 200000 means the threshold is 200us.
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
protected virtual void Dispose(bool disposing)
Parameters
disposingbool
Finalize()
protected override void Finalize()
Receive()
Performs a blocking receive operation. This call waits until symbols are received or a timeout occurs. Throws InvalidOperationException if StartReceive is active.
public RmtSymbols Receive()
Returns
- RmtSymbols
A RmtSymbols instance containing received symbols, or
null.
Start()
Starts continuous non-blocking receive mode. Symbols can be retrieved using TryGetReceivedSymbols(). Throws InvalidOperationException if blocking receive is active.
public void Start()
Stop()
Stops continuous non-blocking receive mode. Throws InvalidOperationException if continuous mode is not active.
public void Stop()
TryGetReceivedSymbols()
Attempts to retrieve received RMT symbols without blocking.
Returns null if no symbols are available.
Throws InvalidOperationException if Start is not active or Receive is active.
public RmtSymbols TryGetReceivedSymbols()
Returns
- RmtSymbols
A RmtSymbols instance containing received symbols, or
null.