The interrupt signal on pin
TRX_PIN_IRQ can be configured regarding to the masking of interrupt causes (see
IRQ Mask Configuration) and to the signal polarity (see
IRQ Polarity Configuration). A more detailed description can also be found
section 4.7 (Interrupt Logic) of the AT86RF212 datasheet. The configuration of
TRX_PIN_DIG2 is described in section
RX Frame Time Stamping.
Use Cases:
The value of the register
RG_IRQ_MASK determines, which of the
interrupt causes generate interrupt requests at
TRX_PIN_IRQ. Additionally, the generation of interrupt events can be controlled with the subregister
SR_IRQ_MASK_MODE.
- Parameters:
-
| mskirqs | The mask value, which is written to RG_IRQ_MASK. An IRQ is signalled on TRX_PIN_IRQ, if the apropriate bit in this register is set to 1. |
| mskmode | IRQ mask mode.
{0} : Only IRQs are enabled by mskirqs will be shown in RG_IRQ_STATUS.
{1} : All IRQs will be shown in RG_IRQ_STATUS. |
- Note:
>> The registers RG_IRQ_MASK and SR_IRQ_MASK_MODE should not be changed in any of the [BUSY] states.
>> The register RG_IRQ_MASK and can set in P_ON as described in POWER_ON_RESET.
>> The pin TRX_PIN_IRQ can be alternatively used as Frame Buffer Empty Indicator. The functionality of the IRQ pin can be configured using SR_RX_BL_CTRL.
>> The current IRQ status can also be monitored with the SPI Command Mode.
It is assumed, that the radio transceiver is in the state
BUSY_RX and the registers have the following values:
RG_IRQ_MASK = TRX_IRQ_TRX_END,
SR_IRQ_MASK_MODE = 1. At the end of a received frame, the interrupt
TRX_IRQ_TRX_END is generated. If the address of the received frame matches the settings in the address registers (see section
Extended Configuration of RX_AACK mode), also the bit
TRX_IRQ_AMI will be set in the register
RG_IRQ_STATUS.
- Code example
The polarity of the pin
TRX_PIN_IRQ is configured with the sub register
SR_IRQ_POLARITY. Before doing so, the content of the
RG_IRQ_MASK has to be saved, in order to restore it after changing the polarity.
- Parameters:
-
| irqpol | Polarity of the IRQ
{0} : IRQ is active high
{1} : IRQ is active low |
- Code example
If an interrupt event in the radio transceiver occurs, the
TRX_PIN_IRQ is raised to active level. While processing this interrupt request, the MCU acknowledges the interrupt by reading the register
RG_IRQ_STATUS. The read operation also switches the signal on the
TRX_PIN_IRQ back to inactive level and clears the register
RG_IRQ_STATUS.
- Return values:
-
| cause | This return parameter contains a flag value, indicating the interrupt cause. |
- Note:
>> Depending on the actual interrupt latency time of the MCU, more than one flag bit can be set within one interrupt event.
>> During the transition from P_ON (not contained in [ACTIVE]) to TRX_OFF, the TRX_IRQ_AWAKE_END occurs, as described in POWER_ON_RESET.
- Code example
-