Class ReceiverChannelSettings
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 using default settings.
public ReceiverChannelSettings(int pinNumber)
Parameters
pinNumberintThe GPIO Pin number to use with the channel.
Remarks
Default settings:
- IdleThreshold = 12000000 (12ms)
- FilterThreshold = 1200 (1.2us)
- ReceiveTimeout = 1 second
- EnableDemodulation = true
- CarrierWaveFrequency = 38_000
- CarrierWaveDutyPercentage = 33
- CarrierLevel = true
- BufferSize = 100
Properties
BufferSize
Gets or sets the RMT Receive Buffer size.
public int BufferSize { get; set; }
Property Value
Remarks
Incoming RmtSymbols are saved in the buffer. Any RmtSymbols when full will be ignored. Receive of RmtSymbol completes after the IdleThreshold has lapsed.
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 float 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 0 or less, 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.
FilterThreshold
Gets or sets the minimum valid pulse duration for either high or low levels, specified in nanoseconds.
It will ignore pulses shorter than the specified value.
public uint FilterThreshold { get; set; }
Property Value
Remarks
Setting to a value like 100000 will cause the receiver channel to ignore any pulses that are shorter than 100 microseconds.
The maximum value depends on the hardware capabilities of the specific ESP32 target. For a clock of 80mhz, the maximum value is 3199. (3.199us). Exception given on starting receive operation.
Please refer to the ESP32 IDF docs for more information on feature availability for the various ESP32 targets, this value is called signal_range_min_ns in the docs.
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 nanoseconds.
So setting this property to a value of 200000 means the threshold is 200us.
Value cannot be set to 0 or greater than the maximum value supported by the specific ESP32 target. Please refer to the ESP32 IDF docs for more information on feature availability for the various ESP32 targets, this value is called signal_range_max_ns in the docs.
Typically the value can not be set higher then 32,767,000,000,000 / channel resolution. Exception given on starting receive operation.
For a resolution of 1Mhz, the maximum value is 32,767,000. (32.767ms)
Exceptions
ReceiveTimeout
Gets or sets the timeout threshold for the Receive() call. Defaults to 1 second.
public TimeSpan ReceiveTimeout { get; set; }