DFU functions for the communication interface.
These communication functions have to be re-implemented in the user's code.
◆ cy_stc_dfu_transport_i2c_cfg_t
| struct cy_stc_dfu_transport_i2c_cfg_t |
| Data Fields |
|
mtb_hal_i2c_t * |
i2c |
The pointer to the HAL I2C object. |
|
Cy_DFU_TransportI2cCallback |
callback |
The pointer to the callback function for initialization/de-initialization of I2C hardware. |
◆ cy_stc_dfu_transport_spi_cfg_t
| struct cy_stc_dfu_transport_spi_cfg_t |
| Data Fields |
|
mtb_hal_spi_t * |
spi |
The pointer to the HAL SPI object. |
|
Cy_DFU_TransportSpiCallback |
callback |
The pointer to the callback function for initialization/de-initialization of SPI hardware. |
◆ cy_stc_dfu_transport_uart_cfg_t
| struct cy_stc_dfu_transport_uart_cfg_t |
| Data Fields |
|
mtb_hal_uart_t * |
uart |
The pointer to the HAL UART object. |
|
Cy_DFU_TransportUartCallback |
callback |
The pointer to the callback function for initialization/de-initialization of UART hardware. |
◆ cy_stc_dfu_transport_pmbus_cfg_t
| struct cy_stc_dfu_transport_pmbus_cfg_t |
| Data Fields |
|
mtb_pmbus_stc_t * |
pmbus |
The pointer to the PMBUS object. |
|
uint32_t |
cmdCode |
The PMBUS command used for DFU. |
|
uint8_t * |
cmdData |
The pointer to the PMBUS command data storage. |
◆ cy_stc_dfu_transport_usb_cdc_cfg_t
| struct cy_stc_dfu_transport_usb_cdc_cfg_t |
◆ cy_stc_dfu_transport_usb_hid_cfg_t
| struct cy_stc_dfu_transport_usb_hid_cfg_t |
◆ Cy_DFU_TransportI2cCallback
The type for the user I2C callback to execute some actions.
Typically, it is initialization/de-initialization of I2C hardware. cy_stc_dfu_transport_i2c_cfg_t
◆ Cy_DFU_TransportSpiCallback
The type for the user SPI callback to execute some actions.
Typically, it is initialization/de-initialization of SPI hardware. cy_stc_dfu_transport_spi_cfg_t
◆ Cy_DFU_TransportUartCallback
The type for the user UART callback to execute some actions.
Typically, it is initialization/de-initialization of UART hardware. cy_stc_dfu_transport_uart_cfg_t
◆ Cy_DFU_TransportUsbCdcCallback
◆ Cy_DFU_TransportUsbHidCallback
◆ cy_en_dfu_transport_i2c_action_t
Execute these actions for I2C transport from the user application side.
Cy_DFU_TransportI2cCallback
| Enumerator |
|---|
| CY_DFU_TRANSPORT_I2C_INIT | Initialize and enable I2C transport.
|
| CY_DFU_TRANSPORT_I2C_DEINIT | De-initialize and disable I2C transport.
|
◆ cy_en_dfu_transport_spi_action_t
Execute these actions for SPI transport from the user application side.
Cy_DFU_TransportSpiCallback
| Enumerator |
|---|
| CY_DFU_TRANSPORT_SPI_INIT | Initialize and enable SPI transport.
|
| CY_DFU_TRANSPORT_SPI_DEINIT | De-initialize and disable SPI transport.
|
◆ cy_en_dfu_transport_uart_action_t
Execute these actions for UART transport from the user application side.
Cy_DFU_TransportUartCallback
| Enumerator |
|---|
| CY_DFU_TRANSPORT_UART_INIT | Initialize and enable UART transport.
|
| CY_DFU_TRANSPORT_UART_DEINIT | De-initialize and disable UART transport.
|
◆ cy_en_dfu_transport_usb_cdc_action_t
Execute these actions for USB CDC transport from the user application side.
Cy_DFU_TransportUsbCdcCallback
| Enumerator |
|---|
| CY_DFU_TRANSPORT_USB_CDC_INIT | Initialize USB CDC transport.
|
| CY_DFU_TRANSPORT_USB_CDC_ENABLE | Enable USB CDC transport.
|
| CY_DFU_TRANSPORT_USB_CDC_DEINIT | De-initialize USB CDC transport.
|
| CY_DFU_TRANSPORT_USB_CDC_DISABLE | Disable USB CDC transport.
|
◆ cy_en_dfu_transport_usb_hid_action_t
Execute these actions for USB HID transport from the user application side.
Cy_DFU_TransportUsbHidCallback
| Enumerator |
|---|
| CY_DFU_TRANSPORT_USB_HID_INIT | Initialize USB HID transport.
|
| CY_DFU_TRANSPORT_USB_HID_ENABLE | Enable USB HID transport.
|
| CY_DFU_TRANSPORT_USB_HID_DEINIT | De-initialize USB HID transport.
|
| CY_DFU_TRANSPORT_USB_HID_DISABLE | Disable USB HID transport.
|
◆ Cy_DFU_TransportRead()
| cy_en_dfu_status_t Cy_DFU_TransportRead |
( |
uint8_t | buffer[], |
|
|
uint32_t | size, |
|
|
uint32_t * | count, |
|
|
uint32_t | timeout ) |
This function must be implemented in the user's code.
This function receives a command packet from the DFU Host via the communication channel. The function waits for a timeout until all bytes are received.
- Parameters
-
| buffer | The pointer to a buffer to store a received command. |
| size | The number of bytes to read. |
| count | The pointer to the variable that contains the number of received bytes. |
| timeout | The time to wait before the function returns because of a timeout, in milliseconds. |
- Returns
- The status of the transmit operation:
- CY_DFU_SUCCESS - If successful.
- CY_DFU_ERROR_TIMEOUT - If no data is received.
- See cy_en_dfu_status_t.
◆ Cy_DFU_TransportWrite()
| cy_en_dfu_status_t Cy_DFU_TransportWrite |
( |
uint8_t | buffer[], |
|
|
uint32_t | size, |
|
|
uint32_t * | count, |
|
|
uint32_t | timeout ) |
This function must be implemented in the user's code.
This function transmits a response packet to the DFU host via the communication channel. The function waits for a timeout until all bytes are sent.
- Parameters
-
| buffer | The pointer response packet buffer. |
| size | The number of bytes to transmit. |
| count | The pointer to the actual number of transmitted bytes. |
| timeout | The time to wait before the function returns because of a timeout, in milliseconds |
- Returns
- See cy_en_dfu_status_t. The status of the transmit operation:
- CY_DFU_SUCCESS - If successful.
- CY_DFU_ERROR_TIMEOUT - If no data is transmitted.
◆ Cy_DFU_TransportReset()
| void Cy_DFU_TransportReset |
( |
void | | ) |
|
This function must be implemented in the user's code.
Resets the communication interface with clearing buffers, offsets, length, etc.
◆ Cy_DFU_TransportStart()
This function must be implemented in the user's code.
Starts the communication interface through which updating will be working.
- Parameters
-
◆ Cy_DFU_TransportStop()
| void Cy_DFU_TransportStop |
( |
void | | ) |
|
This function must be implemented in the user's code.
Stops the communication interface through which updating will be working.
◆ Cy_DFU_TransportI2cConfig()
Configure DFU I2C Transport.
Call this function in the user application to provide the HAL object and callback function to DFU transport.
- Parameters
-
| config | Configuration structure |
◆ Cy_DFU_TransportSpiConfig()
Configure DFU SPI Transport.
Call this function in the user application to provide the HAL object and callback function to DFU transport.
- Parameters
-
| config | Configuration structure |
◆ Cy_DFU_TransportUartConfig()
Configure DFU UART Transport.
Call this function in the user application to provide the HAL object and callback function to DFU transport.
- Parameters
-
| config | Configuration structure |
◆ Cy_DFU_TransportPMBusConfig()
Configure DFU PMBUS Transport.
Call this function in the user application to provide the HAL object and callback function to DFU transport.
- Parameters
-
| config | Configuration structure |
◆ Cy_DFU_TransportUsbCdcConfig()
Configure DFU USB CDC Transport.
Call this function in the user application to provide the HAL object and callback function to DFU transport.
- Parameters
-
| config | Configuration structure |
◆ Cy_DFU_TransportUsbHidConfig()
Configure DFU USB HID Transport.
Call this function in the user application to provide the HAL object and callback function to DFU transport.
- Parameters
-
| config | Configuration structure |