aboutsummaryrefslogtreecommitdiff
path: root/test_fw/include
diff options
context:
space:
mode:
Diffstat (limited to 'test_fw/include')
-rw-r--r--test_fw/include/board.h20
-rw-r--r--test_fw/include/bringup.h18
-rw-r--r--test_fw/include/veml.h8
3 files changed, 42 insertions, 4 deletions
diff --git a/test_fw/include/board.h b/test_fw/include/board.h
new file mode 100644
index 0000000..3f4be82
--- /dev/null
+++ b/test_fw/include/board.h
@@ -0,0 +1,20 @@
+#pragma once
+
+#include <SPI.h>
+
+constexpr auto SDA_PIN = 6, SCL_PIN = 23;
+
+constexpr auto SD_CS = 17, SD_SCK = 18, SD_MOSI = 19, SD_MISO = 20;
+constexpr auto CARD_DETECT = 12;
+
+constexpr auto LSM_CS = 13, LSM_SCK = 10, LSM_MOSI = 11, LSM_MISO = 8;
+constexpr auto LSM_INT1 = 4, LSM_INT2 = 5;
+
+constexpr auto LED_FAULT = 0, LED_CAPTURING = 1, LED_OTHER = 2, LED_STORAGE = 3;
+constexpr auto I2S_DATA = 22, I2S_BCLK = 24, I2S_WS = 25;
+
+constexpr auto BME_ADDR = 0x76;
+
+#define SD_SPI SPI
+#define LSM_SPI SPI1
+
diff --git a/test_fw/include/bringup.h b/test_fw/include/bringup.h
new file mode 100644
index 0000000..762a26a
--- /dev/null
+++ b/test_fw/include/bringup.h
@@ -0,0 +1,18 @@
+#pragma once
+
+#include <Arduino.h>
+#include <etl/span.h>
+
+namespace ocularium::bringup {
+ struct init_check
+ {
+ const String name;
+ bool (*f)();
+ bool succeeded;
+ };
+
+ void startup_checks(const etl::span<init_check> &checks);
+ void init_buses();
+ void init_pins();
+ void boot_animation();
+}
diff --git a/test_fw/include/veml.h b/test_fw/include/veml.h
index 89282c8..51345a9 100644
--- a/test_fw/include/veml.h
+++ b/test_fw/include/veml.h
@@ -50,9 +50,9 @@ namespace ocularium
AmbientLightGain gain = AmbientLightGain::Eighth;
IntegrationTime integration = IntegrationTime::Ms100;
- uint16_t to_reg() const;
+ [[nodiscard]] uint16_t to_reg() const;
- int32_t gain_factor() const
+ [[nodiscard]] int32_t gain_factor() const
{
int32_t gain = 0;
@@ -122,8 +122,8 @@ namespace ocularium
bool init(const Config& config = Config{});
- uint16_t chipid() const;
- float lux() const;
+ [[nodiscard]] uint16_t chipid() const;
+ [[nodiscard]] float lux() const;
void set_config(const Config& config);