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.
Data Types¶
RFM12_tx_fsk_polarity_t¶
-
type RFM12_tx_fsk_polarity_t¶
Enum. FSK data polarity selection for bit 8.
Constant
Value
Meaning
RFM12_TX_FSK_POLARITY_NORMAL0Logic 0 selects higher frequency; logic 1 selects lower frequency.
RFM12_TX_FSK_POLARITY_INVERTED1Logic 0 selects lower frequency; logic 1 selects higher frequency.
RFM12_tx_fsk_deviation_t¶
-
type RFM12_tx_fsk_deviation_t¶
Enum. FSK frequency deviation for bits 7:4, in 15 kHz steps from 15 through 240 kHz.
Constant
Value
Meaning
RFM12_TX_FSK_DEVIATION_15KHZ015 kHz.
RFM12_TX_FSK_DEVIATION_30KHZ130 kHz.
RFM12_TX_FSK_DEVIATION_45KHZ245 kHz.
RFM12_TX_FSK_DEVIATION_60KHZ360 kHz.
RFM12_TX_FSK_DEVIATION_75KHZ475 kHz.
RFM12_TX_FSK_DEVIATION_90KHZ590 kHz.
RFM12_TX_FSK_DEVIATION_105KHZ6105 kHz.
RFM12_TX_FSK_DEVIATION_120KHZ7120 kHz.
RFM12_TX_FSK_DEVIATION_135KHZ8135 kHz.
RFM12_TX_FSK_DEVIATION_150KHZ9150 kHz.
RFM12_TX_FSK_DEVIATION_165KHZ10165 kHz.
RFM12_TX_FSK_DEVIATION_180KHZ11180 kHz.
RFM12_TX_FSK_DEVIATION_195KHZ12195 kHz.
RFM12_TX_FSK_DEVIATION_210KHZ13210 kHz.
RFM12_TX_FSK_DEVIATION_225KHZ14225 kHz.
RFM12_TX_FSK_DEVIATION_240KHZ15240 kHz.
RFM12_tx_power_t¶
-
type RFM12_tx_power_t¶
Enum. Output power attenuation relative to maximum output for bits 2:0. Values describe relative attenuation in dB, not absolute output in dBm.
Constant
Value
Meaning
RFM12_TX_POWER_0DB00 dB.
RFM12_TX_POWER_MINUS_2_5DB1-2.5 dB.
RFM12_TX_POWER_MINUS_5DB2-5 dB.
RFM12_TX_POWER_MINUS_7_5DB3-7.5 dB.
RFM12_TX_POWER_MINUS_10DB4-10 dB.
RFM12_TX_POWER_MINUS_12_5DB5-12.5 dB.
RFM12_TX_POWER_MINUS_15DB6-15 dB.
RFM12_TX_POWER_MINUS_17_5DB7-17.5 dB.
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.