Analog Comparator
4 Analog Comparator
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.1 Introduction
The comparator API provides a set of functions for dealing with the analog comparators. A com-
parator can compare a test voltage against individual external reference voltage, a shared single
external reference voltage, or a shared internal reference voltage. It can provide its output to a
device pin, acting as a replacement for an analog comparator on the board, or it can be used to
signal the application via interrupts or triggers to the ADC to cause it to start capturing a sample
sequence. The interrupt generation and ADC triggering logic is separate, so that an interrupt can
be generated on a rising edge and the ADC triggered on a falling edge (for example).
4.2 Functions
Functions
void ROM_ComparatorConfigure (uint32_t ui32Base, uint32_t ui32Comp, uint32_t ui32Config)
void ROM_ComparatorIntClear (uint32_t ui32Base, uint32_t ui32Comp)
void ROM_ComparatorIntDisable (uint32_t ui32Base, uint32_t ui32Comp)
void ROM_ComparatorIntEnable (uint32_t ui32Base, uint32_t ui32Comp)
bool ROM_ComparatorIntStatus (uint32_t ui32Base, uint32_t ui32Comp, bool bMasked)
void ROM_ComparatorRefSet (uint32_t ui32Base, uint32_t ui32Ref)
bool ROM_ComparatorValueGet (uint32_t ui32Base, uint32_t ui32Comp)
4.2.1 Function Documentation
4.2.1.1 ROM_ComparatorConfigure
Configures a comparator.
Prototype:
void
ROM_ComparatorConfigure(uint32_t ui32Base,
uint32_t ui32Comp,
uint32_t ui32Config)
ROM Location:
ROM_APITABLE is an array of pointers located at 0x0100.0010.
ROM_COMPARATORTABLE is an array of pointers located at ROM_APITABLE[6].
ROM_ComparatorConfigure is a function pointer located at ROM_COMPARATORTABLE[1].
April 8, 2013 29