PSOC E8XXGP Device Support Library

| PSOC E8XXGP Device Support Library

API Reference | Functions
Functions
PDL API Reference » AUTONOMOUS ANALOG (Autonomous Analog Block) » FIFO (The buffer block to store collected data)

## General Description

## API Reference
| Initialization Functions
| This set of functions is used to configure the FIFO.
| Interrupt Functions
| This set of functions is used to handle interrupts in the FIFO.

## Functions
__STATIC_INLINE uint16_t | Cy_AutAnalog_FIFO_GetSize (uint8_t fifoIdx, uint8_t buffIdx)
| Returns the current number of data samples in the specified FIFO buffer. More...
__STATIC_INLINE int32_t | Cy_AutAnalog_FIFO_ReadWord (uint8_t fifoIdx, uint8_t buffIdx)
| Reads one data sample from the specified FIFO buffer. More...
uint16_t | Cy_AutAnalog_FIFO_ReadData (uint8_t fifoIdx, uint8_t buffIdx, uint16_t words, int32_t *data)
| Reads the given number of words from the specified FIFO buffer. More...
uint16_t | Cy_AutAnalog_FIFO_ReadAllData (uint8_t fifoIdx, uint8_t buffIdx, int32_t *data)
| Reads all data from the specified FIFO buffer. More...
uint16_t | Cy_AutAnalog_FIFO_ReadDataChanId (uint8_t fifoIdx, uint8_t buffIdx, cy_en_autanalog_sar_input_t input, int32_t *data, uint8_t *chanID)
| Reads all of the data and the channel IDs from the specified FIFO buffer. More...

## Function Documentation

## ◆ Cy_AutAnalog_FIFO_GetSize()

__STATIC_INLINE uint16_t Cy_AutAnalog_FIFO_GetSize | ( | uint8_t | fifoIdx,
|  | uint8_t | buffIdx
| ) |  |

Returns the current number of data samples in the specified FIFO buffer.

Parameters

  fifoIdx | The index of the FIFO subsystem within the Autonomous Analog.

Note
  One instance of the FIFO is currently supported.

Parameters

  buffIdx | The buffer index within the FIFO subsystem. The number of buffers depends on the cy_stc_autanalog_fifo_cfg_t::split setting.

Returns
  The 9-bit number of data samples.

Note
  Under invalid FIFO index, "zero" returns in the result.

## ◆ Cy_AutAnalog_FIFO_ReadWord()

__STATIC_INLINE int32_t Cy_AutAnalog_FIFO_ReadWord | ( | uint8_t | fifoIdx,
|  | uint8_t | buffIdx
| ) |  |

Reads one data sample from the specified FIFO buffer.

Note
  The ADC result sign extended to 32 bits.

Parameters

  fifoIdx | The index of the FIFO subsystem within the Autonomous Analog.

Note
  One instance of the FIFO is currently supported.

Parameters

  buffIdx | The buffer index within the FIFO subsystem. The number of buffers depends on the cy_stc_autanalog_fifo_cfg_t::split setting.

Returns
  The 32-bit data sample.

Note
  If the FIFO index is not valid, zero is returned in the result.

## ◆ Cy_AutAnalog_FIFO_ReadData()

uint16_t Cy_AutAnalog_FIFO_ReadData | ( | uint8_t | fifoIdx,
|  | uint8_t | buffIdx,
|  | uint16_t | words,
|  | int32_t * | data
| ) |  |

Reads the given number of words from the specified FIFO buffer.

Note
  The ADC result sign extended to 32 bits.

Parameters

  fifoIdx | The index of the FIFO subsystem within the Autonomous Analog.

Note
  One instance of the FIFO is currently supported.

Parameters

  buffIdx | The buffer index within the FIFO subsystem.
  words | The number of words to read from the FIFO buffer.
  data | The pointer to the data array with a size bigger or equal to the number of words to read from the FIFO buffer.

Returns
  The 9-bit size of the buffer payload to be copied into the data array.

## ◆ Cy_AutAnalog_FIFO_ReadAllData()

uint16_t Cy_AutAnalog_FIFO_ReadAllData | ( | uint8_t | fifoIdx,
|  | uint8_t | buffIdx,
|  | int32_t * | data
| ) |  |

Reads all data from the specified FIFO buffer.

Note
  The ADC result sign extended to 32 bits.

Parameters

  fifoIdx | The index of the FIFO subsystem within the Autonomous Analog.

Note
  One instance of the FIFO is currently supported.

Parameters

  buffIdx | The buffer index within the FIFO subsystem. The number of buffers depends on the cy_stc_autanalog_fifo_cfg_t::split setting.
  data | The pointer to the data array with a size not less than the buffer size (specified by the cy_stc_autanalog_fifo_cfg_t::split setting)

Returns
  The 9-bit size of the buffer payload to be copied into the data array.

## ◆ Cy_AutAnalog_FIFO_ReadDataChanId()

uint16_t Cy_AutAnalog_FIFO_ReadDataChanId | ( | uint8_t | fifoIdx,
|  | uint8_t | buffIdx,
|  | cy_en_autanalog_sar_input_t | input,
|  | int32_t * | data,
|  | uint8_t * | chanID
| ) |  |

Reads all of the data and the channel IDs from the specified FIFO buffer.

Note
  The ADC result sign extended to 32 bits.

Parameters

  fifoIdx | The index of the FIFO subsystem within the Autonomous Analog.

Note
  One instance of the FIFO is currently supported.

Parameters

  buffIdx | The buffer index within the FIFO subsystem. The number of buffers depends on the cy_stc_autanalog_fifo_cfg_t::split setting.
  input | The ADC input type is either GPIO or MUX.
  data | The pointer to the data array with a size not less than the buffer size (specified by the cy_stc_autanalog_fifo_cfg_t::split setting)
  chanID | The pointer to the channel IDs array with a size not less than the buffer size (specified by the cy_stc_autanalog_fifo_cfg_t::split setting)

Returns
  The 9-bit size of the buffer payload to be copied into the data and the channel ID arrays.