Functions | |
bool | Comp_E_init (uint16_t baseAddress, Comp_E_initParam *param) |
Initializes the Comp_E Module. More... | |
void | Comp_E_setReferenceVoltage (uint16_t baseAddress, uint16_t supplyVoltageReferenceBase, uint16_t lowerLimitSupplyVoltageFractionOf32, uint16_t upperLimitSupplyVoltageFractionOf32) |
Generates a Reference Voltage to the terminal selected during initialization. More... | |
void | Comp_E_setReferenceAccuracy (uint16_t baseAddress, uint16_t referenceAccuracy) |
Sets the reference accuracy. More... | |
void | Comp_E_setPowerMode (uint16_t baseAddress, uint16_t powerMode) |
Sets the power mode. More... | |
void | Comp_E_enableInterrupt (uint16_t baseAddress, uint16_t interruptMask) |
Enables selected Comp_E interrupt sources. More... | |
void | Comp_E_disableInterrupt (uint16_t baseAddress, uint16_t interruptMask) |
Disables selected Comp_E interrupt sources. More... | |
void | Comp_E_clearInterrupt (uint16_t baseAddress, uint16_t interruptFlagMask) |
Clears Comp_E interrupt flags. More... | |
uint8_t | Comp_E_getInterruptStatus (uint16_t baseAddress, uint16_t interruptFlagMask) |
Gets the current Comp_E interrupt status. More... | |
void | Comp_E_setInterruptEdgeDirection (uint16_t baseAddress, uint16_t edgeDirection) |
Explicitly sets the edge direction that would trigger an interrupt. More... | |
void | Comp_E_toggleInterruptEdgeDirection (uint16_t baseAddress) |
Toggles the edge direction that would trigger an interrupt. More... | |
void | Comp_E_enable (uint16_t baseAddress) |
Turns on the Comp_E module. More... | |
void | Comp_E_disable (uint16_t baseAddress) |
Turns off the Comp_E module. More... | |
void | Comp_E_shortInputs (uint16_t baseAddress) |
Shorts the two input pins chosen during initialization. More... | |
void | Comp_E_unshortInputs (uint16_t baseAddress) |
Disables the short of the two input pins chosen during initialization. More... | |
void | Comp_E_disableInputBuffer (uint16_t baseAddress, uint16_t inputPort) |
Disables the input buffer of the selected input port to effectively allow for analog signals. More... | |
void | Comp_E_enableInputBuffer (uint16_t baseAddress, uint16_t inputPort) |
Enables the input buffer of the selected input port to allow for digital signals. More... | |
void | Comp_E_swapIO (uint16_t baseAddress) |
Toggles the bit that swaps which terminals the inputs go to, while also inverting the output of the Comp_E. More... | |
uint16_t | Comp_E_outputValue (uint16_t baseAddress) |
Returns the output value of the Comp_E module. More... | |
void Comp_E_clearInterrupt | ( | uint16_t | baseAddress, |
uint16_t | interruptFlagMask | ||
) |
Clears Comp_E interrupt flags.
The Comp_E interrupt source is cleared, so that it no longer asserts. The highest interrupt flag is automatically cleared when an interrupt vector generator is used.
baseAddress | is the base address of the COMP_E module. |
interruptFlagMask | Mask value is the logical OR of any of the following:
|
void Comp_E_disable | ( | uint16_t | baseAddress | ) |
Turns off the Comp_E module.
This function clears the CEON bit disabling the operation of the Comp_E module, saving from excess power consumption.
baseAddress | is the base address of the COMP_E module. |
Modified bits are CEON of CECTL1 register.
void Comp_E_disableInputBuffer | ( | uint16_t | baseAddress, |
uint16_t | inputPort | ||
) |
Disables the input buffer of the selected input port to effectively allow for analog signals.
This function sets the bit to disable the buffer for the specified input port to allow for analog signals from any of the Comp_E input pins. This bit is automatically set when the input is initialized to be used with the Comp_E module. This function should be used whenever an analog input is connected to one of these pins to prevent parasitic voltage from causing unexpected results.
baseAddress | is the base address of the COMP_E module. |
inputPort | is the port in which the input buffer will be disabled. Mask value is the logical OR of any of the following:
|
void Comp_E_disableInterrupt | ( | uint16_t | baseAddress, |
uint16_t | interruptMask | ||
) |
Disables selected Comp_E interrupt sources.
Disables the indicated Comp_E interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
baseAddress | is the base address of the COMP_E module. |
interruptMask | Mask value is the logical OR of any of the following:
|
void Comp_E_enable | ( | uint16_t | baseAddress | ) |
Turns on the Comp_E module.
This function sets the bit that enables the operation of the Comp_E module.
baseAddress | is the base address of the COMP_E module. |
void Comp_E_enableInputBuffer | ( | uint16_t | baseAddress, |
uint16_t | inputPort | ||
) |
Enables the input buffer of the selected input port to allow for digital signals.
This function clears the bit to enable the buffer for the specified input port to allow for digital signals from any of the Comp_E input pins. This should not be reset if there is an analog signal connected to the specified input pin to prevent from unexpected results.
baseAddress | is the base address of the COMP_E module. |
inputPort | is the port in which the input buffer will be enabled. Mask value is the logical OR of any of the following:
|
void Comp_E_enableInterrupt | ( | uint16_t | baseAddress, |
uint16_t | interruptMask | ||
) |
Enables selected Comp_E interrupt sources.
Enables the indicated Comp_E interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor. Does not clear interrupt flags.
baseAddress | is the base address of the COMP_E module. |
interruptMask | Mask value is the logical OR of any of the following:
|
uint8_t Comp_E_getInterruptStatus | ( | uint16_t | baseAddress, |
uint16_t | interruptFlagMask | ||
) |
Gets the current Comp_E interrupt status.
This returns the interrupt status for the Comp_E module based on which flag is passed.
baseAddress | is the base address of the COMP_E module. |
interruptFlagMask | Mask value is the logical OR of any of the following:
|
bool Comp_E_init | ( | uint16_t | baseAddress, |
Comp_E_initParam * | param | ||
) |
Initializes the Comp_E Module.
Upon successful initialization of the Comp_E module, this function will have reset all necessary register bits and set the given options in the registers. To actually use the Comp_E module, the Comp_E_enable() function must be explicitly called before use. If a Reference Voltage is set to a terminal, the Voltage should be set using the setReferenceVoltage() function.
baseAddress | is the base address of the COMP_E module. |
param | is the pointer to struct for initialization. |
References Comp_E_initParam::invertedOutputPolarity, Comp_E_initParam::negTerminalInput, Comp_E_initParam::outputFilterEnableAndDelayLevel, and Comp_E_initParam::posTerminalInput.
uint16_t Comp_E_outputValue | ( | uint16_t | baseAddress | ) |
Returns the output value of the Comp_E module.
Returns the output value of the Comp_E module.
baseAddress | is the base address of the COMP_E module. |
void Comp_E_setInterruptEdgeDirection | ( | uint16_t | baseAddress, |
uint16_t | edgeDirection | ||
) |
Explicitly sets the edge direction that would trigger an interrupt.
This function will set which direction the output will have to go, whether rising or falling, to generate an interrupt based on a non-inverted interrupt.
baseAddress | is the base address of the COMP_E module. |
edgeDirection | determines which direction the edge would have to go to generate an interrupt based on the non-inverted interrupt flag. Valid values are:
|
void Comp_E_setPowerMode | ( | uint16_t | baseAddress, |
uint16_t | powerMode | ||
) |
Sets the power mode.
baseAddress | is the base address of the COMP_E module. |
powerMode | decides the power mode Valid values are:
|
void Comp_E_setReferenceAccuracy | ( | uint16_t | baseAddress, |
uint16_t | referenceAccuracy | ||
) |
Sets the reference accuracy.
The reference accuracy is set to the desired setting. Clocked is better for low power operations but has a lower accuracy.
baseAddress | is the base address of the COMP_E module. |
referenceAccuracy | is the reference accuracy setting of the COMP_E. Valid values are:
|
void Comp_E_setReferenceVoltage | ( | uint16_t | baseAddress, |
uint16_t | supplyVoltageReferenceBase, | ||
uint16_t | lowerLimitSupplyVoltageFractionOf32, | ||
uint16_t | upperLimitSupplyVoltageFractionOf32 | ||
) |
Generates a Reference Voltage to the terminal selected during initialization.
Use this function to generate a voltage to serve as a reference to the terminal selected at initialization. The voltage is determined by the equation: Vbase * (Numerator / 32). If the upper and lower limit voltage numerators are equal, then a static reference is defined, whereas they are different then a hysteresis effect is generated.
baseAddress | is the base address of the COMP_E module. |
supplyVoltageReferenceBase | decides the source and max amount of Voltage that can be used as a reference. Valid values are:
|
lowerLimitSupplyVoltageFractionOf32 | is the numerator of the equation to generate the reference voltage for the lower limit reference voltage. Modified bits are CEREF0 of CECTL2 register. |
upperLimitSupplyVoltageFractionOf32 | is the numerator of the equation to generate the reference voltage for the upper limit reference voltage. Modified bits are CEREF1 of CECTL2 register. |
void Comp_E_shortInputs | ( | uint16_t | baseAddress | ) |
Shorts the two input pins chosen during initialization.
This function sets the bit that shorts the devices attached to the input pins chosen from the initialization of the Comp_E.
baseAddress | is the base address of the COMP_E module. |
Modified bits are CESHORT of CECTL1 register.
void Comp_E_swapIO | ( | uint16_t | baseAddress | ) |
Toggles the bit that swaps which terminals the inputs go to, while also inverting the output of the Comp_E.
This function toggles the bit that controls which input goes to which terminal. After initialization, this bit is set to 0, after toggling it once the inputs are routed to the opposite terminal and the output is inverted.
baseAddress | is the base address of the COMP_E module. |
void Comp_E_toggleInterruptEdgeDirection | ( | uint16_t | baseAddress | ) |
Toggles the edge direction that would trigger an interrupt.
This function will toggle which direction the output will have to go, whether rising or falling, to generate an interrupt based on a non-inverted interrupt. If the direction was rising, it is now falling, if it was falling, it is now rising.
baseAddress | is the base address of the COMP_E module. |
Modified bits are CEIES of CECTL1 register.
void Comp_E_unshortInputs | ( | uint16_t | baseAddress | ) |
Disables the short of the two input pins chosen during initialization.
This function clears the bit that shorts the devices attached to the input pins chosen from the initialization of the Comp_E.
baseAddress | is the base address of the COMP_E module. |
Modified bits are CESHORT of CECTL1 register.