Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
embedded-linux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Maul
embedded-linux
Commits
a612a48f
Commit
a612a48f
authored
4 months ago
by
David Maul
Browse files
Options
Downloads
Patches
Plain Diff
docs: add documentation for gpio protocol
parent
5f8e1fb9
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+46
-0
46 additions, 0 deletions
README.md
with
46 additions
and
0 deletions
README.md
+
46
−
0
View file @
a612a48f
...
...
@@ -53,3 +53,49 @@ When `data_t` is copied, it checkes if the pointer to the measurements array is
If both applies, it also copies the data from the array pointer to the kernel space.
### GPIO interface
#### Physical Layer
The protocol implements unidirectional serial communication over GPIO with the following characteristics:
-
Transmission rate: 9600 baud (104.17 microseconds per bit)
-
Signal levels:
-
Logical 0: GPIO Low
-
Logical 1: GPIO High
-
Pin configuration: GPIO 575 as output
#### Bit Transmission
Bit transmission follows the UART-8N1 compatible format:
1.
Start bit: Logical 0 (Low)
2.
8 data bits in LSB-first order
3.
Stop bit: Logical 1 (High)
4.
No parity checking
5.
No flow control
#### Packet Structure
A complete data
`packet_t`
consists of a header, variable measurement payload, and a CRC32 checksum field:
#### Header (3 Bytes)
1.
Magic Number (1 byte)
-
Fixed value: 0xAA
-
Used for packet detection and synchronization
2.
Sender ID (1 byte)
-
Identifies the sender
3.
Measurement Count (1 byte)
-
Number of subsequent measurements
-
Maximum value: 16 (MAX_MEASUREMENTS)
#### Measurement Payload (10 bytes per measurement)
For each
`measurement_t`
, the following fields are transmitted:
1.
Measurement Data (8 bytes)
-
64-bit measurement value
-
The data is packed as a c-style union
2.
Measurement Type (1 byte)
-
Data type of the measurement
-
The following data types are available for a measurement: INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64, FLOAT32, FLOAT64
3.
Measurement ID (1 byte)
-
Unique identifier for the measurement
#### Trailer (4 bytes)
-
CRC32 checksum
-
Calculated over all preceding packet fields
-
Uses the Linux standard CRC32 algorithm
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment