LPCOpen Platform
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 "LPC/HAL/HAL_LPC.h"
#include "USBMemory.h"

Go to the source code of this file.

Data Structures

struct  PMemBlockInfo
 

Macros

#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) ? NULL : head + (x)->next )) )
 
#define LINK_TO_THIS_BLOCK(x)   ( ((uint32_t) ((x)-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)
 
void USB_Memory_Free (uint8_t *ptr)
 

Macro Definition Documentation

#define ALIGN_FOUR_BYTES   (4)

Definition at line 54 of file USBMemory.c.

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

Definition at line 59 of file USBMemory.c.

#define HEADER_SIZE   (sizeof(sMemBlockInfo))

Definition at line 58 of file USBMemory.c.

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

Definition at line 61 of file USBMemory.c.

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

Definition at line 60 of file USBMemory.c.

Function Documentation

static PRAGMA_ALIGN_4 uint8_t USB_Mem_Buffer [USBRAM_BUFFER_SIZE] ATTR_ALIGNED ( )
static

Definition at line 64 of file USBMemory.c.

uint8_t* USB_Memory_Alloc ( uint32_t  size)

Definition at line 75 of file USBMemory.c.

void USB_Memory_Free ( uint8_t *  ptr)

Definition at line 121 of file USBMemory.c.