diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2025-10-24 16:55:59 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2025-10-24 16:55:59 -0400 |
| commit | 01bd9cbc6fe64f236a1b467f011e56dcae0306e7 (patch) | |
| tree | dc74cfa742d77befcbe58715e3ae7a2727c89781 /fw/types.h | |
| parent | a0c6bbb21c5e7d9e0090e66c316cf88ef7f0726b (diff) | |
| download | can-gauge-interface-01bd9cbc6fe64f236a1b467f011e56dcae0306e7.zip | |
table module
Diffstat (limited to 'fw/types.h')
| -rw-r--r-- | fw/types.h | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -13,6 +13,7 @@ typedef enum { } Status; typedef uint8_t U8; +typedef int8_t I8; typedef struct { U8 hi, lo; @@ -21,8 +22,19 @@ typedef struct { // Little-endian 32-bit unsigned integer. typedef U8 U32[4]; -// *a = *a+b -void addU16(U16 *a, U8 b); +// a + b +U16 addU16(U16 a, U16 b); -// *a = *a<<b -void lshiftU16(U16 *a, U8 b); +// a + b +U16 addU16U8(U16 a, U8 b); + +// a << b +U16 lshiftU16(U16 a, U8 b); + +// a >> b +U16 rshiftU16(U16 a, U8 b); + +// -1 if a < b +// 0 if a == b +// +1 if a > b +I8 cmpU16(U16 a, U16 b); |