| aIR_ConfigRX | Index |
Definition:
Parameters:
| protocol | - | The type of IR protocol to look for. |
| reply | - | The defines what devices are informed of a IR data reception. |
Return Value:
Description:
This routine configures the digital pin that is physically connected to the controller for IR data reception. DIO pin number 4. Polling is enabled and high pulse widths are measured. Timer number 4 is utilized to measure the pulse durations.
The IR module can operate in different protocol modes.
| AIR_PROTOCOL_NEC | 0 | Set to make IR operate with the NEC protocol. |
| AIR_PROTOCOL_RC5 | 1 | Set to make IR operate with the RC5 protocol. |
Additionally, bit masks can specific different actions to perform once data is received. The following bits specifiy what happens with the data.
| AIR_REPLY_TEA | 0 | IR value is quietly returned to a TEA process. |
| AIR_REPLY_REFLEX | 64 | IR value is sent to a reflex. |
| AIR_REPLY_HOST | 64 | IR value is sent to a host. |
| Note: | This routine only works with BrainStem GP 2.0 moduless. |
Example:
#include <aIR.tea>
aIR_ConfigRX(AIR_PROTOCOL_NEC,AIR_REPLY_TEA);
This would enable IR detection in the form of the NEC IR protocol. IR values that are detected can be used by executing TEA programs.
#include <aIR.tea>
aIR_ConfigRX(AIR_PROTOCOL_RC5,AIR_REPLY_TEA | AIR_REPLY_HOST);
This would enable IR detection in the form of the RC5 IR protocol. Values are also sent back to a host.
Related: