stm32-adc-core.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * This file is part of STM32 ADC driver
  3. *
  4. * Copyright (C) 2016, STMicroelectronics - All Rights Reserved
  5. * Author: Fabrice Gasnier <fabrice.gasnier@st.com>.
  6. *
  7. * License type: GPLv2
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License version 2 as published by
  11. * the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  15. * or FITNESS FOR A PARTICULAR PURPOSE.
  16. * See the GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along with
  19. * this program. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. #ifndef __STM32_ADC_H
  22. #define __STM32_ADC_H
  23. /*
  24. * STM32 - ADC global register map
  25. * ________________________________________________________
  26. * | Offset | Register |
  27. * --------------------------------------------------------
  28. * | 0x000 | Master ADC1 |
  29. * --------------------------------------------------------
  30. * | 0x100 | Slave ADC2 |
  31. * --------------------------------------------------------
  32. * | 0x200 | Slave ADC3 |
  33. * --------------------------------------------------------
  34. * | 0x300 | Master & Slave common regs |
  35. * --------------------------------------------------------
  36. */
  37. #define STM32_ADC_MAX_ADCS 3
  38. #define STM32_ADCX_COMN_OFFSET 0x300
  39. /**
  40. * struct stm32_adc_common - stm32 ADC driver common data (for all instances)
  41. * @base: control registers base cpu addr
  42. * @vref_mv: vref voltage (mv)
  43. */
  44. struct stm32_adc_common {
  45. void __iomem *base;
  46. int vref_mv;
  47. };
  48. #endif