![]() |
LPCOpen Platform
v1.03
LPCOpen Platform for NXP LPC Microcontrollers
|
Go to the source code of this file.
Data Structures | |
| struct | MEM_POOL |
Macros | |
| #define | LIB_MEM_EXT extern |
| #define | LIB_MEM_CFG_ARG_CHK_EXT_EN DEF_DISABLED |
| #define | LIB_MEM_CFG_OPTIMIZE_ASM_EN DEF_DISABLED |
| #define | LIB_MEM_CFG_ALLOC_EN DEF_DISABLED |
| #define | LIB_MEM_ERR_NONE 10000u |
| #define | LIB_MEM_ERR_NULL_PTR 10001u /* Ptr arg(s) passed NULL ptr(s). */ |
| #define | LIB_MEM_ERR_INVALID_MEM_SIZE 10100u /* Invalid mem size. */ |
| #define | LIB_MEM_ERR_INVALID_MEM_ALIGN 10101u /* Invalid mem align. */ |
| #define | LIB_MEM_ERR_INVALID_SEG_SIZE 10110u /* Invalid mem seg size. */ |
| #define | LIB_MEM_ERR_INVALID_SEG_OVERLAP 10111u /* Invalid mem seg overlaps other mem seg(s). */ |
| #define | LIB_MEM_ERR_INVALID_POOL 10120u /* Invalid mem pool. */ |
| #define | LIB_MEM_ERR_INVALID_BLK_NBR 10130u /* Invalid mem pool blk nbr. */ |
| #define | LIB_MEM_ERR_INVALID_BLK_SIZE 10131u /* Invalid mem pool blk size. */ |
| #define | LIB_MEM_ERR_INVALID_BLK_ALIGN 10132u /* Invalid mem pool blk align. */ |
| #define | LIB_MEM_ERR_INVALID_BLK_IX 10133u /* Invalid mem pool ix. */ |
| #define | LIB_MEM_ERR_INVALID_BLK_ADDR 10135u /* Invalid mem pool blk addr. */ |
| #define | LIB_MEM_ERR_INVALID_BLK_ADDR_IN_POOL 10136u /* Mem pool blk addr already in mem pool. */ |
| #define | LIB_MEM_ERR_SEG_EMPTY 10200u /* Mem seg empty; i.e. NO avail mem in seg. */ |
| #define | LIB_MEM_ERR_SEG_OVF 10201u /* Mem seg ovf; i.e. req'd mem ovfs rem mem in seg. */ |
| #define | LIB_MEM_ERR_POOL_FULL 10205u /* Mem pool full; i.e. all mem blks avail in mem pool. */ |
| #define | LIB_MEM_ERR_POOL_EMPTY 10206u /* Mem pool empty; i.e. NO mem blks avail in mem pool. */ |
| #define | LIB_MEM_ERR_HEAP_NOT_FOUND 10210u /* Heap seg NOT found. */ |
| #define | LIB_MEM_ERR_HEAP_EMPTY 10211u /* Heap seg empty; i.e. NO avail mem in heap. */ |
| #define | LIB_MEM_ERR_HEAP_OVF 10212u /* Heap seg ovf; i.e. req'd mem ovfs rem mem in heap. */ |
| #define | LIB_MEM_TYPE_NONE CPU_TYPE_CREATE('N', 'O', 'N', 'E') |
| #define | LIB_MEM_TYPE_HEAP CPU_TYPE_CREATE('H', 'E', 'A', 'P') |
| #define | LIB_MEM_TYPE_POOL CPU_TYPE_CREATE('P', 'O', 'O', 'L') |
| #define | MEM_POOL_IX_NONE DEF_INT_16U_MAX_VAL /* Define as max unsigned val (see Note #1). */ |
| #define | MEM_POOL_IX_MIN 1 |
| #define | MEM_POOL_IX_MAX (MEM_POOL_IX_NONE - 1) |
| #define | MEM_VAL_GET_INT08U_BIG(addr) ((CPU_INT08U) (((CPU_INT08U)(*(((CPU_INT08U *)(addr)) + 0))) << (0u * DEF_OCTET_NBR_BITS))) |
| #define | MEM_VAL_GET_INT16U_BIG(addr) |
| #define | MEM_VAL_GET_INT32U_BIG(addr) |
| #define | MEM_VAL_GET_INT08U_LITTLE(addr) ((CPU_INT08U) (((CPU_INT08U)(*(((CPU_INT08U *)(addr)) + 0))) << (0u * DEF_OCTET_NBR_BITS))) |
| #define | MEM_VAL_GET_INT16U_LITTLE(addr) |
| #define | MEM_VAL_GET_INT32U_LITTLE(addr) |
| #define | MEM_VAL_GET_INT08U(addr) MEM_VAL_GET_INT08U_BIG(addr) |
| #define | MEM_VAL_GET_INT16U(addr) MEM_VAL_GET_INT16U_BIG(addr) |
| #define | MEM_VAL_GET_INT32U(addr) MEM_VAL_GET_INT32U_BIG(addr) |
| #define | MEM_VAL_SET_INT08U_BIG(addr, val) do { (*(((CPU_INT08U *)(addr)) + 0)) = ((CPU_INT08U)((((CPU_INT08U)(val)) & 0xFFuL) >> (0u * DEF_OCTET_NBR_BITS))); } while (0) |
| #define | MEM_VAL_SET_INT16U_BIG(addr, val) |
| #define | MEM_VAL_SET_INT32U_BIG(addr, val) |
| #define | MEM_VAL_SET_INT08U_LITTLE(addr, val) do { (*(((CPU_INT08U *)(addr)) + 0)) = ((CPU_INT08U)((((CPU_INT08U)(val)) & 0xFFuL) >> (0u * DEF_OCTET_NBR_BITS))); } while (0) |
| #define | MEM_VAL_SET_INT16U_LITTLE(addr, val) |
| #define | MEM_VAL_SET_INT32U_LITTLE(addr, val) |
| #define | MEM_VAL_SET_INT08U(addr, val) MEM_VAL_SET_INT08U_BIG(addr, val) |
| #define | MEM_VAL_SET_INT16U(addr, val) MEM_VAL_SET_INT16U_BIG(addr, val) |
| #define | MEM_VAL_SET_INT32U(addr, val) MEM_VAL_SET_INT32U_BIG(addr, val) |
| #define | MEM_VAL_COPY_GET_INT08U_BIG(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); } while (0) |
| #define | MEM_VAL_COPY_GET_INT16U_BIG(addr_dest, addr_src) |
| #define | MEM_VAL_COPY_GET_INT32U_BIG(addr_dest, addr_src) |
| #define | MEM_VAL_COPY_GET_INT08U_LITTLE(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); } while (0) |
| #define | MEM_VAL_COPY_GET_INT16U_LITTLE(addr_dest, addr_src) |
| #define | MEM_VAL_COPY_GET_INT32U_LITTLE(addr_dest, addr_src) |
| #define | MEM_VAL_COPY_GET_INT08U(addr_dest, addr_src) MEM_VAL_COPY_GET_INT08U_BIG(addr_dest, addr_src) |
| #define | MEM_VAL_COPY_GET_INT16U(addr_dest, addr_src) MEM_VAL_COPY_GET_INT16U_BIG(addr_dest, addr_src) |
| #define | MEM_VAL_COPY_GET_INT32U(addr_dest, addr_src) MEM_VAL_COPY_GET_INT32U_BIG(addr_dest, addr_src) |
| #define | MEM_VAL_COPY_GET_INTU_BIG(addr_dest, addr_src, val_size) |
| #define | MEM_VAL_COPY_GET_INTU_LITTLE(addr_dest, addr_src, val_size) |
| #define | MEM_VAL_COPY_GET_INTU(addr_dest, addr_src, val_size) MEM_VAL_COPY_GET_INTU_BIG(addr_dest, addr_src, val_size) |
| #define | MEM_VAL_COPY_SET_INT08U_BIG(addr_dest, addr_src) MEM_VAL_COPY_GET_INT08U_BIG(addr_dest, addr_src) |
| #define | MEM_VAL_COPY_SET_INT16U_BIG(addr_dest, addr_src) MEM_VAL_COPY_GET_INT16U_BIG(addr_dest, addr_src) |
| #define | MEM_VAL_COPY_SET_INT32U_BIG(addr_dest, addr_src) MEM_VAL_COPY_GET_INT32U_BIG(addr_dest, addr_src) |
| #define | MEM_VAL_COPY_SET_INT08U_LITTLE(addr_dest, addr_src) MEM_VAL_COPY_GET_INT08U_LITTLE(addr_dest, addr_src) |
| #define | MEM_VAL_COPY_SET_INT16U_LITTLE(addr_dest, addr_src) MEM_VAL_COPY_GET_INT16U_LITTLE(addr_dest, addr_src) |
| #define | MEM_VAL_COPY_SET_INT32U_LITTLE(addr_dest, addr_src) MEM_VAL_COPY_GET_INT32U_LITTLE(addr_dest, addr_src) |
| #define | MEM_VAL_COPY_SET_INT08U(addr_dest, addr_src) MEM_VAL_COPY_GET_INT08U(addr_dest, addr_src) |
| #define | MEM_VAL_COPY_SET_INT16U(addr_dest, addr_src) MEM_VAL_COPY_GET_INT16U(addr_dest, addr_src) |
| #define | MEM_VAL_COPY_SET_INT32U(addr_dest, addr_src) MEM_VAL_COPY_GET_INT32U(addr_dest, addr_src) |
| #define | MEM_VAL_COPY_SET_INTU_BIG(addr_dest, addr_src, val_size) MEM_VAL_COPY_GET_INTU_BIG(addr_dest, addr_src, val_size) |
| #define | MEM_VAL_COPY_SET_INTU_LITTLE(addr_dest, addr_src, val_size) MEM_VAL_COPY_GET_INTU_LITTLE(addr_dest, addr_src, val_size) |
| #define | MEM_VAL_COPY_SET_INTU(addr_dest, addr_src, val_size) MEM_VAL_COPY_GET_INTU(addr_dest, addr_src, val_size) |
| #define | MEM_VAL_COPY_08(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); } while (0) |
| #define | MEM_VAL_COPY_16(addr_dest, addr_src) |
| #define | MEM_VAL_COPY_32(addr_dest, addr_src) |
Typedefs | |
| typedef CPU_INT32U | LIB_MEM_TYPE |
| typedef CPU_INT16U | MEM_POOL_IX |
Functions | |
| void | Mem_Init (void) |
| void | Mem_Clr (void *pmem, CPU_SIZE_T size) |
| void | Mem_Set (void *pmem, CPU_INT08U data_val, CPU_SIZE_T size) |
| void | Mem_Copy (void *pdest, const void *psrc, CPU_SIZE_T size) |
| CPU_BOOLEAN | Mem_Cmp (const void *p1_mem, const void *p2_mem, CPU_SIZE_T size) |
| #define LIB_MEM_CFG_ALLOC_EN DEF_DISABLED |
| #define LIB_MEM_CFG_ARG_CHK_EXT_EN DEF_DISABLED |
| #define LIB_MEM_CFG_OPTIMIZE_ASM_EN DEF_DISABLED |
| #define LIB_MEM_ERR_HEAP_EMPTY 10211u /* Heap seg empty; i.e. NO avail mem in heap. */ |
| #define LIB_MEM_ERR_HEAP_NOT_FOUND 10210u /* Heap seg NOT found. */ |
| #define LIB_MEM_ERR_HEAP_OVF 10212u /* Heap seg ovf; i.e. req'd mem ovfs rem mem in heap. */ |
| #define LIB_MEM_ERR_INVALID_BLK_ADDR 10135u /* Invalid mem pool blk addr. */ |
| #define LIB_MEM_ERR_INVALID_BLK_ADDR_IN_POOL 10136u /* Mem pool blk addr already in mem pool. */ |
| #define LIB_MEM_ERR_INVALID_BLK_ALIGN 10132u /* Invalid mem pool blk align. */ |
| #define LIB_MEM_ERR_INVALID_BLK_IX 10133u /* Invalid mem pool ix. */ |
| #define LIB_MEM_ERR_INVALID_BLK_NBR 10130u /* Invalid mem pool blk nbr. */ |
| #define LIB_MEM_ERR_INVALID_BLK_SIZE 10131u /* Invalid mem pool blk size. */ |
| #define LIB_MEM_ERR_INVALID_MEM_ALIGN 10101u /* Invalid mem align. */ |
| #define LIB_MEM_ERR_INVALID_MEM_SIZE 10100u /* Invalid mem size. */ |
| #define LIB_MEM_ERR_INVALID_POOL 10120u /* Invalid mem pool. */ |
| #define LIB_MEM_ERR_INVALID_SEG_OVERLAP 10111u /* Invalid mem seg overlaps other mem seg(s). */ |
| #define LIB_MEM_ERR_INVALID_SEG_SIZE 10110u /* Invalid mem seg size. */ |
| #define LIB_MEM_ERR_NULL_PTR 10001u /* Ptr arg(s) passed NULL ptr(s). */ |
| #define LIB_MEM_ERR_POOL_EMPTY 10206u /* Mem pool empty; i.e. NO mem blks avail in mem pool. */ |
| #define LIB_MEM_ERR_POOL_FULL 10205u /* Mem pool full; i.e. all mem blks avail in mem pool. */ |
| #define LIB_MEM_ERR_SEG_EMPTY 10200u /* Mem seg empty; i.e. NO avail mem in seg. */ |
| #define LIB_MEM_ERR_SEG_OVF 10201u /* Mem seg ovf; i.e. req'd mem ovfs rem mem in seg. */ |
| #define LIB_MEM_TYPE_HEAP CPU_TYPE_CREATE('H', 'E', 'A', 'P') |
| #define LIB_MEM_TYPE_NONE CPU_TYPE_CREATE('N', 'O', 'N', 'E') |
| #define LIB_MEM_TYPE_POOL CPU_TYPE_CREATE('P', 'O', 'O', 'L') |
| #define MEM_POOL_IX_MAX (MEM_POOL_IX_NONE - 1) |
| #define MEM_POOL_IX_NONE DEF_INT_16U_MAX_VAL /* Define as max unsigned val (see Note #1). */ |
| #define MEM_VAL_COPY_08 | ( | addr_dest, | |
| addr_src | |||
| ) | do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); } while (0) |
| #define MEM_VAL_COPY_16 | ( | addr_dest, | |
| addr_src | |||
| ) |
| #define MEM_VAL_COPY_32 | ( | addr_dest, | |
| addr_src | |||
| ) |
| #define MEM_VAL_COPY_GET_INT08U | ( | addr_dest, | |
| addr_src | |||
| ) | MEM_VAL_COPY_GET_INT08U_BIG(addr_dest, addr_src) |
| #define MEM_VAL_COPY_GET_INT08U_BIG | ( | addr_dest, | |
| addr_src | |||
| ) | do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); } while (0) |
| #define MEM_VAL_COPY_GET_INT08U_LITTLE | ( | addr_dest, | |
| addr_src | |||
| ) | do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); } while (0) |
| #define MEM_VAL_COPY_GET_INT16U | ( | addr_dest, | |
| addr_src | |||
| ) | MEM_VAL_COPY_GET_INT16U_BIG(addr_dest, addr_src) |
| #define MEM_VAL_COPY_GET_INT16U_BIG | ( | addr_dest, | |
| addr_src | |||
| ) |
| #define MEM_VAL_COPY_GET_INT16U_LITTLE | ( | addr_dest, | |
| addr_src | |||
| ) |
| #define MEM_VAL_COPY_GET_INT32U | ( | addr_dest, | |
| addr_src | |||
| ) | MEM_VAL_COPY_GET_INT32U_BIG(addr_dest, addr_src) |
| #define MEM_VAL_COPY_GET_INT32U_BIG | ( | addr_dest, | |
| addr_src | |||
| ) |
| #define MEM_VAL_COPY_GET_INT32U_LITTLE | ( | addr_dest, | |
| addr_src | |||
| ) |
| #define MEM_VAL_COPY_GET_INTU | ( | addr_dest, | |
| addr_src, | |||
| val_size | |||
| ) | MEM_VAL_COPY_GET_INTU_BIG(addr_dest, addr_src, val_size) |
| #define MEM_VAL_COPY_GET_INTU_BIG | ( | addr_dest, | |
| addr_src, | |||
| val_size | |||
| ) |
| #define MEM_VAL_COPY_GET_INTU_LITTLE | ( | addr_dest, | |
| addr_src, | |||
| val_size | |||
| ) |
| #define MEM_VAL_COPY_SET_INT08U | ( | addr_dest, | |
| addr_src | |||
| ) | MEM_VAL_COPY_GET_INT08U(addr_dest, addr_src) |
| #define MEM_VAL_COPY_SET_INT08U_BIG | ( | addr_dest, | |
| addr_src | |||
| ) | MEM_VAL_COPY_GET_INT08U_BIG(addr_dest, addr_src) |
| #define MEM_VAL_COPY_SET_INT08U_LITTLE | ( | addr_dest, | |
| addr_src | |||
| ) | MEM_VAL_COPY_GET_INT08U_LITTLE(addr_dest, addr_src) |
| #define MEM_VAL_COPY_SET_INT16U | ( | addr_dest, | |
| addr_src | |||
| ) | MEM_VAL_COPY_GET_INT16U(addr_dest, addr_src) |
| #define MEM_VAL_COPY_SET_INT16U_BIG | ( | addr_dest, | |
| addr_src | |||
| ) | MEM_VAL_COPY_GET_INT16U_BIG(addr_dest, addr_src) |
| #define MEM_VAL_COPY_SET_INT16U_LITTLE | ( | addr_dest, | |
| addr_src | |||
| ) | MEM_VAL_COPY_GET_INT16U_LITTLE(addr_dest, addr_src) |
| #define MEM_VAL_COPY_SET_INT32U | ( | addr_dest, | |
| addr_src | |||
| ) | MEM_VAL_COPY_GET_INT32U(addr_dest, addr_src) |
| #define MEM_VAL_COPY_SET_INT32U_BIG | ( | addr_dest, | |
| addr_src | |||
| ) | MEM_VAL_COPY_GET_INT32U_BIG(addr_dest, addr_src) |
| #define MEM_VAL_COPY_SET_INT32U_LITTLE | ( | addr_dest, | |
| addr_src | |||
| ) | MEM_VAL_COPY_GET_INT32U_LITTLE(addr_dest, addr_src) |
| #define MEM_VAL_COPY_SET_INTU | ( | addr_dest, | |
| addr_src, | |||
| val_size | |||
| ) | MEM_VAL_COPY_GET_INTU(addr_dest, addr_src, val_size) |
| #define MEM_VAL_COPY_SET_INTU_BIG | ( | addr_dest, | |
| addr_src, | |||
| val_size | |||
| ) | MEM_VAL_COPY_GET_INTU_BIG(addr_dest, addr_src, val_size) |
| #define MEM_VAL_COPY_SET_INTU_LITTLE | ( | addr_dest, | |
| addr_src, | |||
| val_size | |||
| ) | MEM_VAL_COPY_GET_INTU_LITTLE(addr_dest, addr_src, val_size) |
| #define MEM_VAL_GET_INT08U | ( | addr | ) | MEM_VAL_GET_INT08U_BIG(addr) |
| #define MEM_VAL_GET_INT08U_BIG | ( | addr | ) | ((CPU_INT08U) (((CPU_INT08U)(*(((CPU_INT08U *)(addr)) + 0))) << (0u * DEF_OCTET_NBR_BITS))) |
| #define MEM_VAL_GET_INT08U_LITTLE | ( | addr | ) | ((CPU_INT08U) (((CPU_INT08U)(*(((CPU_INT08U *)(addr)) + 0))) << (0u * DEF_OCTET_NBR_BITS))) |
| #define MEM_VAL_GET_INT16U | ( | addr | ) | MEM_VAL_GET_INT16U_BIG(addr) |
| #define MEM_VAL_GET_INT16U_BIG | ( | addr | ) |
| #define MEM_VAL_GET_INT16U_LITTLE | ( | addr | ) |
| #define MEM_VAL_GET_INT32U | ( | addr | ) | MEM_VAL_GET_INT32U_BIG(addr) |
| #define MEM_VAL_GET_INT32U_BIG | ( | addr | ) |
| #define MEM_VAL_GET_INT32U_LITTLE | ( | addr | ) |
| #define MEM_VAL_SET_INT08U | ( | addr, | |
| val | |||
| ) | MEM_VAL_SET_INT08U_BIG(addr, val) |
| #define MEM_VAL_SET_INT08U_BIG | ( | addr, | |
| val | |||
| ) | do { (*(((CPU_INT08U *)(addr)) + 0)) = ((CPU_INT08U)((((CPU_INT08U)(val)) & 0xFFuL) >> (0u * DEF_OCTET_NBR_BITS))); } while (0) |
| #define MEM_VAL_SET_INT08U_LITTLE | ( | addr, | |
| val | |||
| ) | do { (*(((CPU_INT08U *)(addr)) + 0)) = ((CPU_INT08U)((((CPU_INT08U)(val)) & 0xFFuL) >> (0u * DEF_OCTET_NBR_BITS))); } while (0) |
| #define MEM_VAL_SET_INT16U | ( | addr, | |
| val | |||
| ) | MEM_VAL_SET_INT16U_BIG(addr, val) |
| #define MEM_VAL_SET_INT16U_BIG | ( | addr, | |
| val | |||
| ) |
| #define MEM_VAL_SET_INT16U_LITTLE | ( | addr, | |
| val | |||
| ) |
| #define MEM_VAL_SET_INT32U | ( | addr, | |
| val | |||
| ) | MEM_VAL_SET_INT32U_BIG(addr, val) |
| #define MEM_VAL_SET_INT32U_BIG | ( | addr, | |
| val | |||
| ) |
| #define MEM_VAL_SET_INT32U_LITTLE | ( | addr, | |
| val | |||
| ) |
| typedef CPU_INT32U LIB_MEM_TYPE |
| typedef CPU_INT16U MEM_POOL_IX |
| void Mem_Clr | ( | void * | pmem, |
| CPU_SIZE_T | size | ||
| ) |
| CPU_BOOLEAN Mem_Cmp | ( | const void * | p1_mem, |
| const void * | p2_mem, | ||
| CPU_SIZE_T | size | ||
| ) |
| void Mem_Copy | ( | void * | pdest, |
| const void * | psrc, | ||
| CPU_SIZE_T | size | ||
| ) |
| void Mem_Set | ( | void * | pmem, |
| CPU_INT08U | data_val, | ||
| CPU_SIZE_T | size | ||
| ) |