LPCOpen Platform  v1.03
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
USBMemory.c File Reference
#include "USBMode.h"
#include "../../../Common/Common.h"
#include "USBTask.h"
#include "HAL/HAL.h"
#include "USBMemory.h"

Go to the source code of this file.

Data Structures

struct  PMemBlockInfo
 

Macros

#define TEST_NEW_ALLOC   0
 
#define ALIGN_FOUR_BYTES   (4)
 
#define HEADER_SIZE   (sizeof(sMemBlockInfo))
 
#define HEADER_POINTER(x)   ((uint8_t *)x - sizeof(sMemBlockInfo))
 
#define NEXT_BLOCK(x)   ((PMemBlockInfo) ( ((x)->next==0) ? 0 : ((uint32_t)head +(x)->next) ))
 
#define LINK_TO_THIS_BLOCK(x)   (((uint32_t)(x))-((uint32_t)head))
 

Functions

static PRAGMA_ALIGN_4 uint8_t
USB_Mem_Buffer[USBRAM_BUFFER_SIZE
ATTR_ALIGNED (4)
 
uint8_t * USB_Memory_Alloc (uint32_t size, uint32_t num_aligned_bytes)
 
void USB_Memory_Free (uint8_t *ptr)
 

Macro Definition Documentation

#define ALIGN_FOUR_BYTES   (4)

Definition at line 74 of file USBMemory.c.

#define HEADER_POINTER (   x)    ((uint8_t *)x - sizeof(sMemBlockInfo))

Definition at line 79 of file USBMemory.c.

#define HEADER_SIZE   (sizeof(sMemBlockInfo))

Definition at line 78 of file USBMemory.c.

#define LINK_TO_THIS_BLOCK (   x)    (((uint32_t)(x))-((uint32_t)head))

Definition at line 81 of file USBMemory.c.

#define NEXT_BLOCK (   x)    ((PMemBlockInfo) ( ((x)->next==0) ? 0 : ((uint32_t)head +(x)->next) ))

Definition at line 80 of file USBMemory.c.

#define TEST_NEW_ALLOC   0

Definition at line 45 of file USBMemory.c.

Function Documentation

static PRAGMA_ALIGN_4 uint8_t USB_Mem_Buffer [USBRAM_BUFFER_SIZE] ATTR_ALIGNED ( )
static

Definition at line 84 of file USBMemory.c.

uint8_t* USB_Memory_Alloc ( uint32_t  size,
uint32_t  num_aligned_bytes 
)

Definition at line 99 of file USBMemory.c.

void USB_Memory_Free ( uint8_t *  ptr)

Definition at line 213 of file USBMemory.c.