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

Config Workflow Diagram in adoc. Issue #210 #219

Merged
merged 6 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
:imagesdir: img/

ifndef::rootpath[]
:rootpath: ../
endif::rootpath[]

ifdef::rootpath[]
:imagesdir: {rootpath}{imagesdir}
endif::rootpath[]

=== Communicating with a Hardware Component
[.text-right]
https://github.com/oss-slu/Pi4Micronaut/edit/develop/micronautpi4j-utils/src/docs/asciidoc/components/commun_WithHardware.adoc[Improve this doc]
https://github.com/oss-slu/Pi4Micronaut/edit/develop/pi4micronaut-utils/src/docs/asciidoc/components/commun_WithHardware.adoc[Improve this doc]

Interacting with a hardware component is done through its communication type which determines
its circuit setup and configuration.

For example, the LCD1602 component uses an I2C communication type
which determines how the circuit is created by utilizing the I2C pins of the GPIO.

Based on the pins and communication type, you have to define the configuration in the yml file accordingly.

==== YAML Configuration Workflow:

- The specifications in the yml file are given to the component in the controller through the use of the @Named() annotation.
- The controller passes on the configuration to the helper through the object.
- The communication types are initialized in the Pi4JFactory and Pi4JMultiPinFactory as beans with specifications as listed in the yml file.
- The communication type configuration classes are in our utilities folder which define the methods and attributes which are used in the factory classes
to apply the specifics listed in the yml file.
- The factory classes create a context with all the beans which can be used by the different hardware components.
- When the JAR file is ran on the RaspberryPi, the beans interact with the pigpio library to communicate with the GPIO pins.

TODO: outline the use and access of application.yaml for an app +
TODO: Consolidate the format and include examples of how each comm type is used
image:Config_Workflow.png[]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading