PSOC E8XXGP Device Support Library

General Description

This set of functions is used for data handling in the DAC look-up table.

Functions

__STATIC_INLINE int32_t Cy_AutAnalog_DAC_Data_ReadSample (uint8_t dacIdx, uint16_t dataIdx)
 Reads data for a DAC sample from the look-up table at the defined index. More...
 
__STATIC_INLINE cy_en_autanalog_dac_out_drive_mode_t Cy_AutAnalog_DAC_Data_GetDriveMode (uint8_t dacIdx, uint16_t dataIdx)
 Reads the drive mode of the DAC output from the look-up table at the defined index. More...
 
__STATIC_INLINE void Cy_AutAnalog_DAC_Data_WriteSample (uint8_t dacIdx, uint16_t dataIdx, int32_t sample)
 Writes data for a DAC sample to a look-up table at a defined index. More...
 
__STATIC_INLINE void Cy_AutAnalog_DAC_Data_SetDriveMode (uint8_t dacIdx, uint16_t dataIdx, cy_en_autanalog_dac_out_drive_mode_t driveMode)
 Writes the drive mode of the DAC output to the look-up table at a defined index. More...
 
cy_en_autanalog_status_t Cy_AutAnalog_DAC_Data_ReadWaveform (uint8_t dacIdx, uint16_t dataIdx, uint16_t numSamples, int32_t *waveform)
 Reads a block of samples for the entire waveform from the DAC look-up table, starting from a defined index. More...
 
cy_en_autanalog_status_t Cy_AutAnalog_DAC_Data_GetDriveModeArray (uint8_t dacIdx, uint16_t dataIdx, uint16_t numSamples, cy_en_autanalog_dac_out_drive_mode_t *driveModeArray)
 Reads the block of Drive mode configurations for the DAC output from the look-up table. More...
 
cy_en_autanalog_status_t Cy_AutAnalog_DAC_Data_WriteWaveform (uint8_t dacIdx, uint16_t dataIdx, uint16_t numSamples, const int32_t *waveform)
 Writes a block of samples for the entire waveform into the DAC look-up table, starting from a defined index. More...
 
cy_en_autanalog_status_t Cy_AutAnalog_DAC_Data_SetDriveModeArray (uint8_t dacIdx, uint16_t dataIdx, uint16_t numSamples, const cy_en_autanalog_dac_out_drive_mode_t *driveModeArray)
 Writes a block of Drive mode configurations for the DAC output to the look-up table. More...
 
void Cy_AutAnalog_DAC_Data_SetDriveModeAll (uint8_t dacIdx, const cy_en_autanalog_dac_out_drive_mode_t driveModeAll)
 Modifies the DAC output Drive mode for the entire look-up table according to the supplied configuration. More...
 

Function Documentation

◆ Cy_AutAnalog_DAC_Data_ReadSample()

__STATIC_INLINE int32_t Cy_AutAnalog_DAC_Data_ReadSample ( uint8_t  dacIdx,
uint16_t  dataIdx 
)

Reads data for a DAC sample from the look-up table at the defined index.

Note
The DAC should not output a waveform while this API is being called.
Parameters
dacIdxThe index of the DAC subsystem within the Autonomous Analog, see cy_stc_autanalog_cfg_t::dac
dataIdxThe sample index in the DAC look-up table.
Returns
The sample value from the DAC look-up table.
Note
Under invalid DAC index, "zero" returns in the result.
The DAC HW does not preserve the sign of the output value.

◆ Cy_AutAnalog_DAC_Data_GetDriveMode()

__STATIC_INLINE cy_en_autanalog_dac_out_drive_mode_t Cy_AutAnalog_DAC_Data_GetDriveMode ( uint8_t  dacIdx,
uint16_t  dataIdx 
)

Reads the drive mode of the DAC output from the look-up table at the defined index.

Note
The DAC should not output a waveform while this API is being called.
Parameters
dacIdxThe index of the DAC subsystem within the Autonomous Analog, see cy_stc_autanalog_cfg_t::dac
dataIdxThe sample index in the DAC look-up table.
Returns
The configuration of the DAC output drive mode, see cy_en_autanalog_dac_out_drive_mode_t.
Note
Under invalid DAC index, CY_AUTANALOG_DAC_OUT_DRIVE_MODE_EN returns in the result.

◆ Cy_AutAnalog_DAC_Data_WriteSample()

__STATIC_INLINE void Cy_AutAnalog_DAC_Data_WriteSample ( uint8_t  dacIdx,
uint16_t  dataIdx,
int32_t  sample 
)

Writes data for a DAC sample to a look-up table at a defined index.

Note
The DAC should not output a waveform while this API is being called.
Parameters
dacIdxThe index of the DAC subsystem within the Autonomous Analog, see cy_stc_autanalog_cfg_t::dac
dataIdxThe sample index in the DAC look-up table.
Note
Under invalid DAC index, the function has no effect.
Parameters
sampleThe sample value for the DAC look-up table.

◆ Cy_AutAnalog_DAC_Data_SetDriveMode()

__STATIC_INLINE void Cy_AutAnalog_DAC_Data_SetDriveMode ( uint8_t  dacIdx,
uint16_t  dataIdx,
cy_en_autanalog_dac_out_drive_mode_t  driveMode 
)

Writes the drive mode of the DAC output to the look-up table at a defined index.

Note
The DAC should not output a waveform while this API is being called.
Parameters
dacIdxThe index of the DAC subsystem within the Autonomous Analog, see cy_stc_autanalog_cfg_t::dac
dataIdxThe sample index in the DAC look-up table.
Note
Under invalid DAC index, the function has no effect.
Parameters
driveModeThe configuration of the DAC output drive mode, see cy_en_autanalog_dac_out_drive_mode_t.

◆ Cy_AutAnalog_DAC_Data_ReadWaveform()

cy_en_autanalog_status_t Cy_AutAnalog_DAC_Data_ReadWaveform ( uint8_t  dacIdx,
uint16_t  dataIdx,
uint16_t  numSamples,
int32_t *  waveform 
)

Reads a block of samples for the entire waveform from the DAC look-up table, starting from a defined index.

Note
The DAC should not output a waveform while this API is being called.
The function does not apply if the channel operMode is set to CY_AUTANALOG_DAC_WAVEFORM_MODE_DATA, see cy_stc_autanalog_dac_ch_t::operMode.
Parameters
dacIdxThe index of the DAC subsystem within the Autonomous Analog, see cy_stc_autanalog_cfg_t::dac
dataIdxStart index of the DAC waveform in the look-up table. See cy_stc_autanalog_dac_ch_t::startAddr
numSamplesThe number of samples for the DAC waveform: numSamples = endAddr - startAddr + 1; see cy_stc_autanalog_dac_ch_t.
waveformThe pointer to the location of the DAC waveform data.
Returns
Status of execution, cy_en_autanalog_status_t.

◆ Cy_AutAnalog_DAC_Data_GetDriveModeArray()

cy_en_autanalog_status_t Cy_AutAnalog_DAC_Data_GetDriveModeArray ( uint8_t  dacIdx,
uint16_t  dataIdx,
uint16_t  numSamples,
cy_en_autanalog_dac_out_drive_mode_t driveModeArray 
)

Reads the block of Drive mode configurations for the DAC output from the look-up table.

Note
The DAC should not output a waveform while this API is being called.
The function does not apply if the channel operMode is set to CY_AUTANALOG_DAC_WAVEFORM_MODE_DATA, see cy_stc_autanalog_dac_ch_t::operMode.
Parameters
dacIdxThe index of the DAC subsystem within the Autonomous Analog, see cy_stc_autanalog_cfg_t::dac
dataIdxStart index of the waveform in the DAC look-up table. See cy_stc_autanalog_dac_ch_t::startAddr
numSamplesThe number of samples for the DAC waveform: numSamples = endAddr - startAddr + 1; see cy_stc_autanalog_dac_ch_t.
driveModeArrayThe pointer to the location of the DAC output drive mode configurations, see cy_en_autanalog_dac_out_drive_mode_t.
Returns
Status of execution, cy_en_autanalog_status_t.

◆ Cy_AutAnalog_DAC_Data_WriteWaveform()

cy_en_autanalog_status_t Cy_AutAnalog_DAC_Data_WriteWaveform ( uint8_t  dacIdx,
uint16_t  dataIdx,
uint16_t  numSamples,
const int32_t *  waveform 
)

Writes a block of samples for the entire waveform into the DAC look-up table, starting from a defined index.

Note
The DAC should not output a waveform while this API is being called.
The function does not apply if the channel operMode is set to CY_AUTANALOG_DAC_WAVEFORM_MODE_DATA, see cy_stc_autanalog_dac_ch_t::operMode.
Parameters
dacIdxThe index of the DAC subsystem within the Autonomous Analog, see cy_stc_autanalog_cfg_t::dac
dataIdxStart index of the waveform in the DAC look-up table. See cy_stc_autanalog_dac_ch_t::startAddr
numSamplesThe number of samples for the DAC waveform: numSamples = endAddr - startAddr + 1; see cy_stc_autanalog_dac_ch_t.
waveformThe pointer to the location of the DAC waveform data.
Returns
Status of execution, cy_en_autanalog_status_t.

◆ Cy_AutAnalog_DAC_Data_SetDriveModeArray()

cy_en_autanalog_status_t Cy_AutAnalog_DAC_Data_SetDriveModeArray ( uint8_t  dacIdx,
uint16_t  dataIdx,
uint16_t  numSamples,
const cy_en_autanalog_dac_out_drive_mode_t driveModeArray 
)

Writes a block of Drive mode configurations for the DAC output to the look-up table.

Note
The DAC should not output a waveform while this API is being called.
The function does not apply if the channel operMode is set to CY_AUTANALOG_DAC_WAVEFORM_MODE_DATA, see cy_stc_autanalog_dac_ch_t::operMode.
Parameters
dacIdxThe index of the DAC subsystem within the Autonomous Analog, see cy_stc_autanalog_cfg_t::dac
dataIdxStart index of the waveform in the DAC look-up table. See cy_stc_autanalog_dac_ch_t::startAddr
numSamplesThe number of samples for the waveform: numSamples = endAddr - startAddr + 1; see cy_stc_autanalog_dac_ch_t.
driveModeArrayThe pointer to the location of the DAC output drive mode configurations, see cy_en_autanalog_dac_out_drive_mode_t.
Returns
Status of execution, cy_en_autanalog_status_t.

◆ Cy_AutAnalog_DAC_Data_SetDriveModeAll()

void Cy_AutAnalog_DAC_Data_SetDriveModeAll ( uint8_t  dacIdx,
const cy_en_autanalog_dac_out_drive_mode_t  driveModeAll 
)

Modifies the DAC output Drive mode for the entire look-up table according to the supplied configuration.

Note
The DAC should not output a waveform while this API is being called.
The function does not apply if the channel operMode is set to CY_AUTANALOG_DAC_WAVEFORM_MODE_DATA, see cy_stc_autanalog_dac_ch_t::operMode.
Parameters
dacIdxThe index of the DAC subsystem within the Autonomous Analog, see cy_stc_autanalog_cfg_t::dac
Note
Under invalid DAC index, the function has no effect.
Parameters
driveModeAllThe DAC output drive mode configuration, see cy_en_autanalog_dac_out_drive_mode_t.