weAut_01 / weAutSys    R 2.2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Defines | Functions
include/fatFS/diskio.h File Reference

Overview

Small memory card (SMC / MMC) driver function definitions.

This is the basic include file for ChaN's (grande) fatFS. It defines the low level disk / media I/O driver functions.

Copyright (c) 2012, ChaN, all right reserved.

Modification for weAutSys by A. Weinert
Copyright © 2012 Albrecht Weinert
weinert - automation, Bochum
weinert-automation.de weAut.de a-weinert.de

A.W.'s modifications for weAutSys are

See the notes on copyright and modifications in file fatFS/ff.h.

Revision:
2
Date:
2017-01-25 17:49:03 +0100 (Mi, 25 Jan 2017)

Defines

#define _USE_IOCTL   1
 enable disk_ioctl function
#define _USE_WRITE   1
 enable disk_write function
#define CT_BLOCK   0x08
 Card type flag: block addressing.
#define CT_MMC   0x01
 Card type flag: MMC version 3.
#define CT_SD1   0x02
 Card type flag: SD version 1.
#define CT_SD2   0x04
 Card type flag: SD version 2.
#define CT_SDC
 Card type mask: SD.
#define CTRL_ERASE_SECTOR   4
 Generic command: force erased a block of sectors (for only _USE_ERASE)
#define CTRL_POWER   5
 Generic command: get/set power status.
#define DRESULT
 Results of disk (media driver) functions.
#define GET_BLOCK_SIZE   3
 Generic command: get erase block size (for only f_mkfs())
#define GET_SECTOR_COUNT   1
 Generic command: get media size (for only f_mkfs())
#define GET_SECTOR_SIZE   2
 Generic command: get sector size.
#define MMC_GET_CID   12
 Specific ioctl command: get CID.
#define MMC_GET_CSD   11
 Specific ioctl command: get CSD.
#define MMC_GET_OCR   13
 Specific ioctl command: get OCR.
#define MMC_GET_SDSTAT   14
 Specific ioctl command: get SMC status.
#define MMC_GET_TYPE   10
 Specific ioctl command: get card type.
#define RES_ERROR   1
 Any (hard) error occurred.
#define RES_NOTRDY   3
 The drive has not been initialised.
#define RES_PARERR   3
 Invalid function argument.
#define STA_NODISK   0x02
 No medium in the drive / slot.
#define STA_NOINIT   0x01
 Drive not initialized.
#define STA_PROTECT   0x04
 Medium is write protected by hardware switch.

Functions

uint8_t disk_initialize (uint8_t drv)
 Initialise the SMC drive.
DRESULT disk_ioctl (uint8_t drv, uint8_t ctrl, uint8_t *buff)
 Special control functions.
DRESULT disk_read (uint8_t drv, uint8_t *buff, uint32_t sector)
 Read a sector.
uint8_t disk_status (uint8_t drv)
 Get drive status.
DRESULT disk_write (uint8_t drv, const uint8_t *buff, uint32_t sector)
 Write a sector.