OpenBIC
OpenSource Bridge-IC
gpio_shell.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef GPIO_SHELL_H
18#define GPIO_SHELL_H
19
20#include <stdlib.h>
21#include <shell/shell.h>
22#include <drivers/gpio.h>
23
24void cmd_gpio_cfg_list_group(const struct shell *shell, size_t argc, char **argv);
25void cmd_gpio_cfg_list_all(const struct shell *shell, size_t argc, char **argv);
26void cmd_gpio_cfg_get(const struct shell *shell, size_t argc, char **argv);
27void cmd_gpio_cfg_set_val(const struct shell *shell, size_t argc, char **argv);
28void cmd_gpio_cfg_set_int_type(const struct shell *shell, size_t argc, char **argv);
29void cmd_gpio_muti_fn_ctl_list(const struct shell *shell, size_t argc, char **argv);
30void device_gpio_name_get(size_t idx, struct shell_static_entry *entry);
31
33
35 SHELL_CMD(val, NULL, "Set pin value.", cmd_gpio_cfg_set_val),
36 SHELL_CMD(int_type, NULL, "Set interrupt pin type.",
38 SHELL_SUBCMD_SET_END);
39
40/* GPIO sub commands */
42 sub_gpio_cmds,
43 SHELL_CMD(list_group, &gpio_device_name, "List all GPIO config from certain group.",
45 SHELL_CMD(list_all, NULL, "List all GPIO config.", cmd_gpio_cfg_list_all),
46 SHELL_CMD(get, NULL, "Get GPIO config", cmd_gpio_cfg_get),
47 SHELL_CMD(set, &sub_gpio_set_cmds, "Set GPIO config", NULL),
48 SHELL_CMD(multifnctl, NULL, "List all GPIO multi-function control regs.",
50 SHELL_SUBCMD_SET_END);
51
52#endif
uint8_t idx
Definition: plat_util.c:39
uint32_t val
Definition: plat_util.c:40
void cmd_gpio_muti_fn_ctl_list(const struct shell *shell, size_t argc, char **argv)
Definition: gpio_shell.c:325
void cmd_gpio_cfg_set_val(const struct shell *shell, size_t argc, char **argv)
Definition: gpio_shell.c:278
SHELL_DYNAMIC_CMD_CREATE(gpio_device_name, device_gpio_name_get)
void cmd_gpio_cfg_set_int_type(const struct shell *shell, size_t argc, char **argv)
Definition: gpio_shell.c:296
void cmd_gpio_cfg_get(const struct shell *shell, size_t argc, char **argv)
Definition: gpio_shell.c:264
SHELL_STATIC_SUBCMD_SET_CREATE(sub_gpio_set_cmds, SHELL_CMD(val, NULL, "Set pin value.", cmd_gpio_cfg_set_val), SHELL_CMD(int_type, NULL, "Set interrupt pin type.", cmd_gpio_cfg_set_int_type), SHELL_SUBCMD_SET_END)
void cmd_gpio_cfg_list_all(const struct shell *shell, size_t argc, char **argv)
Definition: gpio_shell.c:244
void device_gpio_name_get(size_t idx, struct shell_static_entry *entry)
Definition: gpio_shell.c:363
void cmd_gpio_cfg_list_group(const struct shell *shell, size_t argc, char **argv)
Definition: gpio_shell.c:178