ad7266.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * AD7266/65 SPI ADC driver
  3. *
  4. * Copyright 2012 Analog Devices Inc.
  5. *
  6. * Licensed under the GPL-2.
  7. */
  8. #ifndef __IIO_ADC_AD7266_H__
  9. #define __IIO_ADC_AD7266_H__
  10. /**
  11. * enum ad7266_range - AD7266 reference voltage range
  12. * @AD7266_RANGE_VREF: Device is configured for input range 0V - VREF
  13. * (RANGE pin set to low)
  14. * @AD7266_RANGE_2VREF: Device is configured for input range 0V - 2VREF
  15. * (RANGE pin set to high)
  16. */
  17. enum ad7266_range {
  18. AD7266_RANGE_VREF,
  19. AD7266_RANGE_2VREF,
  20. };
  21. /**
  22. * enum ad7266_mode - AD7266 sample mode
  23. * @AD7266_MODE_DIFF: Device is configured for full differential mode
  24. * (SGL/DIFF pin set to low, AD0 pin set to low)
  25. * @AD7266_MODE_PSEUDO_DIFF: Device is configured for pseudo differential mode
  26. * (SGL/DIFF pin set to low, AD0 pin set to high)
  27. * @AD7266_MODE_SINGLE_ENDED: Device is configured for single-ended mode
  28. * (SGL/DIFF pin set to high)
  29. */
  30. enum ad7266_mode {
  31. AD7266_MODE_DIFF,
  32. AD7266_MODE_PSEUDO_DIFF,
  33. AD7266_MODE_SINGLE_ENDED,
  34. };
  35. /**
  36. * struct ad7266_platform_data - Platform data for the AD7266 driver
  37. * @range: Reference voltage range the device is configured for
  38. * @mode: Sample mode the device is configured for
  39. * @fixed_addr: Whether the address pins are hard-wired
  40. * @addr_gpios: GPIOs used for controlling the address pins, only used if
  41. * fixed_addr is set to false.
  42. */
  43. struct ad7266_platform_data {
  44. enum ad7266_range range;
  45. enum ad7266_mode mode;
  46. bool fixed_addr;
  47. unsigned int addr_gpios[3];
  48. };
  49. #endif