您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

49 行
2.0 KiB

  1. /*
  2. * wiringPiI2C.h:
  3. * Simplified I2C access routines
  4. * Copyright (c) 2013-2024 Gordon Henderson and contributors
  5. ***********************************************************************
  6. * This file is part of wiringPi:
  7. * https://github.com/WiringPi/WiringPi/
  8. *
  9. * wiringPi is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Lesser General Public License as
  11. * published by the Free Software Foundation, either version 3 of the
  12. * License, or (at your option) any later version.
  13. *
  14. * wiringPi is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with wiringPi.
  21. * If not, see <http://www.gnu.org/licenses/>.
  22. ***********************************************************************
  23. */
  24. #include <stdint.h>
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. extern int wiringPiI2CRead (int fd) ;
  29. extern int wiringPiI2CReadReg8 (int fd, int reg) ;
  30. extern int wiringPiI2CReadReg16 (int fd, int reg) ;
  31. extern int wiringPiI2CReadBlockData (int fd, int reg, uint8_t *values, uint8_t size); //Interface 3.3
  32. extern int wiringPiI2CRawRead (int fd, uint8_t *values, uint8_t size); //Interface 3.3
  33. extern int wiringPiI2CWrite (int fd, int data) ;
  34. extern int wiringPiI2CWriteReg8 (int fd, int reg, int data) ;
  35. extern int wiringPiI2CWriteReg16 (int fd, int reg, int data) ;
  36. extern int wiringPiI2CWriteBlockData (int fd, int reg, const uint8_t *values, uint8_t size); //Interface 3.3
  37. extern int wiringPiI2CRawWrite (int fd, const uint8_t *values, uint8_t size); //Interface 3.3
  38. extern int wiringPiI2CSetupInterface (const char *device, int devId) ;
  39. extern int wiringPiI2CSetup (const int devId) ;
  40. #ifdef __cplusplus
  41. }
  42. #endif