Microchip® Advanced Software Framework

sdram_loader.c File Reference
#include <stddef.h>
#include "board.h"
#include "sdramc.h"
#include "navigation.h"
#include "file.h"
#include "spi.h"
#include "at45dbx.h"
#include "conf_at45dbx.h"
#include "conf_audio_player.h"
#include "gpio.h"
#include "et024006dhu.h"
#include "sdram_loader.h"

Data Structures

struct  bm_file_header_s
 File header of a bitmap file. 14 bytes long, little endian representation and packed. See bitmap specification for more details. More...
 
struct  bm_info_header_s
 Bitmap file information header. More...
 

Macros

#define AT45DBX_ENABLE_NPCS_PIN(NPCS, unused)   {AT45DBX_SPI_NPCS##NPCS##_PIN, AT45DBX_SPI_NPCS##NPCS##_FUNCTION},
 
#define DATAFLASH_DISK_ID   1
 
#define DATAFLASH_NAV_ID   0
 

Typedefs

typedef struct bm_file_header_s bm_file_header_t
 File header of a bitmap file. 14 bytes long, little endian representation and packed. See bitmap specification for more details. More...
 
typedef struct bm_info_header_s bm_info_header_t
 Bitmap file information header. More...
 

Functions

void ascii2unicode (char *deststr, const char *srcstr, size_t strlen)
 
static void at45dbx_resources_init (void)
 Initializes AT45DBX resources: GPIO, SPI and AT45DBX. More...
 
void bm_get_info (bm_file_header_t *bf, bm_info_header_t *bi)
 
void load_sdram_data (int hsb_hz)
 
void swap_endian_blk (unsigned char *pblock, int size)
 Swaps a block of data to the other endian representation. More...
 

Variables

ram_file_t ram_files [NUMBER_OF_IMAGES]
 
mspace sdram_mspace
 

#define AT45DBX_ENABLE_NPCS_PIN (   NPCS,
  unused 
)    {AT45DBX_SPI_NPCS##NPCS##_PIN, AT45DBX_SPI_NPCS##NPCS##_FUNCTION},

Referenced by at45dbx_resources_init().

#define DATAFLASH_DISK_ID   1
#define DATAFLASH_NAV_ID   0

Referenced by load_sdram_data().

File header of a bitmap file. 14 bytes long, little endian representation and packed. See bitmap specification for more details.

Bitmap file information header.

Starts after the file header and is 40 bytes long, in little endian and packed.

void ascii2unicode ( char *  deststr,
const char *  srcstr,
size_t  strlen 
)
void bm_get_info ( bm_file_header_t bf,
bm_info_header_t bi 
)

References file_read_buf(), and swap_endian_blk().

Referenced by load_sdram_data().

void swap_endian_blk ( unsigned char *  pblock,
int  size 
)

Swaps a block of data to the other endian representation.

Parameters
pblockPointer to the first byte of the data block
sizeSize of the data bock in bytes

Referenced by bm_get_info().

Initial value:
= {
{ .name = L"/AVR32_start_320x240_RGB565.bmp"},
{ .name = L"/disk_nav_320x240_RGB565.bmp"},
{ .name = L"/audio_player.bmp"},
{ .name = L"/Gjallarhorn_100x100_RGB565.bmp"},
{ .name = L"/in_progress_128x16_RGB565.bmp"},
{ .name = L"/loading_100x29_RGB565.bmp"},
{ .name = L"/not_supported_176x29_RGB565.bmp"}
}

Referenced by clear_in_progress(), draw_background(), draw_config(), draw_config_view_print_cursor(), draw_config_view_print_repeat(), draw_config_view_print_shuffle(), draw_cover_art(), draw_device_not_present(), draw_device_not_supported(), draw_device_present(), draw_file_list(), draw_in_progress(), draw_navigation(), draw_pause_button(), draw_play_button(), draw_play_view(), draw_play_view_print_artist(), draw_play_view_print_file(), draw_play_view_print_title(), draw_play_view_print_total_time(), draw_playtime_update(), draw_song_progress_bar(), draw_startup(), draw_volume_bar(), and load_sdram_data().