Commit Graph

21 Commits

Author SHA1 Message Date
Bohdan Buinich c0442cc0e6 [RPI] Refactor SPI and GPIO handling for XVF3510 initialization
This commit significantly overhauls the script for setting the XVF3510 board to boot from SPI slave mode and for loading a binary file. The refactor not only aims at improving code readability, maintainability, and robustness but also addresses compatibility issues with the latest Raspberry Pi models, specifically the Raspberry Pi 5, which does not support the RPi.GPIO library.

Changes made:
- Switched from `smbus` to `smbus2` for I2C communication, offering a more modern and robust interface.
- Replaced `RPi.GPIO` and `spidev` with `digitalio` and `busio` from the `adafruit_blinka` library, enhancing cross-platform compatibility and providing a more Pythonic API for GPIO and SPI operations.
- Introduced type annotations for function signatures, improving code readability and type safety.
- Added exception handling around I2C operations and file reading, increasing the script's robustness by gracefully handling potential errors.
- Defined global variables for GPIO pin configurations, making the code cleaner and easier to modify for different setups.
- Encapsulated GPIO setup and reset logic into dedicated functions (`setup_direct_gpio`), streamlining the main logic flow and separating concerns.
- Modularized SPI setup (`setup_spi`) and data transmission logic (`send_data_over_spi` and `handle_block_transfer`), enhancing code organization and maintainability.

Benefits:
- The use of `smbus2` and `adafruit_blinka` libraries modernizes the script and may improve compatibility with a wider range of devices and future Python versions.
- Type annotations and structured exception handling make the script more understandable and safer to execute, reducing the risk of runtime errors.
- The refactoring into more granular functions and the introduction of global variables for configuration parameters make the script easier to read, modify, and extend.
- Improved error handling ensures that the script fails gracefully, providing clear error messages and avoiding potential resource leaks.
2024-02-08 01:25:53 +02:00
j1nx fffa51ff5f [All] (testing) Bumpe kernel to 6.6.14 2024-02-05 16:41:40 +00:00
j1nx e999e64152 [All] Disable libcamera-apps 2024-02-05 11:31:53 +00:00
j1nx c3a0370a4b [All] Enable alsa-plugins 2024-02-03 12:34:51 +00:00
Bohdan Buinich d1ac3d4be1 Merge remote-tracking branch 'origin/develop' into refactor-buildroot-scripts 2024-01-27 02:28:15 +02:00
j1nx 29a4ad1690 Merge branch 'develop' of github.com:OpenVoiceOS/ovos-buildroot into develop 2024-01-26 11:56:39 +00:00
j1nx 4ce75256d3 [RPI] Get the Raspberry Pi3 and 4 back in sync again.
With a possible fix for the RT kernel not booting on the rpi3
2024-01-24 15:43:33 +00:00
Bohdan Buinich d0dcab2864 Moved post-build and post-images on top level (not fully tested) 2024-01-12 14:52:02 +02:00
j1nx 27200f51c5 [All] Enable python-pip on the host OS 2024-01-06 18:56:40 +00:00
j1nx 6d807b2a6d [ALL] Small additions and changes 2024-01-05 12:15:25 +00:00
j1nx adf40880dd [ALL] Fixes (non-boot rpi) and tweaks (pipewire/wireplumber) 2023-12-27 16:11:15 +00:00
j1nx 6e49362369 [ALL] {WIP} Sound architectual changes for pipewire 2023-12-19 14:02:11 +00:00
j1nx d0c5ebd4d1 [All][RPI] Clean ups and some fixed (+kerenl bump) 2023-12-17 13:49:45 +00:00
j1nx 31008b58cc [RPI3] Fix and use pre-installed headless containers for rpi3 2023-12-12 18:07:18 +00:00
j1nx f6a47e9398 [All] Bump kernel and buildroot 2023-12-10 09:05:19 +00:00
j1nx 9da8f7a580 [ALL] First try-out on pre loading the podman containers at buildtime 2023-11-30 18:24:34 +00:00
j1nx 27bc2c917f [ALL] Enable libinput 2023-11-11 09:40:39 +00:00
j1nx 6978919f16 [ALL] Bump kernel to 6.1.61 2023-11-07 09:41:53 +00:00
j1nx f5154ef459 [RPI][WIP] Work on migrating the i2csound system towards pipewire 2023-11-04 12:57:26 +00:00
j1nx f5afcc2c2a [ALL] Bump buildroot + podman/crun [RPI] Update configs for it. 2023-10-28 14:31:43 +00:00
j1nx 1f37a5d29f [RPI3] Start of RaspberryPi3 support 2023-09-30 14:19:55 +00:00