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
39
typedef
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);
48
}
block_ops_t
;
49
51
typedef
struct
{
53
const
block_ops_t
*
ops
;
55
void
*
device
;
56
}
block_device_t
;
57
60
#endif
/* HOMECORE_DRIVERS_BLOCK_H */
block_device_t
A block device: driver operations bound to one device instance.
Definition
block.h:51
block_device_t::device
void * device
Driver instance passed to every operation.
Definition
block.h:55
block_device_t::ops
const block_ops_t * ops
Operations of the device's driver.
Definition
block.h:53
block_ops_t
Operations a block driver provides; every one is required.
Definition
block.h:39
include
homecore
drivers
block.h
Generated by
1.9.8