Skip to content
Snippets Groups Projects
Commit a612a48f authored by David Maul's avatar David Maul :crab:
Browse files

docs: add documentation for gpio protocol

parent 5f8e1fb9
Branches main
No related tags found
No related merge requests found
...@@ -53,3 +53,49 @@ When `data_t` is copied, it checkes if the pointer to the measurements array is ...@@ -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. If both applies, it also copies the data from the array pointer to the kernel space.
### GPIO interface ### 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment