RH850 specific API’s

sgui_rh850_mem_init

Defined in <sparklet_api.h>

Version

int32_t sgui_rh850_mem_init (uint32_t u32_rh850_iram_base_addr, uint32_t u32_rh850_iram_block_count,

uint32_t u32_rh850_iram_block_size,

uint32_t u32_rh850_vram_base_addr,

uint32_t u32_rh850_vram_block_count,

uint32_t u32_rh850_vram_block_size,

uint32_t u32_rh850_sdram_base_addr,

uint32_t u32_rh850_sdram_block_count,

uint32_t u32_rh850_sdram_block_size,

uint32_t u32_rh850_video_ram_base_addr,

uint32_t u32_rh850_video_ram_size,

uint32_t u32_rh850_capture_buf)

Since 3.1

This function initializes the memory blocks of various RAM memories for RH8450 operation.

PARAMETERS:

u32_rh850_iram_base_addr

Base address of IRAM

u32_rh850_iram_block_count

Block count of IRAM

u32_rh850_iram_block_size

Size of IRAM

u32_rh850_vram_base_addr

Base address of VRAM

u32_rh850_vram_block_count

Block count of VRAM

u32_rh850_vram_block_size

Size of VRAM

u32_rh850_sdram_base_addr

Base address of SDRAM

u32_rh850_sdram_block_count

Block count of SDRAM

u32_rh850_sdram_block_size

Size of SDRAM

u32_rh850_video_ram_base_addr

Base address of video RAM

u32_rh850_video_ram_size

Size of video RAM

u32_rh850_capture_buf

Capture buffer

RETURN VALUE:

0 - Success

-1 - IRAM heap manager failure

-2 - VRAM heap manager failure

-3 - SDRAM heap manager failure

Example:

The below function initializes the memory blocks of various RAM units as following:

 1#define LOCAL_NUM_BLOCKS             0x800
 2#define LOCAL_BLOCK_SIZE             0x40
 3#define LOC_HEAP_SIZE                        (LOCAL_NUM_BLOCKS * LOCAL_BLOCK_SIZE)
 4static uint32_t loc_LocalHeap[LOC_HEAP_SIZE >> 2];
 5#define SDRAM_BASE                           0x40000000
 6#define SDRAM_SIZE                           (16 << 20)
 7#define SDRAM_BLOCK_SIZE             (2 * 1024)
 8#define SDRAM_NUM_BLOCKS             (SDRAM_SIZE / SDRAM_BLOCK_SIZE)
 9#define VRAM_BASE                    (0x3FD9C000u + 8192)
10#define VRAM_NUM_BLOCKS              2431
11#define VRAM_BLOCK_SIZE                      512
12#define CAMERA_BASE                  0x3FD9C000u
13#define CAMERA_BLOCK_SIZE                    8192
14#define CAPTURE_BUF         (VRAM_BASE + (VRAM_NUM_BLOCKS * VRAM_BLOCK_SIZE))
15sgui_rh850_mem_init((uint32_t)loc_LocalHeap, LOCAL_NUM_BLOCKS, LOCAL_BLOCK_SIZE, \
16VRAM_BASE, VRAM_NUM_BLOCKS, VRAM_BLOCK_SIZE, \
17SDRAM_BASE, SDRAM_NUM_BLOCKS, SDRAM_BLOCK_SIZE, \
18CAMERA_BASE, CAMERA_BLOCK_SIZE, CAPTURE_BUF);