Files
T2-start-2025/C/t-oer-prc2-cbdb-main-Assignments-Adidas/Adidas/shared/decode.h
Rens Pastoor 11b391b8a1 sync
2025-05-27 22:41:46 +02:00

30 lines
815 B
C

#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