blob: 5bf20481799c8623d4be5c4b5c9f51b1c4620f1c [file] [log] [blame]
edition = "2023";
package milotic_tlbmc;
enum GpioDirection {
// For GPIO input/output, we can set the GPIO line to be input or output.
// Note that it's not possible to read the value of an output GPIO line.
GPIO_DIRECTION_UNKNOWN = 0;
GPIO_DIRECTION_INPUT = 1;
GPIO_DIRECTION_OUTPUT = 2;
}
enum GpioEventType {
// For GPIO event monitoring, we can monitor the rising edge, falling edge,
// or both edges.
GPIO_EVENT_UNKNOWN = 0;
GPIO_EVENT_RISING = 1;
GPIO_EVENT_FALLING = 2;
GPIO_EVENT_BOTH = 3;
}
message GpioEventConfig {
GpioEventType event_type = 1;
// If true, the event callback will be triggered only once. Otherwise, the
// event callback will be triggered every time the GPIO line changes.
bool one_time_request = 2;
}
message GpioIdentifier {
string chip_id = 1;
int32 gpio_num = 2;
}
message GpioConfig {
// The name of the GPIO. This is used only for response and logging.
string name = 1;
// The identifier of the GPIO line. There are two ways to identify the GPIO
// line:
// 1. line_name: The name of the GPIO line.
// 2. gpio_identifier: The chip_id and gpio_num of the GPIO line.
oneof identifier {
string line_name = 2;
GpioIdentifier gpio_identifier = 3;
}
// The request type of the GPIO line. This is used to set the how the GPIO
// line is used.
oneof request_type {
GpioDirection gpio_direction = 4;
GpioEventConfig gpio_event_config = 5;
}
}
message GpioConfigs {
repeated GpioConfig gpio_configs = 1;
}