Download Interface

[English]

DL_IF API Brief

Application

Brief

dl_if_register()

Registration download interface

dl_if_active()

Enable the download interface

dl_if_byte_avaliable()

Get available bytes

dl_if_read()

Read data from the download interface

dl_if_write()

Write data to the download interface

dl_if_change_baudrate()

Change the baud rate of the download interface

DL_IF API Reference

Header File

Functions

int32_t dl_if_register(dl_if_e e_if, dl_if_ops_t *pt_ops)

Registration download interface.

Register the download interface operation structure, pointed to by pt_ops, to the type specified in e_if.

参数:
  • e_if[in] Type of download interface.

  • pt_ops[in] A pointer to the download operation structure that needs to be registered.

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail

返回:

result

int32_t dl_if_active(dl_if_e e_if)

Enable the download interface.

Enable the download interface operation for the type specified by e_if.

参数:

e_if[in] Type of download interface.

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail

返回:

result

uint32_t dl_if_byte_avaliable(void)

Get available bytes.

Get the bytes of data that the device has received but has not yet processed.

返回:

available bytes

uint32_t dl_if_read(uint8_t *pu1_buf, uint16_t read_size)

Read data from the download interface.

Read data of size read_size from the download interface into the buffer pointed to by pu1_buf.

参数:
  • pu1_buf[in] A buffer pointer used for receiving data read from the download interface.

  • read_size[in] The size of the data to be read from the download interface.

返回:

read size

int32_t dl_if_write(uint8_t *pu1_buf, uint16_t write_size, uint8_t cmd)

Write data to the download interface.

Write write_size bytes of data from the buffer pointed to by pu1_buf to the download interface.

参数:
  • pu1_buf[in] A buffer pointer for the data to be written to the download interface.

  • write_size[in] The size of the data to be written to the download interface.

  • cmd[in] Beken debug command.

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail

返回:

result

int32_t dl_if_change_baudrate(uint32_t baudrate)

Change the baud rate of the download interface.

Change the baud rate of the download interface to baudrate.

参数:

baudrate[in] Baud rate setting

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail DL_IF_H EOF

返回:

result

Structures

struct _dl_if_ops_t

download interface operations struct definition.

Type Definitions

typedef enum _dl_if_e dl_if_e

download interface type definition.

typedef struct _dl_if_ops_t dl_if_ops_t

download interface operations struct definition.

Enumerations

enum _dl_if_e

download interface type definition.

Values:

enumerator DLIF_NULL
enumerator DLIF_UART
enumerator DLIF_DLP
enumerator DLIF_MAX