INL-retro-progdump/host/source/memory.h

51 lines
1.2 KiB
C

#ifndef _memory_h
#define _memory_h
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <errno.h>
//include prior to other file includes
//that way DEBUG can be turned on/off for this file alone
//uncomment to DEBUG this file alone
#define DEBUG
//"make debug" to get DEBUG msgs on entire program
#include "dbg.h"
#include "usb_operations.h"
#include "shared_errors.h"
#include "shared_dictionaries.h"
#include "dictionary.h"
#include "enums.h"
//SST 39SF0x0 manf/prod IDs
#define SST_MANF_ID 0xBF
#define SST_PROD_128 0xB5
#define SST_PROD_256 0xB6
#define SST_PROD_512 0xB7
//SRAM manf/prod ID
#define SRAM 0xAA
//KByte for easy math
#define KBYTE 1024
//memory object/struct
typedef struct memory{
int manf;
int part;
int volatility; //sram no batt vs batt, mask rom, erasability, etc
int size; //size of the max addressable memory grounding addr pins lowers this value
int bank_size; //size of banks/pages of memory created by mapper banking
int width; //width of data bus as configured
int protocol; //parallel, SPI, I2C, JTAG, custom etc.
int sector_size; //minimum eraseable size in bytes
} memory;
void init_memory_elements( memory *mem );
#endif