REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches
front_panel.cpp
Go to the documentation of this file.
1// Copyright (c) 2024 anabrid GmbH
2// Contact: https://www.anabrid.com/licensing/
3//
4// SPDX-License-Identifier: MIT OR GPL-2.0-or-later
5
6#include "interfaces/signal_generator.h"
8
9#include <entity/base.h>
10#include <entity/meta.h>
11#include <lucidac/front_panel.h>
12#include <lucidac/teensy/leds.h>
13
14platform::LUCIDACFrontPanel::LUCIDACFrontPanel(interfaces::SignalGenerator * hardware)
15: Entity("FP"),
16 leds(std::make_unique<TeensyLEDs>()),
17 signal_generator(hardware) {}
18
19platform::LUCIDACFrontPanel *
20platform::LUCIDACFrontPanel::from_entity_classifier(entities::EntityClassifier classifier,
21 __attribute__((__unused__)) bus::addr_t block_address) {
22 if (!classifier or classifier.class_enum != CLASS_)
23 return nullptr;
24
25 // Currently, there are no different variants
26 if (classifier.variant != entities::EntityClassifier::DEFAULT_)
27 return nullptr;
28
29 // TODO: signal generator should be its won entity since it coule be combined arbitrarily
30 if (classifier.version < entities::Version(1, 1))
31 return new LUCIDACFrontPanel(new interfaces::FrontPlaneSignalGenerator(new interfaces::FrontPlaneSignalgeneratorHAL_V_1_1_X));
32
33 if (classifier.version <= entities::Version(1, 2))
34 return new LUCIDACFrontPanel(new interfaces::FrontPlaneSignalGenerator(new interfaces::FrontPlaneSignalgeneratorHAL_V_1_2_X));
35
36 return nullptr;
37}
__attribute__((section(".fastrun"), noinline, noclone, optimize("Os"))) int flash_sector_not_erased(uint32_t address)
Definition flasher.cpp:114