DMCP interface  03.15_020
Disk functions

Disk functions. More...

Functions

int sys_disk_ok ()
 Returns current disk status. More...
 
int sys_disk_write_enable (int val)
 (En/Dis)able disk write mode More...
 
int sys_is_disk_write_enable ()
 Returns current disk write state. More...
 
void sys_disk_check_valid ()
 Update disk state based on low level disk state. More...
 
void set_fat_label (const char *label)
 Sets disk label. More...
 

Detailed Description

Disk functions.

Current calculator hardware (hwid=0 and hwid=1) provides FAT formatted disk using 6MB of external QSPI flash (bottom 2MB are reserved for use by programs).

Function Documentation

◆ set_fat_label()

void set_fat_label ( const char *  label)

Sets disk label.

Parameters
labelNew disk label

◆ sys_disk_check_valid()

void sys_disk_check_valid ( )

Update disk state based on low level disk state.

Deactivates disk if any low level error occurs.

Current disk state can be seen in 'Disk info' screen. Disk can be still attached to PC through MSC interface (usually File->Activate USB Disk) and files from disk possibly recovered.

Note that even if the filesystem is potentially corrected on PC. When the calculator system assigns disk as invalid because of write error. Disk has to be re-validated using (System -> FAT Disk Media Test). It performs check for bad sectors and makes filesystem format afterwards.

◆ sys_disk_ok()

int sys_disk_ok ( )

Returns current disk status.

Returns
(0/1) 1 = Disk is ready

◆ sys_disk_write_enable()

int sys_disk_write_enable ( int  val)

(En/Dis)able disk write mode

By default the FAT disk is in read-only mode. This function allows to put the disk into write mode and back.

Returns
Previous disk write state

◆ sys_is_disk_write_enable()

int sys_is_disk_write_enable ( )

Returns current disk write state.

Returns
(0/1) 1 = write enabled