C ordening

This commit is contained in:
Rens Pastoor
2025-05-27 23:26:28 +02:00
parent 39269a71a7
commit 517087ccc1
207 changed files with 0 additions and 4278 deletions

View File

@@ -0,0 +1,33 @@
#ifndef ENCODE_H_
#define ENCODE_H_
#include <stdbool.h>
#include <stdint.h>
/*!
* Split a byte 'value' into two nibbles (4-bits) named 'low' and 'high'.
* See assignment for more details.
*
* @param value: A byte that will be encoded.
* @param low: The address to which the 4 least-significant-bits
* of 'value' will be written.
* @param high: The address to which the 4 most-significant-bits
* of 'value' will be written.
*/
void encode_get_nibbles(uint8_t value, uint8_t* high, uint8_t* low);
/*!
* Encodes a the byte 'value' into two bytes named 'low' and 'high'.
* The encoded bytes contain the parity bits. See assignment for more details.
*
* @param value: A byte that will be encoded.
* @param low: The address to which the encoded value of the
* 4 least-significant-bits of 'value' will be written.
* @param high: The address to which the encoded value of the
* 4 most-significant-bits of 'value' will be written.
*/
void encode_value(uint8_t input, uint8_t* high, uint8_t* low);
uint8_t encode_nibble(uint8_t nibble);
#endif