libyggdrasil  v1.0.0
interfaces.hpp
Go to the documentation of this file.
1  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * _____.___. .___ .__.__ *
3  * \__ | | ____ ____ __| _/___________ _____|__| | *
4  * / | |/ ___\ / ___\ / __ |\_ __ \__ \ / ___/ | | *
5  * \____ / /_/ > /_/ > /_/ | | | \// __ \_\___ \| | |__ *
6  * / ______\___ /\___ /\____ | |__| (____ /____ >__|____/ *
7  * \/ /_____//_____/ \/ \/ \/ *
8  * - Asgard - *
9  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
10  * This software can be used by students and other personal of the *
11  * Bern University of Applied Sciences under the terms of the MIT *
12  * license. *
13  * For other persons this software is under the terms of the GNU *
14  * General Public License version 2. *
15  * *
16  * Copyright © 2021, Bern University of Applied Sciences. *
17  * All rights reserved. *
18  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
26 #pragma once
27 
33 
35 
36 #include <array>
37 
38 #if defined(YGGDRASIL_PERIPHERAL_DEFS)
39 
40  namespace bsp {
41 
57 
63  static constexpr auto& LD1 = GPIOPortJ::Pin<0>;
64  static constexpr auto& LDA = LD1;
65  static constexpr auto& LedBlue = LD1;
66  static constexpr auto& LD2 = GPIOPortJ::Pin<1>;
67  static constexpr auto& LDB = LD2;
68  static constexpr auto& LedRed = LD2;
69  static constexpr auto& LD3 = GPIOPortJ::Pin<2>;
70  static constexpr auto& LDC = LD3;
71  static constexpr auto& LedYellow = LD3;
72  static constexpr auto& LD4 = GPIOPortJ::Pin<3>;
73  static constexpr auto& LDD = LD4;
74  static constexpr auto& LedGreen = LD4;
75 
76  static constexpr auto& LeftJoyStickButton = GPIOPortE::Pin<9, drv::Active::Low>;
77  static constexpr auto& ButtonJoystickA = LeftJoyStickButton;
78  static constexpr auto& RightJoyStickButton = GPIOPortE::Pin<7, drv::Active::Low>;
79  static constexpr auto& ButtonJoystickB = RightJoyStickButton;
80 
81  static constexpr auto& ButtonA = GPIOPortJ::Pin<4, drv::Active::Low>;
82  static constexpr auto& ButtonB = GPIOPortJ::Pin<5, drv::Active::Low>;
83  static constexpr auto& ButtonC = GPIOPortJ::Pin<6, drv::Active::Low>;
84  static constexpr auto& ButtonD = GPIOPortJ::Pin<7, drv::Active::Low>;
85 
86  static constexpr auto& DriverA = GPIOPortB::Pin<3>;
87  static constexpr auto& LD5 = DriverA;
88  static constexpr auto& LDE = DriverA;
89  static constexpr auto& DriverB = GPIOPortB::Pin<4>;
90  static constexpr auto& LD6 = DriverB;
91  static constexpr auto& LDF = DriverB;
92  static constexpr auto& DriverC = GPIOPortB::Pin<14>;
93  static constexpr auto& LD7 = DriverC;
94  static constexpr auto& LDG = DriverC;
95  static constexpr auto& DriverD = GPIOPortB::Pin<15>;
96  static constexpr auto& LD8 = DriverD;
97  static constexpr auto& LDH = DriverD;
98 
105 
111  static constexpr auto& ADCA = ADConverter1::Channel<0, 0, (1 << 16) - 1>;
112  static constexpr auto& ADCB = ADConverter1::Channel<1, 0, (1 << 16) - 1>;
113  static constexpr auto& ADCC = ADConverter1::Channel<2, 0, (1 << 16) - 1>;
114  static constexpr auto& ADCD = ADConverter1::Channel<6, 0, (1 << 16) - 1>;
115  static constexpr auto& ADCPotentiometer = ADConverter1::Channel<15, 0, (1 << 16) - 1>;
116 
124 
130  static constexpr auto& DACA = DAConverter1::Channel<1, 0, (1 << 16) - 1>;
131  static constexpr auto& DACB = DAConverter2::Channel<2, 0, (1 << 16) - 1>;
132 
142 
148  using SPIA = bsp::drv::SPI<std::array{ 0, 0 }, bsp::asg::drv::SPI>;
149 
150  static constexpr auto& SPIACE = GPIOPortI::Pin<0>;
151  static constexpr auto& SK9822_EN = GPIOPortE::Pin<10>;
152 
159 
161  }
162 
163 #endif
bsp::drv::SPI
Base class for SPI abstraction.
Definition: spi.hpp:51
i2c.hpp
I2C abstraction implementation for Asgard.
spi.hpp
SPI abstraction implementation for Asgard.
bsp::drv::I2C
Base class for I2C abstraction.
Definition: i2c.hpp:43
gpio.hpp
GPIO Pin abstraction implementation for Asgard.
adc.hpp
ADC Channel abstraction implementation for Asgard.
bsp::drv::GPIOPort
Base class for GPIO port abstraction.
Definition: gpio.hpp:48
bsp::drv::ADConverter
Base class for ADC abstraction.
Definition: adc.hpp:39
bsp::drv::Display
Base class for Display abstraction.
Definition: display.hpp:45
bsp
Definition: cortex.hpp:33
dac.hpp
DAC Channel abstraction implementation for Asgard.
cortex.hpp
Core control functions for Asgard.
bsp::asg::drv::SPI
SPI implementation for Asgard.
Definition: spi.hpp:47
bsp::drv::DAConverter
Base class for DAC abstraction.
Definition: dac.hpp:40