PageRenderTime 25ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/FreeRTOS/Demo/Common/drivers/LuminaryMicro/adc.h

https://gitlab.com/21mece13/FreeRTOS
C Header | 142 lines | 80 code | 7 blank | 55 comment | 0 complexity | 0cd5c7a932ad66774edace06c0193bcf MD5 | raw file
  1. //*****************************************************************************
  2. //
  3. // adc.h - ADC headers for using the ADC driver functions.
  4. //
  5. // Copyright (c) 2005-2008 Luminary Micro, Inc. All rights reserved.
  6. //
  7. // Software License Agreement
  8. //
  9. // Luminary Micro, Inc. (LMI) is supplying this software for use solely and
  10. // exclusively on LMI's microcontroller products.
  11. //
  12. // The software is owned by LMI and/or its suppliers, and is protected under
  13. // applicable copyright laws. All rights are reserved. You may not combine
  14. // this software with "viral" open-source software in order to form a larger
  15. // program. Any use in violation of the foregoing restrictions may subject
  16. // the user to criminal sanctions under applicable laws, as well as to civil
  17. // liability for the breach of the terms and conditions of this license.
  18. //
  19. // THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
  20. // OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
  21. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
  22. // LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
  23. // CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
  24. //
  25. // This is part of revision 2523 of the Stellaris Peripheral Driver Library.
  26. //
  27. //*****************************************************************************
  28. #ifndef __ADC_H__
  29. #define __ADC_H__
  30. //*****************************************************************************
  31. //
  32. // If building with a C++ compiler, make all of the definitions in this header
  33. // have a C binding.
  34. //
  35. //*****************************************************************************
  36. #ifdef __cplusplus
  37. extern "C"
  38. {
  39. #endif
  40. //*****************************************************************************
  41. //
  42. // Values that can be passed to ADCSequenceConfigure as the ulTrigger
  43. // parameter.
  44. //
  45. //*****************************************************************************
  46. #define ADC_TRIGGER_PROCESSOR 0x00000000 // Processor event
  47. #define ADC_TRIGGER_COMP0 0x00000001 // Analog comparator 0 event
  48. #define ADC_TRIGGER_COMP1 0x00000002 // Analog comparator 1 event
  49. #define ADC_TRIGGER_COMP2 0x00000003 // Analog comparator 2 event
  50. #define ADC_TRIGGER_EXTERNAL 0x00000004 // External event
  51. #define ADC_TRIGGER_TIMER 0x00000005 // Timer event
  52. #define ADC_TRIGGER_PWM0 0x00000006 // PWM0 event
  53. #define ADC_TRIGGER_PWM1 0x00000007 // PWM1 event
  54. #define ADC_TRIGGER_PWM2 0x00000008 // PWM2 event
  55. #define ADC_TRIGGER_ALWAYS 0x0000000F // Always event
  56. //*****************************************************************************
  57. //
  58. // Values that can be passed to ADCSequenceStepConfigure as the ulConfig
  59. // parameter.
  60. //
  61. //*****************************************************************************
  62. #define ADC_CTL_TS 0x00000080 // Temperature sensor select
  63. #define ADC_CTL_IE 0x00000040 // Interrupt enable
  64. #define ADC_CTL_END 0x00000020 // Sequence end select
  65. #define ADC_CTL_D 0x00000010 // Differential select
  66. #define ADC_CTL_CH0 0x00000000 // Input channel 0
  67. #define ADC_CTL_CH1 0x00000001 // Input channel 1
  68. #define ADC_CTL_CH2 0x00000002 // Input channel 2
  69. #define ADC_CTL_CH3 0x00000003 // Input channel 3
  70. #define ADC_CTL_CH4 0x00000004 // Input channel 4
  71. #define ADC_CTL_CH5 0x00000005 // Input channel 5
  72. #define ADC_CTL_CH6 0x00000006 // Input channel 6
  73. #define ADC_CTL_CH7 0x00000007 // Input channel 7
  74. //*****************************************************************************
  75. //
  76. // Prototypes for the APIs.
  77. //
  78. //*****************************************************************************
  79. extern void ADCIntRegister(unsigned long ulBase, unsigned long ulSequenceNum,
  80. void (*pfnHandler)(void));
  81. extern void ADCIntUnregister(unsigned long ulBase,
  82. unsigned long ulSequenceNum);
  83. extern void ADCIntDisable(unsigned long ulBase, unsigned long ulSequenceNum);
  84. extern void ADCIntEnable(unsigned long ulBase, unsigned long ulSequenceNum);
  85. extern unsigned long ADCIntStatus(unsigned long ulBase,
  86. unsigned long ulSequenceNum,
  87. tBoolean bMasked);
  88. extern void ADCIntClear(unsigned long ulBase, unsigned long ulSequenceNum);
  89. extern void ADCSequenceEnable(unsigned long ulBase,
  90. unsigned long ulSequenceNum);
  91. extern void ADCSequenceDisable(unsigned long ulBase,
  92. unsigned long ulSequenceNum);
  93. extern void ADCSequenceConfigure(unsigned long ulBase,
  94. unsigned long ulSequenceNum,
  95. unsigned long ulTrigger,
  96. unsigned long ulPriority);
  97. extern void ADCSequenceStepConfigure(unsigned long ulBase,
  98. unsigned long ulSequenceNum,
  99. unsigned long ulStep,
  100. unsigned long ulConfig);
  101. extern long ADCSequenceOverflow(unsigned long ulBase,
  102. unsigned long ulSequenceNum);
  103. extern void ADCSequenceOverflowClear(unsigned long ulBase,
  104. unsigned long ulSequenceNum);
  105. extern long ADCSequenceUnderflow(unsigned long ulBase,
  106. unsigned long ulSequenceNum);
  107. extern void ADCSequenceUnderflowClear(unsigned long ulBase,
  108. unsigned long ulSequenceNum);
  109. extern long ADCSequenceDataGet(unsigned long ulBase,
  110. unsigned long ulSequenceNum,
  111. unsigned long *pulBuffer);
  112. extern void ADCProcessorTrigger(unsigned long ulBase,
  113. unsigned long ulSequenceNum);
  114. extern void ADCSoftwareOversampleConfigure(unsigned long ulBase,
  115. unsigned long ulSequenceNum,
  116. unsigned long ulFactor);
  117. extern void ADCSoftwareOversampleStepConfigure(unsigned long ulBase,
  118. unsigned long ulSequenceNum,
  119. unsigned long ulStep,
  120. unsigned long ulConfig);
  121. extern void ADCSoftwareOversampleDataGet(unsigned long ulBase,
  122. unsigned long ulSequenceNum,
  123. unsigned long *pulBuffer,
  124. unsigned long ulCount);
  125. extern void ADCHardwareOversampleConfigure(unsigned long ulBase,
  126. unsigned long ulFactor);
  127. //*****************************************************************************
  128. //
  129. // Mark the end of the C bindings section for C++ compilers.
  130. //
  131. //*****************************************************************************
  132. #ifdef __cplusplus
  133. }
  134. #endif
  135. #endif // __ADC_H__