Bootloader Functions

This section describes the Bootloader functions. They are used to control and monitor the Bootloader module of a DLN-series adapter.Actual control of the device is performed by use of commands and responses. Each function utilizes respective commands and responses. You can send such commands directly if necessary.

Rating: 
Голосов пока нет

DlnBootEnterBootloader() Function

The DlnBootEnterBootloader() function enters the Bootloader mode.

This function is defined in the dln_boot.h file.

Syntax
C/C++
DLN_RESULT DlnBootEnterBootloader(
   HDLN handle
);
Parameters
handle

A handle to the DLN-series adapter.

Return Value
DLN_RES_SUCCESS

Function was successfully executed.

DlnBootExitBootloader() Function

The DlnExitBootloader() function exits the Bootloader mode and continues in the Application mode.

This function is defined in the dln_boot.h file.

Syntax
C/C++
DLN_RESULT DlnBootExitBootloader(
    HDLN handle
);
Parameters
handle

A handle to the DLN-series adapter.

Return Value
DLN_RES_SUCCESS

Function was successfully executed.

DlnBootGetMode() Function

The DlnBootGetMode() function retrieves current mode of your DLN-series adapter.

This function is defined in the dln_boot.h file.

Syntax
C/C++
DLN_RESULT DlnBootGetMode(
    HDLN handle, 
    DLN_BOOT_MODE* mode
 );
Parameters
handle

A handle to the DLN-series adapter.

mode

A pointer to the 32-bit DLN_BOOT_MODE variable. This variable will be used to store current device mode after the function execution.

Return Value
DLN_RES_SUCCESS

Function was successfully executed.

DlnBootGetMemDesc() Function

The DlnBootGetMemDesc() function retrieves information about the device internal flash memory.

This function is defined in the dln_adc.h file.

Syntax
C/C++
DLN_RESULT DlnBootGetMemDesc(
    HDLN handle, 
    uint32_t memory, 
    DLN_BOOT_MEM_DESC *descriptor
);
Parameters
handle

A handle to the DLN-series adapter.

memory

Memory type value. Available only DLN_BOOT_MEM_FLASH value.

descriptor

A pointer to the DLN_BOOT_MEM_DESC structure, which will be filled with data after the function execution.

Return Value
DLN_RES_SUCCESS

Function was successfully executed.

DlnBootGetMemCount() Function

The DlnBootGetMemCount() function retrieves the number of flash panes of your DLN-series adapter.

This function is defined in the dln_boot.h file.

Syntax
C/C++
DLN_RESULT DlnBootGetMemCount(
    HDLN handle, 
    uint32_t *count
);
Parameters
handle

A handle to the DLN device.

count

A pointer to 8-bit unsigned integer, which will be filled with the number of flash panes after the function execution.

Return Value
DLN_RES_SUCCESS

The number of flash panes was successfully retrieved.

DlnBootRead() Function

The DlnBootRead() function reads data on the DLN-series adapter current firmware.

This function is defined in the dln_boot.h file.

This function is only available, when the device operates in Bootloader mode.
Syntax
C/C++
DLN_RESULT DlnBootReadFlash(
    HDLN handle,
    uint32_t memory, 
    uint32_t address, 
    uint16_t size, 
    uint8_t* buffer
 );
Parameters
handle

A handle to the DLN-series adapter.

memory

Memory type value. Available only DLN_BOOT_MEM_FLASH value.

address

Address to start reading from.

size

Size of the data to read.

buffer

A pointer to an unsigned 8 bit integer. This integer will be filled with the firmware data after the function execution.

Return Value
DLN_RES_SUCCESS

The number of flash panes was successfully retrieved.

DlnBootWrite() Function

The DlnBootWrite() function writes new firmware into the device internal memory. This function is only available, when the device functions in the Bootloader mode. This function is defined in the dln_boot.h file.

Syntax
C/C++
DLN_RESULT DlnBootWrite(
    HDLN handle,
    uint32_t memory,
    uint32_t address,
    uint16_t size,
    uint8_t* buffer
 );
Parameters
handle

A handle to the DLN-series adapter.

memory

Memory type value. Available only DLN_BOOT_MEM_FLASH value.

address

The address to start writing from.

size

The size of the firmware.

buffer

Buffer with the firmware data.

Return Value
DLN_RES_SUCCESS

The number of flash panes was successfully retrieved.