#include <stdint.h>
Go to the source code of this file.
|
void | copy_al2un (unsigned char *dst, const unsigned long *src, int count) |
| Copy aligned to unaligned.
|
|
void | copy_un2al (unsigned long *dst, const unsigned char *src, int count) |
| Copy unaligned to aligned.
|
|
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_read (unsigned char *buff, unsigned long sector, unsigned char count) |
| Read sectors over 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)
|
|
|
#define | CTRL_SYNC 0 |
| Flush disk cache (for write functions)
|
|
#define | GET_SECTOR_COUNT 1 |
| Get media size (for only f_mkfs())
|
|
#define | GET_SECTOR_SIZE 2 |
| Get sector size (for multiple sector size (_MAX_SS >= 1024))
|
|
#define | GET_BLOCK_SIZE 3 |
| Get erase block size (for only f_mkfs())
|
|
#define | CTRL_ERASE_SECTOR 4 |
| Force erased a block of sectors (for only _USE_ERASE)
|
|
◆ mci_initialize()
Initialize media control interface (MCI)
- Returns
- 0 on success
-
a diskio_sta_t value on error
◆ mci_ioctl()
IOCTL functions for the media control interface (MCI)
- Parameters
-
[in] | ctrl | Control code |
[in,out] | buff | Buffer to send/receive data block |
- Returns
- DISKIO_RES_OK on success
-
any other diskio_result_t value on error
◆ mci_read()
diskio_result_t mci_read |
( |
unsigned char * |
buff, |
|
|
unsigned long |
sector, |
|
|
unsigned char |
count |
|
) |
| |
Read sectors over the media control interface (MCI)
- Parameters
-
[out] | buff | Pointer to the data buffer to store read data |
[in] | sector | Start sector number (LBA) |
[in] | count | Sector count (1..127) |
- Returns
- DISKIO_RES_OK on success
-
any other diskio_result_t value on error
◆ mci_status()
Get the status of the media control interface (MCI)
- Returns
- 0 on success
-
a diskio_sta_t value on error
◆ mci_write()
diskio_result_t mci_write |
( |
const unsigned char * |
buff, |
|
|
unsigned long |
sector, |
|
|
unsigned char |
count |
|
) |
| |
Write sectors over the media control interface (MCI)
- Parameters
-
[in] | buff | Pointer to the data to be written |
[in] | sector | Start sector number (LBA) |
[in] | count | Sector count (1..127) |
- Returns
- DISKIO_RES_OK on success
-
any other diskio_result_t value on error