BusVoodoo I²C mode (code)
More...
Go to the source code of this file.
|
enum | busvoodoo_i2c_setting_t {
BUSVOODOO_I2C_SETTING_NONE,
BUSVOODOO_I2C_SETTING_SPEED,
BUSVOODOO_I2C_SETTING_ADDRESSBITS,
BUSVOODOO_I2C_SETTING_PULLUP,
BUSVOODOO_I2C_SETTING_DONE
} |
| mode setup stage
|
|
◆ busvoodoo_i2c_action()
static bool busvoodoo_i2c_action |
( |
const char * |
action, |
|
|
uint32_t |
repetition, |
|
|
bool |
perform |
|
) |
| |
|
static |
perform I2C action
- Parameters
-
[in] | action | action to perform |
[in] | repetition | how many times to perform the action |
[in] | perform | the action (true) or just check it (false) |
- Returns
- true if the action has been performed, false if it is malformed
Definition at line 265 of file busvoodoo_i2c.c.
◆ busvoodoo_i2c_command_actions()
static void busvoodoo_i2c_command_actions |
( |
void * |
argument | ) |
|
|
static |
command to perform actions
- Parameters
-
[in] | argument | actions to perform |
Definition at line 419 of file busvoodoo_i2c.c.
◆ busvoodoo_i2c_command_reset()
static void busvoodoo_i2c_command_reset |
( |
void * |
argument | ) |
|
|
static |
command to reset I2C peripheral
- Parameters
-
[in] | argument | no argument required |
Definition at line 407 of file busvoodoo_i2c.c.
◆ busvoodoo_i2c_command_scan()
static void busvoodoo_i2c_command_scan |
( |
void * |
argument | ) |
|
|
static |
command to scan for slave devices
- Parameters
-
[in] | argument | no argument required |
Definition at line 453 of file busvoodoo_i2c.c.
◆ busvoodoo_i2c_select()
static void busvoodoo_i2c_select |
( |
uint16_t |
slave, |
|
|
bool |
write |
|
) |
| |
|
static |
select I2C slave
- Parameters
-
[in] | slave | slave I2C address |
[in] | write | enter read (false) or write (true) mode |
Definition at line 224 of file busvoodoo_i2c.c.
◆ busvoodoo_i2c_setup()
static bool busvoodoo_i2c_setup |
( |
char ** |
prefix, |
|
|
const char * |
line |
|
) |
| |
|
static |
setup I2C mode
- Parameters
-
[out] | prefix | terminal prompt prefix |
[in] | line | terminal prompt line to configure mode |
- Returns
- if setup is complete
Definition at line 64 of file busvoodoo_i2c.c.
◆ busvoodoo_i2c_write()
static void busvoodoo_i2c_write |
( |
uint8_t |
data | ) |
|
|
static |
◆ busvoodoo_i2c_commands
Initial value:= {
{
.shortcut = 'r',
.name = "reset_i2c",
.command_description = "reset I2C peripheral",
.argument_description = NULL,
},
{
.shortcut = 'a',
.name = "action",
.command_description = "perform protocol actions",
.argument_description = "[actions]",
},
{
.shortcut = 's',
.name = "scan",
.command_description = "scan for slave devices",
.argument_description = NULL,
},
}
static void busvoodoo_i2c_command_reset(void *argument)
command to reset I2C peripheral
static void busvoodoo_i2c_command_actions(void *argument)
command to perform actions
static void busvoodoo_i2c_command_scan(void *argument)
command to scan for slave devices
I2C menu commands.
Definition at line 523 of file busvoodoo_i2c.c.
◆ busvoodoo_i2c_mode
Initial value:= {
.name = "i2c",
.description = "Inter-Integrated Circuit",
.full_only = false,
}
static void busvoodoo_i2c_exit(void)
exit I2C mode
static bool busvoodoo_i2c_setup(char **prefix, const char *line)
setup I2C mode
static const struct menu_command_t busvoodoo_i2c_commands[]
I2C menu commands.
#define LENGTH(x)
get the length of an array
I2C mode interface definition.
Definition at line 550 of file busvoodoo_i2c.c.