2021-07-20 17:14:42 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2021-10-21 18:12:20 +00:00
|
|
|
typedef enum {
|
|
|
|
UartIrqEventRXNE,
|
|
|
|
UartIrqEventIDLE,
|
|
|
|
//TODO: more events
|
|
|
|
} UartIrqEvent;
|
|
|
|
|
2021-08-08 18:03:25 +00:00
|
|
|
void furi_hal_console_init();
|
2021-07-20 17:14:42 +00:00
|
|
|
|
2021-08-08 18:03:25 +00:00
|
|
|
void furi_hal_console_tx(const uint8_t* buffer, size_t buffer_size);
|
2021-07-20 17:14:42 +00:00
|
|
|
|
2021-09-21 09:48:08 +00:00
|
|
|
void furi_hal_console_tx_with_new_line(const uint8_t* buffer, size_t buffer_size);
|
|
|
|
|
2021-08-22 10:43:45 +00:00
|
|
|
/**
|
|
|
|
* Printf-like plain uart interface
|
|
|
|
* @warning Will not work in ISR context
|
|
|
|
* @param format
|
|
|
|
* @param ...
|
|
|
|
*/
|
2021-08-18 22:06:18 +00:00
|
|
|
void furi_hal_console_printf(const char format[], ...);
|
|
|
|
|
2021-08-22 10:43:45 +00:00
|
|
|
void furi_hal_console_puts(const char* data);
|
|
|
|
|
2021-10-21 18:12:20 +00:00
|
|
|
|
|
|
|
void furi_hal_usart_init();
|
|
|
|
|
|
|
|
void furi_hal_usart_deinit();
|
|
|
|
|
|
|
|
void furi_hal_usart_set_br(uint32_t baud);
|
|
|
|
|
|
|
|
void furi_hal_usart_tx(const uint8_t* buffer, size_t buffer_size);
|
|
|
|
|
|
|
|
void furi_hal_usart_set_irq_cb(void (*cb)(UartIrqEvent ev, uint8_t data));
|
|
|
|
|
|
|
|
|
2021-07-20 17:14:42 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|