OpenBIC
OpenSource Bridge-IC
gpio_shell.c File Reference
#include "gpio_shell.h"
#include "hal_gpio.h"
#include "plat_gpio.h"
#include <drivers/gpio.h>
#include <stdio.h>
Include dependency graph for gpio_shell.c:

Macros

#define GET_BIT_VAL(val, n)   ((val & BIT(n)) >> (n))
 
#define GPIO_DEVICE_PREFIX   "GPIO0_"
 

Enumerations

enum  GPIO_ACCESS { GPIO_READ , GPIO_WRITE }
 

Functions

void cmd_gpio_cfg_list_group (const struct shell *shell, size_t argc, char **argv)
 
void cmd_gpio_cfg_list_all (const struct shell *shell, size_t argc, char **argv)
 
void cmd_gpio_cfg_get (const struct shell *shell, size_t argc, char **argv)
 
void cmd_gpio_cfg_set_val (const struct shell *shell, size_t argc, char **argv)
 
void cmd_gpio_cfg_set_int_type (const struct shell *shell, size_t argc, char **argv)
 
void cmd_gpio_muti_fn_ctl_list (const struct shell *shell, size_t argc, char **argv)
 
void device_gpio_name_get (size_t idx, struct shell_static_entry *entry)
 

Variables

int num_of_pin_in_one_group_lst [GPIO_GROUP_NUM] = { 32, 32, 32, 32, 32, 16 }
 
char GPIO_GROUP_NAME_LST [GPIO_GROUP_NUM][10]
 
gpio_flags_t int_type_table []
 

Macro Definition Documentation

◆ GET_BIT_VAL

#define GET_BIT_VAL (   val,
 
)    ((val & BIT(n)) >> (n))

◆ GPIO_DEVICE_PREFIX

#define GPIO_DEVICE_PREFIX   "GPIO0_"

Enumeration Type Documentation

◆ GPIO_ACCESS

Enumerator
GPIO_READ 
GPIO_WRITE 

Function Documentation

◆ cmd_gpio_cfg_get()

void cmd_gpio_cfg_get ( const struct shell *  shell,
size_t  argc,
char **  argv 
)

◆ cmd_gpio_cfg_list_all()

void cmd_gpio_cfg_list_all ( const struct shell *  shell,
size_t  argc,
char **  argv 
)

◆ cmd_gpio_cfg_list_group()

void cmd_gpio_cfg_list_group ( const struct shell *  shell,
size_t  argc,
char **  argv 
)

◆ cmd_gpio_cfg_set_int_type()

void cmd_gpio_cfg_set_int_type ( const struct shell *  shell,
size_t  argc,
char **  argv 
)
Here is the call graph for this function:

◆ cmd_gpio_cfg_set_val()

void cmd_gpio_cfg_set_val ( const struct shell *  shell,
size_t  argc,
char **  argv 
)

◆ cmd_gpio_muti_fn_ctl_list()

void cmd_gpio_muti_fn_ctl_list ( const struct shell *  shell,
size_t  argc,
char **  argv 
)

◆ device_gpio_name_get()

void device_gpio_name_get ( size_t  idx,
struct shell_static_entry *  entry 
)

Variable Documentation

◆ GPIO_GROUP_NAME_LST

char GPIO_GROUP_NAME_LST[GPIO_GROUP_NUM][10]
Initial value:
= { "GPIO0_A_D", "GPIO0_E_H", "GPIO0_I_L",
"GPIO0_M_P", "GPIO0_Q_T", "GPIO0_U_V" }

◆ int_type_table

gpio_flags_t int_type_table[]
Initial value:
= { GPIO_INT_DISABLE, GPIO_INT_EDGE_RISING, GPIO_INT_EDGE_FALLING,
GPIO_INT_EDGE_BOTH, GPIO_INT_LEVEL_LOW, GPIO_INT_LEVEL_HIGH }

◆ num_of_pin_in_one_group_lst

int num_of_pin_in_one_group_lst[GPIO_GROUP_NUM] = { 32, 32, 32, 32, 32, 16 }