Lazuli
Loading...
Searching...
No Matches
serial.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: GPL-3.0-only
3 * This file is part of Lazuli.
4 */
5
18#ifndef LAZULI_SERIAL_H
19#define LAZULI_SERIAL_H
20
21#include <Lazuli/common.h>
22
24
51
62 __LZ_SERIAL_STOP_BITS_ENUM_BEGIN = -1,
63
70
75
82 __LZ_SERIAL_STOP_BITS_ENUM_END
83
85};
86
97 __LZ_SERIAL_PARITY_BIT_ENUM_BEGIN = -1,
98
105
110
115
122 __LZ_SERIAL_PARITY_BIT_ENUM_END
123
125};
126
137 __LZ_SERIAL_SIZE_ENUM_BEGIN = -1,
138
145
150
155
160
167 __LZ_SERIAL_SIZE_ENUM_END
168
170};
171
182 __LZ_SERIAL_SPEED_ENUM_BEGIN = -1,
183
190
195
200
205
212 __LZ_SERIAL_SPEED_ENUM_END
213
215};
216
248
258void
259Lz_Serial_GetConfiguration(Lz_SerialConfiguration * const serialConfiguration);
260
275void
276Lz_Serial_SetConfiguration(Lz_SerialConfiguration * const serialConfiguration);
277
279
280#endif /* LAZULI_SERIAL_H */
Basic type definitions and useful macros.
#define _EXTERN_C_DECL_BEGIN
Open C++ header file declarations.
Definition common.h:39
#define _EXTERN_C_DECL_END
Close C++ header file declarations.
Definition common.h:44
#define POSITION(X)
Define a constant bit at position X, starting from index 0.
Definition common_asm.h:30
void Lz_Serial_GetConfiguration(Lz_SerialConfiguration *const serialConfiguration)
Retrieve the configuration of the serial line.
Definition serial.c:20
Lz_SerialSpeed
Define the baud rate of the serial line.
Definition serial.h:175
@ LZ_SERIAL_SPEED_4800
Use a 4800 baud rate on the serial line.
Definition serial.h:194
@ LZ_SERIAL_SPEED_2400
Use a 2400 baud rate on the serial line.
Definition serial.h:189
@ LZ_SERIAL_SPEED_19200
Use a 19200 baud rate on the serial line.
Definition serial.h:204
@ LZ_SERIAL_SPEED_9600
Use a 9600 baud rate on the serial line.
Definition serial.h:199
Lz_SerialParityBit
Define the kind of parity bit to use on serial line.
Definition serial.h:90
@ LZ_SERIAL_PARITY_EVEN
Use even parity bit.
Definition serial.h:109
@ LZ_SERIAL_PARITY_ODD
Use odd parity bit.
Definition serial.h:114
@ LZ_SERIAL_PARITY_NONE
Use no parity bit.
Definition serial.h:104
Lz_SerialSize
Define the size of the character used on serial line.
Definition serial.h:130
@ LZ_SERIAL_SIZE_6
Use 6-bit character size on serial line.
Definition serial.h:149
@ LZ_SERIAL_SIZE_7
Use 7-bit character size on serial line.
Definition serial.h:154
@ LZ_SERIAL_SIZE_5
Use 5-bit character size on serial line.
Definition serial.h:144
@ LZ_SERIAL_SIZE_8
Use 8-bit character size on serial line.
Definition serial.h:159
void Lz_Serial_SetConfiguration(Lz_SerialConfiguration *const serialConfiguration)
Set the configuration of the serial line.
Definition serial.c:32
Lz_SerialEnableFlags
Define flags for enabling/disabling serial transmission/reception.
Definition serial.h:30
@ LZ_SERIAL_ENABLE_ALL
Enable both serial transmission and reception.
Definition serial.h:49
@ LZ_SERIAL_ENABLE_RECEIVE
Enable serial reception.
Definition serial.h:44
@ LZ_SERIAL_DISABLE_ALL
Disable both serial transmission and reception.
Definition serial.h:34
@ LZ_SERIAL_ENABLE_TRANSMIT
Enable serial transmission.
Definition serial.h:39
Lz_SerialStopBits
Define the number of stop bits to use on serial line.
Definition serial.h:55
@ LZ_SERIAL_STOP_BITS_1
Use 1 stop bit.
Definition serial.h:69
@ LZ_SERIAL_STOP_BITS_2
Use 2 stop bits.
Definition serial.h:74
Represents the configuration of a serial interface.
Definition serial.h:222
enum Lz_SerialParityBit parityBit
The kind of parity bit.
Definition serial.h:236
enum Lz_SerialStopBits stopBits
The number of stop bits.
Definition serial.h:231
enum Lz_SerialEnableFlags enableFlags
The enable/disable Tx/Rx options.
Definition serial.h:226
enum Lz_SerialSize size
The size of the character.
Definition serial.h:241
enum Lz_SerialSpeed speed
The baud rate.
Definition serial.h:246