NHAL Interface
v0.5.0
Hardware Abstraction Layer Interface for Embedded Systems
Loading...
Searching...
No Matches
include
nhal_uart_types.h
Go to the documentation of this file.
1
12
#ifndef NHAL_UART_TYPES_H
13
#define NHAL_UART_TYPES_H
14
15
#include <stddef.h>
16
#include <stdint.h>
17
18
#include "
nhal_common.h
"
19
20
typedef
uint8_t
nhal_uart_bus_id
;
21
22
23
typedef
enum
{
24
NHAL_UART_PARITY_NONE
,
25
NHAL_UART_PARITY_EVEN
,
26
NHAL_UART_PARITY_ODD
,
27
}
nhal_uart_parity_t
;
28
29
typedef
enum
{
30
NHAL_UART_STOP_BITS_1
,
31
NHAL_UART_STOP_BITS_2
,
32
}
nhal_uart_stop_bits_t
;
33
34
typedef
enum
{
35
NHAL_UART_DATA_BITS_7
,
36
NHAL_UART_DATA_BITS_8
,
37
}
nhal_uart_data_bits_t
;
38
39
struct
nhal_uart_config
{
40
uint32_t
baudrate
;
41
nhal_uart_parity_t
parity
;
42
nhal_uart_stop_bits_t
stop_bits
;
43
nhal_uart_data_bits_t
data_bits
;
44
struct
nhal_uart_impl_config *
impl_config
;
45
};
46
50
struct
nhal_uart_context
{
51
nhal_uart_bus_id
uart_bus_id
;
52
53
struct
nhal_uart_impl_ctx *
impl_ctx
;
54
55
// Async extensions handled separately in async context
56
};
57
58
typedef
void (*
nhal_uart_tx_complete_cb_t
)(
void
*context);
59
typedef
void (*
nhal_uart_rx_complete_cb_t
)(
void
*context);
60
typedef
void (*
nhal_uart_error_cb_t
)(
void
*context);
61
62
63
#endif
/* NHAL_UART_TYPES_H */
nhal_common.h
nhal_uart_stop_bits_t
nhal_uart_stop_bits_t
Definition
nhal_uart_types.h:29
NHAL_UART_STOP_BITS_1
@ NHAL_UART_STOP_BITS_1
1 stop bit is used.
Definition
nhal_uart_types.h:30
NHAL_UART_STOP_BITS_2
@ NHAL_UART_STOP_BITS_2
2 stop bits are used.
Definition
nhal_uart_types.h:31
nhal_uart_tx_complete_cb_t
void(* nhal_uart_tx_complete_cb_t)(void *context)
Definition
nhal_uart_types.h:58
nhal_uart_error_cb_t
void(* nhal_uart_error_cb_t)(void *context)
Definition
nhal_uart_types.h:60
nhal_uart_bus_id
uint8_t nhal_uart_bus_id
Definition
nhal_uart_types.h:20
nhal_uart_data_bits_t
nhal_uart_data_bits_t
Definition
nhal_uart_types.h:34
NHAL_UART_DATA_BITS_7
@ NHAL_UART_DATA_BITS_7
7 data bits are used.
Definition
nhal_uart_types.h:35
NHAL_UART_DATA_BITS_8
@ NHAL_UART_DATA_BITS_8
8 data bits are used.
Definition
nhal_uart_types.h:36
nhal_uart_parity_t
nhal_uart_parity_t
Definition
nhal_uart_types.h:23
NHAL_UART_PARITY_EVEN
@ NHAL_UART_PARITY_EVEN
Parity bit is set such that the total number of '1' bits is even.
Definition
nhal_uart_types.h:25
NHAL_UART_PARITY_ODD
@ NHAL_UART_PARITY_ODD
Parity bit is set such that the total number of '1' bits is odd.
Definition
nhal_uart_types.h:26
NHAL_UART_PARITY_NONE
@ NHAL_UART_PARITY_NONE
No parity bit is used.
Definition
nhal_uart_types.h:24
nhal_uart_rx_complete_cb_t
void(* nhal_uart_rx_complete_cb_t)(void *context)
Definition
nhal_uart_types.h:59
nhal_uart_config
Definition
nhal_uart_types.h:39
nhal_uart_config::baudrate
uint32_t baudrate
The baud rate for communication (bits per second).
Definition
nhal_uart_types.h:40
nhal_uart_config::stop_bits
nhal_uart_stop_bits_t stop_bits
The number of stop bits (e.g., 1 or 2).
Definition
nhal_uart_types.h:42
nhal_uart_config::data_bits
nhal_uart_data_bits_t data_bits
The number of data bits (e.g., 7 or 8).
Definition
nhal_uart_types.h:43
nhal_uart_config::parity
nhal_uart_parity_t parity
The parity setting (none, even, or odd).
Definition
nhal_uart_types.h:41
nhal_uart_config::impl_config
struct nhal_uart_impl_config * impl_config
Definition
nhal_uart_types.h:44
nhal_uart_context
Base UART context - always present, minimal footprint.
Definition
nhal_uart_types.h:50
nhal_uart_context::uart_bus_id
nhal_uart_bus_id uart_bus_id
Definition
nhal_uart_types.h:51
nhal_uart_context::impl_ctx
struct nhal_uart_impl_ctx * impl_ctx
Definition
nhal_uart_types.h:53
Generated by
1.9.8