-
Notifications
You must be signed in to change notification settings - Fork 2
/
uart.proto
37 lines (33 loc) · 1.79 KB
/
uart.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// SPDX-FileCopyrightText: 2023 Brent Rubell for Adafruit Industries
// SPDX-License-Identifier: MIT
syntax = "proto3";
package wippersnapper.uart.v1;
import "nanopb/nanopb.proto";
/**
* UARTBusData represents a message to configure a UART bus for communication with a device.
* NOTE: This message is never sent directly, it is packed inside UARTDeviceAttachRequest.
*/
message UARTBusData {
int32 baudrate = 1; /** The baudrate to use for UART communication (may be a common baud rate such as: 1200bps, 2400bps, 4800bps, 19200bps, 38400bps, 57600bps, or 115200bps). */
string pin_rx = 2; /** The pin on which to receive UART stream data. */
string pin_tx = 3; /** The pin on which to transmit UART stream data. */
bool is_invert = 4; /** Inverts the UART signal on RX and TX pins. Defaults to False. */
bool is_software_uart = 5; /** Enables software UART. Defaults to False. */
}
/**
* UARTDeviceAttachRequest represents a message sent from IO to a device
* to configure the UART bus (if not already configured) and attach a device.
*/
message UARTDeviceAttachRequest {
UARTBusData bus_info = 1; /** The UART bus configuration. */
string device_id = 2; /** The unique identifier of the device to attach to the UART bus, from Adafruit_WipperSnapper_Components. */
int32 polling_interval = 3; /** The polling interval, in milliseconds, to use for the device. */
}
/**
* UARTDeviceAttachResponse represents a message sent from a device to IO to
* confirm that a device has been attached to the UART bus.
*/
message UARTDeviceAttachResponse {
string device_id = 1; /** The unique identifier of the device to attach to the UART bus, from Adafruit_WipperSnapper_Components. */
bool is_success = 2; /** True if the UARTInitRequest was successful, False otherwise. */
}