DonCon2040/include/GlobalConfiguration.h

100 lines
1.9 KiB
C
Raw Normal View History

2023-04-10 13:04:38 +02:00
#ifndef _GLOBALCONFIGURATION_H_
#define _GLOBALCONFIGURATION_H_
2023-05-21 22:02:24 +02:00
#include "peripherals/Controller.h"
2023-05-22 00:08:23 +02:00
#include "peripherals/Display.h"
2023-04-10 13:04:38 +02:00
#include "peripherals/Drum.h"
#include "peripherals/StatusLed.h"
2023-04-10 13:04:38 +02:00
#include "hardware/i2c.h"
2023-05-22 00:08:23 +02:00
namespace Doncon::Config {
struct I2c {
uint8_t sda_pin;
uint8_t scl_pin;
i2c_inst_t *block;
uint speed_hz;
};
namespace Default {
const I2c i2c_config = {
6, // SDA Pin
7, // SCL Pin
i2c1, // Block
1000000, // Speed
};
2023-04-10 13:04:38 +02:00
const Peripherals::Drum::Config drum_config = {
// Pin config
{
2023-07-02 23:48:33 +02:00
2, // Don Left
3, // Ka Left
1, // Don Right
0, // Ka Right
2023-04-10 13:04:38 +02:00
},
2023-07-02 23:48:33 +02:00
// Trigger thresholds soft
{
80, // Don Left
50, // Ka Left
80, // Don Right
50, // Ka Right
},
50, // ADC sample count
18, // Debounce delay in milliseconds
2023-04-10 13:04:38 +02:00
};
const Peripherals::Buttons::Config button_config = {
2023-05-22 00:08:23 +02:00
// I2c config
{
2023-05-22 00:08:23 +02:00
i2c_config.block, // Block
0x20, // Address
},
// Pins
{{
0, // Up
1, // Down
2, // Left
3, // Right
},
{
2023-07-02 23:48:33 +02:00
10, // North
9, // East
2023-07-02 23:48:33 +02:00
8, // South
11, // West
4, // L
12, // R
13, // Start
5, // Select
14, // Home
6, // Share
}},
20, // Debounce delay in milliseconds
};
const Peripherals::StatusLed::Config led_config = {
{255, 0, 0}, // Don Left Color
{0, 0, 255}, // Ka Left Color
{255, 255, 0}, // Don Right Color
{0, 255, 255}, // Ka Right Color
11, // LED Enable Pin,
12, // LED Pin
false, // Is RGBW
255, // Brightness
};
2023-05-22 00:08:23 +02:00
const Peripherals::Display::Config display_config = {
i2c_config.block, // Block
0x3C, // Address
};
} // namespace Default
} // namespace Doncon::Config
2023-04-10 13:04:38 +02:00
#endif // _GLOBALCONFIGURATION_H_