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 250 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 392 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 426 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 212 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:= {
{
'a',
"action",
"perform protocol actions",
"[actions]",
},
{
's',
"scan",
"scan for slave devices",
NULL,
},
}
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 495 of file busvoodoo_i2c.c.
◆ busvoodoo_i2c_mode
Initial value:= {
"i2c",
"Inter-Integrated Circuit",
}
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 514 of file busvoodoo_i2c.c.