rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
pd_uart.h
Go to the documentation of this file.
1
21
22#pragma once
23
24#include <stdbool.h>
25#include <stddef.h>
26#include <stdint.h>
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
42bool pd_uart_open(uint8_t tx, uint8_t rx, uint32_t baud);
43
50void pd_uart_baud(uint32_t baud);
51
53void pd_uart_close(void);
54
60void pd_uart_attach(void *ctx);
66void pd_uart_detach(void *ctx);
74void pd_uart_send(void *ctx, const uint8_t *p, size_t n);
75
82bool pd_uart_getc(uint8_t *b);
83
84#ifdef __cplusplus
85}
86#endif
bool pd_uart_getc(uint8_t *b)
A received byte, or false for none.
Definition pd_uart.c:158
void pd_uart_attach(void *ctx)
Attach the UART to the pins for one transaction.
Definition pd_uart.c:110
void pd_uart_detach(void *ctx)
Detach the UART; the pins go back to pulled-down inputs.
Definition pd_uart.c:134
bool pd_uart_open(uint8_t tx, uint8_t rx, uint32_t baud)
Claim the state machines for tx and rx at baud.
Definition pd_uart.c:39
void pd_uart_baud(uint32_t baud)
Another rate for both machines, between transactions only: nothing happens while the UART is attached...
Definition pd_uart.c:100
void pd_uart_send(void *ctx, const uint8_t *p, size_t n)
Send bytes on the attached UART.
Definition pd_uart.c:146
void pd_uart_close(void)
Release them; the pins stay at rest.
Definition pd_uart.c:70