summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2022-11-07 12:20:20 +1100
committerjacqueline <me@jacqueline.id.au>2022-11-07 12:20:20 +1100
commit675d52c9a5bd32c18e5c7f1588965d2238add9c2 (patch)
treed36358f39fbc9347737b46d65e9ec37e6c1fb63c /src/drivers
parent28d73ad8660e27f9c7b20b6e978d3d0c412dec00 (diff)
downloadtangara-fw-675d52c9a5bd32c18e5c7f1588965d2238add9c2.tar.gz
use a less fun but more descriptive namespace
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/battery.cpp4
-rw-r--r--src/drivers/dac.cpp4
-rw-r--r--src/drivers/display-init.cpp4
-rw-r--r--src/drivers/display.cpp4
-rw-r--r--src/drivers/gpio-expander.cpp4
-rw-r--r--src/drivers/i2c.cpp4
-rw-r--r--src/drivers/include/battery.hpp4
-rw-r--r--src/drivers/include/dac.hpp4
-rw-r--r--src/drivers/include/display-init.hpp4
-rw-r--r--src/drivers/include/display.hpp4
-rw-r--r--src/drivers/include/gpio-expander.hpp4
-rw-r--r--src/drivers/include/i2c.hpp4
-rw-r--r--src/drivers/include/playback.hpp4
-rw-r--r--src/drivers/include/storage.hpp4
-rw-r--r--src/drivers/playback.cpp4
-rw-r--r--src/drivers/storage.cpp4
16 files changed, 32 insertions, 32 deletions
diff --git a/src/drivers/battery.cpp b/src/drivers/battery.cpp
index 66c96daf..b3341eab 100644
--- a/src/drivers/battery.cpp
+++ b/src/drivers/battery.cpp
@@ -4,7 +4,7 @@
#include "esp_adc_cal.h"
#include "hal/adc_types.h"
-namespace gay_ipod {
+namespace drivers {
static esp_adc_cal_characteristics_t calibration;
@@ -28,4 +28,4 @@ uint32_t read_battery_voltage(void) {
return esp_adc_cal_raw_to_voltage(raw, &calibration);
}
-} // namespace gay_ipod
+} // namespace drivers
diff --git a/src/drivers/dac.cpp b/src/drivers/dac.cpp
index d74e9523..ac5b5eaa 100644
--- a/src/drivers/dac.cpp
+++ b/src/drivers/dac.cpp
@@ -11,7 +11,7 @@
#include "esp_log.h"
#include "hal/i2c_types.h"
-namespace gay_ipod {
+namespace drivers {
static const char* kTag = "AUDIODAC";
static const uint8_t kPcm5122Address = 0x4C;
@@ -103,4 +103,4 @@ void AudioDac::WriteRegister(Register reg, uint8_t val) {
ESP_ERROR_CHECK(transaction.Execute());
}
-} // namespace gay_ipod
+} // namespace drivers
diff --git a/src/drivers/display-init.cpp b/src/drivers/display-init.cpp
index e4545339..b958505d 100644
--- a/src/drivers/display-init.cpp
+++ b/src/drivers/display-init.cpp
@@ -1,6 +1,6 @@
#include "display-init.hpp"
-namespace gay_ipod {
+namespace drivers {
namespace displays {
/* Bit to use to signify we should delay after part of an init sequence */
@@ -100,4 +100,4 @@ const InitialisationData kST7735R = {
kST7735RCommonFooter}};
} // namespace displays
-} // namespace gay_ipod
+} // namespace drivers
diff --git a/src/drivers/display.cpp b/src/drivers/display.cpp
index 8708436f..d59d61bc 100644
--- a/src/drivers/display.cpp
+++ b/src/drivers/display.cpp
@@ -41,7 +41,7 @@ static const int kDisplayBufferSize = (kDisplayWidth * kDisplayHeight) / 10;
DMA_ATTR static lv_color_t sBuffer1[kDisplayBufferSize];
DMA_ATTR static lv_color_t sBuffer2[kDisplayBufferSize];
-namespace gay_ipod {
+namespace drivers {
// Static functions for interrop with the LVGL display driver API, which
// requires a function pointer.
@@ -282,4 +282,4 @@ void Display::ServiceTransactions() {
}
}
-} // namespace gay_ipod
+} // namespace drivers
diff --git a/src/drivers/gpio-expander.cpp b/src/drivers/gpio-expander.cpp
index 6b472d1c..b2490c8f 100644
--- a/src/drivers/gpio-expander.cpp
+++ b/src/drivers/gpio-expander.cpp
@@ -4,7 +4,7 @@
#include <cstdint>
-namespace gay_ipod {
+namespace drivers {
GpioExpander::GpioExpander() {
ports_ = pack(kPortADefault, kPortBDefault);
@@ -84,4 +84,4 @@ GpioExpander::SpiLock::~SpiLock() {
gpio_.with([&](auto& gpio) { gpio.set_pin(cs_, 1); });
}
-} // namespace gay_ipod
+} // namespace drivers
diff --git a/src/drivers/i2c.cpp b/src/drivers/i2c.cpp
index d3bfaa59..d3378df6 100644
--- a/src/drivers/i2c.cpp
+++ b/src/drivers/i2c.cpp
@@ -4,7 +4,7 @@
#include "assert.h"
#include "driver/i2c.h"
-namespace gay_ipod {
+namespace drivers {
static constexpr int kCmdLinkSize = I2C_LINK_RECOMMENDED_SIZE(12);
@@ -48,4 +48,4 @@ I2CTransaction& I2CTransaction::read(uint8_t* dest, i2c_ack_type_t ack) {
return *this;
}
-} // namespace gay_ipod
+} // namespace drivers
diff --git a/src/drivers/include/battery.hpp b/src/drivers/include/battery.hpp
index 399e866f..9358f9b0 100644
--- a/src/drivers/include/battery.hpp
+++ b/src/drivers/include/battery.hpp
@@ -4,7 +4,7 @@
#include "esp_err.h"
-namespace gay_ipod {
+namespace drivers {
esp_err_t init_adc(void);
@@ -13,4 +13,4 @@ esp_err_t init_adc(void);
*/
uint32_t read_battery_voltage(void);
-} // namespace gay_ipod
+} // namespace drivers
diff --git a/src/drivers/include/dac.hpp b/src/drivers/include/dac.hpp
index 6d025384..b4e95ad4 100644
--- a/src/drivers/include/dac.hpp
+++ b/src/drivers/include/dac.hpp
@@ -8,7 +8,7 @@
#include "esp_err.h"
#include "result.hpp"
-namespace gay_ipod {
+namespace drivers {
/**
* Interface for a PCM5122PWR DAC, configured over I2C.
@@ -70,4 +70,4 @@ class AudioDac {
void WriteRegister(Register reg, uint8_t val);
};
-} // namespace gay_ipod
+} // namespace drivers
diff --git a/src/drivers/include/display-init.hpp b/src/drivers/include/display-init.hpp
index f11e9b57..f7d287f7 100644
--- a/src/drivers/include/display-init.hpp
+++ b/src/drivers/include/display-init.hpp
@@ -2,7 +2,7 @@
#include <cstdint>
-namespace gay_ipod {
+namespace drivers {
namespace displays {
extern const uint8_t kDelayBit;
@@ -78,4 +78,4 @@ enum StCommands {
};
} // namespace displays
-} // namespace gay_ipod
+} // namespace drivers
diff --git a/src/drivers/include/display.hpp b/src/drivers/include/display.hpp
index 2d6e9cd6..6caf1571 100644
--- a/src/drivers/include/display.hpp
+++ b/src/drivers/include/display.hpp
@@ -7,7 +7,7 @@
#include "lvgl/lvgl.h"
#include "result.hpp"
-namespace gay_ipod {
+namespace drivers {
/*
* Display driver for LVGL.
@@ -64,4 +64,4 @@ class Display {
uintptr_t flags = 0);
};
-} // namespace gay_ipod
+} // namespace drivers
diff --git a/src/drivers/include/gpio-expander.hpp b/src/drivers/include/gpio-expander.hpp
index 2a12fba4..7ae0f107 100644
--- a/src/drivers/include/gpio-expander.hpp
+++ b/src/drivers/include/gpio-expander.hpp
@@ -13,7 +13,7 @@
#include "esp_log.h"
#include "freertos/FreeRTOS.h"
-namespace gay_ipod {
+namespace drivers {
/**
* Wrapper for interfacing with the PCA8575 GPIO expander. Includes basic
@@ -205,4 +205,4 @@ class GpioExpander {
std::atomic<uint16_t> inputs_;
};
-} // namespace gay_ipod
+} // namespace drivers
diff --git a/src/drivers/include/i2c.hpp b/src/drivers/include/i2c.hpp
index db554f5d..a4c71767 100644
--- a/src/drivers/include/i2c.hpp
+++ b/src/drivers/include/i2c.hpp
@@ -5,7 +5,7 @@
#include "driver/i2c.h"
#include "hal/i2c_types.h"
-namespace gay_ipod {
+namespace drivers {
/*
* Convenience wrapper for performing an I2C transaction with a reasonable
@@ -81,4 +81,4 @@ class I2CTransaction {
uint8_t* buffer_;
};
-} // namespace gay_ipod
+} // namespace drivers
diff --git a/src/drivers/include/playback.hpp b/src/drivers/include/playback.hpp
index 493dd311..5fa7ab38 100644
--- a/src/drivers/include/playback.hpp
+++ b/src/drivers/include/playback.hpp
@@ -17,7 +17,7 @@
#include "mp3_decoder.h"
#include "result.hpp"
-namespace gay_ipod {
+namespace drivers {
class DacAudioPlayback {
public:
@@ -64,4 +64,4 @@ class DacAudioPlayback {
audio_element_handle_t mp3_decoder_;
};
-} // namespace gay_ipod
+} // namespace drivers
diff --git a/src/drivers/include/storage.hpp b/src/drivers/include/storage.hpp
index cee49cc5..3aa2cb92 100644
--- a/src/drivers/include/storage.hpp
+++ b/src/drivers/include/storage.hpp
@@ -10,7 +10,7 @@
#include "esp_vfs_fat.h"
#include "result.hpp"
-namespace gay_ipod {
+namespace drivers {
extern const char* kStoragePath;
@@ -57,4 +57,4 @@ class SdStorage {
FATFS* fs_ = nullptr;
};
-} // namespace gay_ipod
+} // namespace drivers
diff --git a/src/drivers/playback.cpp b/src/drivers/playback.cpp
index 46dec680..89b1f7e1 100644
--- a/src/drivers/playback.cpp
+++ b/src/drivers/playback.cpp
@@ -15,7 +15,7 @@
static const char* kTag = "PLAYBACK";
static const i2s_port_t kI2SPort = I2S_NUM_0;
-namespace gay_ipod {
+namespace drivers {
static audio_element_status_t status_from_the_void(void* status) {
uintptr_t as_pointer_int = reinterpret_cast<uintptr_t>(status);
@@ -243,4 +243,4 @@ auto DacAudioPlayback::volume() -> uint8_t {
return volume_;
}
-} // namespace gay_ipod
+} // namespace drivers
diff --git a/src/drivers/storage.cpp b/src/drivers/storage.cpp
index 7fed6ed0..465c84ea 100644
--- a/src/drivers/storage.cpp
+++ b/src/drivers/storage.cpp
@@ -22,7 +22,7 @@
static const char* kTag = "SDSTORAGE";
static const uint8_t kMaxOpenFiles = 8;
-namespace gay_ipod {
+namespace drivers {
const char* kStoragePath = "/sdcard";
@@ -146,4 +146,4 @@ auto SdStorage::HandleTransaction(sdspi_dev_handle_t handle,
return do_transaction_(handle, cmdinfo);
}
-} // namespace gay_ipod
+} // namespace drivers