unleashed-firmware/firmware/targets/f7/furi-hal/furi-hal-uart.h
Nikolay Minaylov f8d3cc251c
[FL-1984, FL-2004, FL-2010] USB CDC Fixes (#801)
* [FL-1984, FL-2004] USB-UART Fixes, test with high timer task priority
* added forgotten file
* switch from EventFlags to ThreadFlags
* [FL-1984, FL-2010] USB-UART and furi-hal-vcp rework
* Scripts: modernize string formatting.

Co-authored-by: あく <alleteam@gmail.com>
2021-11-04 22:33:28 +03:00

33 lines
645 B
C

#pragma once
#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
FuriHalUartIdUSART1,
FuriHalUartIdLPUART1,
} FuriHalUartId;
typedef enum {
UartIrqEventRXNE,
UartIrqEventIDLE,
//TODO: more events
} UartIrqEvent;
void furi_hal_uart_init(FuriHalUartId ch, uint32_t baud);
void furi_hal_uart_deinit(FuriHalUartId ch);
void furi_hal_uart_set_br(FuriHalUartId ch, uint32_t baud);
void furi_hal_uart_tx(FuriHalUartId ch, uint8_t* buffer, size_t buffer_size);
void furi_hal_uart_set_irq_cb(FuriHalUartId ch, void (*cb)(UartIrqEvent ev, uint8_t data));
#ifdef __cplusplus
}
#endif