uart working but fix send char
This commit is contained in:
@@ -1,24 +1,23 @@
|
||||
#include <cstdio>
|
||||
#include "SHAL.h"
|
||||
|
||||
int main() {
|
||||
|
||||
SHAL_init();
|
||||
|
||||
PIN(E9).setPinMode(PinMode::ALTERNATE_FUNCTION_MODE);
|
||||
PIN(C0).setPinMode(PinMode::OUTPUT_MODE);
|
||||
|
||||
PIN(E9).setAlternateFunction(GPIO_Alternate_Function::AF1);
|
||||
SHAL_UART3.init(UART_Pair_Key::Tx3D8_Rx3D9);
|
||||
SHAL_UART3.begin(115200,SHAL_USART_Word_Length::Bits_8);
|
||||
|
||||
SHAL_TIM1.configurePWM(SHAL_Timer_Channel::CH1,24,2000,5);
|
||||
|
||||
SHAL_TIM1.start();
|
||||
|
||||
PIN(A3).setPinMode(PinMode::OUTPUT_MODE);
|
||||
PIN(B0).setPinMode(PinMode::ALTERNATE_FUNCTION_MODE);
|
||||
SHAL_UART3.sendChar('a');
|
||||
|
||||
while (true) {
|
||||
PIN(A3).toggle();
|
||||
PIN(B0).toggle();
|
||||
|
||||
SHAL_UART3.sendString("Hello");
|
||||
|
||||
PIN(C0).toggle();
|
||||
|
||||
SHAL_delay_ms(500);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user