![]() |
TT-System-Firmware APIs 19.13.99
Tenstorrent Firmware
|
#include <zephyr/sys/util.h>#include <zephyr/kernel.h>#include <errno.h>#include <zephyr/drivers/i2c.h>#include <zephyr/sys/crc.h>#include <zephyr/sys/atomic.h>#include <tenstorrent/smbus_target.h>#include <zephyr/logging/log.h>
Data Structures | |
| struct | smbus_target_data |
| struct | smbus_target_config |
Macros | |
| #define | DT_DRV_COMPAT zephyr_smbus_target |
| #define | LOG_LEVEL CONFIG_I2C_LOG_LEVEL |
| #define | SMBUS_LOG_ERR_RATELIMIT(data, fmt, ...) |
| #define | SMBUS_TARGET_INIT(inst) |
Enumerations | |
| enum | smbus_state { SMBUS_STATE_IDLE , SMBUS_STATE_CMD , SMBUS_STATE_RCV_DATA , SMBUS_STATE_RCV_PEC , SMBUS_STATE_SEND_DATA , SMBUS_STATE_SEND_PEC , SMBUS_STATE_WAIT_IDLE } |
Functions | |
| LOG_MODULE_REGISTER (i2c_target) | |
| static const struct smbus_cmd_def * | get_cmd_def (struct smbus_target_data *smbus_data, uint8_t cmd) |
| static uint8_t | pec_crc_8 (uint8_t crc, uint8_t data) |
| static int32_t | smbus_target_register (const struct device *dev) |
| static int32_t | smbus_target_unregister (const struct device *dev) |
| static int | smbus_write_handler (struct i2c_target_config *config, uint8_t val) |
| static int32_t | smbus_read_handler (struct i2c_target_config *config, uint8_t *val) |
| uint32_t | smbus_target_get_error_count (const struct device *dev) |
| Get total number of SMBUS target errors. | |
| static void | reset_state_machine (struct smbus_target_data *smbus_data) |
| static int32_t | smbus_stop_handler (struct i2c_target_config *config) |
| static int32_t | smbus_write_requested (struct i2c_target_config *config) |
| static | DEVICE_API (i2c_target, api_funcs) |
| static int32_t | smbus_target_init (const struct device *dev) |
| int32_t | smbus_target_register_cmd (const struct device *dev, uint8_t cmd_id, const struct smbus_cmd_def *smbus_cmd) |
| Register the given command to the SMBUS target implementation. | |
| int32_t | smbus_target_register_cmds (const struct device *dev, const struct smbus_cmd_registration *cmds, size_t num_cmds) |
| Register a table of commands to the SMBUS target implementation. | |
Variables | |
| const struct i2c_target_callbacks | smbus_target_cb_impl |
| #define DT_DRV_COMPAT zephyr_smbus_target |
| #define LOG_LEVEL CONFIG_I2C_LOG_LEVEL |
| #define SMBUS_LOG_ERR_RATELIMIT | ( | data, | |
| fmt, | |||
| ... ) |
| #define SMBUS_TARGET_INIT | ( | inst | ) |
| enum smbus_state |
|
static |
|
static |
| LOG_MODULE_REGISTER | ( | i2c_target | ) |
|
static |
|
static |
|
static |
Get total number of SMBUS target errors.
| dev | The SMBUS target device instance. |
| int32_t smbus_target_register_cmd | ( | const struct device * | dev, |
| uint8_t | cmd_id, | ||
| const struct smbus_cmd_def * | smbus_cmd ) |
Register the given command to the SMBUS target implementation.
| dev | The device to register the command for. |
| cmd_id | The command ID to register the handler for. |
| smbus_cmd | Pointer to the smbus command to register. The memory must have persistent storage for the duration of the time the target remains registered to the I2C. |
| int32_t smbus_target_register_cmds | ( | const struct device * | dev, |
| const struct smbus_cmd_registration * | cmds, | ||
| size_t | num_cmds ) |
Register a table of commands to the SMBUS target implementation.
| dev | The device to register commands for. |
| cmds | Pointer to command registration table. |
| num_cmds | Number of entries in cmds. |
|
static |
|
static |
| const struct i2c_target_callbacks smbus_target_cb_impl |