OpenBIC
OpenSource Bridge-IC
shell_plat_throttle_switch.c File Reference
#include <stdlib.h>
#include <logging/log.h>
#include "plat_hook.h"
#include "plat_class.h"
#include "hal_i2c.h"
#include "plat_i2c.h"
#include "plat_user_setting.h"
#include "plat_fru.h"
#include "shell_plat_throttle_switch.h"
Include dependency graph for shell_plat_throttle_switch.c:

Classes

struct  throttle_user_settings_struct
 

Macros

#define CPLD_THROTTLE_SWITCH_ADDR   0x25
 
#define EEPROM_MAX_WRITE_TIME   5
 

Typedefs

typedef struct throttle_user_settings_struct throttle_user_settings_struct
 

Functions

 LOG_MODULE_REGISTER (plat_throttle_switch_shell, LOG_LEVEL_DBG)
 
bool set_user_settings_throttle_to_eeprom (void *throttle_user_settings, uint8_t data_length)
 
bool set_throttle_user_settings (uint8_t *throttle_status_reg, bool is_perm)
 
void cmd_throttle_status_get (const struct shell *shell, size_t argc, char **argv)
 
int cmd_throttle_status_en (const struct shell *shell, size_t argc, char **argv)
 
int cmd_throttle_status_dis (const struct shell *shell, size_t argc, char **argv)
 
 SHELL_DYNAMIC_CMD_CREATE (throttle_status, throttle_status_get)
 
 SHELL_DYNAMIC_CMD_CREATE (throttle_name, throttle_name_get)
 
 SHELL_STATIC_SUBCMD_SET_CREATE (sub_throttle_switch_cmds, SHELL_CMD(get, NULL, "get throttle switch status", cmd_throttle_status_get), SHELL_CMD_ARG(set, &throttle_name, "throttle_switch set <lv1 |lv2 |lv3 |all> <enable>|<disable> [perm]", NULL, 3, 1), SHELL_SUBCMD_SET_END)
 
 SHELL_CMD_REGISTER (throttle_switch, &sub_throttle_switch_cmds, "thermal trip switch command", NULL)
 

Variables

throttle_user_settings_struct throttle_user_settings = { 0xFF }
 

Macro Definition Documentation

◆ CPLD_THROTTLE_SWITCH_ADDR

#define CPLD_THROTTLE_SWITCH_ADDR   0x25

◆ EEPROM_MAX_WRITE_TIME

#define EEPROM_MAX_WRITE_TIME   5

Typedef Documentation

◆ throttle_user_settings_struct

Function Documentation

◆ cmd_throttle_status_dis()

int cmd_throttle_status_dis ( const struct shell *  shell,
size_t  argc,
char **  argv 
)

◆ cmd_throttle_status_en()

int cmd_throttle_status_en ( const struct shell *  shell,
size_t  argc,
char **  argv 
)

◆ cmd_throttle_status_get()

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

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_throttle_switch_shell  ,
LOG_LEVEL_DBG   
)

◆ set_throttle_user_settings()

bool set_throttle_user_settings ( uint8_t *  throttle_status_reg,
bool  is_perm 
)
Here is the call graph for this function:

◆ set_user_settings_throttle_to_eeprom()

bool set_user_settings_throttle_to_eeprom ( void *  throttle_user_settings,
uint8_t  data_length 
)
Here is the call graph for this function:

◆ SHELL_CMD_REGISTER()

SHELL_CMD_REGISTER ( throttle_switch  ,
sub_throttle_switch_cmds,
"thermal trip switch command"  ,
NULL   
)

◆ SHELL_DYNAMIC_CMD_CREATE() [1/2]

SHELL_DYNAMIC_CMD_CREATE ( throttle_name  ,
throttle_name_get   
)

◆ SHELL_DYNAMIC_CMD_CREATE() [2/2]

SHELL_DYNAMIC_CMD_CREATE ( throttle_status  ,
throttle_status_get   
)

◆ SHELL_STATIC_SUBCMD_SET_CREATE()

SHELL_STATIC_SUBCMD_SET_CREATE ( sub_throttle_switch_cmds  ,
SHELL_CMD(get, NULL, "get throttle switch status", cmd_throttle_status_get)  ,
SHELL_CMD_ARG(set, &throttle_name, "throttle_switch set <lv1 |lv2 |lv3 |all> <enable>|<disable> [perm]", NULL, 3, 1)  ,
SHELL_SUBCMD_SET_END   
)

Variable Documentation

◆ throttle_user_settings

throttle_user_settings_struct throttle_user_settings = { 0xFF }