A code for the spindling of bots.

Dependencies:   MX12 ServoRingBuffer mbed-src

Fork of SpindleBot by MRD Lab

Committer:
labmrd
Date:
Mon Apr 06 21:23:36 2015 +0000
Revision:
4:e44ac08027bd
This is the state of the art before Rod busted in, Kool Aid Man Style, and blew the whole shebang wigitty-wide open.  From now on, we worship at the alter of the Two State Solution as proposed by Dr. Rod Dockter Master of Science.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
labmrd 4:e44ac08027bd 1 //-----------------------------------------------------------------------
labmrd 4:e44ac08027bd 2 // Low level disk interface modlue include file
labmrd 4:e44ac08027bd 3 //-----------------------------------------------------------------------
labmrd 4:e44ac08027bd 4
labmrd 4:e44ac08027bd 5 #ifndef _DISKIO
labmrd 4:e44ac08027bd 6
labmrd 4:e44ac08027bd 7 #define _READONLY 0 // 1: Remove write functions
labmrd 4:e44ac08027bd 8 #define _USE_IOCTL 1 // 1: Use disk_ioctl fucntion
labmrd 4:e44ac08027bd 9
labmrd 4:e44ac08027bd 10 #include "integer.h"
labmrd 4:e44ac08027bd 11
labmrd 4:e44ac08027bd 12
labmrd 4:e44ac08027bd 13 // Status of Disk Functions
labmrd 4:e44ac08027bd 14 typedef BYTE DSTATUS;
labmrd 4:e44ac08027bd 15
labmrd 4:e44ac08027bd 16 // Results of Disk Functions
labmrd 4:e44ac08027bd 17 typedef enum {
labmrd 4:e44ac08027bd 18 RES_OK = 0, // 0: Successful
labmrd 4:e44ac08027bd 19 RES_ERROR, // 1: R/W Error
labmrd 4:e44ac08027bd 20 RES_WRPRT, // 2: Write Protected
labmrd 4:e44ac08027bd 21 RES_NOTRDY, // 3: Not Ready
labmrd 4:e44ac08027bd 22 RES_PARERR // 4: Invalid Parameter
labmrd 4:e44ac08027bd 23 } DRESULT;
labmrd 4:e44ac08027bd 24
labmrd 4:e44ac08027bd 25
labmrd 4:e44ac08027bd 26 // Prototypes for disk control functions
labmrd 4:e44ac08027bd 27
labmrd 4:e44ac08027bd 28 int assign_drives (int, int);
labmrd 4:e44ac08027bd 29 DSTATUS disk_initialize (BYTE);
labmrd 4:e44ac08027bd 30 DSTATUS disk_status (BYTE);
labmrd 4:e44ac08027bd 31 DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);
labmrd 4:e44ac08027bd 32 #if _READONLY == 0
labmrd 4:e44ac08027bd 33 DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);
labmrd 4:e44ac08027bd 34 #endif
labmrd 4:e44ac08027bd 35 DRESULT disk_ioctl (BYTE, BYTE, void*);
labmrd 4:e44ac08027bd 36
labmrd 4:e44ac08027bd 37
labmrd 4:e44ac08027bd 38
labmrd 4:e44ac08027bd 39 // Disk Status Bits (DSTATUS)
labmrd 4:e44ac08027bd 40 #define STA_NOINIT 0x01 // Drive not initialized
labmrd 4:e44ac08027bd 41 #define STA_NODISK 0x02 // No medium in the drive
labmrd 4:e44ac08027bd 42 #define STA_PROTECT 0x04 // Write protected
labmrd 4:e44ac08027bd 43
labmrd 4:e44ac08027bd 44
labmrd 4:e44ac08027bd 45 // Command code for disk_ioctrl fucntion
labmrd 4:e44ac08027bd 46
labmrd 4:e44ac08027bd 47 // Generic command (defined for FatFs)
labmrd 4:e44ac08027bd 48 #define CTRL_SYNC 0 // Flush disk cache (for write functions)
labmrd 4:e44ac08027bd 49 #define GET_SECTOR_COUNT 1 // Get media size (for only f_mkfs())
labmrd 4:e44ac08027bd 50 #define GET_SECTOR_SIZE 2 // Get sector size (for multiple sector size (_MAX_SS >= 1024))
labmrd 4:e44ac08027bd 51 #define GET_BLOCK_SIZE 3 // Get erase block size (for only f_mkfs())
labmrd 4:e44ac08027bd 52 #define CTRL_ERASE_SECTOR 4 // Force erased a block of sectors (for only _USE_ERASE)
labmrd 4:e44ac08027bd 53
labmrd 4:e44ac08027bd 54 // Generic command
labmrd 4:e44ac08027bd 55 #define CTRL_POWER 5 // Get/Set power status
labmrd 4:e44ac08027bd 56 #define CTRL_LOCK 6 // Lock/Unlock media removal
labmrd 4:e44ac08027bd 57 #define CTRL_EJECT 7 // Eject media
labmrd 4:e44ac08027bd 58
labmrd 4:e44ac08027bd 59 // MMC/SDC specific ioctl command
labmrd 4:e44ac08027bd 60 #define MMC_GET_TYPE 10 // Get card type
labmrd 4:e44ac08027bd 61 #define MMC_GET_CSD 11 // Get CSD
labmrd 4:e44ac08027bd 62 #define MMC_GET_CID 12 // Get CID
labmrd 4:e44ac08027bd 63 #define MMC_GET_OCR 13 // Get OCR
labmrd 4:e44ac08027bd 64 #define MMC_GET_SDSTAT 14 // Get SD status
labmrd 4:e44ac08027bd 65
labmrd 4:e44ac08027bd 66 // ATA/CF specific ioctl command
labmrd 4:e44ac08027bd 67 #define ATA_GET_REV 20 // Get F/W revision
labmrd 4:e44ac08027bd 68 #define ATA_GET_MODEL 21 // Get model name
labmrd 4:e44ac08027bd 69 #define ATA_GET_SN 22 // Get serial number
labmrd 4:e44ac08027bd 70
labmrd 4:e44ac08027bd 71 // NAND specific ioctl command
labmrd 4:e44ac08027bd 72 #define NAND_FORMAT 30 // Create physical format
labmrd 4:e44ac08027bd 73
labmrd 4:e44ac08027bd 74
labmrd 4:e44ac08027bd 75 #define _DISKIO
labmrd 4:e44ac08027bd 76 #endif