N64FlashcartMenu
Loading...
Searching...
No Matches
sc64_ll.c File Reference

Low-level functions for SummerCart64. More...

Data Structures

struct  sc64_regs_t
 SummerCart64 Registers Structure. More...
 
struct  sc64_cmd_t
 SummerCart64 Commands Structure. More...
 

Macros

#define SC64_REGS_BASE   (0x1FFF0000UL)
 
#define SC64_REGS   ((sc64_regs_t *) SC64_REGS_BASE)
 
#define SC64_SR_CMD_ERROR   (1 << 30)
 
#define SC64_SR_CPU_BUSY   (1 << 31)
 
#define SC64_KEY_LOCK   (0xFFFFFFFFUL)
 

Enumerations

enum  sc64_cmd_id_t {
  CMD_ID_VERSION_GET = 'V' , CMD_ID_CONFIG_GET = 'c' , CMD_ID_CONFIG_SET = 'C' , CMD_ID_DISK_MAPPING_SET = 'D' ,
  CMD_ID_WRITEBACK_PENDING = 'w' , CMD_ID_WRITEBACK_SD_INFO = 'W' , CMD_ID_FLASH_WAIT_BUSY = 'p' , CMD_ID_FLASH_ERASE_BLOCK = 'P'
}
 SummerCart64 Command IDs.
 

Functions

void sc64_ll_lock (void)
 Lock the SummerCart64.
 
sc64_error_t sc64_ll_get_version (uint16_t *major, uint16_t *minor, uint32_t *revision)
 Get the firmware version of the SummerCart64.
 
sc64_error_t sc64_ll_get_config (sc64_cfg_id_t id, uint32_t *value)
 Get a configuration value from the SummerCart64.
 
sc64_error_t sc64_ll_set_config (sc64_cfg_id_t id, uint32_t value)
 Set a configuration value on the SummerCart64.
 
sc64_error_t sc64_ll_set_disk_mapping (sc64_disk_mapping_t *disk_mapping)
 Set the disk mapping on the SummerCart64.
 
sc64_error_t sc64_ll_writeback_pending (bool *pending)
 Check if there are pending writebacks on the SummerCart64.
 
sc64_error_t sc64_ll_writeback_enable (void *address)
 Enable writeback on the SummerCart64.
 
sc64_error_t sc64_ll_flash_wait_busy (void)
 Wait for the flash to become idle on the SummerCart64.
 
sc64_error_t sc64_ll_flash_get_erase_block_size (size_t *erase_block_size)
 Get the flash erase block size on the SummerCart64.
 
sc64_error_t sc64_ll_flash_erase_block (void *address)
 Erase a flash block on the SummerCart64.
 

Detailed Description

Low-level functions for SummerCart64.


Data Structure Documentation

◆ sc64_regs_t

struct sc64_regs_t

SummerCart64 Registers Structure.

Data Fields
uint32_t SR_CMD

Command Status Register.

uint32_t DATA[2]

Data Registers.

uint32_t IDENTIFIER

Identifier Register.

uint32_t KEY

Key Register.

◆ sc64_cmd_t

struct sc64_cmd_t

SummerCart64 Commands Structure.

Data Fields
sc64_cmd_id_t id

Command ID.

uint32_t arg[2]

Command arguments.

uint32_t rsp[2]

Command response.