This commit is contained in:
Rens Pastoor
2025-05-27 22:41:46 +02:00
parent d141296aea
commit 11b391b8a1
416 changed files with 25232 additions and 0 deletions

28
C/Adidas/shared/decode.h Normal file
View File

@@ -0,0 +1,28 @@
#ifndef DECODE_H_
#define DECODE_H_
#include <stdint.h>
/*!
* Combines the nibbles located at the 4-least-significant bits of
* parameters 'low' and 'high' into one byte.
*
* @param high: A nibble that contains the 4 most-significant bits
* @param low: A nibble that contains the 4 most-significant bits
*
* @return: A byte that combines the high and low nibble.
*/
uint8_t decode_combine_nibbles(uint8_t high, uint8_t low);
/*!
* Decodes a nibble from a byte that contains the nible (4-bits) and
* corresponding parity bits (3-bits). See assignment for more details.
*
* @param in: A bytes that contains a nibble and parity bits.
* @param nibble: The address to which the decoded nibble
* of 'in' will be written.
*
*/
void decode_byte(uint8_t in, uint8_t* nibble);
#endif