HomeCore 0.1.3 (07b5544)
Bare-metal personal computer firmware for Cortex-M
Loading...
Searching...
No Matches
block.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: MIT */
6#ifndef HOMECORE_DRIVERS_BLOCK_H
7#define HOMECORE_DRIVERS_BLOCK_H
8
9#include <stdint.h>
10
36#define BLOCK_SECTOR_SIZE 512U
37
39typedef struct {
41 int (*read)(void *device, uint32_t sector, void *buf, uint32_t count);
43 int (*write)(void *device, uint32_t sector, const void *buf, uint32_t count);
45 int (*sync)(void *device);
47 uint32_t (*sector_count)(void *device);
49
51typedef struct {
55 void *device;
57
60#endif /* HOMECORE_DRIVERS_BLOCK_H */
A block device: driver operations bound to one device instance.
Definition block.h:51
void * device
Driver instance passed to every operation.
Definition block.h:55
const block_ops_t * ops
Operations of the device's driver.
Definition block.h:53
Operations a block driver provides; every one is required.
Definition block.h:39