4.9 HAL_EnableRFCtrl
Definition: This function is called by the stack to inform HAL which RF path signal is used for TX/RX and, based on the RF front-end design, which respective GPIO pin will be controlled.
Usage of the RFCTRL1 variable:
The RFCtrl1 parameter is used to select the RF output frequency range (or band). The following values are applicable for the parameter.
- RFO_LF is used when the RF output frequency range is lesser than 525 MHz (band 2/3).
- RFO_HF is used when the RF output frequency range is greater than 779 MHz (band 1).
- PA_BOOST is used regardless of the RF output frequency. But, when the TX power is greater than +15 dBm.
- When the TX power is between -4 dBm to +15 dBm, either RFO_LF or RFO_HF should be used. The following table describes the frequency range and TX power of RFCtrl1.
ENUM Value |
Frequency Region |
TX Power |
---|---|---|
RFO_LF | < 525 MHz | -4 to +15 dBm |
RFO_HF | From 779 MHz | -4 to +15 dBm |
PA_BOOST | All frequencies | +2 to +17 dBm |
- All 3 ENUM values represent a pin out from the SX1276 transceiver.
- The RFCtrl1 value indicates which of these 3 pin-outs the signal will be received at. For example, if the frequency is 868MHz and the output power is +10dBm, then the signal will come from the RFO_HF pin.
- Refer to the SX1276 data sheet, RF power amplifiers section for more details on the transceiver operation with different frequencies and output power.
- Refer to the SAM R34 data sheet for the pin mapping details for these 3 pins.
Usage of RFCTRL2 variable:
The RFCtrl2 parameter is used to select either a transmit or receive operation by the transceiver.
- For a receive operation, front-end RF circuitry routes the received signal through either the RFI_LF or RFI_HF pin.
- Based on the frequency range, either RFI_LF or RFI_HF is selected.
- The frequency range can be determined from the RFCtrl1 parameter to select between RFI_LF and RFI_HF.
RFCtrl1 |
RFCtrl2 |
Operation |
---|---|---|
RFO_LF | TX |
|
RFO_HF | TX |
|
PA_BOOST | Do not care |
|
RFO_LF | RX |
|
RFO_HF | RX |
|
For the SAM R34 Xplained Pro board or WLR089 Xplained Pro board:
- Only RFO_HF and PA_BOOST values of RFCtrl1 are valid and used to set the BAND_SELECT pin. Refer to the SAM R34 Xplained Pro board or WLR089 Xplained Pro board for more details on the front-end RF circuit design.
- RFO_LF is not used because neither the SAM R34 Xplained Pro nor WLR089 Xplained Pro supports the frequency operation in < 525 MHz.
- The RFCtrl2 input is not used. The SAM R34 Xplained Pro or WLR089 Xplained Pro front-end RF circuit does not need to control based on the TX and RX operation.
Syntax
void HAL_EnableRFCtrl(RFCtrl1_t RFCtrl1, RFCtrl2_t RFCtrl2)
Parameters Name |
Parameter Type |
Description |
---|---|---|
RFCtrl1 | ENUM | RF Control 1 indicates the FREQUENCY band (Higher UHF or Lower UHF) or PA Boost
enabled.
|
RFCtrl2 | ENUM | RF Control 2 indicates the Transmit or Receive path.
|
Return Types and Values
<void>
API Type – Synchronous