PSOC E8XXGP Device Support Library

| PSOC E8XXGP Device Support Library

Functions
Target
PDL API Reference » I3C (I3C) » Functions

## General Description

## Functions
cy_en_i3c_status_t | Cy_I3C_TargetGetDynamicAddress (I3C_CORE_Type const *base, uint8_t *address, cy_stc_i3c_context_t const *context)
| Provides the controller assigned dynamic address of the target device. More...
uint32_t | Cy_I3C_TargetGetMaxReadLength (I3C_CORE_Type const *base, cy_stc_i3c_context_t const *context)
| Provides the maximum data read length of the target. More...
uint32_t | Cy_I3C_TargetGetMaxWriteLength (I3C_CORE_Type const *base, cy_stc_i3c_context_t const *context)
| Provides the maximum data write length of the target. More...
cy_en_i3c_status_t | Cy_I3C_TargetGenerateIbi (I3C_CORE_Type *base, cy_stc_i3c_ibi_t *ibitype, cy_stc_i3c_context_t *context)
| Generates the specified IBI on the bus. More...
void | Cy_I3C_TargetConfigReadBuf (I3C_CORE_Type *base, uint8_t *buffer, uint32_t size, cy_stc_i3c_context_t *context)
| Configures the buffer pointer and the read buffer size. More...
uint32_t | Cy_I3C_TargetGetReadTransferCount (I3C_CORE_Type const *base, cy_stc_i3c_context_t const *context)
| Returns the number of bytes read by the controller since the last time Cy_I3C_TargetConfigReadBuf was called. More...
void | Cy_I3C_TargetConfigWriteBuf (I3C_CORE_Type const *base, uint8_t *buffer, uint32_t size, cy_stc_i3c_context_t *context)
| Configures the buffer pointer and the write buffer size. More...
uint32_t | Cy_I3C_TargetGetWriteTransferCount (I3C_CORE_Type const *base, cy_stc_i3c_context_t const *context)
| Returns the number of bytes written by the controller since the last time Cy_I3C_TargetConfigWriteBuf was called. More...
cy_en_i3c_status_t | Cy_I3C_ConfigureVendorCCC0 (I3C_CORE_Type *base, cy_stc_i3c_ccc_cmd_t *cccCmd, cy_stc_i3c_context_t *context)
| Configure vendor specific CCC0. More...
cy_en_i3c_status_t | Cy_I3C_ConfigureVendorCCC1 (I3C_CORE_Type *base, cy_stc_i3c_ccc_cmd_t *cccCmd, cy_stc_i3c_context_t *context)
| Configure vendor specific CCC1. More...
void | Cy_I3C_RegisterCCCRespCallback (I3C_CORE_Type const *base, cy_cb_i3c_handle_ccc_response_t callback, cy_stc_i3c_context_t *context)
| Registers an event handler callback function of type cy_cb_i3c_handle_ccc_response_t which will be invoked by the PDL to indicate ccc response received by target. More...
cy_en_i3c_status_t | Cy_I3C_TargetGetCCCData (I3C_CORE_Type *base, uint8_t *buffer, uint32_t size, cy_stc_i3c_context_t *context)
| Read data received from controller write CCC into given buffer. More...

## Function Documentation

## ◆ Cy_I3C_TargetGetDynamicAddress()

cy_en_i3c_status_t Cy_I3C_TargetGetDynamicAddress | ( | I3C_CORE_Type const * | base,
|  | uint8_t * | address,
|  | cy_stc_i3c_context_t const * | context
| ) |  |

Provides the controller assigned dynamic address of the target device.

Parameters

  base | The pointer to the I3C instance.
  address | The pointer to the address.
  context | The pointer to the context structure cy_stc_i3c_context_t allocated by the user. The structure is used during the I3C operation for internal configuration and data retention. The user must not modify anything in this structure.

Returns
  cy_en_i3c_status_t.

Note
  I3C supports only Primary Controller mode in PSE84A0. Secondary controller mode and Target mode are supported in PSE84B0.

## ◆ Cy_I3C_TargetGetMaxReadLength()

uint32_t Cy_I3C_TargetGetMaxReadLength | ( | I3C_CORE_Type const * | base,
|  | cy_stc_i3c_context_t const * | context
| ) |  |

Provides the maximum data read length of the target.

Parameters

  base | The pointer to the I3C instance.
  context | The pointer to the context structure cy_stc_i3c_context_t allocated by the user. The structure is used during the I3C operation for internal configuration and data retention. The user must not modify anything in this structure.

Returns
  Max data read length.

Note
  I3C supports only Primary Controller mode in PSE84A0. Secondary controller mode and Target mode are supported in PSE84B0.

## ◆ Cy_I3C_TargetGetMaxWriteLength()

uint32_t Cy_I3C_TargetGetMaxWriteLength | ( | I3C_CORE_Type const * | base,
|  | cy_stc_i3c_context_t const * | context
| ) |  |

Provides the maximum data write length of the target.

Parameters

  base | The pointer to the I3C instance.
  context | The pointer to the context structure cy_stc_i3c_context_t allocated by the user. The structure is used during the I3C operation for internal configuration and data retention. The user must not modify anything in this structure.

Returns
  Max write data length.

Note
  I3C supports only Primary Controller mode in PSE84A0. Secondary controller mode and Target mode are supported in PSE84B0.

## ◆ Cy_I3C_TargetGenerateIbi()

cy_en_i3c_status_t Cy_I3C_TargetGenerateIbi | ( | I3C_CORE_Type * | base,
|  | cy_stc_i3c_ibi_t * | ibitype,
|  | cy_stc_i3c_context_t * | context
| ) |  |

Generates the specified IBI on the bus.

After calling this function, IP will continuously try to generate ibi until it is acked or controller sends DISEC CCC. Event callback is generated to indicate the status of IBI.

Parameters

  base | The pointer to the I3C instance.
  ibitype | The pointer to the ibi structure cy_stc_i3c_ibi_t containing the type of ibi event to be generated.
  context | The pointer to the context structure cy_stc_i3c_context_t allocated by the user. The structure is used during the I3C operation for internal configuration and data retention. The user must not modify anything in this structure.

Returns
  cy_en_i3c_status_t.

Note
  I3C supports only Primary Controller mode in PSE84A0. Secondary controller mode and Target mode are supported in PSE84B0.

## ◆ Cy_I3C_TargetConfigReadBuf()

void Cy_I3C_TargetConfigReadBuf | ( | I3C_CORE_Type * | base,
|  | uint8_t * | buffer,
|  | uint32_t | size,
|  | cy_stc_i3c_context_t * | context
| ) |  |

Configures the buffer pointer and the read buffer size.

This is the buffer from which the controller reads data. After this function is called, data transfer from the read buffer to the controller is handled by Cy_I3C_Interrupt.

When the Read transaction is completed CY_I3C_TARGET_WR_CMPLT is set. Also the CY_I3C_TARGET_WR_CMPLT_EVENT event is generated.

Parameters

  base | The pointer to the I3C instance.
  buffer | The pointer to the buffer with data to be read by the controller.
  size | Size of the buffer.
  context | The pointer to the context structure cy_stc_i3c_context_t allocated by the user. The structure is used during the I3C operation for internal configuration and data retention. The user must not modify anything in this structure.

Note
  I3C supports only Primary Controller mode in PSE84A0. Secondary controller mode and Target mode are supported in PSE84B0.

## ◆ Cy_I3C_TargetGetReadTransferCount()

uint32_t Cy_I3C_TargetGetReadTransferCount | ( | I3C_CORE_Type const * | base,
|  | cy_stc_i3c_context_t const * | context
| ) |  |

Returns the number of bytes read by the controller since the last time Cy_I3C_TargetConfigReadBuf was called.

Parameters

  base | The pointer to the I3C instance.
  context | The pointer to the context structure cy_stc_i3c_context_t allocated by the user. The structure is used during the I3C operation for internal configuration and data retention. The user must not modify anything in this structure.

Returns
  The number of bytes read by the controller.

Note
  I3C supports only Primary Controller mode in PSE84A0. Secondary controller mode and Target mode are supported in PSE84B0.

## ◆ Cy_I3C_TargetConfigWriteBuf()

void Cy_I3C_TargetConfigWriteBuf | ( | I3C_CORE_Type const * | base,
|  | uint8_t * | buffer,
|  | uint32_t | size,
|  | cy_stc_i3c_context_t * | context
| ) |  |

Configures the buffer pointer and the write buffer size.

This is the buffer that the controller writes data to. After this function is called, data transfer from the controller into the write buffer is handled by Cy_I3C_Interrupt.

When the write transaction is completed CY_I3C_TARGET_RD_CMPLT is set. Also the CY_I3C_TARGET_RD_CMPLT_EVENT event is generated.

Parameters

  base | The pointer to the I3C instance.
  buffer | The pointer to buffer to store data written by the controller.
  size | Size of the buffer.
  context | The pointer to the context structure cy_stc_i3c_context_t allocated by the user. The structure is used during the I3C operation for internal configuration and data retention. The user must not modify anything in this structure.

Note
  I3C supports only Primary Controller mode in PSE84A0. Secondary controller mode and Target mode are supported in PSE84B0.

## ◆ Cy_I3C_TargetGetWriteTransferCount()

uint32_t Cy_I3C_TargetGetWriteTransferCount | ( | I3C_CORE_Type const * | base,
|  | cy_stc_i3c_context_t const * | context
| ) |  |

Returns the number of bytes written by the controller since the last time Cy_I3C_TargetConfigWriteBuf was called.

Parameters

  base | The pointer to the I3C instance.
  context | The pointer to the context structure cy_stc_i3c_context_t allocated by the user. The structure is used during the I3C operation for internal configuration and data retention. The user must not modify anything in this structure.

Returns
  The number of bytes written by the controller.

Note
  I3C supports only Primary Controller mode in PSE84A0. Secondary controller mode and Target mode are supported in PSE84B0.

## ◆ Cy_I3C_ConfigureVendorCCC0()

cy_en_i3c_status_t Cy_I3C_ConfigureVendorCCC0 | ( | I3C_CORE_Type * | base,
|  | cy_stc_i3c_ccc_cmd_t * | cccCmd,
|  | cy_stc_i3c_context_t * | context
| ) |  |

Configure vendor specific CCC0.

Target will ACK this CCC in read mode and transfer the configured data.

Parameters

  base | The pointer to the I3C instance.
  cccCmd | The pointer to the CCC command description structure cy_stc_i3c_ccc_cmd_t.
  context | The pointer to the context structure cy_stc_i3c_context_t allocated by the user. The structure is used during the I3C operation for internal configuration and data retention. The user must not modify anything in this structure.

Returns
  configuration status - CY_I3C_TIMEOUT / CY_I3C_SUCCESS.

## ◆ Cy_I3C_ConfigureVendorCCC1()

cy_en_i3c_status_t Cy_I3C_ConfigureVendorCCC1 | ( | I3C_CORE_Type * | base,
|  | cy_stc_i3c_ccc_cmd_t * | cccCmd,
|  | cy_stc_i3c_context_t * | context
| ) |  |

Configure vendor specific CCC1.

Target will ACK this CCC in read mode and transfer the configured data.

Parameters

  base | The pointer to the I3C instance.
  cccCmd | The pointer to the CCC command description structure cy_stc_i3c_ccc_cmd_t.
  context | The pointer to the context structure cy_stc_i3c_context_t allocated by the user. The structure is used during the I3C operation for internal configuration and data retention. The user must not modify anything in this structure.

Returns
  configuration status - CY_I3C_TIMEOUT / CY_I3C_SUCCESS.

## ◆ Cy_I3C_RegisterCCCRespCallback()

void Cy_I3C_RegisterCCCRespCallback | ( | I3C_CORE_Type const * | base,
|  | cy_cb_i3c_handle_ccc_response_t | callback,
|  | cy_stc_i3c_context_t * | context
| ) |  |

Registers an event handler callback function of type cy_cb_i3c_handle_ccc_response_t which will be invoked by the PDL to indicate ccc response received by target.

Parameters

  base | The pointer to the I3C instance.
  callback | The pointer to a callback function. See cy_cb_i3c_handle_ccc_response_t for the function prototype.
  context | The pointer to the context structure cy_stc_i3c_context_t allocated by the user. The structure is used during the I3C operation for internal configuration and data retention. The user must not modify anything in this structure.

Note
  To remove the callback, pass NULL as the pointer to the callback function.

## ◆ Cy_I3C_TargetGetCCCData()

cy_en_i3c_status_t Cy_I3C_TargetGetCCCData | ( | I3C_CORE_Type * | base,
|  | uint8_t * | buffer,
|  | uint32_t | size,
|  | cy_stc_i3c_context_t * | context
| ) |  |

Read data received from controller write CCC into given buffer.

This function must be called from ccc response callback handler.

Parameters

  base | The pointer to the I3C instance.
  buffer | Read buffer pointer for ccc data.
  size | Number of bytes of data received. Size in indicated in CCC response event callback.
  context | The pointer to the context structure cy_stc_i3c_context_t allocated by the user. The structure is used during the I3C operation for internal configuration and data retention. The user must not modify anything in this structure.

Returns
  reset successful status - CY_I3C_BAD_BUFFER_SIZE / CY_I3C_SUCCESS.