![]() |
TT-System-Firmware APIs 19.10.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 <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_TARGET_INIT(inst) |
Enumerations | |
| enum | SmbusState { kSmbusStateIdle , kSmbusStateCmd , kSmbusStateRcvData , kSmbusStateRcvPec , kSmbusStateSendData , kSmbusStateSendPec , kSmbusStateWaitIdle } |
Functions | |
| LOG_MODULE_REGISTER (i2c_target) | |
| static const struct SmbusCmdDef * | 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) |
| static int32_t | smbus_stop_handler (struct i2c_target_config *config) |
| static int32_t | smbus_write_requested (struct i2c_target_config *config) |
| 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 SmbusCmdDef *smbus_cmd) |
| Register the given command to the SMBUS target implementation. | |
Variables | |
| static const struct i2c_target_driver_api | api_funcs |
| 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_TARGET_INIT | ( | inst | ) |
| enum SmbusState |
|
static |
| LOG_MODULE_REGISTER | ( | i2c_target | ) |
|
static |
|
static |
| int32_t smbus_target_register_cmd | ( | const struct device * | dev, |
| uint8_t | cmd_id, | ||
| const struct SmbusCmdDef * | 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. |
|
static |
|
static |
|
static |
| const struct i2c_target_callbacks smbus_target_cb_impl |