![]() |
NANO100_BSP V3.04.002
The Board Support Package for Nano100BN Series
|
Macros | |
#define | DAC_WRITE_DATA(dac, u32Ch, u32Data) |
Write data for conversion. More... | |
#define | DAC_ENABLE_GROUP_MODE(dac) |
Enable DAC group mode. More... | |
#define | DAC_DISABLE_GROUP_MODE(dac) |
Disable DAC group mode. More... | |
#define | DAC_IS_BUSY(dac, u32Ch) |
Get the busy state of DAC. More... | |
#define | DAC_GET_INT_FLAG(dac, u32Ch) |
Get the interrupt flag of specified channel. More... | |
#define | DAC_CLR_INT_FLAG(dac, u32Ch) |
This macro clear the interrupt status bit of specified channel. More... | |
#define | DAC_SET_REF_VOLTAGE(dac, u32Ref) |
Set the DAC reference voltage. This setting affects both DAC channel. More... | |
#define | DAC_ENABLE_INT(dac, u32Ch) |
This macro enable the interrupt of specified channel. More... | |
#define | DAC_DISABLE_INT(dac, u32Ch) |
This macro disable the interrupt of specified channel. More... | |
Functions | |
void | DAC_Open (DAC_T *dac, uint32_t u32Ch, uint32_t u32TrgSrc) |
This function make a DAC channel ready to convert. More... | |
void | DAC_Close (DAC_T *dac, uint32_t u32Ch) |
Disable DAC analog power. More... | |
int | DAC_SetDelayTime (DAC_T *dac, uint32_t u32Delay) |
Set delay time for DAC to become stable. More... | |
#define DAC_CLR_INT_FLAG | ( | dac, | |
u32Ch | |||
) |
#define DAC_DISABLE_GROUP_MODE | ( | dac | ) |
#define DAC_DISABLE_INT | ( | dac, | |
u32Ch | |||
) |
#define DAC_ENABLE_GROUP_MODE | ( | dac | ) |
#define DAC_ENABLE_INT | ( | dac, | |
u32Ch | |||
) |
#define DAC_GET_INT_FLAG | ( | dac, | |
u32Ch | |||
) |
Get the interrupt flag of specified channel.
[in] | dac | Base address of DAC module. |
[in] | u32Ch | DAC channel number, could be 0 or 1 |
0 | DAC interrupt flag is not set. |
1 | DAC interrupt flag is set. |
#define DAC_IS_BUSY | ( | dac, | |
u32Ch | |||
) |
Get the busy state of DAC.
[in] | dac | Base address of DAC module. |
[in] | u32Ch | DAC channel number, could be 0 or 1 |
0 | DAC is in idle state. |
1 | DAC is in busy state, or DAC is not in ready state. |
If this macro returns 1, DAC is not in ready state. Ether DAC is busy or not in ready state.
#define DAC_SET_REF_VOLTAGE | ( | dac, | |
u32Ref | |||
) |
Set the DAC reference voltage. This setting affects both DAC channel.
[in] | dac | Base address of DAC module |
[in] | u32Ref | The reference voltage selection. Valid values are: |
#define DAC_WRITE_DATA | ( | dac, | |
u32Ch, | |||
u32Data | |||
) |
void DAC_Close | ( | DAC_T * | dac, |
uint32_t | u32Ch | ||
) |
void DAC_Open | ( | DAC_T * | dac, |
uint32_t | u32Ch, | ||
uint32_t | u32TrgSrc | ||
) |
This function make a DAC channel ready to convert.
[in] | dac | Base address of DAC module. |
[in] | u32Ch | DAC channel number, could be 0 or 1 |
[in] | u32TrgSrc | Decides the trigger source of specified DAC channel. Valid options are: |
Definition at line 40 of file dac.c.
int DAC_SetDelayTime | ( | DAC_T * | dac, |
uint32_t | u32Delay | ||
) |
Set delay time for DAC to become stable.
[in] | dac | Base address of DAC module. |
[in] | u32Delay | Decides the DAC conversion settling time, Valid values are between 1~0xFF. |
0 | Success |
-1 | Failed, the new setting will cause stable time less than 2us. So new setting is not applied. |
For example, DAC controller clock speed is 12MHz and DAC conversion settling time is 3 us, u32Delay should be given the value 3 * 12 = 36.
Definition at line 94 of file dac.c.