哪位用51驱过智能电池SBS1.1协议 smbus

2020-01-24 12:04发布

最近在做电池管理,用原来的i2c试了试,咋也不通,哪位做过指点一下
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
4条回答
wye11083
1楼-- · 2020-01-24 12:36
 精彩回答 2  元偷偷看……
wdluo
2楼-- · 2020-01-24 13:55
本帖最后由 wdluo 于 2014-3-13 16:59 编辑

纬图的USB-I2C适配器支持SMBUS和PMBUS协议
  1. #ifdef __cplusplus
  2. extern "C"
  3. {
  4. #endif
  5. int32_t WINAPI VII_ScanDevice(uint8_t NeedInit=1);
  6. int32_t WINAPI VII_OpenDevice(int32_t DevType,int32_t DevIndex,int32_t Reserved);
  7. int32_t WINAPI VII_CloseDevice(int32_t DevType,int32_t DevIndex);
  8. int32_t WINAPI VII_ReadBoardInfo(int32_t DevType,int32_t DevIndex,PVII_BOARD_INFO pInfo);
  9. int32_t WINAPI VII_TimeConfig(int32_t DevType, int32_t DevIndex, int32_t I2CIndex, PVII_TIME_CONFIG pTimeConfig);
  10. int32_t WINAPI VII_InitI2C(int32_t DevType, int32_t DevIndex, int32_t I2CIndex, PVII_INIT_CONFIG pInitConfig);
  11. int32_t WINAPI VII_WriteBytes(int32_t DevType,int32_t DevIndex,int32_t I2CIndex,uint16_t Addr,uint32_t SubAddr,uint8_t *pWriteData,uint16_t Len);
  12. int32_t WINAPI VII_ReadBytes(int32_t DevType,int32_t DevIndex,int32_t I2CIndex,uint16_t Addr,uint32_t SubAddr,uint8_t *pReadData,uint16_t Len);

  13. int32_t WINAPI SMBUS_ScanDevice(uint8_t NeedInit=1);
  14. int32_t WINAPI SMBUS_OpenDevice(int32_t DevType,int32_t DevIndex,int32_t Reserved);
  15. int32_t WINAPI SMBUS_CloseDevice(int32_t DevType,int32_t DevIndex);
  16. int32_t WINAPI SMBUS_HardInit(int32_t DevType,int32_t DevIndex,int32_t SMBUSIndex,uint32_t ClockSpeed, uint8_t OwnAddr);
  17. int32_t WINAPI SMBUS_QuickCommand(int32_t DevType,int32_t DevIndex,int32_t SMBUSIndex,uint8_t SlaveAddr);
  18. int32_t WINAPI SMBUS_WriteByte(int32_t DevType,int32_t DevIndex,int32_t SMBUSIndex,uint8_t SlaveAddr,uint8_t Data,uint8_t PEC);
  19. int32_t WINAPI SMBUS_ReadByte(int32_t DevType,int32_t DevIndex,int32_t SMBUSIndex,uint8_t SlaveAddr,uint8_t *pData,uint8_t PEC);
  20. int32_t WINAPI SMBUS_WriteByteProtocol(int32_t DevType,int32_t DevIndex,int32_t SMBUSIndex,uint8_t SlaveAddr,uint8_t CommandCode,uint8_t Data,uint8_t PEC);
  21. int32_t WINAPI SMBUS_WriteWordProtocol(int32_t DevType,int32_t DevIndex,int32_t SMBUSIndex,uint8_t SlaveAddr,uint8_t CommandCode,uint16_t Data,uint8_t PEC);
  22. int32_t WINAPI SMBUS_ReadByteProtocol(int32_t DevType,int32_t DevIndex,int32_t SMBUSIndex,uint8_t SlaveAddr,uint8_t CommandCode, uint8_t *pData,uint8_t PEC);
  23. int32_t WINAPI SMBUS_ReadWordProtocol(int32_t DevType,int32_t DevIndex,int32_t SMBUSIndex,uint8_t SlaveAddr,uint8_t CommandCode, uint16_t *pData,uint8_t PEC);
  24. int32_t WINAPI SMBUS_ProcessCall(int32_t DevType,int32_t DevIndex,int32_t SMBUSIndex,uint8_t SlaveAddr,uint8_t CommandCode,uint16_t WriteData, uint16_t *pReadData,uint8_t PEC);
  25. int32_t WINAPI SMBUS_BlockWrite(int32_t DevType,int32_t DevIndex,int32_t SMBUSIndex,uint8_t SlaveAddr,uint8_t CommandCode,uint8_t *pData,uint8_t ByteCount,uint8_t PEC);
  26. int32_t WINAPI SMBUS_BlockRead(int32_t DevType,int32_t DevIndex,int32_t SMBUSIndex,uint8_t SlaveAddr,uint8_t CommandCode,uint8_t *pData,uint8_t *pByteCount,uint8_t PEC);
  27. int32_t WINAPI SMBUS_BlockProcessCall(int32_t DevType,int32_t DevIndex,int32_t SMBUSIndex,uint8_t SlaveAddr,uint8_t CommandCode,uint8_t *pWriteData,uint8_t WriteByteCount,uint8_t *pReadData,uint8_t *pReadByteCount,uint8_t PEC);
  28. int32_t WINAPI SMBUS_GetAlert(int32_t DevType,int32_t DevIndex,int32_t SMBUSIndex,uint8_t *pAlertFlag);

  29. #ifdef __cplusplus
  30. }
  31. #endif
复制代码
下面这个是PC端接口函数定义的截图:

smbus.jpg (659.11 KB, 下载次数: 0)

下载附件

2014-3-13 16:56 上传


Smartist
3楼-- · 2020-01-24 19:19
没有资源,不过顶下
wdluo
4楼-- · 2020-01-24 21:44
纬图官网有程序和资料下载

一周热门 更多>