You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.0 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __ADC_SUBSYSTEM_HEADER__
  2. #define __ADC_SUBSYSTEM_HEADER__
  3. #include <stdio.h>
  4. #include <fcntl.h>
  5. #include <unistd.h>
  6. #include <errno.h>
  7. #include <string.h>
  8. #include <sys/mman.h>
  9. #include <sys/types.h>
  10. #include <sys/stat.h>
  11. #include "../../general/sitara-am437x.h"
  12. //#include "sys_adc1MagSs.h"
  13. //#include "sys_adc0TscSs.h"
  14. #include "ti__adc1MagSs.h"
  15. #include "ti__adc0TscSs.h"
  16. /* 1.8V is ADC Maximum voltage
  17. * ADC is 12 bit resolution
  18. * 1.8/4096 = 0.000439
  19. *
  20. * */
  21. #define ADC_WORK_SIMULTANEOUS_MODE
  22. #define ADC_MULTIPLIER 0.000439453125f
  23. #define ADC_CLK_DIV 11 //(11+1)
  24. bool init_ADC_0( void );
  25. bool init_ADC_1( void );
  26. void prepareFSM1( void );
  27. void startADC1( void );
  28. void prepareFSM0( void );
  29. void startADC0( void );
  30. uint32_t getRevisionADC1( void );
  31. uint32_t getRevisionADC0( void );
  32. uint32_t getSizeADC1_FIFO( uint8_t ID );
  33. uint32_t getSizeADC0_FIFO( uint8_t ID );
  34. uint32_t getDataADC1_FIFO0( uint32_t timeOut );
  35. uint32_t getDataADC1_FIFO1( uint32_t timeOut );
  36. #endif