hv_drv_GpioSimI2c.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * @file hv_drv_GpioSimI2c.h
  3. * @brief Header file of gpio simulate iic module.
  4. *
  5. * @verbatim
  6. * ==============================================================================
  7. * ##### How to use #####
  8. * ==============================================================================
  9. * (+) Use ()
  10. *
  11. * @endverbatim
  12. * @author HiView SoC Software Team
  13. * @version 1.0.0
  14. * @date 2023-06-06
  15. */
  16. #ifndef _HV_DRV_GPIOSIMI2C_H
  17. #define _HV_DRV_GPIOSIMI2C_H
  18. /** @defgroup DRV_GPIOSIMI2C DRV GPIO SIMULATE IIC
  19. * drv gpio simulate i2c functions
  20. * @{
  21. */
  22. typedef struct _GpioSimI2c
  23. {
  24. UCHAR8 ucSdaPin;
  25. UCHAR8 ucSclPin;
  26. }GpioSimI2c;
  27. /** Initialize i2c
  28. * @param pstInitParam pointer to i2c configuration parameters
  29. * @return SUCCESS/FAILURE
  30. */
  31. Status Hv_Drv_GpioSimI2c_Init(I2cBusID enBus, const GpioSimI2c *pstGpioSimI2c);
  32. /** Send in master mode an amount of data
  33. * @param ucDevAddr target device address
  34. * @param pucRegAddr pointer to register address
  35. * @param usRegAddrSize register address length
  36. * @param pucData pointer to data buffer to be transmited
  37. * @param usDataSize amount of data to be sent
  38. * @retval Status SUCESS/FAILURE
  39. */
  40. Status Hv_Drv_GpioSimI2c_SendData(I2cBusID enBus, UCHAR8 ucDevAddr, UCHAR8 *pucRegAddr,
  41. USHORT16 usRegAddrSize, UCHAR8 *pcData, UINT32 uiDatasize);
  42. /** Receive in master mode an amount of data
  43. * @param ucDevAddr target device address
  44. * @param pucRegAddr pointer to register address
  45. * @param usRegAddrSize register address length
  46. * @param pucData pointer to data buffer to be transmited
  47. * @param usDataSize amount of data to be receive
  48. * @retval Status SUCESS/FAILURE
  49. */
  50. Status Hv_Drv_GpioSimI2c_RecvData(I2cBusID enBus, UCHAR8 ucDevAddr, UCHAR8 *pucRegAddr,
  51. USHORT16 usRegAddrSize, UCHAR8 *pucData, USHORT16 usDataSize);
  52. /** @} */
  53. #endif