Driver API for DACC (plib_dacc.h) More...
Typedefs | |
| typedef uint32_t | DACC_CHANNEL_NUM |
| Type definition representing a DACC channel number (0/1). | |
| typedef void(* | DACC_CALLBACK) (uint32_t status) |
| Function pointer type for DACC event callback. | |
Enumerations | |
| enum | DACC_IBCTL_MODE { DACC_IBCTL_BYPASS = 0U , DACC_IBCTL_LOW_POWER = 1U , DACC_IBCTL_NORMAL = 2U , DACC_IBCTL_HIGH_POWER = 3U } |
| Enumeration for DACC analog output current bias (IBCTL) mode selection. More... | |
Functions | |
| void | DACC_ResetSoftware (void) |
| Performs a software reset of the DACC peripheral. | |
| void | DACC_EnableChannel (DACC_CHANNEL_NUM channel) |
| Enables the specified DACC output channel. | |
| void | DACC_DisableChannel (DACC_CHANNEL_NUM channel) |
| Disables the specified DACC output channel. | |
| bool | DACC_IsReady (DACC_CHANNEL_NUM channel) |
| Checks whether the specified DACC channel end-of-conversion is ready. | |
| bool | DACC_IsTXReady (DACC_CHANNEL_NUM channel) |
| Checks whether the specified DACC channel transmit buffer is ready for new data. | |
| void | DACC_WriteData (DACC_CHANNEL_NUM channel, uint16_t data) |
| Writes a half-word data value to the specified DACC channel. | |
| void | DACC_WriteDataWord (DACC_CHANNEL_NUM channel, uint16_t data0, uint16_t data1) |
| Writes a word (dual channel data) to the DACC in word transfer mode. | |
| void | DACC_SetPrescaler (uint8_t prescaler) |
| Sets the DACC peripheral clock prescaler value. | |
| void | DACC_EnableDifferentialMode (void) |
| Enables differential mode for the DACC output. | |
| void | DACC_DisableDifferentialMode (void) |
| Disables differential mode for the DACC output. | |
| void | DACC_EnableWordTransfer (void) |
| Enables word transfer mode (both channels written simultaneously). | |
| void | DACC_DisableWordTransfer (void) |
| Disables word transfer mode (channels written independently). | |
| void | DACC_EnableMaxSpeed (DACC_CHANNEL_NUM channel) |
| Enables max speed mode for the specified DACC channel. | |
| void | DACC_DisableMaxSpeed (DACC_CHANNEL_NUM channel) |
| Disables max speed mode for the specified DACC channel. | |
| void | DACC_EnableTrigger (DACC_CHANNEL_NUM channel, uint32_t trig_sel) |
| Enables hardware trigger for the specified DACC channel and selects the trigger source. | |
| void | DACC_DisableTrigger (DACC_CHANNEL_NUM channel) |
| Disables hardware trigger for the specified DACC channel (free-running mode). | |
| void | DACC_SetOSR (DACC_CHANNEL_NUM channel, uint32_t osr) |
| Sets the oversampling ratio (OSR) for the specified DACC channel. | |
| void | DACC_SetAnalogCurrent (DACC_CHANNEL_NUM channel, DACC_IBCTL_MODE mode) |
| Sets the analog output current bias (IBCTL) for the specified DACC channel. | |
| void | DACC_EnableWriteProtection (void) |
| Enables write protection for the DACC configuration registers. | |
| void | DACC_DisableWriteProtection (void) |
| Disables write protection for the DACC configuration registers. | |
| bool | DACC_GetWriteProtectionViolation (uint8_t *violation_src) |
| Retrieves the write protection violation status. | |
| void | DACC_EnableInterrupt (uint32_t flag) |
| Enables one or more DACC interrupt sources. | |
| void | DACC_DisableInterrupt (uint32_t flag) |
| Disables one or more DACC interrupt sources. | |
| void | DACC_SetCallbackHandler (DACC_CALLBACK callback) |
| Registers the callback function to be invoked from the DACC ISR. | |
Driver API for DACC (plib_dacc.h)
The following example demonstrates typical usage of the DACC peripheral:
| typedef void(* DACC_CALLBACK) (uint32_t status) |
Function pointer type for DACC event callback.
| status | DACC interrupt status register value at the time of the interrupt. |
| typedef uint32_t DACC_CHANNEL_NUM |
Type definition representing a DACC channel number (0/1).
| enum DACC_IBCTL_MODE |
| void DACC_DisableChannel | ( | DACC_CHANNEL_NUM | channel | ) |
Disables the specified DACC output channel.
| channel | DACC channel number (0 or 1). |
| void DACC_DisableDifferentialMode | ( | void | ) |
Disables differential mode for the DACC output.
| void DACC_DisableInterrupt | ( | uint32_t | flag | ) |
Disables one or more DACC interrupt sources.
| flag | Bitwise OR of DACC_IDR_*_Msk values representing the interrupt sources to disable. |
| void DACC_DisableMaxSpeed | ( | DACC_CHANNEL_NUM | channel | ) |
Disables max speed mode for the specified DACC channel.
| channel | DACC channel number (0 or 1). |
| void DACC_DisableTrigger | ( | DACC_CHANNEL_NUM | channel | ) |
Disables hardware trigger for the specified DACC channel (free-running mode).
| channel | DACC channel number (0 or 1). |
| void DACC_DisableWordTransfer | ( | void | ) |
Disables word transfer mode (channels written independently).
| void DACC_DisableWriteProtection | ( | void | ) |
Disables write protection for the DACC configuration registers.
| void DACC_EnableChannel | ( | DACC_CHANNEL_NUM | channel | ) |
Enables the specified DACC output channel.
| channel | DACC channel number (0 or 1). |
| void DACC_EnableDifferentialMode | ( | void | ) |
Enables differential mode for the DACC output.
| void DACC_EnableInterrupt | ( | uint32_t | flag | ) |
Enables one or more DACC interrupt sources.
| flag | Bitwise OR of DACC_IER_*_Msk values representing the interrupt sources to enable. |
| void DACC_EnableMaxSpeed | ( | DACC_CHANNEL_NUM | channel | ) |
Enables max speed mode for the specified DACC channel.
| channel | DACC channel number (0 or 1). |
| void DACC_EnableTrigger | ( | DACC_CHANNEL_NUM | channel, |
| uint32_t | trig_sel ) |
Enables hardware trigger for the specified DACC channel and selects the trigger source.
| channel | DACC channel number (0 or 1). |
| trig_sel | Trigger source selection value (refer to DACC_TRIGR register field definitions). |
| void DACC_EnableWordTransfer | ( | void | ) |
Enables word transfer mode (both channels written simultaneously).
| void DACC_EnableWriteProtection | ( | void | ) |
Enables write protection for the DACC configuration registers.
| bool DACC_GetWriteProtectionViolation | ( | uint8_t * | violation_src | ) |
Retrieves the write protection violation status.
| violation_src | Pointer to a variable that will receive the violation source identifier. |
| bool DACC_IsReady | ( | DACC_CHANNEL_NUM | channel | ) |
Checks whether the specified DACC channel end-of-conversion is ready.
| channel | DACC channel number (0 or 1). |
| bool DACC_IsTXReady | ( | DACC_CHANNEL_NUM | channel | ) |
Checks whether the specified DACC channel transmit buffer is ready for new data.
| channel | DACC channel number (0 or 1). |
| void DACC_ResetSoftware | ( | void | ) |
Performs a software reset of the DACC peripheral.
| void DACC_SetAnalogCurrent | ( | DACC_CHANNEL_NUM | channel, |
| DACC_IBCTL_MODE | mode ) |
Sets the analog output current bias (IBCTL) for the specified DACC channel.
| channel | DACC channel number (0 or 1). |
| mode | DACC_IBCTL_mode value selecting the analog current bias level. |
| void DACC_SetCallbackHandler | ( | DACC_CALLBACK | callback | ) |
Registers the callback function to be invoked from the DACC ISR.
| callback | Pointer to the callback function (NULL to clear). |
| void DACC_SetOSR | ( | DACC_CHANNEL_NUM | channel, |
| uint32_t | osr ) |
Sets the oversampling ratio (OSR) for the specified DACC channel.
| channel | DACC channel number (0 or 1). |
| osr | Oversampling ratio value (refer to DACC_TRIGR register OSR field definitions). |
| void DACC_SetPrescaler | ( | uint8_t | prescaler | ) |
Sets the DACC peripheral clock prescaler value.
| prescaler | 8-bit prescaler value to divide the peripheral clock. |
| void DACC_WriteData | ( | DACC_CHANNEL_NUM | channel, |
| uint16_t | data ) |
Writes a half-word data value to the specified DACC channel.
| channel | DACC channel number (0 or 1). |
| data | 16-bit data value to be converted. |
| void DACC_WriteDataWord | ( | DACC_CHANNEL_NUM | channel, |
| uint16_t | data0, | ||
| uint16_t | data1 ) |
Writes a word (dual channel data) to the DACC in word transfer mode.
| channel | DACC channel number (0 or 1). |
| data0 | 16-bit data value for channel x. |
| data1 | 16-bit data value for channel x. |