21 lines
520 B
C++
21 lines
520 B
C++
#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;
|
|
}
|
|
|
|
void _HC_12(char *string)
|
|
{
|
|
uart_tx_program_puts(HC_12_PIO, HC_12_PIO_SM_TX, string);
|
|
sleep_ms(100);
|
|
|
|
return;
|
|
}
|