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

f3:f0

FIFO interrupt level

rfm12_set_fifo_interrupt_level()

3

sp

Synchronization-pattern length

rfm12_set_sync_pattern_length()

2

al

FIFO fill-start condition

rfm12_set_fifo_fill_start()

1

ff

FIFO fill enable

rfm12_set_rx_fifo_fill_enable()

0

dr

Reset-mode sensitivity

rfm12_set_reset_mode()

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_OK on success, or an appropriate RFM12_result_t error.

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_2BYTE for the fixed byte 0x2D followed by the programmable synchronization byte, or RFM12_SYNC_PATTERN_1BYTE for 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_OK on success, or an appropriate RFM12_result_t error.

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_SYNC to start filling after recognizing the synchronization pattern, or RFM12_FIFO_FILL_ALWAYS to fill without waiting for synchronization. FIFO filling must also be enabled with rfm12_set_rx_fifo_fill_enable().

Parameters:
  • dev – RFM12 radio instance.

  • mode – FIFO fill-start condition.

Returns:

RFM12_OK on success, or an appropriate RFM12_result_t error.

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_OK on success, or an appropriate RFM12_result_t error.

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_SENSITIVE for the highly sensitive reset mode, or RFM12_RESET_MODE_NON_SENSITIVE to 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_OK on success, or an appropriate RFM12_result_t error.

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_OK on success, or an appropriate RFM12_result_t error.

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 ff cleared, then writes it again with ff set. This also applies any pending settings belonging to this command without modifying the staged FIFO configuration.

Parameters:
  • dev – RFM12 radio instance.

Returns:

RFM12_OK on success, or an appropriate RFM12_result_t error.