Driver API for ACC (plib_acc.h) More...
Typedefs | |
| typedef void(* | ACC_CALLBACK_HANDLER) (uint32_t status) |
| ACC interrupt callback function type. | |
Functions | |
| void | ACC_Enable (void) |
| Enables the ACC peripheral. | |
| void | ACC_Disable (void) |
| Disables the ACC peripheral. | |
| void | ACC_ResetSoftware (void) |
| Performs a software reset of the ACC peripheral. | |
| bool | ACC_SelectPositiveInput (uint8_t positive) |
| Selects the positive input source for the ACC comparator. Module should be disabled before using this API. | |
| bool | ACC_SelectNegativeInput (uint8_t negative) |
| Selects the negative input source for the ACC comparator. Module should be disabled before using this API. | |
| bool | ACC_SetHysteresis (uint8_t hystersis) |
| Sets the hysteresis level for the ACC comparator. | |
| bool | ACC_SetCurrentMode (uint8_t isel) |
| Sets the operating current mode (speed/power) of the ACC. | |
| void | ACC_SetOutputInversion (bool invert) |
| Enables or disables inversion of the ACC comparator output. | |
| bool | ACC_SetEdgeType (uint8_t edge_type) |
| Configures the edge type that triggers an ACC comparison interrupt. | |
| void | ACC_EnableFaultOutput (void) |
| Enables the ACC fault output to the PWM fault input. | |
| void | ACC_DisableFaultOutput (void) |
| Disables the ACC fault output to the PWM fault input. | |
| void | ACC_SelectFaultSource (bool use_output) |
| Selects the source for the ACC fault output. | |
| bool | ACC_GetSynchronizedComparatorOutput (void) |
| Reads the SCO (Synchronized Comparator Output) bit from ACC_ISR. | |
| bool | ACC_ComparatorOutputIsValid (void) |
| Reads the MASK bit from ACC_ISR to check if the comparator output is valid. | |
| bool | ACC_GetAndClearComparisonEdge (void) |
| Reads and clears the comparison edge flag from the ACC status register. | |
| void | ACC_EnableWriteProtection (void) |
| Enables write protection on ACC configuration registers. | |
| void | ACC_DisableWriteProtection (void) |
| Disables write protection on ACC configuration registers. | |
| bool | ACC_WriteProtectionViolationHasOccurred (void) |
| Reads the write protection status register. | |
| void | ACC_EnableComparisonEdgeInterrupt (void) |
| Enables the ACC comparison edge interrupt in ACC_IER. | |
| void | ACC_DisableComparisonEdgeInterrupt (void) |
| Disables the ACC comparison edge interrupt. | |
| bool | ACC_GetComparisonEdgeStatus (void) |
| Reads the comparison edge interrupt mask status. | |
| void | ACC_SetCallbackHandler (ACC_CALLBACK_HANDLER callback) |
| Register a callback for ACC interrupts. | |
Driver API for ACC (plib_acc.h)
The following example demonstrates typical usage of the ACC peripheral:
| typedef void(* ACC_CALLBACK_HANDLER) (uint32_t status) |
ACC interrupt callback function type.
This function pointer type is used to register a user callback for the Analog Comparator controller (ACC) interrupt. The callback is invoked when an ACC interrupt occurs, providing the interrupt flags and user context.
| context | User-defined context value passed during callback registration. |
| bool ACC_ComparatorOutputIsValid | ( | void | ) |
Reads the MASK bit from ACC_ISR to check if the comparator output is valid.
| void ACC_Disable | ( | void | ) |
Disables the ACC peripheral.
| void ACC_DisableComparisonEdgeInterrupt | ( | void | ) |
Disables the ACC comparison edge interrupt.
| void ACC_DisableFaultOutput | ( | void | ) |
Disables the ACC fault output to the PWM fault input.
| void ACC_DisableWriteProtection | ( | void | ) |
Disables write protection on ACC configuration registers.
| void ACC_Enable | ( | void | ) |
Enables the ACC peripheral.
| void ACC_EnableComparisonEdgeInterrupt | ( | void | ) |
Enables the ACC comparison edge interrupt in ACC_IER.
| void ACC_EnableFaultOutput | ( | void | ) |
Enables the ACC fault output to the PWM fault input.
| void ACC_EnableWriteProtection | ( | void | ) |
Enables write protection on ACC configuration registers.
| bool ACC_GetAndClearComparisonEdge | ( | void | ) |
Reads and clears the comparison edge flag from the ACC status register.
| bool ACC_GetComparisonEdgeStatus | ( | void | ) |
Reads the comparison edge interrupt mask status.
| bool ACC_GetSynchronizedComparatorOutput | ( | void | ) |
Reads the SCO (Synchronized Comparator Output) bit from ACC_ISR.
| void ACC_ResetSoftware | ( | void | ) |
Performs a software reset of the ACC peripheral.
| void ACC_SelectFaultSource | ( | bool | use_output | ) |
Selects the source for the ACC fault output.
| useOutput | 0 or 1 for fault source selection |
| bool ACC_SelectNegativeInput | ( | uint8_t | negative | ) |
Selects the negative input source for the ACC comparator. Module should be disabled before using this API.
| negative | negative input channel selection |
| bool ACC_SelectPositiveInput | ( | uint8_t | positive | ) |
Selects the positive input source for the ACC comparator. Module should be disabled before using this API.
| positive | postive input channel selection |
| void ACC_SetCallbackHandler | ( | ACC_CALLBACK_HANDLER | callback | ) |
Register a callback for ACC interrupts.
Registers a user callback to be called from the AC interrupt handler when any enabled ACC interrupt occurs. The callback receives the interrupt flags and user context.
| [in] | callback | Pointer to the callback function (ACC_CALLBACK). |
| bool ACC_SetCurrentMode | ( | uint8_t | isel | ) |
Sets the operating current mode (speed/power) of the ACC.
| isel | Current mode selection |
| bool ACC_SetEdgeType | ( | uint8_t | edge_type | ) |
Configures the edge type that triggers an ACC comparison interrupt.
| edgetyp | edge type selection 0 to 2 |
| bool ACC_SetHysteresis | ( | uint8_t | hystersis | ) |
Sets the hysteresis level for the ACC comparator.
| hystersis | Hyseteresis selection 0 to 3 |
| void ACC_SetOutputInversion | ( | bool | invert | ) |
Enables or disables inversion of the ACC comparator output.
| invert | 1 to enable and 0 to disable. |
| bool ACC_WriteProtectionViolationHasOccurred | ( | void | ) |
Reads the write protection status register.