Skip to content
Snippets Groups Projects
Commit 1b73f4f3 authored by luca-conterio's avatar luca-conterio
Browse files

[StrainBoard] added leds gpio and remove usart3 pins init

parent 93b84f19
Branches
No related tags found
No related merge requests found
...@@ -68,14 +68,24 @@ void IRQbspInit() ...@@ -68,14 +68,24 @@ void IRQbspInit()
spi1::miso::mode(Mode::INPUT); spi1::miso::mode(Mode::INPUT);
spi1::mosi::mode(Mode::ALTERNATE); spi1::mosi::mode(Mode::ALTERNATE);
usart3::tx::mode(Mode::ALTERNATE);
usart3::rx::mode(Mode::INPUT);
can::tx::mode(Mode::ALTERNATE); can::tx::mode(Mode::ALTERNATE);
can::rx::mode(Mode::INPUT); can::rx::mode(Mode::INPUT);
using namespace sensors; using namespace sensors;
ads1118::cs::mode(Mode::OUTPUT); ads1118::cs::mode(Mode::ALTERNATE);
using namespace leds;
led1::mode(Mode::OUTPUT);
led2::mode(Mode::OUTPUT);
led3::mode(Mode::OUTPUT);
for (uint8_t i = 0; i < 5; i++)
{
ledOn();
delayMs(100);
ledOff();
delayMs(100);
}
DefaultConsole::instance().IRQset(intrusive_ref_ptr<Device>( DefaultConsole::instance().IRQset(intrusive_ref_ptr<Device>(
new STM32Serial(defaultSerial,defaultSerialSpeed, new STM32Serial(defaultSerial,defaultSerialSpeed,
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#ifndef BSP_IMPL_H #ifndef BSP_IMPL_H
#define BSP_IMPL_H #define BSP_IMPL_H
#include "hwmapping.h"
namespace miosix { namespace miosix {
/** /**
...@@ -40,8 +42,12 @@ namespace miosix { ...@@ -40,8 +42,12 @@ namespace miosix {
\{ \{
*/ */
inline void ledOn() {} inline void ledOn() {
inline void ledOff() {} leds::led1::high();
}
inline void ledOff() {
leds::led1::low();
}
/** /**
* Polls the SD card sense GPIO * Polls the SD card sense GPIO
......
...@@ -26,6 +26,13 @@ using rx = Gpio<GPIOA_BASE, 11>; ...@@ -26,6 +26,13 @@ using rx = Gpio<GPIOA_BASE, 11>;
} }
namespace leds
{
using led1 = Gpio<GPIOB_BASE, 12>;
using led2 = Gpio<GPIOB_BASE, 13>;
using led3 = Gpio<GPIOB_BASE, 14>;
}
namespace sensors { namespace sensors {
namespace ads1118 { namespace ads1118 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment