Nut/OS  5.0.5
API Reference
lpc17xx_iap.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  IAP_COMMAND_Type
 IAP command structure. More...

Defines

#define IAP_LOCATION   (0x1FFF1FF1UL)

Enumerations

enum  IAP_COMMAND_CODE {
  IAP_PREPARE = 50, IAP_COPY_RAM2FLASH = 51, IAP_ERASE = 52, IAP_BLANK_CHECK = 53,
  IAP_READ_PART_ID = 54, IAP_READ_BOOT_VER = 55, IAP_COMPARE = 56, IAP_REINVOKE_ISP = 57,
  IAP_READ_SERIAL_NUMBER = 58
}
 IAP command code definitions. More...
enum  IAP_STATUS_CODE {
  CMD_SUCCESS, INVALID_COMMAND, SRC_ADDR_ERROR, DST_ADDR_ERROR,
  SRC_ADDR_NOT_MAPPED, DST_ADDR_NOT_MAPPED, COUNT_ERROR, INVALID_SECTOR,
  SECTOR_NOT_BLANK, SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION, COMPARE_ERROR, BUSY
}
 IAP status code definitions. More...
enum  IAP_WRITE_SIZE { IAP_WRITE_256 = 256, IAP_WRITE_512 = 512, IAP_WRITE_1024 = 1024, IAP_WRITE_4096 = 4096 }
 IAP write length definitions. More...

Functions

uint32_t Lpc17xxIapGetSectorNr (uint32_t addr)
 IAP API.
IAP_STATUS_CODE Lpc17xxIapSectorRead (uint32_t addr, void *data, size_t len)
 Read data from flash memory.
IAP_STATUS_CODE Lpc17xxIapSectorWrite (uint32_t dest, void *source, IAP_WRITE_SIZE size)
 Write data to flash.
IAP_STATUS_CODE Lpc17xxIapSectorErase (uint32_t start_sec, uint32_t end_sec)
 Erase sector(s)
IAP_STATUS_CODE Lpc17xxIapSectorBlankCheck (uint32_t start_sec, uint32_t end_sec, uint32_t *first_nblank_off, uint32_t *first_nblank_val)
 Blank check sector(s)
IAP_STATUS_CODE Lpc17xxIapReadBootCodeVersion (uint8_t *major, uint8_t *minor)
 Read boot code version. The version is interpreted as <major>.<minor>.
IAP_STATUS_CODE Lpc17xxIapReadDeviceSerialNumber (uint32_t *uid)
 Read Device serial number.
int Lpc17xxIapParamRead (unsigned int pos, void *data, size_t len)
 Load configuration parameters from embedded flash memory.
int Lpc17xxIapParamWrite (unsigned int pos, const void *data, size_t len)
 Store configuration parameters in embedded flash memory.

Define Documentation

#define IAP_LOCATION   (0x1FFF1FF1UL)

Enumeration Type Documentation

IAP command code definitions.

Enumerator:
IAP_PREPARE 
IAP_COPY_RAM2FLASH 
IAP_ERASE 
IAP_BLANK_CHECK 
IAP_READ_PART_ID 
IAP_READ_BOOT_VER 
IAP_COMPARE 
IAP_REINVOKE_ISP 
IAP_READ_SERIAL_NUMBER 

IAP status code definitions.

Enumerator:
CMD_SUCCESS 
INVALID_COMMAND 
SRC_ADDR_ERROR 
DST_ADDR_ERROR 
SRC_ADDR_NOT_MAPPED 
DST_ADDR_NOT_MAPPED 
COUNT_ERROR 
INVALID_SECTOR 
SECTOR_NOT_BLANK 
SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION 
COMPARE_ERROR 
BUSY 

IAP write length definitions.

Enumerator:
IAP_WRITE_256 
IAP_WRITE_512 
IAP_WRITE_1024 
IAP_WRITE_4096