5. Receiver Control Command¶
Configures receiver bandwidth, low-noise amplifier (LNA) gain, received signal strength indicator (RSSI) threshold, valid data indicator (VDI) behavior, and the function of pin 16.
Register Fields¶
Bits |
Name |
Meaning |
API |
|---|---|---|---|
10 |
|
Pin 16 function |
|
9:8 |
|
VDI response mode |
|
7:5 |
|
Receiver baseband bandwidth |
|
4:3 |
|
LNA gain |
|
2:0 |
|
RSSI detector threshold |
The functions listed in the register field table above directly configure
fields in the Receiver Control 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_pin16_function()¶
-
RFM12_result_t rfm12_set_pin16_function(RFM12_t *dev, RFM12_pin16_function_t pin16)¶
Stage the function of pin 16.
Select
RFM12_PIN16_INTERRUPT_INfor the external interrupt input orRFM12_PIN16_VDI_OUTfor the valid data indicator output.- Parameters:
dev – RFM12 radio instance.
pin16 – Pin 16 function to select.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_set_vdi_mode()¶
-
RFM12_result_t rfm12_set_vdi_mode(RFM12_t *dev, RFM12_vdi_mode_t mode)¶
Stage the valid data indicator response mode.
Select
RFM12_VDI_FAST,RFM12_VDI_MEDIUM,RFM12_VDI_SLOW, orRFM12_VDI_ALWAYS. The always-on mode holds VDI high independently of the receiving parameters.- Parameters:
dev – RFM12 radio instance.
mode – VDI response mode to select.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_set_rx_bandwidth()¶
-
RFM12_result_t rfm12_set_rx_bandwidth(RFM12_t *dev, RFM12_rx_bandwidth_t bandwidth)¶
Stage the receiver baseband bandwidth.
Select
RFM12_RX_BANDWIDTH_400_KHZ,RFM12_RX_BANDWIDTH_340_KHZ,RFM12_RX_BANDWIDTH_270_KHZ,RFM12_RX_BANDWIDTH_200_KHZ,RFM12_RX_BANDWIDTH_134_KHZ, orRFM12_RX_BANDWIDTH_67_KHZ.- Parameters:
dev – RFM12 radio instance.
bandwidth – Receiver bandwidth selection.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_set_lna_gain()¶
-
RFM12_result_t rfm12_set_lna_gain(RFM12_t *dev, RFM12_lna_gain_t gain)¶
Stage the low-noise amplifier gain relative to its maximum gain.
Select
RFM12_LNA_GAIN_0_DB,RFM12_LNA_GAIN_M6_DB,RFM12_LNA_GAIN_M14_DB, orRFM12_LNA_GAIN_M20_DBfor 0, -6, -14, or -20 dB respectively. The LNA gain also affects the effective RSSI threshold configured byrfm12_set_rssi_threshold().- Parameters:
dev – RFM12 radio instance.
gain – LNA gain selection.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_set_rssi_threshold()¶
-
RFM12_result_t rfm12_set_rssi_threshold(RFM12_t *dev, RFM12_rssi_threshold_t threshold)¶
Stage the RSSI detector threshold setting.
Select
RFM12_RSSI_THRESHOLD_M103_DBM,RFM12_RSSI_THRESHOLD_M97_DBM,RFM12_RSSI_THRESHOLD_M91_DBM,RFM12_RSSI_THRESHOLD_M85_DBM,RFM12_RSSI_THRESHOLD_M79_DBM, orRFM12_RSSI_THRESHOLD_M73_DBM.The effective RSSI threshold depends on the LNA gain. The datasheet expresses this relationship as
RSSI_th = RSSI_setth + G_LNA.- Parameters:
dev – RFM12 radio instance.
threshold – RSSI detector threshold selection.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_reset_receiver_control()¶
-
RFM12_result_t rfm12_reset_receiver_control(RFM12_t *dev)¶
Reset the staged Receiver Control 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.