11. TX Configuration Control Command¶
Configures FSK modulation polarity, frequency deviation, and transmitter output power.
Register Fields¶
Bits |
Name |
Meaning |
API |
|---|---|---|---|
8 |
|
FSK modulation polarity |
|
7:4 |
|
FSK frequency deviation |
|
3 |
Fixed |
Must be |
None |
2:0 |
|
Output-power attenuation |
The setters listed in the register field table above directly configure
fields in the TX Configuration 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_tx_fsk_polarity()¶
-
RFM12_result_t rfm12_set_tx_fsk_polarity(RFM12_t *dev, RFM12_tx_fsk_polarity_t polarity)¶
Stage the FSK modulation polarity.
Select
RFM12_TX_FSK_POLARITY_NORMALformp = 0: logic 0 produces the higher frequency and logic 1 produces the lower frequency. SelectRFM12_TX_FSK_POLARITY_INVERTEDformp = 1: logic 0 produces the lower frequency and logic 1 produces the higher frequency.The datasheet defines the output frequency as
f_out = f0 + (-1)^SIGN * (M + 1) * 15 kHz, whereSIGN = mp XOR FSK,FSKis the transmitted data bit,Mis the encoded deviation field, andf0is the carrier center frequency.- Parameters:
dev – RFM12 radio instance.
polarity – FSK modulation polarity selection.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_set_tx_fsk_deviation()¶
-
RFM12_result_t rfm12_set_tx_fsk_deviation(RFM12_t *dev, RFM12_tx_fsk_deviation_t deviation)¶
Stage the FSK frequency deviation from the carrier center frequency.
Select a predefined deviation from
RFM12_TX_FSK_DEVIATION_15KHZthroughRFM12_TX_FSK_DEVIATION_240KHZin 15 kHz increments. Pass the enum constant rather than a numeric frequency.The deviation magnitude is
(M + 1) * 15 kHz, whereMis the four-bitm3:m0field. The two FSK frequencies lie this distance above and below the center frequency, so their separation is twice the selected deviation.- Parameters:
dev – RFM12 radio instance.
deviation – Predefined FSK frequency-deviation selection.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_set_tx_power()¶
-
RFM12_result_t rfm12_set_tx_power(RFM12_t *dev, RFM12_tx_power_t power)¶
Stage the transmitter output-power selection.
Selection
p2:p0Relative output power
RFM12_TX_POWER_0DB0000 dB (maximum output)
RFM12_TX_POWER_MINUS_2_5DB001-2.5 dB
RFM12_TX_POWER_MINUS_5DB010-5 dB
RFM12_TX_POWER_MINUS_7_5DB011-7.5 dB
RFM12_TX_POWER_MINUS_10DB100-10 dB
RFM12_TX_POWER_MINUS_12_5DB101-12.5 dB
RFM12_TX_POWER_MINUS_15DB110-15 dB
RFM12_TX_POWER_MINUS_17_5DB111-17.5 dB
Select attenuation from maximum output in 2.5 dB increments, from 0 dB through 17.5 dB, using the enum constants above.
These values are relative to maximum available output power, not absolute power in dBm. Maximum available power depends on antenna impedance.
- Parameters:
dev – RFM12 radio instance.
power – Transmitter output-power selection.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_reset_tx_configuration()¶
-
RFM12_result_t rfm12_reset_tx_configuration(RFM12_t *dev)¶
Reset the staged TX Configuration 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.