kspi.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // kspi.h :
  2. //
  3. #if !defined(AGD_KSPI_H__C0C2E2F9_77AA_4807_9B26_08F970CFD563__INCLUDED_)
  4. #define AGD_KSPI_H__C0C2E2F9_77AA_4807_9B26_08F970CFD563__INCLUDED_
  5. #include <linux/kernel.h>
  6. #include <linux/spi/spidev.h>
  7. #include <linux/syscalls.h>
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif // __cplusplus
  11. /////////////////////////////////////////////////////////////////////////////
  12. // kspi.h - Declarations:
  13. typedef struct _TIVA_ADC
  14. {
  15. int UVers;
  16. int UBatV3;
  17. int Temp;
  18. int UV5Vsys;
  19. int UV3V6Bat;
  20. int TempTIVA;
  21. }TIVA_ADC, *LPTIVA_ADC;
  22. typedef const TIVA_ADC *LPCTIVA_ADC;
  23. /////////////////////////////////////////////////////////////////////////////
  24. int SendCMD(struct file *pf, unsigned char Cmd, unsigned char DataLen, unsigned char *Data);
  25. int ReadCmd(struct file *pf, int MaxLen, unsigned char *Data);
  26. int CmdGetFirmwareVersion(struct file *pf, int *Hw, int *Sw);
  27. void getUPTIME(struct file *pf, unsigned int Addr, int nFwVersion);
  28. int CmdGetADC(struct file *pf, LPTIVA_ADC padc);
  29. /////////////////////////////////////////////////////////////////////////////
  30. #ifdef __cplusplus
  31. }
  32. #endif // __cplusplus
  33. #endif // !defined(AGD_KSPI_H__C0C2E2F9_77AA_4807_9B26_08F970CFD563__INCLUDED_)