Table of Contents

Class ReceiverChannel

Namespace
nanoFramework.Hardware.Esp32.Rmt
Assembly
nanoFramework.Hardware.Esp32.Rmt.dll

A class that can be used to Receive RMT items 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

settings ReceiverChannelSettings

The channel settings to use.

Exceptions

ArgumentNullException

settings cannot be null.

Properties

EnableFilter

Gets or sets a value indicating if the the filter is enabled. If enabled, the receiver will ignore pulses with widths (in clock ticks) shorter than specified in FilterThreshold.

public bool EnableFilter { get; set; }

Property Value

bool

FilterThreshold

Gets or sets the threshold, in clock ticks, of the filter. when EnableFilter is set to true It will ignore pulses shorter than the specified threshold. The acceptable range of values is 0 to 255 clock ticks.

public byte FilterThreshold { get; set; }

Property Value

byte

Remarks

Example: If the ClockDivider is set to 80 then the clock (80Mhz) will tick at a rate of 1Mhz (80Mhz / 80 = 1Mhz) making each clock tick equal to 1 microsecond. Therefore, setting FilterThreshold to a value like 100 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 RmtCommands are copied into the ring buffer and availble to your code. This is measured by number of clock ticks (after applying the clock divider).

public ushort IdleThreshold { get; set; }

Property Value

ushort

Remarks

The receive process finishes(goes idle) when no edges have been detected for the specified IdleThreshold clock cycles. Supported value range between 1 and 65535 (0xFFFF). The RMT Module's clock ticks at a rate of 80Mhz. If the ClockDivider is set to 80 for example, then a clock tick is equal to 1 microsecond (80Mhz / 80 = 1Mhz = 1us). So setting this property to a value of 200 means the threshold is 200us.

Mode

Gets the current ChannelMode for this instance.

public override ChannelMode Mode { get; }

Property Value

ChannelMode

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

disposing bool

Finalize()

protected override void Finalize()

GetAllItems()

Get all RmtCommand items available.

public RmtCommand[] GetAllItems()

Returns

RmtCommand[]

Return array of RMTCommand.
If no signal received in time-out period then empty array will be returned.

Remarks

If no signal received in time-out period then empty array will be returned.

Start(bool)

Start receiving data on channel.

public void Start(bool clearBuffer)

Parameters

clearBuffer bool

Clears buffer before starting.

Stop()

Stop receiving data on channel.

public void Stop()