aboutsummaryrefslogtreecommitdiff
path: root/strings.h
diff options
context:
space:
mode:
authorWojtek Kosior <kwojtus@protonmail.com>2019-12-30 17:34:23 +0100
committerWojtek Kosior <kwojtus@protonmail.com>2019-12-30 17:34:23 +0100
commitc9e045dc2170a99c9f32386e3e53aee9e01a8e7c (patch)
treefaa57aef89cd1a03efc665c1e5809cf4f0304269 /strings.h
parenteae54c24e2e2b89f399bc2d3be195468c2e462a5 (diff)
downloadrpi-MMU-example-c9e045dc2170a99c9f32386e3e53aee9e01a8e7c.tar.gz
rpi-MMU-example-c9e045dc2170a99c9f32386e3e53aee9e01a8e7c.zip
io api rework
Diffstat (limited to 'strings.h')
-rw-r--r--strings.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/strings.h b/strings.h
index 8d4b511..bfe6fd0 100644
--- a/strings.h
+++ b/strings.h
@@ -3,12 +3,22 @@
#include <stdint.h>
-static inline void uint32_to_bits(uint32_t number, char *buf)
-{
- for (int i = 0; i < 32; i++)
- buf[i] = ((number >> (32 - i - 1)) & 1) ? '1' : '0';
+void uint32_to_dec(uint32_t number, char buf[10]);
- buf[32] = '\0';
-}
+void uint32_to_hex(uint32_t number, char buf[8]);
+
+void uint32_to_bin(uint32_t number, char buf[32]);
+
+void uint32_to_decstring(uint32_t number, char buf[11]);
+
+void uint32_to_hexstring(uint32_t number, char buf[9]);
+
+void uint32_to_binstring(uint32_t number, char buf[33]);
+
+void trim_0s(char string[]);
+
+void uint32_to_decstringt(uint32_t number, char buf[11]);
+
+void uint32_to_hexstringt(uint32_t number, char buf[9]);
#endif // STRINGS_H