From e7e79a6ccb4f3e320b2b8b7bad1b14d65218641d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 18 Mar 2011 18:38:08 +0000 Subject: License updated. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2827 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- ext/ext.dox | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/ext.dox b/ext/ext.dox index 4994f02de..1c3b8c001 100644 --- a/ext/ext.dox +++ b/ext/ext.dox @@ -1,5 +1,6 @@ /* - ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio. + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011 Giovanni Di Sirio. This file is part of ChibiOS/RT. -- cgit v1.2.3 From 4015cc5e3a0302529d2e7a13ee343cdba2d72488 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 29 May 2011 16:37:45 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3003 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- ext/diskio.c | 222 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 222 insertions(+) create mode 100644 ext/diskio.c (limited to 'ext') diff --git a/ext/diskio.c b/ext/diskio.c new file mode 100644 index 000000000..2da536c34 --- /dev/null +++ b/ext/diskio.c @@ -0,0 +1,222 @@ +/*-----------------------------------------------------------------------*/ +/* Low level disk I/O module skeleton for FatFs (C)ChaN, 2007 */ +/*-----------------------------------------------------------------------*/ +/* This is a stub disk I/O module that acts as front end of the existing */ +/* disk I/O modules and attach it to FatFs module with common interface. */ +/*-----------------------------------------------------------------------*/ + +#include "ch.h" +#include "hal.h" + +#include "diskio.h" + +extern MMCDriver MMCD1; + +/*-----------------------------------------------------------------------*/ +/* Correspondence between physical drive number and physical drive. */ + +#define MMC 0 +#define SDC 1 + + + +/*-----------------------------------------------------------------------*/ +/* Inidialize a Drive */ + +DSTATUS disk_initialize ( + BYTE drv /* Physical drive nmuber (0..) */ +) +{ + DSTATUS stat; + + switch (drv) { +#if HAL_USE_MMC_SPI + case MMC: + stat = 0; + /* It is initialized externally, just reads the status.*/ + if (mmcGetDriverState(&MMCD1) != MMC_READY) + stat |= STA_NODISK; + if (mmcIsWriteProtected(&MMCD1)) + stat |= STA_PROTECT; + return stat; +#endif /* HAL_USE_MMC_SPI */ +#if HAL_USE_SDC + case SDC: + stat = 0; + /* It is initialized externally, just reads the status.*/ + if (sdcGetDriverState(&SDCD1) != SDC_ACTIVE) + stat |= STA_NODISK; + if (sdcIsWriteProtected(&SDCD1)) + stat |= STA_PROTECT; + return stat; +#endif /* HAL_USE_SDC */ + } + return STA_NOINIT; +} + + + +/*-----------------------------------------------------------------------*/ +/* Return Disk Status */ + +DSTATUS disk_status ( + BYTE drv /* Physical drive nmuber (0..) */ +) +{ + DSTATUS stat; + + switch (drv) { +#if HAL_USE_MMC_SPI + case MMC: + stat = 0; + /* It is initialized externally, just reads the status.*/ + if (mmcGetDriverState(&MMCD1) != MMC_READY) + stat |= STA_NODISK; + if (mmcIsWriteProtected(&MMCD1)) + stat |= STA_PROTECT; + return stat; +#endif /* HAL_USE_MMC_SPI */ +#if HAL_USE_SDC + case SDC: + stat = 0; + /* It is initialized externally, just reads the status.*/ + if (sdcGetDriverState(&SDCD1) != SDC_ACTIVE) + stat |= STA_NODISK; + if (sdcIsWriteProtected(&SDCD1)) + stat |= STA_PROTECT; + return stat; +#endif /* HAL_USE_SDC */ + } + return STA_NOINIT; +} + + + +/*-----------------------------------------------------------------------*/ +/* Read Sector(s) */ + +DRESULT disk_read ( + BYTE drv, /* Physical drive nmuber (0..) */ + BYTE *buff, /* Data buffer to store read data */ + DWORD sector, /* Sector address (LBA) */ + BYTE count /* Number of sectors to read (1..255) */ +) +{ + switch (drv) { +#if HAL_USE_MMC_SPI + case MMC: + if (mmcGetDriverState(&MMCD1) != MMC_READY) + return RES_NOTRDY; + if (mmcStartSequentialRead(&MMCD1, sector)) + return RES_ERROR; + while (count > 0) { + if (mmcSequentialRead(&MMCD1, buff)) + return RES_ERROR; + buff += MMC_SECTOR_SIZE; + count--; + } + if (mmcStopSequentialRead(&MMCD1)) + return RES_ERROR; + return RES_OK; +#endif /* HAL_USE_MMC_SPI */ +#if HAL_USE_SDC + case SDC: + if (sdcGetDriverState(&SDCD1) != SDC_ACTIVE) + stat |= STA_NODISK; + if (sdcRead(&SDCD1, sector, buff, count)) + return RES_ERROR; +#endif /* HAL_USE_SDC */ + } + return RES_PARERR; +} + + + +/*-----------------------------------------------------------------------*/ +/* Write Sector(s) */ + +#if _READONLY == 0 +DRESULT disk_write ( + BYTE drv, /* Physical drive nmuber (0..) */ + const BYTE *buff, /* Data to be written */ + DWORD sector, /* Sector address (LBA) */ + BYTE count /* Number of sectors to write (1..255) */ +) +{ + switch (drv) { +#if HAL_USE_MMC_SPI + case MMC: + if (mmcGetDriverState(&MMCD1) != MMC_READY) + return RES_NOTRDY; + if (mmcIsWriteProtected(&MMCD1)) + return RES_WRPRT; + if (mmcStartSequentialWrite(&MMCD1, sector)) + return RES_ERROR; + while (count > 0) { + if (mmcSequentialWrite(&MMCD1, buff)) + return RES_ERROR; + buff += MMC_SECTOR_SIZE; + count--; + } + if (mmcStopSequentialWrite(&MMCD1)) + return RES_ERROR; + return RES_OK; +#endif /* HAL_USE_MMC_SPI */ +#if HAL_USE_SDC + case SDC: + if (sdcGetDriverState(&SDCD1) != SDC_ACTIVE) + stat |= STA_NODISK; + if (sdcWrite(&SDCD1, sector, buff, count)) + return RES_ERROR; +#endif /* HAL_USE_SDC */ + } + return RES_PARERR; +} +#endif /* _READONLY */ + + + +/*-----------------------------------------------------------------------*/ +/* Miscellaneous Functions */ + +DRESULT disk_ioctl ( + BYTE drv, /* Physical drive nmuber (0..) */ + BYTE ctrl, /* Control code */ + void *buff /* Buffer to send/receive control data */ +) +{ + switch (drv) { +#if HAL_USE_MMC_SPI + case MMC: + switch (ctrl) { + case CTRL_SYNC: + return RES_OK; + case GET_SECTOR_SIZE: + *((WORD *)buff) = MMC_SECTOR_SIZE; + return RES_OK; + default: + return RES_PARERR; + } + return RES_OK; +#endif /* HAL_USE_MMC_SPI */ +#if HAL_USE_SDC + case SDC: + switch (ctrl) { + case CTRL_SYNC: + return RES_OK; + case GET_SECTOR_SIZE: + *((WORD *)buff) = SDC_BLOCK_SIZE; + return RES_OK; + default: + return RES_PARERR; + } + return RES_OK; +#endif /* HAL_USE_SDC */ + } + return RES_PARERR; +} + +DWORD get_fattime(void) { + + return 0; +} -- cgit v1.2.3 From ed8a14e6880b1ec6f065c6267d4ee86ae1cdb745 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 6 Jun 2011 09:33:47 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3031 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- ext/lwip-1.4.0.zip | Bin 0 -> 613916 bytes ext/readme.txt | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 ext/lwip-1.4.0.zip (limited to 'ext') diff --git a/ext/lwip-1.4.0.zip b/ext/lwip-1.4.0.zip new file mode 100644 index 000000000..3dbe92da4 Binary files /dev/null and b/ext/lwip-1.4.0.zip differ diff --git a/ext/readme.txt b/ext/readme.txt index f1715c1ca..5c8a76b2e 100644 --- a/ext/readme.txt +++ b/ext/readme.txt @@ -10,7 +10,7 @@ instructions contained in the various distributions. The currently included items are: 1. uip-1.0, a minimal TCP/IP implementation: http://www.sics.se/~adam/uip/ -2. lwip-1.3.1, lightweight TCP/IP stack: http://savannah.nongnu.org/projects/lwip/ +2. lwip-1.4.0, lightweight TCP/IP stack: http://savannah.nongnu.org/projects/lwip/ 3. STM32 firmware library 3.3.0 (partial, library only) the full download is available from http://www.st.com 4. FatFS 0.7e (patched), the original version is available from @@ -21,7 +21,7 @@ and without any modification, in order to use the libraries unpack them under ./ext as: ./ext/uip-1.0 -./ext/lwip +./ext/lwip-1.4.0 ./ext/stm32lib ./ext/fatfs -- cgit v1.2.3 From aec912f13f9aa85cd677353fa556f679c3832970 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 6 Jun 2011 18:15:38 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3034 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- ext/ff007e-patched.zip | Bin 634222 -> 634416 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'ext') diff --git a/ext/ff007e-patched.zip b/ext/ff007e-patched.zip index e6aab7a8b..37a014cdf 100644 Binary files a/ext/ff007e-patched.zip and b/ext/ff007e-patched.zip differ -- cgit v1.2.3