Class ReceiverChannelSettings
- Namespace
- nanoFramework.Hardware.Esp32.Rmt
- Assembly
- nanoFramework.Hardware.Esp32.Rmt.dll
ReceiverChannel's settings class.
public sealed class ReceiverChannelSettings : RmtChannelSettings
- Inheritance
-
ReceiverChannelSettings
- Inherited Members
- Extension Methods
Remarks
All changes made to properties of this class are ignored after the ReceiverChannel is initialized. The equivalent properties in the channel instance can be used to make on-the-fly changes to the configurations.
Constructors
ReceiverChannelSettings(int)
Initializes a new instance of the ReceiverChannelSettings class.
public ReceiverChannelSettings(int pinNumber)
Parameters
pinNumber
intThe GPIO Pin number to use with the channel.
Remarks
This constructor will use the next available RMT channel starting from channel 0 and up to channel 7.
ReceiverChannelSettings(int, int)
Initializes a new instance of the ReceiverChannelSettings class.
public ReceiverChannelSettings(int channel, int pinNumber)
Parameters
channel
intThe channel number to use. Valid value range is 0 to 7 (inclusive).
pinNumber
intThe GPIO Pin number to use with the channel.
Exceptions
- ArgumentOutOfRangeException
channel
must be between 0 and 7.
Properties
CarrierLevel
Gets or sets a value indicating at which level of RMT output is the carrier wave applied. Only applicable when EnableDemodulation is set to true. true = HIGH.
public bool CarrierLevel { get; set; }
Property Value
Remarks
This configuration is not available on the base ESP32 target and will be ignored. Please refer to the ESP32 IDF docs for more information on feature availability for the various ESP32 targets.
CarrierWaveDutyPercentage
Gets or sets the carrier wave duty cycle percentage. Only applicable when EnableDemodulation is set to true.
public byte CarrierWaveDutyPercentage { get; set; }
Property Value
Remarks
This configuration is not available on the base ESP32 target and will be ignored. Please refer to the ESP32 IDF docs for more information on feature availability for the various ESP32 targets.
Exceptions
- ArgumentOutOfRangeException
Value cannot be less that 1 or greater than 100.
CarrierWaveFrequency
Gets or sets the carrier wave frequency. Only applicable when EnableDemodulation is set to true.
public int CarrierWaveFrequency { get; set; }
Property Value
Remarks
This configuration is not available on the base ESP32 target and will be ignored. Please refer to the ESP32 IDF docs for more information on feature availability for the various ESP32 targets.
EnableDemodulation
Enables or disables demodulating the received signal.
public bool EnableDemodulation { get; set; }
Property Value
Remarks
This configuration is not available on the base ESP32 target and will be ignored. Please refer to the ESP32 IDF docs for more information on feature availability for the various ESP32 targets.
EnableFilter
Gets or sets the filter state. If enabled, the receiver will ignore pulses with widths less than specified in FilterThreshold.
public bool EnableFilter { get; set; }
Property Value
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
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
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.
Exceptions
- ArgumentOutOfRangeException
Value cannot be set to 0 or less
ReceiveTimeout
Gets or sets the timeout threshold for the GetAllItems() call. Defaults to 1 second.
public TimeSpan ReceiveTimeout { get; set; }