root / lab4 / utils.h @ 104
History | View | Annotate | Download (1.05 KB)
1 | 68 | up20180642 | #ifndef UTILS_H_INCLUDED
|
---|---|---|---|
2 | #define UTILS_H_INCLUDED
|
||
3 | |||
4 | 90 | up20180655 | /**
|
5 | * @brief Gets the least significant byte of a 16-bit variable
|
||
6 | * @param val 16-bit variable
|
||
7 | * @param lsb Pointer to a 8-bit variable to store the value of the LSB
|
||
8 | * @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK
|
||
9 | */
|
||
10 | 68 | up20180642 | int(util_get_LSB)(uint16_t val, uint8_t *lsb);
|
11 | |||
12 | 90 | up20180655 | /**
|
13 | * @brief Gets the most significant byte of a 16-bit variable
|
||
14 | * @param val 16-bit variable
|
||
15 | * @param lsb Pointer to a 8-bit variable to store the value of the MSB
|
||
16 | * @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK
|
||
17 | */
|
||
18 | 68 | up20180642 | int(util_get_MSB)(uint16_t val, uint8_t *msb);
|
19 | |||
20 | #ifdef LAB3
|
||
21 | uint32_t sys_inb_counter; |
||
22 | #endif
|
||
23 | |||
24 | 90 | up20180655 | /**
|
25 | * @brief sys_inb wrapper
|
||
26 | * @param port Port to read from
|
||
27 | * @param value Pointer to byte to store value read
|
||
28 | * @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK
|
||
29 | */
|
||
30 | 68 | up20180642 | int (util_sys_inb)(int port, uint8_t *value); |
31 | |||
32 | #endif //UTILS_H_INCLUDED |