[Efsl-cvs] efsl-0.2/inc/interfaces LPC2000_regs.h,NONE,1.1 lpc2000_dbg_printf.h,NONE,1.1 lpc2000_spi
Brought to you by:
flecxie,
lennartyseboodt
From: Lennart <len...@us...> - 2005-11-16 17:33:47
|
Update of /cvsroot/efsl/efsl-0.2/inc/interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1324/inc/interfaces Modified Files: sd.h Added Files: LPC2000_regs.h lpc2000_dbg_printf.h lpc2000_spi.h Log Message: Update Nr2 trying to add the ARM7 port :) --- NEW FILE: LPC2000_regs.h --- /* based on LPC213x.h from Keil GmbH (keil.com/arm.com) */ #ifndef LPC2000_regs_h #define LPC2000_regs_h /* Pin Connect Block */ #define PINSEL0 (*((volatile unsigned long *) 0xE002C000)) #define PINSEL1 (*((volatile unsigned long *) 0xE002C004)) #define PINSEL2 (*((volatile unsigned long *) 0xE002C014)) /* General Purpose Input/Output (GPIO) */ #define IOPIN0 (*((volatile unsigned long *) 0xE0028000)) #define IOSET0 (*((volatile unsigned long *) 0xE0028004)) #define IODIR0 (*((volatile unsigned long *) 0xE0028008)) #define IOCLR0 (*((volatile unsigned long *) 0xE002800C)) #define IOPIN1 (*((volatile unsigned long *) 0xE0028010)) #define IOSET1 (*((volatile unsigned long *) 0xE0028014)) #define IODIR1 (*((volatile unsigned long *) 0xE0028018)) #define IOCLR1 (*((volatile unsigned long *) 0xE002801C)) /* SPI0 (Serial Peripheral Interface 0) */ #define S0SPCR (*((volatile unsigned char *) 0xE0020000)) #define S0SPSR (*((volatile unsigned char *) 0xE0020004)) #define S0SPDR (*((volatile unsigned char *) 0xE0020008)) #define S0SPCCR (*((volatile unsigned char *) 0xE002000C)) #define S0SPTCR (*((volatile unsigned char *) 0xE0020010)) #define S0SPTSR (*((volatile unsigned char *) 0xE0020014)) #define S0SPTOR (*((volatile unsigned char *) 0xE0020018)) #define S0SPINT (*((volatile unsigned char *) 0xE002001C)) /* SSP Controller */ #define SSPCR0 (*((volatile unsigned short* ) 0xE0068000)) #define SSPCR1 (*((volatile unsigned char * ) 0xE0068004)) #define SSPDR (*((volatile unsigned short* ) 0xE0068008)) #define SSPSR (*((volatile unsigned char * ) 0xE006800C)) #define SSPCPSR (*((volatile unsigned char * ) 0xE0068010)) #define SSPIMSC (*((volatile unsigned char * ) 0xE0068014)) #define SSPRIS (*((volatile unsigned char * ) 0xE0068018)) #define SSPMIS (*((volatile unsigned char * ) 0xE006801C)) #define SSPICR (*((volatile unsigned char * ) 0xE0068020)) #define SSPDMACR (*((volatile unsigned char * ) 0xE0068024)) /* Real Time Clock */ /* maybe useful for the efsl time-handling : */ #define ILR (*((volatile unsigned char *) 0xE0024000)) #define CTC (*((volatile unsigned short*) 0xE0024004)) #define CCR (*((volatile unsigned char *) 0xE0024008)) #define CIIR (*((volatile unsigned char *) 0xE002400C)) #define AMR (*((volatile unsigned char *) 0xE0024010)) #define CTIME0 (*((volatile unsigned long *) 0xE0024014)) #define CTIME1 (*((volatile unsigned long *) 0xE0024018)) #define CTIME2 (*((volatile unsigned long *) 0xE002401C)) #define SEC (*((volatile unsigned char *) 0xE0024020)) #define MIN (*((volatile unsigned char *) 0xE0024024)) #define HOUR (*((volatile unsigned char *) 0xE0024028)) #define DOM (*((volatile unsigned char *) 0xE002402C)) #define DOW (*((volatile unsigned char *) 0xE0024030)) #define DOY (*((volatile unsigned short*) 0xE0024034)) #define MONTH (*((volatile unsigned char *) 0xE0024038)) #define YEAR (*((volatile unsigned short*) 0xE002403C)) #define ALSEC (*((volatile unsigned char *) 0xE0024060)) #define ALMIN (*((volatile unsigned char *) 0xE0024064)) #define ALHOUR (*((volatile unsigned char *) 0xE0024068)) #define ALDOM (*((volatile unsigned char *) 0xE002406C)) #define ALDOW (*((volatile unsigned char *) 0xE0024070)) #define ALDOY (*((volatile unsigned short*) 0xE0024074)) #define ALMON (*((volatile unsigned char *) 0xE0024078)) #define ALYEAR (*((volatile unsigned short*) 0xE002407C)) #define PREINT (*((volatile unsigned short*) 0xE0024080)) #define PREFRAC (*((volatile unsigned short*) 0xE0024084)) #endif --- NEW FILE: lpc2000_dbg_printf.h --- #ifndef lpc2000_debug_printf_h_ #define lpc2000_debug_printf_h_ extern void lpc2000_debug_devopen( int(*put)(int) ); extern void lpc2000_debug_printf(char const *format, ...); #endif --- NEW FILE: lpc2000_spi.h --- /*****************************************************************************\ * efs - General purpose Embedded Filesystem library * * --------------------- ----------------------------------- * * * * Filename : lpc2000_spi.h * * Description : Headerfile for lpc2000_spi.c * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * * License as published by the Free Software Foundation; either * * version 2.1 of the License, or (at your option) any later version. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Lesser General Public License for more details. * * * * * * (c)2005 Michael De Nil * * (c)2005 Lennart Yseboodt * * LPC2000 ARM7 Interface (c)2005 Martin Thomas * \*****************************************************************************/ #ifndef __LPC2000_SPI_H_ #define __LPC2000_SPI_H_ #ifndef FALSE #define FALSE 0x00 #define TRUE 0x01 #endif #include "../debug.h" #include "config.h" /*************************************************************\ hwInterface ---------- * FILE* imagefile File emulation of hw interface. * long sectorCount Number of sectors on the file. \*************************************************************/ struct hwInterface{ /*FILE *imageFile;*/ eint32 sectorCount; }; typedef struct hwInterface hwInterface; esint8 if_initInterface(hwInterface* file,eint8* opts); esint8 if_readBuf(hwInterface* file,euint32 address,euint8* buf); esint8 if_writeBuf(hwInterface* file,euint32 address,euint8* buf); esint8 if_setPos(hwInterface* file,euint32 address); void if_spiInit(hwInterface *iface); void if_spiSetSpeed(euint8 speed); euint8 if_spiSend(hwInterface *iface, euint8 outgoing); #endif Index: sd.h =================================================================== RCS file: /cvsroot/efsl/efsl-0.2/inc/interfaces/sd.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** sd.h 20 Jun 2005 08:08:24 -0000 1.11 --- sd.h 16 Nov 2005 17:33:36 -0000 1.12 *************** *** 19,22 **** --- 19,23 ---- * (c)2005 Michael De Nil * * (c)2005 Lennart Yseboodt * + * LPC2000 ARM7 Interface (c)2005 Martin Thomas * \*****************************************************************************/ *************** *** 34,40 **** --- 35,45 ---- #include "interfaces/dsp67xx.h" #endif + #ifdef HW_ENDPOINT_LPC2000_SD + #include "interfaces/lpc2000_spi.h" + #endif #define CMDREAD 17 #define CMDWRITE 24 + #define CMDREADCSD 9 esint8 sd_Init(hwInterface *iface); *************** *** 47,50 **** --- 52,56 ---- esint8 sd_readSector(hwInterface *iface,euint32 address,euint8* buf, euint16 len); esint8 sd_writeSector(hwInterface *iface,euint32 address, euint8* buf); + esint8 sd_getDriveSize(hwInterface *iface, euint32* drive_size ); #endif |