1/* 2 * Copyright (c) 2023 Unionman Technology Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://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, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15export enum GpioName { 16 GPIO_01, 17 GPIO_02, 18 GPIO_03, 19 GPIO_04, 20 GPIO_05, 21 GPIO_06, 22 GPIO_07, 23 GPIO_08, 24 GPIO_09, 25 GPIO_10, 26 GPIO_11, 27 GPIO_12, 28 GPIO_13, 29 GPIO_14, 30 GPIO_15, 31 GPIO_16, 32} 33 34export enum Dir { 35 input, 36 output, 37 error 38} 39 40export enum Val { 41 low, 42 height 43} 44 45export class Gpio { 46 constructor(gpio: GpioName, direction: Dir); 47 48 read(): Val; 49 50 write(val: Val): void; 51} 52