1// Copyright 2023 The Pigweed Authors 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); you may not 4// use this file except in compliance with the License. You may obtain a copy of 5// the License at 6// 7// https://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12// License for the specific language governing permissions and limitations under 13// the License. 14 15syntax = "proto3"; 16 17package pw.digital_io; 18 19enum DigitalIoState { 20 INACTIVE = 0; 21 ACTIVE = 1; 22} 23 24message DigitalIoEnableRequest { 25 // Which line to select. 26 uint32 line_index = 1; 27 // Whether to enable or disable. 28 bool enable = 2; 29} 30 31message DigitalIoEnableResponse {} 32 33message DigitalIoSetStateRequest { 34 // Which line to select. 35 uint32 line_index = 1; 36 // Which state to set to. 37 DigitalIoState state = 2; 38} 39 40message DigitalIoSetStateResponse {} 41 42message DigitalIoGetStateRequest { 43 // Which line to select. 44 uint32 line_index = 1; 45} 46 47message DigitalIoGetStateResponse { 48 DigitalIoState state = 1; 49} 50 51service DigitalIo { 52 rpc Enable(DigitalIoEnableRequest) returns (DigitalIoEnableResponse) {} 53 rpc SetState(DigitalIoSetStateRequest) returns (DigitalIoSetStateResponse) {} 54 rpc GetState(DigitalIoGetStateRequest) returns (DigitalIoGetStateResponse) {} 55} 56