Loading...
Searching...
No Matches
diskio.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2010 ChaN
3 * SPDX-FileCopyrightText: 2016 INRIA
4 * SPDX-License-Identifier: LGPL-2.1-only
5 */
6
7#pragma once
8
20
21#include <stdint.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/* These functions are defined in asmfunc.S */
28
36void copy_al2un(unsigned char *dst, const unsigned long *src, int count);
37
45void copy_un2al(unsigned long *dst, const unsigned char *src, int count);
46
55
64
69
74#define CTRL_SYNC 0
75#define GET_SECTOR_COUNT 1
76#define GET_SECTOR_SIZE 2
77#define GET_BLOCK_SIZE 3
78#define CTRL_ERASE_SECTOR 4
80
85#define CTRL_POWER 5
86#define CTRL_LOCK 6
87#define CTRL_EJECT 7
89
94#define MMC_GET_TYPE 10
95#define MMC_GET_CSD 11
96#define MMC_GET_CID 12
97#define MMC_GET_OCR 13
98#define MMC_GET_SDSTAT 14
100
102
110
118
129diskio_result_t mci_read(unsigned char *buff, unsigned long sector, unsigned char count);
130
140diskio_result_t mci_write(const unsigned char *buff, unsigned long sector, unsigned char count);
141
151diskio_result_t mci_ioctl(unsigned char ctrl, void *buff);
152
153#ifdef __cplusplus
154}
155#endif
156
diskio_sta_t mci_initialize(void)
Initialize media control interface (MCI)
diskio_sta_t mci_status(void)
Get the status of the media control interface (MCI)
diskio_result_t mci_write(const unsigned char *buff, unsigned long sector, unsigned char count)
Write sectors over the media control interface (MCI)
diskio_result_t mci_ioctl(unsigned char ctrl, void *buff)
IOCTL functions for the media control interface (MCI)
diskio_result_t mci_read(unsigned char *buff, unsigned long sector, unsigned char count)
Read sectors over the media control interface (MCI)
void copy_un2al(unsigned long *dst, const unsigned char *src, int count)
Copy unaligned to aligned.
diskio_result_t
Results of Disk Functions.
Definition diskio.h:48
void copy_al2un(unsigned char *dst, const unsigned long *src, int count)
Copy aligned to unaligned.
diskio_sta_t
Disk Status Bits.
Definition diskio.h:59
@ DISKIO_RES_NOTRDY
3: Not Ready
Definition diskio.h:52
@ DISKIO_RES_ERROR
1: R/W Error
Definition diskio.h:50
@ DISKIO_RES_PARERR
4: Invalid Parameter
Definition diskio.h:53
@ DISKIO_RES_WRPRT
2: Write Protected
Definition diskio.h:51
@ DISKIO_RES_OK
0: Successful
Definition diskio.h:49
@ DISKIO_STA_PROTECT
Write protected.
Definition diskio.h:62
@ DISKIO_STA_NODISK
No medium in the drive.
Definition diskio.h:61
@ DISKIO_STA_NOINIT
Drive not initialized.
Definition diskio.h:60