mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-10-19 07:51:57 +00:00
Backlight: Add abstraction for support of different hardware.
This commit is contained in:
@@ -31,6 +31,7 @@ using namespace hackrf::one;
|
||||
|
||||
#include "clock_manager.hpp"
|
||||
|
||||
#include "backlight.hpp"
|
||||
#include "touch_adc.hpp"
|
||||
#include "audio.hpp"
|
||||
|
||||
@@ -56,6 +57,9 @@ portapack::IO io {
|
||||
portapack::gpio_unused,
|
||||
};
|
||||
|
||||
portapack::BacklightCAT4004 backlight_cat4004;
|
||||
portapack::BacklightOnOff backlight_on_off;
|
||||
|
||||
lcd::ILI9341 display;
|
||||
|
||||
I2C i2c0(&I2CD0);
|
||||
@@ -147,6 +151,12 @@ static const portapack::cpld::Config& portapack_cpld_config() {
|
||||
;
|
||||
}
|
||||
|
||||
Backlight* backlight() {
|
||||
return (portapack_model() == PortaPackModel::R2_20170522)
|
||||
? static_cast<portapack::Backlight*>(&backlight_cat4004)
|
||||
: static_cast<portapack::Backlight*>(&backlight_on_off);
|
||||
}
|
||||
|
||||
static void shutdown_base() {
|
||||
clock_manager.shutdown();
|
||||
|
||||
@@ -272,6 +282,7 @@ bool init() {
|
||||
void shutdown() {
|
||||
gpdma::controller.disable();
|
||||
|
||||
backlight()->off();
|
||||
display.shutdown();
|
||||
|
||||
radio::disable();
|
||||
|
Reference in New Issue
Block a user