📄 config.h
字号:
/****************************************Copyright (c)**************************************************** Guangzhou ZHIYUAN electronics Co.,LTD.** ** http://www.zyinside.com****--------------File Info-------------------------------------------------------------------------------** File Name: sdconfig.h** Last modified Date: 2006.01.09** Last Version: V1.0 ** Description: User Configurable File****------------------------------------------------------------------------------------------------------** Created By: Ming Yuan Zheng ֣��Զ** Created date: 2006.01.09** Version: V1.0** Descriptions: The original version ��ʼ�汾****------------------------------------------------------------------------------------------------------** Modified by:** Modified date:** Version:** Description:**********************************************************************************************************/#ifndef __CONFIG_H#define __CONFIG_H//This segment should not be modified#ifndef TRUE#define TRUE 1#endif#ifndef FALSE#define FALSE 0#endif#ifndef __KERNEL__ #define __KERNEL__#endif#ifndef MODULE #define MODULE#endif#include <linux/config.h>#include <linux/module.h>#include <linux/kernel.h> /* printk() *///#include <linux/malloc.h> /* kmalloc() */#include <linux/slab.h> /* kmalloc() */#include <linux/fs.h> /* everything... */#include <linux/errno.h> /* error codes */#include <linux/proc_fs.h>#include <linux/fcntl.h> /* O_ACCMODE */#include <asm/irq.h>#include <asm/system.h> /* cli(), *_flags */#include <linux/init.h>#include <asm/uaccess.h>typedef u8 uint8; /* defined for unsigned 8-bits integer variable ����8λ���ͱ�� */typedef s8 int8; /* defined for signed 8-bits integer variable �з���8λ���ͱ�� */typedef u16 uint16; /* defined for unsigned 16-bits integer variable ����16λ���ͱ�� */typedef s16 int16; /* defined for signed 16-bits integer variable �з���16λ���ͱ�� */typedef u32 uint32; /* defined for unsigned 32-bits integer variable ����32λ���ͱ�� */typedef s32 int32; /* defined for signed 32-bits integer variable �з���32λ���ͱ�� */typedef float fp32; /* single precision floating point variable (32bits) �����ȸ�������32λ���ȣ� */typedef double fp64; /* double precision floating point variable (64bits) ˫���ȸ�������64λ���ȣ� *//********************************//*Application Program Configurations*//* Ӧ�ó������� *//********************************///This segment could be modified as needed.//���¸�����Ҫ�Ķ�#include <asm/hardware.h>#include <asm/arch-s3c2410/cpu_s3c2410.h>#include <linux/delay.h> /* mdelay() */#include "sdmmc/sdconfig.h"#include "sdmmc/sdhal.h"#include "sdmmc/sdcmd.h"#include "sdmmc/sddriver.h"#include "zlg_fs/zlg_fs.h"#include "zlg_fs/fat.h"#define DEVICE_NAME "zlg/fs-sd" /* name for messaging */#define MAX_DISK_DRIVES 1#define DEVICE_BYTES_PER_SEC 512#define DEVICE_SEC_PER_DISK (1024 * 32)#define COMMAND_FUNCTION SDCammand//#define DISK_INFO zlg_fs_disk#ifdef IN_ZLG_FS_DRIVERextern uint16 SDCammand(uint8 Cammand, void *Parameter);/*********************************************************************************************************** Function name: drive_init** Descriptions: the initialization of SD/MMC card driver ** SD/MMC ��������ʼ�� ** Input: NULL ** Output: NULL** Created by: MingYuan Zheng ֣��Զ ** Created Date: 2006-01-09 **-------------------------------------------------------------------------------------------------------** Modified by:** Modified Date: **------------------------------------------------------------------------------------------------------********************************************************************************************************/ static void drive_init(void){ int ret; INT8U rec,buff[512]; INT32U i,j; set_gpio_ctrl(SD_GPIO_CD); /* ע��IRQ������ Register IRQ handlers */ set_external_irq(SD_IRQ_CD, EXT_BOTH_EDGES, GPIO_PULLUP_DIS); ret = request_irq(SD_IRQ_CD, card_detect_interrupt, SA_INTERRUPT, "my" DEVICE_NAME, NULL); if (ret) { printk("SD/MMC Slot: request_irq(SD CD) failed\n"); return; } #if SD_INTERRUPT_EN ret = request_irq(IRQ_SDI, sdmmc_interrupt, SA_INTERRUPT, "my" DEVICE_NAME, NULL); if (ret) { printk("SD/MMC Slot: request_irq(SDI) failed\n"); free_irq(SD_IRQ_CD, NULL); return; }#endif //card_insert = 0; card_insert = 1; printk("SD/MMC/SDI slot initialized\n"); card_detect_interrupt(SD_IRQ_CD, NULL, NULL); /* ���е�һ�β */}/*********************************************************************************************************** Function name: drive_clean** Descriptions: the uninstall of SD/MMC card driver ** SD/MMC ������ж�� ** Input: NULL ** Output: NULL** Created by: MingYuan Zheng ֣��Զ ** Created Date: 2006-01-09 **-------------------------------------------------------------------------------------------------------** Modified by:** Modified Date: **------------------------------------------------------------------------------------------------------********************************************************************************************************/ static void drive_clean(void){#if SD_INTERRUPT_EN free_irq(IRQ_SDI, NULL);#endif free_irq(SD_IRQ_CD, NULL); if (card_insert) { card_insert = 0; } }#endif#define malloc(a) kmalloc(a, GFP_KERNEL)#define free(a) kfree(a)#define OS_ENTER_CRITICAL() #define OS_EXIT_CRITICAL()#endif/*********************************************************************************************************** End Of File********************************************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -