Device Firmware Update (DFU) Middleware Library 6.2 6.2.100.2910
 
Loading...
Searching...
No Matches
Transport Management

General Description

DFU functions for the communication interface.

These communication functions have to be re-implemented in the user's code.

Data Structures

struct  cy_stc_dfu_transport_i2c_cfg_t
 Configuration structure for DFU I2C transport. More...
 
struct  cy_stc_dfu_transport_spi_cfg_t
 Configuration structure for DFU SPI transport. More...
 
struct  cy_stc_dfu_transport_uart_cfg_t
 Configuration structure for DFU UART transport. More...
 
struct  cy_stc_dfu_transport_pmbus_cfg_t
 Configuration structure for DFU PMBUS transport. More...
 
struct  cy_stc_dfu_transport_usb_cdc_cfg_t
 Configuration structure for DFU USB CDC transport. More...
 
struct  cy_stc_dfu_transport_usb_hid_cfg_t
 Configuration structure for DFU USB HID transport. More...
 

Typedefs

typedef void(* Cy_DFU_TransportI2cCallback) (cy_en_dfu_transport_i2c_action_t action)
 The type for the user I2C callback to execute some actions.
 
typedef void(* Cy_DFU_TransportSpiCallback) (cy_en_dfu_transport_spi_action_t action)
 The type for the user SPI callback to execute some actions.
 
typedef void(* Cy_DFU_TransportUartCallback) (cy_en_dfu_transport_uart_action_t action)
 The type for the user UART callback to execute some actions.
 
typedef void(* Cy_DFU_TransportUsbCdcCallback) (cy_en_dfu_transport_usb_cdc_action_t action)
 The type for the user USB CDC callback to execute some actions.
 
typedef void(* Cy_DFU_TransportUsbHidCallback) (cy_en_dfu_transport_usb_hid_action_t action)
 The type for the user USB HID callback to execute some actions.
 

Enumerations

enum  cy_en_dfu_transport_i2c_action_t {
  CY_DFU_TRANSPORT_I2C_INIT = 0x01U ,
  CY_DFU_TRANSPORT_I2C_DEINIT = 0x02U
}
 Execute these actions for I2C transport from the user application side. More...
 
enum  cy_en_dfu_transport_spi_action_t {
  CY_DFU_TRANSPORT_SPI_INIT = 0x01U ,
  CY_DFU_TRANSPORT_SPI_DEINIT = 0x02U
}
 Execute these actions for SPI transport from the user application side. More...
 
enum  cy_en_dfu_transport_uart_action_t {
  CY_DFU_TRANSPORT_UART_INIT = 0x01U ,
  CY_DFU_TRANSPORT_UART_DEINIT = 0x02U
}
 Execute these actions for UART transport from the user application side. More...
 
enum  cy_en_dfu_transport_usb_cdc_action_t {
  CY_DFU_TRANSPORT_USB_CDC_INIT = 0x01U ,
  CY_DFU_TRANSPORT_USB_CDC_ENABLE = 0x02U ,
  CY_DFU_TRANSPORT_USB_CDC_DEINIT = 0x03U ,
  CY_DFU_TRANSPORT_USB_CDC_DISABLE = 0x04U
}
 Execute these actions for USB CDC transport from the user application side. More...
 
enum  cy_en_dfu_transport_usb_hid_action_t {
  CY_DFU_TRANSPORT_USB_HID_INIT = 0x01U ,
  CY_DFU_TRANSPORT_USB_HID_ENABLE = 0x02U ,
  CY_DFU_TRANSPORT_USB_HID_DEINIT = 0x03U ,
  CY_DFU_TRANSPORT_USB_HID_DISABLE = 0x04U
}
 Execute these actions for USB HID transport from the user application side. More...
 

Functions

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.
 
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.
 
void Cy_DFU_TransportReset (void)
 This function must be implemented in the user's code.
 
void Cy_DFU_TransportStart (cy_en_dfu_transport_t transport)
 This function must be implemented in the user's code.
 
void Cy_DFU_TransportStop (void)
 This function must be implemented in the user's code.
 
void Cy_DFU_TransportI2cConfig (cy_stc_dfu_transport_i2c_cfg_t *config)
 Configure DFU I2C Transport.
 
void Cy_DFU_TransportSpiConfig (cy_stc_dfu_transport_spi_cfg_t *config)
 Configure DFU SPI Transport.
 
void Cy_DFU_TransportUartConfig (cy_stc_dfu_transport_uart_cfg_t *config)
 Configure DFU UART Transport.
 
void Cy_DFU_TransportPMBusConfig (cy_stc_dfu_transport_pmbus_cfg_t *config)
 Configure DFU PMBUS Transport.
 
void Cy_DFU_TransportUsbCdcConfig (cy_stc_dfu_transport_usb_cdc_cfg_t *config)
 Configure DFU USB CDC Transport.
 
void Cy_DFU_TransportUsbHidConfig (cy_stc_dfu_transport_usb_hid_cfg_t *config)
 Configure DFU USB HID Transport.
 

Data Structure Documentation

◆ 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
Data Fields
Cy_DFU_TransportUsbCdcCallback callback The pointer to the callback function for initialization/de-initialization of USB CDC hardware.

◆ cy_stc_dfu_transport_usb_hid_cfg_t

struct cy_stc_dfu_transport_usb_hid_cfg_t
Data Fields
Cy_DFU_TransportUsbHidCallback callback The pointer to the callback function for initialization/de-initialization of USB HID hardware.

Typedef Documentation

◆ Cy_DFU_TransportI2cCallback

typedef void(* Cy_DFU_TransportI2cCallback) (cy_en_dfu_transport_i2c_action_t action)

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

typedef void(* Cy_DFU_TransportSpiCallback) (cy_en_dfu_transport_spi_action_t action)

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

typedef void(* Cy_DFU_TransportUartCallback) (cy_en_dfu_transport_uart_action_t action)

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

typedef void(* Cy_DFU_TransportUsbCdcCallback) (cy_en_dfu_transport_usb_cdc_action_t action)

The type for the user USB CDC callback to execute some actions.

Typically, it is initialization/de-initialization of USB CDC hardware. cy_stc_dfu_transport_usb_cdc_cfg_t

◆ Cy_DFU_TransportUsbHidCallback

typedef void(* Cy_DFU_TransportUsbHidCallback) (cy_en_dfu_transport_usb_hid_action_t action)

The type for the user USB HID callback to execute some actions.

Typically, it is initialization/de-initialization of USB HID hardware. cy_stc_dfu_transport_usb_hid_cfg_t

Enumeration Type Documentation

◆ 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.

Function Documentation

◆ 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
bufferThe pointer to a buffer to store a received command.
sizeThe number of bytes to read.
countThe pointer to the variable that contains the number of received bytes.
timeoutThe 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
bufferThe pointer response packet buffer.
sizeThe number of bytes to transmit.
countThe pointer to the actual number of transmitted bytes.
timeoutThe 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()

void Cy_DFU_TransportStart ( cy_en_dfu_transport_t transport)

This function must be implemented in the user's code.


Starts the communication interface through which updating will be working.

Parameters
transportdefines transport interface to use. See cy_en_dfu_transport_t for available options

◆ 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()

void Cy_DFU_TransportI2cConfig ( cy_stc_dfu_transport_i2c_cfg_t * config)

Configure DFU I2C Transport.

Call this function in the user application to provide the HAL object and callback function to DFU transport.

Parameters
configConfiguration structure

◆ Cy_DFU_TransportSpiConfig()

void Cy_DFU_TransportSpiConfig ( cy_stc_dfu_transport_spi_cfg_t * config)

Configure DFU SPI Transport.

Call this function in the user application to provide the HAL object and callback function to DFU transport.

Parameters
configConfiguration structure

◆ Cy_DFU_TransportUartConfig()

void Cy_DFU_TransportUartConfig ( cy_stc_dfu_transport_uart_cfg_t * config)

Configure DFU UART Transport.

Call this function in the user application to provide the HAL object and callback function to DFU transport.

Parameters
configConfiguration structure

◆ Cy_DFU_TransportPMBusConfig()

void Cy_DFU_TransportPMBusConfig ( cy_stc_dfu_transport_pmbus_cfg_t * config)

Configure DFU PMBUS Transport.

Call this function in the user application to provide the HAL object and callback function to DFU transport.

Parameters
configConfiguration structure

◆ Cy_DFU_TransportUsbCdcConfig()

void Cy_DFU_TransportUsbCdcConfig ( cy_stc_dfu_transport_usb_cdc_cfg_t * config)

Configure DFU USB CDC Transport.

Call this function in the user application to provide the HAL object and callback function to DFU transport.

Parameters
configConfiguration structure

◆ Cy_DFU_TransportUsbHidConfig()

void Cy_DFU_TransportUsbHidConfig ( cy_stc_dfu_transport_usb_hid_cfg_t * config)

Configure DFU USB HID Transport.

Call this function in the user application to provide the HAL object and callback function to DFU transport.

Parameters
configConfiguration structure