TT Zephyr Platforms 18.11.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
smbus_target.h File Reference
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  SmbusCmdDef

Typedefs

typedef int32_t(* SmbusRcvHandler) (const uint8_t *data, uint8_t size)
 Definition of a SMBUS receive handler.
typedef int32_t(* SmbusSendHandler) (uint8_t *data, uint8_t *size)
 Definition of a SMBUS send handler.

Enumerations

enum  SmbusTransType {
  kSmbusTransWriteByte ,
  kSmbusTransReadByte ,
  kSmbusTransWriteWord ,
  kSmbusTransReadWord ,
  kSmbusTransBlockWrite ,
  kSmbusTransBlockRead ,
  kSmbusTransBlockWriteBlockRead
}
 A list of supported SMBUS transaction types. More...

Functions

int32_t smbus_target_register_cmd (const struct device *dev, uint8_t cmd_id, const SmbusCmdDef *smbus_cmd)
 Register the given command to the SMBUS target implementation.

Typedef Documentation

◆ SmbusRcvHandler

typedef int32_t(* SmbusRcvHandler) (const uint8_t *data, uint8_t size)

Definition of a SMBUS receive handler.

This function is invoked when the SMBUS target has data from the I2C controller to relay to the application. SMBUS receive handlers shall return 0 on success, and any other value on failure.

◆ SmbusSendHandler

typedef int32_t(* SmbusSendHandler) (uint8_t *data, uint8_t *size)

Definition of a SMBUS send handler.

This function is invoked when the SMBUS target requests data from the application to send to the I2C controller. SMBUS send handlers shall return 0 on success, and any other value on failure.

Enumeration Type Documentation

◆ SmbusTransType

A list of supported SMBUS transaction types.

Enumerator
kSmbusTransWriteByte 
kSmbusTransReadByte 
kSmbusTransWriteWord 
kSmbusTransReadWord 
kSmbusTransBlockWrite 
kSmbusTransBlockRead 
kSmbusTransBlockWriteBlockRead 

Function Documentation

◆ smbus_target_register_cmd()

int32_t smbus_target_register_cmd ( const struct device * dev,
uint8_t cmd_id,
const SmbusCmdDef * smbus_cmd )

Register the given command to the SMBUS target implementation.

Parameters
devThe device to register the command for.
cmd_idThe command ID to register the handler for.
smbus_cmdPointer 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.