Day28 - SPI IRQ Integration¶
Objective¶
- Add IRQ support to SPI sensor
- Integrate IRQ into core layer
- Validate hybrid update model
1. SPI Driver Update¶
SPI probe passes IRQ into core:
2. Device Tree (SPI)¶
Example overlay:
mysensor@0 {
compatible = "myvendor,mysensor-spi";
reg = <0>;
spi-max-frequency = <100000>;
interrupt-parent = <&rp1_gpio>;
interrupts = <23 2>;
pinctrl-names = "default";
pinctrl-0 = <&mysensor_spi_irq_pins>;
};
3. Core Layer IRQ Handling¶
Core receives IRQ and registers handler:
- use
devm_request_threaded_irq() - trigger refresh inside IRQ thread
4. Debug Status Implementation¶
Custom sysfs node:
Displays:
- mode
- transport
- counters
- timestamps
5. Build & Deploy¶
Build¶
Copy¶
Install¶
6. Verification¶
Check IRQ:
Check driver:
Check hwmon: