MSP430 DriverLib for MSP430F5xx_6xx Devices  2.91.13.01
sd24_b

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...
 

Detailed Description

Function Documentation

§ SD24_B_clearInterrupt()

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.

Parameters
baseAddressis the base address of the SD24_B module.
converteris the selected converter. Valid values are:
  • SD24_B_CONVERTER_0
  • SD24_B_CONVERTER_1
  • SD24_B_CONVERTER_2
  • SD24_B_CONVERTER_3
  • SD24_B_CONVERTER_4
  • SD24_B_CONVERTER_5
  • SD24_B_CONVERTER_6
  • SD24_B_CONVERTER_7
maskis the bit mask of the converter interrupt sources to clear. Mask value is the logical OR of any of the following:
  • SD24_B_CONVERTER_INTERRUPT
  • SD24_B_CONVERTER_OVERFLOW_INTERRUPT
    Modified bits are SD24OVIFGx of SD24BIFG register.
Returns
None

§ SD24_B_configureDMATrigger()

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.

Parameters
baseAddressis the base address of the SD24_B module.
interruptFlagselects the converter interrupt that triggers a DMA transfer. Valid values are:
  • SD24_B_DMA_TRIGGER_IFG0
  • SD24_B_DMA_TRIGGER_IFG1
  • SD24_B_DMA_TRIGGER_IFG2
  • SD24_B_DMA_TRIGGER_IFG3
  • SD24_B_DMA_TRIGGER_IFG4
  • SD24_B_DMA_TRIGGER_IFG5
  • SD24_B_DMA_TRIGGER_IFG6
  • SD24_B_DMA_TRIGGER_IFG7
  • SD24_B_DMA_TRIGGER_TRGIFG
    Modified bits are SD24DMAx of SD24BCTL1 register.
Returns
None

§ SD24_B_disableInterrupt()

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.

Parameters
baseAddressis the base address of the SD24_B module.
converteris the selected converter. Valid values are:
  • SD24_B_CONVERTER_0
  • SD24_B_CONVERTER_1
  • SD24_B_CONVERTER_2
  • SD24_B_CONVERTER_3
  • SD24_B_CONVERTER_4
  • SD24_B_CONVERTER_5
  • SD24_B_CONVERTER_6
  • SD24_B_CONVERTER_7
maskis the bit mask of the converter interrupt sources to be disabled. Mask value is the logical OR of any of the following:
  • SD24_B_CONVERTER_INTERRUPT
  • SD24_B_CONVERTER_OVERFLOW_INTERRUPT
    Modified bits are SD24OVIEx of SD24BIE register.

Modified bits of SD24BIE register.

Returns
None

§ SD24_B_enableInterrupt()

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.

Parameters
baseAddressis the base address of the SD24_B module.
converteris the selected converter. Valid values are:
  • SD24_B_CONVERTER_0
  • SD24_B_CONVERTER_1
  • SD24_B_CONVERTER_2
  • SD24_B_CONVERTER_3
  • SD24_B_CONVERTER_4
  • SD24_B_CONVERTER_5
  • SD24_B_CONVERTER_6
  • SD24_B_CONVERTER_7
maskis the bit mask of the converter interrupt sources to be enabled. Mask value is the logical OR of any of the following:
  • SD24_B_CONVERTER_INTERRUPT
  • SD24_B_CONVERTER_OVERFLOW_INTERRUPT
    Modified bits are SD24OVIEx of SD24BIE register.
Returns
None

§ SD24_B_getHighWordResults()

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.

Parameters
baseAddressis the base address of the SD24_B module.
converterselects the converter who's results will be returned Valid values are:
  • SD24_B_CONVERTER_0
  • SD24_B_CONVERTER_1
  • SD24_B_CONVERTER_2
  • SD24_B_CONVERTER_3
  • SD24_B_CONVERTER_4
  • SD24_B_CONVERTER_5
  • SD24_B_CONVERTER_6
  • SD24_B_CONVERTER_7
Returns
Result of conversion

§ SD24_B_getInterruptStatus()

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.

Parameters
baseAddressis the base address of the SD24_B module.
converteris the selected converter. Valid values are:
  • SD24_B_CONVERTER_0
  • SD24_B_CONVERTER_1
  • SD24_B_CONVERTER_2
  • SD24_B_CONVERTER_3
  • SD24_B_CONVERTER_4
  • SD24_B_CONVERTER_5
  • SD24_B_CONVERTER_6
  • SD24_B_CONVERTER_7
maskis the bit mask of the converter interrupt sources to return. Mask value is the logical OR of any of the following:
  • SD24_B_CONVERTER_INTERRUPT
  • SD24_B_CONVERTER_OVERFLOW_INTERRUPT
Returns
Logical OR of any of the following:
  • SD24_B_CONVERTER_INTERRUPT
  • SD24_B_CONVERTER_OVERFLOW_INTERRUPT
    indicating the status of the masked interrupts

§ SD24_B_getResults()

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.

Parameters
baseAddressis the base address of the SD24_B module.
converterselects the converter who's results will be returned Valid values are:
  • SD24_B_CONVERTER_0
  • SD24_B_CONVERTER_1
  • SD24_B_CONVERTER_2
  • SD24_B_CONVERTER_3
  • SD24_B_CONVERTER_4
  • SD24_B_CONVERTER_5
  • SD24_B_CONVERTER_6
  • SD24_B_CONVERTER_7
Returns
Result of conversion

§ SD24_B_init()

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)

Parameters
baseAddressis the base address of the SD24_B module.
paramis the pointer to struct for initialization.
Returns
None

References SD24_B_initParam::clockDivider, SD24_B_initParam::clockPreDivider, SD24_B_initParam::clockSourceSelect, and SD24_B_initParam::referenceSelect.

§ SD24_B_initConverter()

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().

Parameters
baseAddressis the base address of the SD24_B module.
paramis the pointer to struct for converter configuration.
Returns
None

References SD24_B_initConverterParam::alignment, SD24_B_initConverterParam::conversionMode, SD24_B_initConverterParam::converter, and SD24_B_initConverterParam::startSelect.

§ SD24_B_initConverterAdvanced()

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.

Parameters
baseAddressis the base address of the SD24_B module.
paramis the pointer to struct for converter advanced configuration.
Returns
None

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.

§ SD24_B_setConversionDelay()

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.

Parameters
baseAddressis the base address of the SD24_B module.
converterselects the converter that will be delayed Valid values are:
  • SD24_B_CONVERTER_0
  • SD24_B_CONVERTER_1
  • SD24_B_CONVERTER_2
  • SD24_B_CONVERTER_3
  • SD24_B_CONVERTER_4
  • SD24_B_CONVERTER_5
  • SD24_B_CONVERTER_6
  • SD24_B_CONVERTER_7
cycleDelayis the clock cycles to delay ranging from 0 to 1023.
Modified bits are SD24PREx of SD24BPREx register.
Returns
None

§ SD24_B_setConverterDataFormat()

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.

Parameters
baseAddressis the base address of the SD24_B module.
converterselects the converter that will be configured. Check datasheet for available converters on device. Valid values are:
  • SD24_B_CONVERTER_0
  • SD24_B_CONVERTER_1
  • SD24_B_CONVERTER_2
  • SD24_B_CONVERTER_3
  • SD24_B_CONVERTER_4
  • SD24_B_CONVERTER_5
  • SD24_B_CONVERTER_6
  • SD24_B_CONVERTER_7
dataFormatselects how the data format of the results Valid values are:
  • SD24_B_DATA_FORMAT_BINARY [Default]
  • SD24_B_DATA_FORMAT_2COMPLEMENT
    Modified bits are SD24DFx of SD24BCCTLx register.
Returns
None

§ SD24_B_setGain()

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.

Parameters
baseAddressis the base address of the SD24_B module.
converterselects the converter that will be configured Valid values are:
  • SD24_B_CONVERTER_0
  • SD24_B_CONVERTER_1
  • SD24_B_CONVERTER_2
  • SD24_B_CONVERTER_3
  • SD24_B_CONVERTER_4
  • SD24_B_CONVERTER_5
  • SD24_B_CONVERTER_6
  • SD24_B_CONVERTER_7
gainselects the gain for the converter Valid values are:
  • SD24_B_GAIN_1 [Default]
  • SD24_B_GAIN_2
  • SD24_B_GAIN_4
  • SD24_B_GAIN_8
  • SD24_B_GAIN_16
  • SD24_B_GAIN_32
  • SD24_B_GAIN_64
  • SD24_B_GAIN_128
    Modified bits are SD24GAINx of SD24BINCTLx register.
Returns
None

§ SD24_B_setInterruptDelay()

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.

Parameters
baseAddressis the base address of the SD24_B module.
converterselects the converter that will be stopped Valid values are:
  • SD24_B_CONVERTER_0
  • SD24_B_CONVERTER_1
  • SD24_B_CONVERTER_2
  • SD24_B_CONVERTER_3
  • SD24_B_CONVERTER_4
  • SD24_B_CONVERTER_5
  • SD24_B_CONVERTER_6
  • SD24_B_CONVERTER_7
sampleDelayselects the delay for the interrupt Valid values are:
  • SD24_B_FOURTH_SAMPLE_INTERRUPT [Default]
  • SD24_B_THIRD_SAMPLE_INTERRUPT
  • SD24_B_SECOND_SAMPLE_INTERRUPT
  • SD24_B_FIRST_SAMPLE_INTERRUPT
    Modified bits are SD24INTDLYx of SD24INCTLx register.
Returns
None

§ SD24_B_setOversampling()

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.

Parameters
baseAddressis the base address of the SD24_B module.
converterselects the converter that will be configured Valid values are:
  • SD24_B_CONVERTER_0
  • SD24_B_CONVERTER_1
  • SD24_B_CONVERTER_2
  • SD24_B_CONVERTER_3
  • SD24_B_CONVERTER_4
  • SD24_B_CONVERTER_5
  • SD24_B_CONVERTER_6
  • SD24_B_CONVERTER_7
oversampleRatioselects oversampling ratio for the converter Valid values are:
  • SD24_B_OVERSAMPLE_32
  • SD24_B_OVERSAMPLE_64
  • SD24_B_OVERSAMPLE_128
  • SD24_B_OVERSAMPLE_256
  • SD24_B_OVERSAMPLE_512
  • SD24_B_OVERSAMPLE_1024
    Modified bits are SD24OSRx of SD24BOSRx register.
Returns
None

§ SD24_B_startConverterConversion()

void SD24_B_startConverterConversion ( uint16_t  baseAddress,
uint8_t  converter 
)

Start Conversion for Converter.

This function starts a single converter.

Parameters
baseAddressis the base address of the SD24_B module.
converterselects the converter that will be started Valid values are:
  • SD24_B_CONVERTER_0
  • SD24_B_CONVERTER_1
  • SD24_B_CONVERTER_2
  • SD24_B_CONVERTER_3
  • SD24_B_CONVERTER_4
  • SD24_B_CONVERTER_5
  • SD24_B_CONVERTER_6
  • SD24_B_CONVERTER_7
    Modified bits are SD24SC of SD24BCCTLx register.
Returns
None

§ SD24_B_startGroupConversion()

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.

Parameters
baseAddressis the base address of the SD24_B module.
groupselects the group that will be started Valid values are:
  • SD24_B_GROUP0
  • SD24_B_GROUP1
  • SD24_B_GROUP2
  • SD24_B_GROUP3
    Modified bits are SD24DGRPxSC of SD24BCTL1 register.
Returns
None

§ SD24_B_stopConverterConversion()

void SD24_B_stopConverterConversion ( uint16_t  baseAddress,
uint8_t  converter 
)

Stop Conversion for Converter.

This function stops a single converter.

Parameters
baseAddressis the base address of the SD24_B module.
converterselects the converter that will be stopped Valid values are:
  • SD24_B_CONVERTER_0
  • SD24_B_CONVERTER_1
  • SD24_B_CONVERTER_2
  • SD24_B_CONVERTER_3
  • SD24_B_CONVERTER_4
  • SD24_B_CONVERTER_5
  • SD24_B_CONVERTER_6
  • SD24_B_CONVERTER_7
    Modified bits are SD24SC of SD24BCCTLx register.
Returns
None

§ SD24_B_stopGroupConversion()

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.

Parameters
baseAddressis the base address of the SD24_B module.
groupselects the group that will be stopped Valid values are:
  • SD24_B_GROUP0
  • SD24_B_GROUP1
  • SD24_B_GROUP2
  • SD24_B_GROUP3
    Modified bits are SD24DGRPxSC of SD24BCTL1 register.
Returns
None

Copyright 2020, Texas Instruments Incorporated