Tiva Driver Lib
|
Functions | |
void | ComparatorConfigure (uint32_t ui32Base, uint32_t ui32Comp, uint32_t ui32Config) |
void | ComparatorRefSet (uint32_t ui32Base, uint32_t ui32Ref) |
bool | ComparatorValueGet (uint32_t ui32Base, uint32_t ui32Comp) |
void | ComparatorIntRegister (uint32_t ui32Base, uint32_t ui32Comp, void(*pfnHandler)(void)) |
void | ComparatorIntUnregister (uint32_t ui32Base, uint32_t ui32Comp) |
void | ComparatorIntEnable (uint32_t ui32Base, uint32_t ui32Comp) |
void | ComparatorIntDisable (uint32_t ui32Base, uint32_t ui32Comp) |
bool | ComparatorIntStatus (uint32_t ui32Base, uint32_t ui32Comp, bool bMasked) |
void | ComparatorIntClear (uint32_t ui32Base, uint32_t ui32Comp) |
void ComparatorConfigure | ( | uint32_t | ui32Base, |
uint32_t | ui32Comp, | ||
uint32_t | ui32Config | ||
) |
Configures a comparator.
ui32Base | is the base address of the comparator module. |
ui32Comp | is the index of the comparator to configure. |
ui32Config | is the configuration of the comparator. |
This function configures a comparator. The ui32Config parameter is the result of a logical OR operation between the COMP_TRIG_xxx, COMP_INT_xxx, COMP_ASRCP_xxx, and COMP_OUTPUT_xxx values.
The COMP_TRIG_xxx term can take on the following values:
The COMP_INT_xxx term can take on the following values:
The COMP_ASRCP_xxx term can take on the following values:
The COMP_OUTPUT_xxx term can take on the following values:
void ComparatorIntClear | ( | uint32_t | ui32Base, |
uint32_t | ui32Comp | ||
) |
Clears a comparator interrupt.
ui32Base | is the base address of the comparator module. |
ui32Comp | is the index of the comparator. |
The comparator interrupt is cleared, so that it no longer asserts. This fucntion must be called in the interrupt handler to keep the handler from being called again immediately upon exit. Note that for a level-triggered interrupt, the interrupt cannot be cleared until it stops asserting.
void ComparatorIntDisable | ( | uint32_t | ui32Base, |
uint32_t | ui32Comp | ||
) |
Disables the comparator interrupt.
ui32Base | is the base address of the comparator module. |
ui32Comp | is the index of the comparator. |
This function disables generation of an interrupt from the specified comparator. Only enabled comparator interrupts can be reflected to the processor.
void ComparatorIntEnable | ( | uint32_t | ui32Base, |
uint32_t | ui32Comp | ||
) |
Enables the comparator interrupt.
ui32Base | is the base address of the comparator module. |
ui32Comp | is the index of the comparator. |
This function enables generation of an interrupt from the specified comparator. Only enabled comparator interrupts can be reflected to the processor.
void ComparatorIntRegister | ( | uint32_t | ui32Base, |
uint32_t | ui32Comp, | ||
void(*)(void) | pfnHandler | ||
) |
Registers an interrupt handler for the comparator interrupt.
ui32Base | is the base address of the comparator module. |
ui32Comp | is the index of the comparator. |
pfnHandler | is a pointer to the function to be called when the comparator interrupt occurs. |
This function sets the handler to be called when the comparator interrupt occurs and enables the interrupt in the interrupt controller. It is the interrupt handler's responsibility to clear the interrupt source via ComparatorIntClear().
bool ComparatorIntStatus | ( | uint32_t | ui32Base, |
uint32_t | ui32Comp, | ||
bool | bMasked | ||
) |
Gets the current interrupt status.
ui32Base | is the base address of the comparator module. |
ui32Comp | is the index of the comparator. |
bMasked | is false if the raw interrupt status is required and true if the masked interrupt status is required. |
This function returns the interrupt status for the comparator. Either the raw or the masked interrupt status can be returned.
void ComparatorIntUnregister | ( | uint32_t | ui32Base, |
uint32_t | ui32Comp | ||
) |
Unregisters an interrupt handler for a comparator interrupt.
ui32Base | is the base address of the comparator module. |
ui32Comp | is the index of the comparator. |
This function clears the handler to be called when a comparator interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler no longer is called.
void ComparatorRefSet | ( | uint32_t | ui32Base, |
uint32_t | ui32Ref | ||
) |
Sets the internal reference voltage.
ui32Base | is the base address of the comparator module. |
ui32Ref | is the desired reference voltage. |
This function sets the internal reference voltage value. The voltage is specified as one of the following values:
bool ComparatorValueGet | ( | uint32_t | ui32Base, |
uint32_t | ui32Comp | ||
) |
Gets the current comparator output value.
ui32Base | is the base address of the comparator module. |
ui32Comp | is the index of the comparator. |
This function retrieves the current value of the comparator output.