Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ZigEmbeddedGroup/serial
Serial port configuration library for Zig
https://github.com/ZigEmbeddedGroup/serial
serial serial-port uart zig zig-package ziglang
Last synced: 2 months ago
JSON representation
Serial port configuration library for Zig
- Host: GitHub
- URL: https://github.com/ZigEmbeddedGroup/serial
- Owner: ZigEmbeddedGroup
- License: mit
- Created: 2020-04-19T18:45:34.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-01-24T17:18:06.000Z (5 months ago)
- Last Synced: 2024-04-13T21:03:20.663Z (2 months ago)
- Topics: serial, serial-port, uart, zig, zig-package, ziglang
- Language: Zig
- Homepage:
- Size: 21.5 KB
- Stars: 40
- Watchers: 4
- Forks: 11
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Lists
- awesome-zig - zig-serial🗒️Serial port configuration library for Zig
- awesome-zig - ZigEmbeddedGroup/serial
README
# Zig Serial Port Helper
Helper library for configuring and listing serial ports.
## Features
- Basic serial port configuration
- Baud Rate
- Parity (none, even, odd, mark, space)
- Stop Bits (one, two)
- Handshake (none, hardware, software)
- Byte Size (5, 6, 7, 8)
- Flushing of the serial port receive buffers
- Supports windows and linux with the API
- Listing available serial ports## Example
```zig
// Serial ports are just files, \\.\COM1 for COM1 on windows:
var serial = try std.fs.cwd().openFile("\\\\.\\COM1", .{ .mode = .read_write }) ;
defer serial.close();try zig_serial.configureSerialPort(serial, zig_serial.SerialConfig{
.baud_rate = 19200,
.word_size = 8,
.parity = .none,
.stop_bits = .one,
.handshake = .none,
});
```