| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
Common programming algorithm functions for the DFU Utility
DFU USB programming algorithms

## Detailed Description

Example description
This is the API file for the LPC18xx/43xx DFU Utility program. Flash algorithms used with the DFU Utility must comply to the functions in this file.

Submitting LPCOpen issues:
Community support for LPCOpen

## Data Structures
struct | DFUPROG_REGZONE_T
struct | PROGALGOS_T
struct | DFUPROG_REGION_T
struct | DFU_FROMHOST_PACKETHDR_T
struct | DFU_TOHOST_PACKETHDR_T

## Macros
#define | DFUPROG_VALIDVAL (0x18430000 | (0x010A))

## Typedefs
typedef int32_t(* | progalgo_flash_erase_region )(uint32_t, uint32_t)
typedef int32_t(* | progalgo_flash_erase_all )(void)
typedef int32_t(* | progalgo_flash_write )(void *, uint32_t, uint32_t)
typedef int32_t(* | progalgo_flash_read )(void *, uint32_t, uint32_t)

## Enumerations
enum | DFU_HOSTCMD_T { DFU_HOSTCMD_SETDEBUG, DFU_HOSTCMD_ERASE_ALL, DFU_HOSTCMD_ERASE_REGION, DFU_HOSTCMD_PROGRAM, DFU_HOSTCMD_READBACK, DFU_HOSTCMD_RESET, DFU_HOSTCMD_EXECUTE }
enum | DFU_OPSTS_T { DFU_OPSTS_IDLE, DFU_OPSTS_ERRER, DFU_OPSTS_PROGER, DFU_OPSTS_READER, DFU_OPSTS_ERRUN, DFU_OPSTS_READBUSY, DFU_OPSTS_READTRIG, DFU_OPSTS_READREADY, DFU_OPSTS_ERASE_ALL_ST, DFU_OPSTS_ERASE_ST, DFU_OPSTS_ERASE, DFU_OPSTS_PROG, DFU_OPSTS_PROG_RSVD, DFU_OPSTS_PROG_STREAM, DFU_OPSTS_RESET, DFU_OPSTS_EXEC, DFU_OPSTS_LOOP }

## Functions
DFUPROG_REGION_T * | algo_flash_init (void)
| Initializes device programming capability.
void | usbDebug (char *str)
| Queues a message for DFU status transfer.

## Macro Definition Documentation

#define DFUPROG_VALIDVAL (0x18430000 | (0x010A))

Magic value used to indicate DFU programming algorithm and DFU Utility support. This is used to lock algorithm support to DFU Utility tool version to prevent issues with non-compatible versions. The upper 16 bits contain a magic number and the lower 16 bits contain the version number in x.y format (1.10 = 0x010A).

Definition at line 149 of file dfuutil_programming_api.h.

## Typedef Documentation

typedef int32_t(* progalgo_flash_erase_all)(void)

Pointer to programming algorithm erase all function

Definition at line 69 of file dfuutil_programming_api.h.

typedef int32_t(* progalgo_flash_erase_region)(uint32_t, uint32_t)

Pointer to programming algorithm region erase function

Definition at line 64 of file dfuutil_programming_api.h.

typedef int32_t(* progalgo_flash_read)(void *, uint32_t, uint32_t)

Pointer to programming algorithm read function First parameter is the pointer to the buffer to fill Second parameter is the starting address to read (32-bit algined) Third parameter is the number of bytes to read

Definition at line 85 of file dfuutil_programming_api.h.

typedef int32_t(* progalgo_flash_write)(void *, uint32_t, uint32_t)

Pointer to programming algorithm write function First parameter is the pointer to the buffer to write Second parameter is the starting address to write (32-bit algined) Third parameter is the number of bytes to write

Definition at line 77 of file dfuutil_programming_api.h.

## Enumeration Type Documentation

enum DFU_HOSTCMD_T

These are possible commands from the host machine

Enumerator:

  DFU_HOSTCMD_SETDEBUG |
  DFU_HOSTCMD_ERASE_ALL |
  DFU_HOSTCMD_ERASE_REGION |
  DFU_HOSTCMD_PROGRAM |
  DFU_HOSTCMD_READBACK |
  DFU_HOSTCMD_RESET |
  DFU_HOSTCMD_EXECUTE |

Definition at line 121 of file dfuutil_programming_api.h.

enum DFU_OPSTS_T

DFU operational status returned from programming algorithm, used by host to monitor status of board

Enumerator:

  DFU_OPSTS_IDLE |
  DFU_OPSTS_ERRER |
  DFU_OPSTS_PROGER |
  DFU_OPSTS_READER |
  DFU_OPSTS_ERRUN |
  DFU_OPSTS_READBUSY |
  DFU_OPSTS_READTRIG |
  DFU_OPSTS_READREADY |
  DFU_OPSTS_ERASE_ALL_ST |
  DFU_OPSTS_ERASE_ST |
  DFU_OPSTS_ERASE |
  DFU_OPSTS_PROG |
  DFU_OPSTS_PROG_RSVD |
  DFU_OPSTS_PROG_STREAM |
  DFU_OPSTS_RESET |
  DFU_OPSTS_EXEC |
  DFU_OPSTS_LOOP |

Definition at line 155 of file dfuutil_programming_api.h.

## Function Documentation

DFUPROG_REGION_T* algo_flash_init | ( | void |  | ) |

Initializes device programming capability.

Initializes device programming capability

Returns
  A pointer to the programming info structure Initializes device programming capability. Returns a pointer to the programming buffer, the programming buffer size, and a pointer to the DFU programming region/API structure used by the DFU streamer.

Definition at line 183 of file dfuutil_programming_any_algorithm.c.

void usbDebug | ( | char * | str | ) |

Queues a message for DFU status transfer.

Parameters

  str | : Message to queue

Returns
  Nothing

Definition at line 755 of file dfuutil_programming_dfu_ops.c.