Functions | |
void | SD24_B_init (uint16_t baseAddress, SD24_B_initParam *param) |
Initializes the SD24_B Module. More... | |
void | SD24_B_initConverter (uint16_t baseAddress, SD24_B_initConverterParam *param) |
Configure SD24_B converter. More... | |
void | SD24_B_initConverterAdvanced (uint16_t baseAddress, SD24_B_initConverterAdvancedParam *param) |
Configure SD24_B converter - Advanced Configure. More... | |
void | SD24_B_setConverterDataFormat (uint16_t baseAddress, uint8_t converter, uint8_t dataFormat) |
Set SD24_B converter data format. More... | |
void | SD24_B_startGroupConversion (uint16_t baseAddress, uint8_t group) |
Start Conversion Group. More... | |
void | SD24_B_stopGroupConversion (uint16_t baseAddress, uint8_t group) |
Stop Conversion Group. More... | |
void | SD24_B_startConverterConversion (uint16_t baseAddress, uint8_t converter) |
Start Conversion for Converter. More... | |
void | SD24_B_stopConverterConversion (uint16_t baseAddress, uint8_t converter) |
Stop Conversion for Converter. More... | |
void | SD24_B_configureDMATrigger (uint16_t baseAddress, uint16_t interruptFlag) |
Configures the converter that triggers a DMA transfer. More... | |
void | SD24_B_setInterruptDelay (uint16_t baseAddress, uint8_t converter, uint8_t sampleDelay) |
Configures the delay for an interrupt to trigger. More... | |
void | SD24_B_setConversionDelay (uint16_t baseAddress, uint8_t converter, uint16_t cycleDelay) |
Configures the delay for the conversion start. More... | |
void | SD24_B_setOversampling (uint16_t baseAddress, uint8_t converter, uint16_t oversampleRatio) |
Configures the oversampling ratio for a converter. More... | |
void | SD24_B_setGain (uint16_t baseAddress, uint8_t converter, uint8_t gain) |
Configures the gain for the converter. More... | |
uint32_t | SD24_B_getResults (uint16_t baseAddress, uint8_t converter) |
Returns the results for a converter. More... | |
uint16_t | SD24_B_getHighWordResults (uint16_t baseAddress, uint8_t converter) |
Returns the high word results for a converter. More... | |
void | SD24_B_enableInterrupt (uint16_t baseAddress, uint8_t converter, uint16_t mask) |
Enables interrupts for the SD24_B Module. More... | |
void | SD24_B_disableInterrupt (uint16_t baseAddress, uint8_t converter, uint16_t mask) |
Disables interrupts for the SD24_B Module. More... | |
void | SD24_B_clearInterrupt (uint16_t baseAddress, uint8_t converter, uint16_t mask) |
Clears interrupts for the SD24_B Module. More... | |
uint16_t | SD24_B_getInterruptStatus (uint16_t baseAddress, uint8_t converter, uint16_t mask) |
Returns the interrupt status for the SD24_B Module. More... | |
void SD24_B_clearInterrupt | ( | uint16_t | baseAddress, |
uint8_t | converter, | ||
uint16_t | mask | ||
) |
Clears interrupts for the SD24_B Module.
This function clears interrupt flags for the SD24_B module.
baseAddress | is the base address of the SD24_B module. |
converter | is the selected converter. Valid values are:
|
mask | is the bit mask of the converter interrupt sources to clear. Mask value is the logical OR of any of the following:
|
void SD24_B_configureDMATrigger | ( | uint16_t | baseAddress, |
uint16_t | interruptFlag | ||
) |
Configures the converter that triggers a DMA transfer.
This function chooses which interrupt will trigger a DMA transfer.
baseAddress | is the base address of the SD24_B module. |
interruptFlag | selects the converter interrupt that triggers a DMA transfer. Valid values are:
|
void SD24_B_disableInterrupt | ( | uint16_t | baseAddress, |
uint8_t | converter, | ||
uint16_t | mask | ||
) |
Disables interrupts for the SD24_B Module.
This function disables interrupts for the SD24_B module.
baseAddress | is the base address of the SD24_B module. |
converter | is the selected converter. Valid values are:
|
mask | is the bit mask of the converter interrupt sources to be disabled. Mask value is the logical OR of any of the following:
|
Modified bits of SD24BIE register.
void SD24_B_enableInterrupt | ( | uint16_t | baseAddress, |
uint8_t | converter, | ||
uint16_t | mask | ||
) |
Enables interrupts for the SD24_B Module.
This function enables interrupts for the SD24_B module. Does not clear interrupt flags.
baseAddress | is the base address of the SD24_B module. |
converter | is the selected converter. Valid values are:
|
mask | is the bit mask of the converter interrupt sources to be enabled. Mask value is the logical OR of any of the following:
|
uint16_t SD24_B_getHighWordResults | ( | uint16_t | baseAddress, |
uint8_t | converter | ||
) |
Returns the high word results for a converter.
This function gets the results from the SD24MEMHx register and returns it.
baseAddress | is the base address of the SD24_B module. |
converter | selects the converter who's results will be returned Valid values are:
|
uint16_t SD24_B_getInterruptStatus | ( | uint16_t | baseAddress, |
uint8_t | converter, | ||
uint16_t | mask | ||
) |
Returns the interrupt status for the SD24_B Module.
This function returns interrupt flag statuses for the SD24_B module.
baseAddress | is the base address of the SD24_B module. |
converter | is the selected converter. Valid values are:
|
mask | is the bit mask of the converter interrupt sources to return. Mask value is the logical OR of any of the following:
|
uint32_t SD24_B_getResults | ( | uint16_t | baseAddress, |
uint8_t | converter | ||
) |
Returns the results for a converter.
This function gets the results from the SD24BMEMLx and SD24MEMHx registers and concatenates them to form a long. The actual result is a maximum 24 bits.
baseAddress | is the base address of the SD24_B module. |
converter | selects the converter who's results will be returned Valid values are:
|
void SD24_B_init | ( | uint16_t | baseAddress, |
SD24_B_initParam * | param | ||
) |
Initializes the SD24_B Module.
This function initializes the SD24_B module sigma-delta analog-to-digital conversions. Specifically the function sets up the clock source for the SD24_B core to use for conversions. Upon completion of the initialization the SD24_B interrupt registers will be reset and the given parameters will be set. The converter configuration settings are independent of this function. The values you choose for the clock divider and predivider are used to determine the effective clock frequency. The formula used is: f_sd24 = f_clk /(divider * predivider)
baseAddress | is the base address of the SD24_B module. |
param | is the pointer to struct for initialization. |
References SD24_B_initParam::clockDivider, SD24_B_initParam::clockPreDivider, SD24_B_initParam::clockSourceSelect, and SD24_B_initParam::referenceSelect.
void SD24_B_initConverter | ( | uint16_t | baseAddress, |
SD24_B_initConverterParam * | param | ||
) |
Configure SD24_B converter.
This function initializes a converter of the SD24_B module. Upon completion the converter will be ready for a conversion and can be started with the SD24_B_startGroupConversion() or SD24_B_startConverterConversion() depending on the startSelect parameter. Additional configuration such as data format can be configured in SD24_B_setConverterDataFormat().
baseAddress | is the base address of the SD24_B module. |
param | is the pointer to struct for converter configuration. |
References SD24_B_initConverterParam::alignment, SD24_B_initConverterParam::conversionMode, SD24_B_initConverterParam::converter, and SD24_B_initConverterParam::startSelect.
void SD24_B_initConverterAdvanced | ( | uint16_t | baseAddress, |
SD24_B_initConverterAdvancedParam * | param | ||
) |
Configure SD24_B converter - Advanced Configure.
This function initializes a converter of the SD24_B module. Upon completion the converter will be ready for a conversion and can be started with the SD24_B_startGroupConversion() or SD24_B_startConverterConversion() depending on the startSelect parameter.
baseAddress | is the base address of the SD24_B module. |
param | is the pointer to struct for converter advanced configuration. |
References SD24_B_initConverterAdvancedParam::alignment, SD24_B_initConverterAdvancedParam::conversionMode, SD24_B_initConverterAdvancedParam::converter, SD24_B_initConverterAdvancedParam::dataFormat, SD24_B_initConverterAdvancedParam::gain, SD24_B_initConverterAdvancedParam::oversampleRatio, SD24_B_initConverterAdvancedParam::sampleDelay, and SD24_B_initConverterAdvancedParam::startSelect.
void SD24_B_setConversionDelay | ( | uint16_t | baseAddress, |
uint8_t | converter, | ||
uint16_t | cycleDelay | ||
) |
Configures the delay for the conversion start.
This function configures the delay for the specified converter start. Please note the delay should be written before conversion or after corresponding conversion is completed. If no delay at start of conversion is desired, a previously written non-zero value must be changed to zero before starting the conversion.
baseAddress | is the base address of the SD24_B module. |
converter | selects the converter that will be delayed Valid values are:
|
cycleDelay | is the clock cycles to delay ranging from 0 to 1023. Modified bits are SD24PREx of SD24BPREx register. |
void SD24_B_setConverterDataFormat | ( | uint16_t | baseAddress, |
uint8_t | converter, | ||
uint8_t | dataFormat | ||
) |
Set SD24_B converter data format.
This function sets the converter format so that the resulting data can be viewed in either binary or 2's complement.
baseAddress | is the base address of the SD24_B module. |
converter | selects the converter that will be configured. Check datasheet for available converters on device. Valid values are:
|
dataFormat | selects how the data format of the results Valid values are:
|
void SD24_B_setGain | ( | uint16_t | baseAddress, |
uint8_t | converter, | ||
uint8_t | gain | ||
) |
Configures the gain for the converter.
This function configures the gain for a single converter.
baseAddress | is the base address of the SD24_B module. |
converter | selects the converter that will be configured Valid values are:
|
gain | selects the gain for the converter Valid values are:
|
void SD24_B_setInterruptDelay | ( | uint16_t | baseAddress, |
uint8_t | converter, | ||
uint8_t | sampleDelay | ||
) |
Configures the delay for an interrupt to trigger.
This function configures the delay for the first interrupt service request for the corresponding converter. This feature delays the interrupt request for a completed conversion by up to four conversion cycles allowing the digital filter to settle prior to generating an interrupt request.
baseAddress | is the base address of the SD24_B module. |
converter | selects the converter that will be stopped Valid values are:
|
sampleDelay | selects the delay for the interrupt Valid values are:
|
void SD24_B_setOversampling | ( | uint16_t | baseAddress, |
uint8_t | converter, | ||
uint16_t | oversampleRatio | ||
) |
Configures the oversampling ratio for a converter.
This function configures the oversampling ratio for a given converter.
baseAddress | is the base address of the SD24_B module. |
converter | selects the converter that will be configured Valid values are:
|
oversampleRatio | selects oversampling ratio for the converter Valid values are:
|
void SD24_B_startConverterConversion | ( | uint16_t | baseAddress, |
uint8_t | converter | ||
) |
Start Conversion for Converter.
This function starts a single converter.
baseAddress | is the base address of the SD24_B module. |
converter | selects the converter that will be started Valid values are:
|
void SD24_B_startGroupConversion | ( | uint16_t | baseAddress, |
uint8_t | group | ||
) |
Start Conversion Group.
This function starts all the converters that are associated with a group. To set a converter to a group use the SD24_B_configureConverter() function.
baseAddress | is the base address of the SD24_B module. |
group | selects the group that will be started Valid values are:
|
void SD24_B_stopConverterConversion | ( | uint16_t | baseAddress, |
uint8_t | converter | ||
) |
Stop Conversion for Converter.
This function stops a single converter.
baseAddress | is the base address of the SD24_B module. |
converter | selects the converter that will be stopped Valid values are:
|
void SD24_B_stopGroupConversion | ( | uint16_t | baseAddress, |
uint8_t | group | ||
) |
Stop Conversion Group.
This function stops all the converters that are associated with a group. To set a converter to a group use the SD24_B_configureConverter() function.
baseAddress | is the base address of the SD24_B module. |
group | selects the group that will be stopped Valid values are:
|