aboutsummaryrefslogtreecommitdiff
path: root/driver_fw/mac.h
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2019-04-14 13:25:23 +0900
committerjaseg <git@jaseg.net>2019-04-14 13:25:23 +0900
commit668c89f88988e4bd6149fa7d13650254037f028d (patch)
treedbd2188c7f15fd2756de1e5d79b9ce569c0f4cd4 /driver_fw/mac.h
parent010d5587b776030690a2ab25902fe9eff52fcf5b (diff)
download8seg-668c89f88988e4bd6149fa7d13650254037f028d.tar.gz
8seg-668c89f88988e4bd6149fa7d13650254037f028d.tar.bz2
8seg-668c89f88988e4bd6149fa7d13650254037f028d.zip
driver/fw: I2C LCD working
Diffstat (limited to 'driver_fw/mac.h')
-rw-r--r--driver_fw/mac.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/driver_fw/mac.h b/driver_fw/mac.h
new file mode 100644
index 0000000..26aaff6
--- /dev/null
+++ b/driver_fw/mac.h
@@ -0,0 +1,22 @@
+#ifndef __MAC_H__
+#define __MAC_H__
+
+#include <unistd.h>
+
+/* Device MAC address.
+ *
+ * 32 bits might seem a little short for a device MAC, but at 20 bus nodes the probablility of a collision is about 1 in
+ * 10 million. Check for yourself using the python code below.
+ *
+ * #!/usr/bin/env python3
+ * from operator import mul
+ * from functools import reduce
+ * m = 32
+ * n = 20
+ * print(reduce(mul, [2**m-i for i in range(n)]) / ((2**m)**n))
+ * # -> 0.9999999557621786
+ */
+
+extern uint32_t device_mac;
+
+#endif /* __MAC_H__ */