@@ -148,6 +148,7 @@ pub struct Cli {
148148 pub inputmodules : bool ,
149149 pub input_deck_mode : Option < InputDeckModeArg > ,
150150 pub charge_limit : Option < Option < u8 > > ,
151+ pub get_gpio : Option < String > ,
151152 pub fp_brightness : Option < Option < FpBrightnessArg > > ,
152153 pub kblight : Option < Option < u8 > > ,
153154 pub console : Option < ConsoleArg > ,
@@ -720,6 +721,13 @@ pub fn run_with_args(args: &Cli, _allupdate: bool) -> i32 {
720721 ec. set_input_deck_mode ( ( * mode) . into ( ) ) . unwrap ( ) ;
721722 } else if let Some ( maybe_limit) = args. charge_limit {
722723 print_err ( handle_charge_limit ( & ec, maybe_limit) ) ;
724+ } else if let Some ( gpio_name) = & args. get_gpio {
725+ print ! ( "Getting GPIO value {}: " , gpio_name) ;
726+ if let Ok ( value) = ec. get_gpio ( gpio_name) {
727+ println ! ( "{:?}" , value) ;
728+ } else {
729+ println ! ( "Not found" ) ;
730+ }
723731 } else if let Some ( maybe_brightness) = & args. fp_brightness {
724732 print_err ( handle_fp_brightness ( & ec, * maybe_brightness) ) ;
725733 } else if let Some ( Some ( kblight) ) = args. kblight {
@@ -979,6 +987,7 @@ Options:
979987 --inputmodules Show status of the input modules (Framework 16 only)
980988 --input-deck-mode Set input deck power mode [possible values: auto, off, on] (Framework 16 only)
981989 --charge-limit [<VAL>] Get or set battery charge limit (Percentage number as arg, e.g. '100')
990+ --get-gpio <GET_GPIO> Get GPIO value by name
982991 --fp-brightness [<VAL>]Get or set fingerprint LED brightness level [possible values: high, medium, low]
983992 --kblight [<KBLIGHT>] Set keyboard backlight percentage or get, if no value provided
984993 --console <CONSOLE> Get EC console, choose whether recent or to follow the output [possible values: recent, follow]
0 commit comments