Danger-alarm/SOFTWARE-FreeRTOS/Source/HC-12.cpp

21 lines
520 B
C++
Raw Normal View History

2024-06-03 16:27:41 +08:00
#include "HC-12.hpp"
void _HC_12_INIT()
{
uint tx_offset = pio_add_program(pio1, &uart_tx_program);
uart_tx_program_init(HC_12_PIO, HC_12_PIO_SM_TX, tx_offset, HC_12_PIO_TX_PIN, HC_12_PIO_SERIAL_BAUD);
uint rx_offset = pio_add_program(pio1, &uart_rx_program);
uart_rx_program_init(HC_12_PIO, HC_12_PIO_SM_RX, rx_offset, HC_12_PIO_RX_PIN, HC_12_PIO_SERIAL_BAUD);
return;
}
2024-06-07 00:10:17 +08:00
void _HC_12(char *string)
2024-06-03 16:27:41 +08:00
{
uart_tx_program_puts(HC_12_PIO, HC_12_PIO_SM_TX, string);
sleep_ms(100);
return;
}