Takanobu Muraguchi / Mbed 2 deprecated picossd_step1_2cs

Dependencies:   mbed EEPROM USBDevice

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers USBMSD_STEP1.h Source File

USBMSD_STEP1.h

00001 #ifndef USBMSD_STEP1_H
00002 #define USBMSD_STEP1_H
00003 
00004 
00005 #include "mbed.h"
00006 #define USBMSD_STEP1_SECTORS  4016
00007 #define USBMSD_STEP1_SECTOR_SIZE 512
00008 #define USBMSD_STEP1_DISK_SIZE    USBMSD_STEP1_SECTOR_SIZE*USBMSD_STEP1_SECTORS
00009 #include <stdlib.h>
00010 #include "USBMSD.h"
00011 #include "RawNAND.h"
00012 #include "bbt_eeprom.h"
00013 
00014 class USBMSD_STEP1: public USBMSD
00015 {   public:
00016         USBMSD_STEP1(PinName ceb0, PinName ceb1, PinName cle,
00017                      PinName ale, PinName web,
00018                      PinName reb, PinName wpb,
00019                      PinName rbb, 
00020                      PinName io1, PinName io2,
00021                      PinName io3, PinName io4,
00022                      PinName io5, PinName io6,
00023                      PinName io7, PinName io8,
00024                      PinName ledRd,PinName ledWr,PinName swInit);
00025 
00026         virtual int disk_read(uint8_t* data, uint64_t block, uint8_t count);
00027         virtual int disk_write(const uint8_t* data, uint64_t block, uint8_t count);
00028         virtual int disk_initialize();
00029         virtual uint64_t disk_sectors();
00030         virtual uint64_t disk_size();
00031         virtual int disk_status();
00032 
00033 
00034         uint8_t get_cs_from_block(uint16_t block);
00035         uint16_t get_chip_block_from_block(uint16_t block);
00036         
00037 
00038         DigitalOut * m_ledRead;
00039         DigitalOut * m_ledWrite;
00040         DigitalIn  * m_swInit;
00041 //        DigitalIn  * m_isp;
00042 
00043 
00044     private:
00045         RawNAND    * m_rawNand;
00046         bbt_eeprom * m_bbt;
00047         uint8_t      m_buffer[512];
00048 };
00049 
00050 #endif