RTEMS: TX FIFO Management

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Macros | Functions
TX FIFO Management
Board Support Packages » ARM » Intel Cyclone V » Contributed Code » I2C Controller API

## Macros
#define | ALT_I2C_TX_FIFO_NUM_ENTRIES 64

## Functions
ALT_STATUS_CODE | alt_i2c_tx_fifo_is_empty (ALT_I2C_DEV_t *i2c_dev)
ALT_STATUS_CODE | alt_i2c_tx_fifo_is_full (ALT_I2C_DEV_t *i2c_dev)
ALT_STATUS_CODE | alt_i2c_tx_fifo_level_get (ALT_I2C_DEV_t *i2c_dev, uint32_t *num_entries)
ALT_STATUS_CODE | alt_i2c_tx_fifo_threshold_get (ALT_I2C_DEV_t *i2c_dev, uint8_t *threshold)
ALT_STATUS_CODE | alt_i2c_tx_fifo_threshold_set (ALT_I2C_DEV_t *i2c_dev, const uint8_t threshold)

## Detailed Description

The transmit FIFO has a configurable threshold value that controls the level of entries (or below) that sets the TX_EMPTY status condition and triggers an interrupt. The valid range is 0 - (ALT_I2C_TX_FIFO_NUM_ENTRIES-1), with the additional restriction that I2C controller does not allow this value to be set to a value larger than the depth of the buffer. If an attempt is made to do that, the actual value set will be the maximum depth of the buffer. A value of 0 sets the threshold for 0 entries, and a value of (ALT_I2C_TX_FIFO_NUM_ENTRIES-1) sets the threshold for (ALT_I2C_TX_FIFO_NUM_ENTRIES-1) entries.

## Macro Definition Documentation

## ◆ ALT_I2C_TX_FIFO_NUM_ENTRIES

#define ALT_I2C_TX_FIFO_NUM_ENTRIES 64

The number of entries (depth) of the I2C controller transmit FIFO.

## Function Documentation

## ◆ alt_i2c_tx_fifo_is_empty()

ALT_STATUS_CODE alt_i2c_tx_fifo_is_empty | ( | ALT_I2C_DEV_t * | i2c_dev | ) |

Returns ALT_E_TRUE when the transmit FIFO is empty.

Parameters

  i2c_dev | A pointer to the I2C controller device block instance.

Return values

  ALT_E_SUCCESS | Successful status.
  ALT_E_ERROR | Details about error status code

## ◆ alt_i2c_tx_fifo_is_full()

ALT_STATUS_CODE alt_i2c_tx_fifo_is_full | ( | ALT_I2C_DEV_t * | i2c_dev | ) |

Returns ALT_E_TRUE when the transmit FIFO is completely full.

Parameters

  i2c_dev | A pointer to the I2C controller device block instance.

Return values

  ALT_E_SUCCESS | Successful status.
  ALT_E_ERROR | Details about error status code

## ◆ alt_i2c_tx_fifo_level_get()

ALT_STATUS_CODE alt_i2c_tx_fifo_level_get | ( | ALT_I2C_DEV_t * | i2c_dev,
|  | uint32_t * | num_entries
| ) |  |

Returns the number of valid entries in the transmit FIFO.

Parameters

  i2c_dev | A pointer to the I2C controller device block instance.
  num_entries | [out] The number of entries in the transmit FIFO.

Return values

  ALT_E_SUCCESS | Successful status.
  ALT_E_ERROR | Details about error status code

## ◆ alt_i2c_tx_fifo_threshold_get()

ALT_STATUS_CODE alt_i2c_tx_fifo_threshold_get | ( | ALT_I2C_DEV_t * | i2c_dev,
|  | uint8_t * | threshold
| ) |  |

Gets the current transmit FIFO threshold level value.

Parameters

  i2c_dev | A pointer to the I2C controller device block instance.
  threshold | [out] The current threshold value.

Return values

  ALT_E_SUCCESS | Successful status.
  ALT_E_ERROR | Details about error status code

## ◆ alt_i2c_tx_fifo_threshold_set()

ALT_STATUS_CODE alt_i2c_tx_fifo_threshold_set | ( | ALT_I2C_DEV_t * | i2c_dev,
|  | const uint8_t | threshold
| ) |  |

Sets the current transmit FIFO threshold level value.

Parameters

  i2c_dev | A pointer to the I2C controller device block instance.
  threshold | The threshold value.

Return values

  ALT_E_SUCCESS | Successful status.
  ALT_E_ERROR | Details about error status code