⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 general.c

📁 基于avr单片机系统硬盘mp3设计
💻 C
字号:
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//					    FAT32 File IO Library for AVR 
//								  V0.1c
// 	  							Rob Riglar
//							Copyright 2003,2004 
//
//   					  Email: rob@robriglar.com
//
//			    Compiled with Imagecraft C Compiler for the AVR series
//-----------------------------------------------------------------------------
//
// This file is part of FAT32 File IO Library.
//
// FAT32 File IO Library is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// FAT32 File IO 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with FAT32 File IO Library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void Setup128Ports_EDTPBoard(void);
void ShowFATDetails(void);


void ShowFATDetails(void)
{
printf("\r\nCurrent Disc FAT details\r\n------------------------\r\nRoot Dir First Cluster = ");   
printf("0x%x",FAT32.RootDir_First_Cluster);
printf("\r\nFAT Begin LBA = ");
printf("0x%x",FAT32.fat_begin_lba);
printf("\r\nCluster Begin LBA = ");
printf("0x%x",FAT32.cluster_begin_lba);
printf("\r\nSectors Per Cluster = ");
printf("%d",FAT32.SectorsPerCluster);
printf("\r\n\r\nFormula for conversion from Cluster num to LBA is;");
printf("\r\nLBA = (cluster_begin_lba + ((Cluster_Number-2)*SectorsPerCluster)))\r\n");
printf("\r\nMax LBA address on this drive is 0x%lx",IDE_Internal.maxLBA-1);
}

void Setup128Ports_EDTPBoard(void)
{
	   DDRA = 0x00;
 	   PORTA = 0xFF;
 	   DDRB = 0x00;
 	   PORTB = 0xFF;
 	   DDRC = 0x00;
 	   PORTC = 0xFF;
 	   DDRD = 0xFE;
 	   PORTD = 0x01;
 	   DDRE = 0x1F;
 	   PORTE = 0xE0;
 	   DDRF = 0xFF;
 	   PORTF = 0xFF;
 	   DDRG = 0x1F;
 	   PORTG = 0xFB;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -