Split disk access into seperate file
This commit is contained in:
@@ -1,33 +1,10 @@
|
||||
#ifndef CONTROL_H
|
||||
#define CONTROL_H
|
||||
|
||||
#include "stm32f4xx_hal.h"
|
||||
#include "fatfs.h"
|
||||
#include <sys/types.h>
|
||||
|
||||
struct DirtyBlock {
|
||||
uint32_t block;
|
||||
struct DirtyBlock* next;
|
||||
uint8_t size;
|
||||
uint8_t* data;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
FATFS *fs;
|
||||
FIL *file;
|
||||
uint8_t command;
|
||||
uint8_t ready;
|
||||
uint32_t counter;
|
||||
uint32_t lba;
|
||||
uint8_t* buffer;
|
||||
uint8_t* directory;
|
||||
unsigned int size;
|
||||
struct DirtyBlock* dirty_block;
|
||||
} Storage;
|
||||
#include "stdint.h"
|
||||
|
||||
typedef struct {
|
||||
uint8_t memory_config;
|
||||
Storage storage;
|
||||
} Control;
|
||||
|
||||
uint16_t read_address();
|
||||
|
||||
16
Inc/disk.h
Normal file
16
Inc/disk.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef DISKL_H
|
||||
#define DISKL_H
|
||||
|
||||
#include "stdint.h"
|
||||
|
||||
uint8_t disk_read_byte();
|
||||
void disk_write_byte(uint8_t value);
|
||||
void disk_receive_command(uint8_t command);
|
||||
uint8_t disk_is_ready();
|
||||
|
||||
void disk_init();
|
||||
void disk_free();
|
||||
|
||||
void disk_set_lba_part(uint8_t value, uint8_t part);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user