Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REFACTOR] Extract peripheral initialisations to relevant drivers #1

Open
2 tasks
s3785111 opened this issue Jan 22, 2025 · 0 comments
Open
2 tasks
Assignees
Labels
refactor Changes to implementation

Comments

@s3785111
Copy link
Member

s3785111 commented Jan 22, 2025

[REFACTOR] Extract peripheral initialisations to relevant drivers

Summary

Currently, many of the STM32 peripherals initialisation code (e.g. GPIO bringup, peripheral config) are isolated in monolithic functions that bring-up all used ports in one go. This refactor aims to extract individual initialisations to the relevant drivers of the devices that require it.

Detailed Description

Current problem areas for initialisation are:

  • sensors.c
  • drivers.c
    • contains startup for all peripheral RCC, SPI for flash and LoRa, UART for GPS, and GPIO for buzzers and outputs
    • RCC, GPIO and relevant peripheral initialisation should be extracted to related device drivers

Motivation

This refactor not only benefits the overall readability and ease of maintenance of the system, but it also allows for greater portability as each device driver can have its initialisation parameters passed to it for startup.

This means that the parameters may be supplied as pre-processor definitions to allow for configurations to be easily adjusted (i.e. in the case of changes to hardware port connections).

Dependencies

Other Considerations

N/A

@s3785111 s3785111 added the refactor Changes to implementation label Jan 22, 2025
@s3785111 s3785111 moved this to Todo in Australis Avionics Jan 22, 2025
@s3785111 s3785111 self-assigned this Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Changes to implementation
Projects
Status: Todo
Development

No branches or pull requests

1 participant