You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
682 B
35 lines
682 B
#include "bsl_nucleo_f042k6.hpp"
|
|
#include "../csl/interfaces/pin.hpp"
|
|
#include "../csl/interfaces/delay.hpp"
|
|
#include "../csl/stm32f042/Inc/stm_pin.hpp"
|
|
|
|
int startBSL()
|
|
{
|
|
stmStart();
|
|
Delay delay;
|
|
|
|
STM_Pin<Pin_no::pin_3, Port_B_base_address> pin;
|
|
STM_Pin<Pin_no::pin_0, Port_A_base_address> pin_a0;
|
|
|
|
pin.init();
|
|
pin.setMode(Pin::mode::output);
|
|
pin.setSpeed(Pin::speed::veryFast);
|
|
|
|
pin_a0.init();
|
|
pin_a0.setMode(Pin::mode::output);
|
|
pin_a0.setSpeed(Pin::speed::veryFast);
|
|
pin_a0.setOutputState(Pin::state::pushPull);
|
|
|
|
while(1)
|
|
{
|
|
delay.ms(100);
|
|
pin.write(true);
|
|
pin_a0.write(true);
|
|
delay.ms(100);
|
|
pin.write(false);
|
|
pin_a0.write(false);
|
|
}
|
|
return 1;
|
|
}
|
|
|