7. FIFO and Reset Mode Command¶
Configures FIFO filling, the FIFO interrupt level, synchronization-pattern length, and reset sensitivity.
Register Fields¶
Bits |
Name |
Meaning |
API |
|---|---|---|---|
7:4 |
|
FIFO interrupt level |
|
3 |
|
Synchronization-pattern length |
|
2 |
|
FIFO fill-start condition |
|
1 |
|
FIFO fill enable |
|
0 |
|
Reset-mode sensitivity |
The functions listed in the register field table above directly configure
fields in the FIFO and Reset Mode Command. The setters and reset function
update staged configuration without communicating with the radio. Use
rfm12_apply_to_radio() to write the staged settings.
The Helper Functions section describes the operation for restarting synchronization-pattern recognition. Unlike the staged setters, this helper communicates with the radio immediately.
Command Functions¶
rfm12_set_fifo_interrupt_level()¶
-
RFM12_result_t rfm12_set_fifo_interrupt_level(RFM12_t *dev, RFM12_fifo_interrupt_level_t level)¶
Stage the FIFO interrupt level.
The FIFO generates an interrupt when the number of received data bits reaches the selected level. The setter accepts values from 1 through 15 bits.
- Parameters:
dev – RFM12 radio instance.
level – FIFO interrupt threshold in bits, from 1 through 15.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_set_sync_pattern_length()¶
-
RFM12_result_t rfm12_set_sync_pattern_length(RFM12_t *dev, RFM12_sync_pattern_length_t length)¶
Stage the synchronization-pattern length.
Select
RFM12_SYNC_PATTERN_2BYTEfor the fixed byte0x2Dfollowed by the programmable synchronization byte, orRFM12_SYNC_PATTERN_1BYTEfor the programmable byte alone. The programmable byte is configured by the Sync Pattern Command.- Parameters:
dev – RFM12 radio instance.
length – One-byte or two-byte synchronization-pattern selection.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_set_fifo_fill_start()¶
-
RFM12_result_t rfm12_set_fifo_fill_start(RFM12_t *dev, RFM12_fifo_fill_start_t mode)¶
Stage the condition that starts FIFO filling.
Select
RFM12_FIFO_FILL_AFTER_SYNCto start filling after recognizing the synchronization pattern, orRFM12_FIFO_FILL_ALWAYSto fill without waiting for synchronization. FIFO filling must also be enabled withrfm12_set_rx_fifo_fill_enable().- Parameters:
dev – RFM12 radio instance.
mode – FIFO fill-start condition.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_set_rx_fifo_fill_enable()¶
-
RFM12_result_t rfm12_set_rx_fifo_fill_enable(RFM12_t *dev, RFM12_enable_t enable)¶
Stage the receiver FIFO fill-enable setting.
When applied, disabling this setting stops FIFO filling. Enabling it permits filling according to the configured fill-start condition.
- Parameters:
dev – RFM12 radio instance.
enable – Enable or disable receiver FIFO filling.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_set_reset_mode()¶
-
RFM12_result_t rfm12_set_reset_mode(RFM12_t *dev, RFM12_reset_mode_t mode)¶
Stage the hardware reset sensitivity.
Select
RFM12_RESET_MODE_SENSITIVEfor the highly sensitive reset mode, orRFM12_RESET_MODE_NON_SENSITIVEto disable that mode. This setting controls the radio’s response to supply-voltage drops and glitches; it does not issue a reset.- Parameters:
dev – RFM12 radio instance.
mode – Reset sensitivity selection.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_reset_fifo_reset_mode()¶
-
RFM12_result_t rfm12_reset_fifo_reset_mode(RFM12_t *dev)¶
Reset the staged FIFO and Reset Mode 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.
Helper Functions¶
The synchronization restart helper clears and then sets the FIFO fill-enable bit to restart synchronization-pattern recognition. It performs two immediate SPI transfers of the complete FIFO and Reset Mode Command.
Any pending FIFO and Reset Mode Command settings are included in these transfers. The staged FIFO configuration stored in the driver is unchanged.
rfm12_restart_sync_recognition()¶
-
RFM12_result_t rfm12_restart_sync_recognition(RFM12_t *dev)¶
Restart receiver synchronization-pattern recognition immediately.
The staged FIFO fill-enable setting must already be enabled. The helper writes the command with
ffcleared, then writes it again withffset. This also applies any pending settings belonging to this command without modifying the staged FIFO configuration.- Parameters:
dev – RFM12 radio instance.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.