IR-RX
Introduction to IR configuration and debugging methods
Module Introduction
The main function of the infrared receiving module is to receive infrared signals.
Function Introduction
On the k1 platform, an external infrared receiver (demodulator) receives the demodulated electrical signal, which is decoded and reported as an event by the driver and the kernel IR framework.
Source Code Structure Introduction
The IR-RX controller driver code is under the drivers/media/rc directory:
drivers/media/rc
|--rc-ir-raw.c # Kernel ir framework interface code
|--ir-nec-decoder.c # Kernel ir signal decoding code
|--ir-spacemit.c # k1 ir driver
Key Features
Feature |
---|
Configurable noise threshold |
32Bytes RX FIFO size |
Configuration Introduction
Mainly includes driver enable configuration and dts configuration
CONFIG Configuration
CONFIG_IR_SPACEMIT=y
Symbol: IR_SPACEMIT [=y]
Device Drivers
-> Remote Controller support (RC_CORE [=y])
-> Remote Controller devices (RC_DEVICES [=y])
-> SPACEMIT IR remote Recriver control (IR_SPACEMIT [=y])
dts配置
pinctrl
可查看linux仓库的arch/riscv/boot/dts/spacemit/k1-x_pinctrl.dtsi,参考已配置好的pwm节点配置,如下:
pinctrl_ir_rx_1: ir_rx_1_grp {
pinctrl-single,pins = <
K1X_PADCONF(GPIO_79, MUX_MODE1, (EDGE_NONE | PULL_UP | PAD_3V_DS4)) /* ir_rx */
>;
};