Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • avn/swd/miosix-kernel
  • emilio.corigliano/miosix-kernel
2 results
Select Git revision
Show changes
Commits on Source (1)
...@@ -376,6 +376,13 @@ void IRQbspInit() ...@@ -376,6 +376,13 @@ void IRQbspInit()
can::tx::mode(Mode::ALTERNATE); can::tx::mode(Mode::ALTERNATE);
can::tx::alternateFunction(9); can::tx::alternateFunction(9);
timers::tim4ch1::mode(Mode::ALTERNATE);
timers::tim4ch1::alternateFunction(2);
timers::tim8ch2::mode(Mode::ALTERNATE);
timers::tim8ch2::alternateFunction(3);
camMosfet::mode(Mode::OUTPUT);
using namespace sensors; using namespace sensors;
ads1118::cs::mode(Mode::OUTPUT); ads1118::cs::mode(Mode::OUTPUT);
...@@ -400,14 +407,10 @@ void IRQbspInit() ...@@ -400,14 +407,10 @@ void IRQbspInit()
using namespace inputs; using namespace inputs;
vbat::mode(Mode::INPUT_ANALOG); vbat::mode(Mode::INPUT_ANALOG);
launchpad::mode(Mode::INPUT);
nosecone_detach::mode(Mode::INPUT);
expulsion::mode(Mode::INPUT); expulsion::mode(Mode::INPUT);
using namespace actuators; using namespace actuators;
nosecone::servo::mode(Mode::ALTERNATE);
nosecone::servo::alternateFunction(2);
nosecone::th_cut_input::mode(Mode::OUTPUT); nosecone::th_cut_input::mode(Mode::OUTPUT);
nosecone::thermal_cutter_1::enable::mode(Mode::OUTPUT); nosecone::thermal_cutter_1::enable::mode(Mode::OUTPUT);
...@@ -418,13 +421,9 @@ void IRQbspInit() ...@@ -418,13 +421,9 @@ void IRQbspInit()
nosecone::thermal_cutter_2::enable::low(); nosecone::thermal_cutter_2::enable::low();
nosecone::thermal_cutter_2::cutter_sens::mode(Mode::INPUT_ANALOG); nosecone::thermal_cutter_2::cutter_sens::mode(Mode::INPUT_ANALOG);
airbrakes::servo::mode(Mode::ALTERNATE);
airbrakes::servo::alternateFunction(3);
using namespace aux; using namespace aux;
sense_aux_1::mode(Mode::INPUT); sense_aux_1::mode(Mode::INPUT);
sense_aux_2::mode(Mode::INPUT);
aux_pd_pu::mode(Mode::OUTPUT); aux_pd_pu::mode(Mode::OUTPUT);
aux_spi1_cs::mode(Mode::OUTPUT); aux_spi1_cs::mode(Mode::OUTPUT);
...@@ -433,6 +432,7 @@ void IRQbspInit() ...@@ -433,6 +432,7 @@ void IRQbspInit()
led_red1::mode(Mode::OUTPUT); led_red1::mode(Mode::OUTPUT);
led_red2::mode(Mode::OUTPUT); led_red2::mode(Mode::OUTPUT);
led_blue1::mode(Mode::OUTPUT); led_blue1::mode(Mode::OUTPUT);
led_ring::mode(Mode::OUTPUT);
using namespace xbee; using namespace xbee;
......
...@@ -34,11 +34,12 @@ ...@@ -34,11 +34,12 @@
#define BSP_IMPL_H #define BSP_IMPL_H
#include "config/miosix_settings.h" #include "config/miosix_settings.h"
#include "interfaces/gpio.h"
#include "drivers/stm32_hardware_rng.h" #include "drivers/stm32_hardware_rng.h"
#include "hwmapping.h" #include "hwmapping.h"
#include "interfaces/gpio.h"
namespace miosix { namespace miosix
{
/** /**
\addtogroup Hardware \addtogroup Hardware
...@@ -60,11 +61,13 @@ void configureSdram(); ...@@ -60,11 +61,13 @@ void configureSdram();
inline void ledOn() inline void ledOn()
{ {
leds::led_blue1::high(); leds::led_blue1::high();
leds::led_ring::high();
} }
inline void ledOff() inline void ledOff()
{ {
leds::led_blue1::low(); leds::led_blue1::low();
leds::led_ring::low();
} }
/** /**
......
...@@ -76,12 +76,22 @@ using tx = Gpio<GPIOA_BASE, 0>; ...@@ -76,12 +76,22 @@ using tx = Gpio<GPIOA_BASE, 0>;
using rx = Gpio<GPIOA_BASE, 1>; using rx = Gpio<GPIOA_BASE, 1>;
} // namespace uart4 } // namespace uart4
// CAN1
namespace can namespace can
{ // CAN1 {
using rx = Gpio<GPIOA_BASE, 11>; using rx = Gpio<GPIOA_BASE, 11>;
using tx = Gpio<GPIOA_BASE, 12>; using tx = Gpio<GPIOA_BASE, 12>;
} // namespace can } // namespace can
// Servo motors timers
namespace timers
{
using tim4ch1 = Gpio<GPIOD_BASE, 12>; // Servo 1
using tim8ch2 = Gpio<GPIOC_BASE, 7>; // Servo 2
} // namespace timers
using camMosfet = Gpio<GPIOC_BASE, 14>;
} // namespace interfaces } // namespace interfaces
namespace sensors namespace sensors
...@@ -120,17 +130,21 @@ using cs = Gpio<GPIOD_BASE, 7>; ...@@ -120,17 +130,21 @@ using cs = Gpio<GPIOD_BASE, 7>;
namespace inputs namespace inputs
{ {
using vbat = Gpio<GPIOF_BASE, 7>; using vbat = Gpio<GPIOF_BASE, 7>;
using launchpad = Gpio<GPIOE_BASE, 4>; // launchpad detach using expulsion = Gpio<GPIOE_BASE, 4>;
using nosecone_detach = Gpio<GPIOC_BASE, 14>; // nosecone detach
using expulsion = Gpio<GPIOB_BASE, 7>; // expulsion sensor
} // namespace inputs } // namespace inputs
namespace actuators namespace actuators
{ {
namespace servos
{
using servo1 = interfaces::timers::tim4ch1;
using servo2 = interfaces::timers::tim8ch2;
} // namespace servos
namespace nosecone namespace nosecone
{ {
using servo = Gpio<GPIOD_BASE, 12>; // Pwm expulsion servo, TIM4_CH1
using th_cut_input = Gpio<GPIOE_BASE, 6>; // Input thermal cutters using th_cut_input = Gpio<GPIOE_BASE, 6>; // Input thermal cutters
namespace thermal_cutter_1 namespace thermal_cutter_1
...@@ -147,17 +161,11 @@ using cutter_sens = Gpio<GPIOF_BASE, 8>; // ADC3 CH6 ...@@ -147,17 +161,11 @@ using cutter_sens = Gpio<GPIOF_BASE, 8>; // ADC3 CH6
} // namespace nosecone } // namespace nosecone
namespace airbrakes
{
using servo = Gpio<GPIOC_BASE, 7>; // Airbrakes PWM, TIM8_CH2
} // namespace airbrakes
} // namespace actuators } // namespace actuators
namespace aux namespace aux
{ {
using sense_aux_1 = Gpio<GPIOE_BASE, 2>; using sense_aux_1 = Gpio<GPIOE_BASE, 2>;
using sense_aux_2 = Gpio<GPIOE_BASE, 3>;
using aux_pd_pu = Gpio<GPIOC_BASE, 5>; using aux_pd_pu = Gpio<GPIOC_BASE, 5>;
using aux_spi1_cs = Gpio<GPIOG_BASE, 7>; using aux_spi1_cs = Gpio<GPIOG_BASE, 7>;
} // namespace aux } // namespace aux
...@@ -167,14 +175,15 @@ namespace leds ...@@ -167,14 +175,15 @@ namespace leds
using led_red1 = Gpio<GPIOG_BASE, 7>; using led_red1 = Gpio<GPIOG_BASE, 7>;
using led_red2 = Gpio<GPIOG_BASE, 10>; using led_red2 = Gpio<GPIOG_BASE, 10>;
using led_blue1 = Gpio<GPIOG_BASE, 14>; using led_blue1 = Gpio<GPIOG_BASE, 14>;
using led_ring = Gpio<GPIOE_BASE, 3>;
/** /**
* These are conencted to the enable pin of the thermal cutters and the cs of * These are connected to the enable pin of the thermal cutters and the cs of
* the lis3mdl magnetometer. * the lis3mdl magnetometer.
*/ */
using led_blue2 = Gpio<GPIOG_BASE, 2>; // using led_blue2 = Gpio<GPIOG_BASE, 2>;
using led_green1 = Gpio<GPIOG_BASE, 6>; // using led_green1 = Gpio<GPIOG_BASE, 6>;
using led_green2 = Gpio<GPIOD_BASE, 11>; // using led_green2 = Gpio<GPIOD_BASE, 11>;
} // namespace leds } // namespace leds
namespace xbee namespace xbee
......