6. Data Filter Command¶
Configures clock recovery, data filtering, and the Data Quality Detector (DQD) threshold.
Register Fields¶
Bits |
Name |
Meaning |
API |
|---|---|---|---|
7 |
|
Automatic clock-recovery mode |
|
6 |
|
Manual clock-recovery speed |
|
5 |
Fixed |
Must be |
None |
4 |
|
Filter type |
|
3 |
Fixed |
Must be |
None |
2:0 |
|
Data Quality Detector threshold |
The setters listed in the register field table above directly configure
fields in the Data Filter Command. The setters and reset function update
staged configuration without communicating with the radio. Use
rfm12_apply_to_radio() to write the staged settings.
Command Functions¶
rfm12_set_clock_recovery_mode()¶
-
RFM12_result_t rfm12_set_clock_recovery_mode(RFM12_t *dev, RFM12_clock_recovery_mode_t mode)¶
Stage the clock-recovery mode.
Select
RFM12_CLOCK_RECOVERY_AUTOto start clock recovery in fast mode and switch to slow mode after locking. In automatic mode, the manual speed setting has no effect.Select
RFM12_CLOCK_RECOVERY_MANUALto use the speed selected byrfm12_set_clock_recovery_speed().- Parameters:
dev – RFM12 radio instance.
mode – Automatic or manual clock-recovery mode.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_set_clock_recovery_speed()¶
-
RFM12_result_t rfm12_set_clock_recovery_speed(RFM12_t *dev, RFM12_clock_recovery_speed_t speed)¶
Stage the manual clock-recovery speed.
Select
RFM12_CLOCK_RECOVERY_FASTfor fast attack and release, orRFM12_CLOCK_RECOVERY_SLOWfor slow attack and release. This setting takes effect only when clock recovery is in manual mode.The datasheet recommends a 4- to 8-bit alternating preamble for fast mode and a 12- to 16-bit preamble for slow mode. Slow mode requires more accurate bit timing.
- Parameters:
dev – RFM12 radio instance.
speed – Manual clock-recovery speed selection.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_set_filter_type()¶
-
RFM12_result_t rfm12_set_filter_type(RFM12_t *dev, RFM12_filter_type_t filter_type)¶
Stage the data-filter type.
Select
RFM12_FILTER_DIGITALfor the digital filter, whose time constant is automatically adjusted to the data rate configured byrfm12_set_data_rate().Select
RFM12_FILTER_ANALOG_RCfor the analog RC filter. This mode requires an external capacitor between pin 7 and VSS to set the filter cutoff frequency. The internal clock-recovery circuit and FIFO cannot be used with the analog RC filter.- Parameters:
dev – RFM12 radio instance.
filter_type – Digital or analog RC filter selection.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_set_dqd_threshold()¶
-
RFM12_result_t rfm12_set_dqd_threshold(RFM12_t *dev, RFM12_dqd_threshold_t threshold)¶
Stage the Data Quality Detector threshold.
The hardware supports thresholds 0 through 7, selected using
RFM12_DQD_THRESHOLD_0throughRFM12_DQD_THRESHOLD_7. The datasheet recommends thresholds 5 through 7; lower thresholds can cause noise to be treated as a valid FSK signal.- Parameters:
dev – RFM12 radio instance.
threshold – Data Quality Detector threshold selection.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_reset_data_filter()¶
-
RFM12_result_t rfm12_reset_data_filter(RFM12_t *dev)¶
Reset the staged Data Filter Command values to their defaults.
This function does not communicate with the radio. The changed settings are written to the radio by
rfm12_apply_to_radio().- Parameters:
dev – RFM12 radio instance.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.