Go to file
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
.github/ISSUE_TEMPLATE Update issue templates 2022-03-14 12:25:25 +01:00
buildroot@e2b977c858 [All] Bump buildroot for rpi fixes 2024-02-05 20:30:20 +00:00
buildroot-external [RPI] Refactor SPI and GPIO handling for XVF3510 initialization 2024-02-08 01:25:53 +02:00
documentation Update kernel.md 2023-11-14 10:44:27 +01:00
logs Add empty logs and release directory by default 2021-05-01 09:08:42 +02:00
release Add empty logs and release directory by default 2021-05-01 09:08:42 +02:00
scripts MycroftOS: BNuilding now uses a proper Makefile. 2019-12-10 13:21:49 +01:00
.gitignore More work and get rpi4 inline 2023-08-21 08:05:43 +00:00
.gitmodules WIP push for backup (Sorry for the mess) 2023-08-08 13:08:11 +00:00
Jenkinsfile convert all steps to use sh in jenkins 2021-02-27 16:56:01 +05:30
LICENSE MycroftOS: Initial setup 2018-10-26 15:02:09 +02:00
Makefile More work and get rpi4 inline 2023-08-21 08:05:43 +00:00
README.md Update README.md 2023-11-14 10:42:40 +01:00

README.md

OVOS - Buildroot OS

A minimalistic Linux OS bringing the open source voice assistant ovos-core to embedded, low-spec headless and/or small (touch)screen devices.

System.

OpenVoiceOS - Full 64 Bit distribution

  • Linux kernel 6.1.x (LTS)
  • Buildroot 2023.02.x (LTS) (With some modification here and there)
  • OVOS framework / software package utilizing ovos-docker containers (Currently latest alpha/development version)
  • Raspberry Pi 3|3b|3b+ (UEFI based)
  • Raspberry Pi 4 (UEFI based)
  • x86_64 Intel based computers (UEFI based) (Work In Progress)
  • Open Virtual Appliance (UEFI based)

Stats:

Build Status GitHub last commit
This shows if the code is valid and can be build. This shows when this repo was updated for the last time
GitHub stars GitHub issues
Please this repo if you find it useful Issues are like my personal TODO list and information archive
License: Apache License 2.0 contributions welcome
I'm using the Apache License 2.0 similar as Mycroft A.I. which means commercial use is allowed If you have any ideas, they're always welcome. Either submit an issue or a PR!
Uptime Robot status Buy me a
I use uptime robot to monitor for things i can't monitor when the connection drops. If you feel the need, now it's as easy as clicking this button!

Documentation.

More information and instructions can be found within the "documentation" folder.

Credits

Mycroft AI (@MycroftAI)
Buildroot (@buildroot)
HassOS (@home-assistant)

Inspired by;

HassOS (@home-assistant)
SkiffOS (@skiffos)