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

📄 options.h

📁 This fat 16 can be used for logging function. The user can use it for logger device.
💻 H
📖 第 1 页 / 共 2 页
字号:
/***************************** C HEADER FILE *********************************
**
**  Project:    FlashFile
**  Filename:   OPTIONS.H 
**  Version:    3.0 
**  Date:       March 29, 2006
**  
******************************************************************************
**
**  VERSION HISTORY:
**  ----------------
**  Version:    3.0 
**  Date:       March 29, 2006
**  Revised by: Erick M. Higa
**  Description:
**      - See "FILE_SYS.C" file for any chages up to this point.
**
*****************************************************************************/
#ifndef _OPTIONS_INCLUDED
#define _OPTIONS_INCLUDED

/*****************************************************************************
**
**    DEFINITIONS AND MACROS
**
*****************************************************************************/

/* Control Block */
//#define _RTC_ON_
#define _SECOND_FAT_ON_
#define _FAT12_ON_
/*#define _READ_ONLY_*/
#define _DEBUG_ON_
#define _DIRECTORIES_SUPPORTED_
#define _NO_MALLOC_
#define _BYTES_PER_SEC_512_

/* The settings below should be modified */
/* to match your hardware/software settings */
#define _CVAVR_
/*#define _ICCAVR_*/
/*#define _ROWLEY_CWAVR_*/

#define _LITTLE_ENDIAN_
/*#define _BIG_ENDIAN_*/

#define _SD_MMC_MEDIA_
/*#define _CF_MEDIA_*/

#ifdef _NO_MALLOC_
    #define _FF_MAX_FILES_OPEN    1
#endif

/*#define _MEGA128NET_*/
/*#define _MEGAAVRDEV_*/

#define uint8   unsigned char
#define uint16  unsigned int
#define uint32  unsigned long
#define int8    char
#define int16   int
#define int32   long

#ifdef _DEBUG_ON_
    #define _DEBUG_FUNCTIONS_
#endif

#if defined(_SD_MMC_MEDIA_)
    #ifndef _READ_ONLY_
        #define _SD_BLOCK_WRITE_
    #endif
    #define _FF_SPCR_SET    0x50

    #if defined(_MEGA128NET_)
        #define SD_CS_OFF()     PORTB |= 0x01
        #define SD_CS_ON()      PORTB &= 0xFE
        #define CS_DDR_SET()    DDRB |= 0x01
    #elif defined(_MEGAAVRDEV_)
        #define SD_CS_OFF()     PORTB |= 0x01
        #define SD_CS_ON()      PORTB &= 0xFE
        #define CS_DDR_SET()    DDRB |= 0x01
    #else
        #define SD_CS_OFF()     PORTD |= 0x01
        #define SD_CS_ON()      PORTD &= 0xFE
        #define CS_DDR_SET()    DDRD |= 0x01
    #endif
#elif defined(_CF_MEDIA_)
    #define CF_DATA_OUT     PORTA
    #define CF_DATA_IN      PINA
    #define CF_DATA_DDR     DDRA

    #define CF_ADDR_PORT    PORTB

    #define CD1         (PINC & 0x10)
    #define RDY         (PINC & 0x08)

    #define RESET_LO()      PORTC &= 0x7F
    #define RESET_HI()      PORTC |= 0x80
    #define WE_LO()         PORTG &= 0xFE
    #define WE_HI()         PORTG |= 0x01
    #define OE_LO()         PORTC &= 0xBF
    #define OE_HI()         PORTC |= 0x40
#endif

#define _FF_MAX_FPRINTF     75
#define _FF_PATH_LENGTH     50

#if defined(_CVAVR_)
    #define     _FF_SEI()       #asm("sei")
    #define     _FF_CLI()       #asm("cli")
    #define     _FF_NOP()       #asm("nop")

    #define     _FF_strcpyf     strcpyf
    #define     _FF_sprintf     sprintf
    #define     _FF_strlen      strlen
    #define     _FF_strncmp     strncmp
#elif defined(_ICCAVR_)
    #define     _FF_SEI         SEI
    #define     _FF_CLI         CLI
    #define     _FF_NOP         NOP

    #define     _FF_strcpyf     cstrcpy
    #define     _FF_sprintf     csprintf
    #define     _FF_strrchr     strrchr
    #define     _FF_strncmp     strncmp
    #define     _FF_strlen      strlen
#elif defined(_ROWLEY_CWAVR_)
    #define     flash           __code const
    #define     _FF_SEI         _SEI
    #define     _FF_CLI         _CLI
    #define     _FF_NOP         _NOP

    #define     _FF_strcpyf     strcpy_c
    #define     _FF_sprintf     sprintf_c
    #define     _FF_strrchr     strrchr
    #define     _FF_strncmp     strncmp
    #define     _FF_strlen      strlen
#elif defined(_IAR_EWAVR_)
    #define     _FF_CLI()       asm("cli")
    #define     _FF_SEI()        asm("sei")
    #define     flash           __farflash

    #define     _FF_strcpyf     strcpy_P
    #define     _FF_sprintf     sprintf_P
#endif



/****************************************************************************
**
**    TYPEDEFS AND STRUCTURES
**
****************************************************************************/
/****************************************************************************
**
**    MODULES USED 
**
****************************************************************************/

#if defined(_CVAVR_)
    #ifdef _MEGAAVRDEV_
        #include <mega32.h>
    #else
        #include <90USB647.h>
    #endif
#elif defined(_ICCAVR_)
    #include     <macros.h>
    #ifndef _MEGAAVRDEV_
        #include     <iom128v.h>
    #else
        #include     <iom32v.h>
    #endif
#elif defined(_ROWLEY_CWAVR_)
    #include    <__cross_studio_io.h>
    #include    <ina90.h>
    #include    <pgmspace.h>
    #include    <stdio_c.h>
    #ifndef _MEGAAVRDEV_
        #include    <atmega128.h>
    #else
        #include    <atmega32.h>
    #endif
#elif defined(_IAR_EWAVR_)
    #include     <pgmspace.h>
    #ifndef _MEGAAVRDEV_
        #include     <iom128.h>
    #else
        #include     <iom32.h>
    #endif
#endif

#include <stdarg.h>

#ifndef _NO_MALLOC_
    #include <stdlib.h>
#endif

#include <stdio.h>
#include <string.h>
#include <ctype.h>

#if defined(_SD_MMC_MEDIA_) && !defined(_SD_CMD_INCLUDED)
    #include "..\flash\sd_cmd.h"
#elif defined(_CF_MEDIA_) && !defined(_CF_CMD_INCLUDED)

⌨️ 快捷键说明

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