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

📄 nf_drv.h

📁 66965389C51SND1C的mp3源程序包.rar
💻 H
📖 第 1 页 / 共 2 页
字号:
          Nf_send_address_odd ( 0x00 );                                             \
          Nf_send_address_odd ( ((Byte*)&address_sector)[3] );                      \
          Nf_send_address_odd ( ((Byte*)&address_sector)[2] );                      \
          if (NF_5_CYCLE_ADDRESS_BIT)                                           \
            Nf_send_address_odd ( ((Byte*)&address_sector)[1] )
    
    #define Nf_read_open_odd(address_sector)                                        \
          Nf_send_command_odd (NF_READ_CMD);                                        \
          Nf_send_address_odd ( 0x00 );                                             \        
          Nf_send_address_odd ( 0x00 );                                             \        
          Nf_send_address_odd ( ((Byte*)&address_sector)[3] );                      \
          Nf_send_address_odd ( ((Byte*)&address_sector)[2] );                      \
          if (NF_5_CYCLE_ADDRESS_BIT)                                           \
            Nf_send_address_odd ( ((Byte*)&address_sector)[1] );                    \
          Nf_send_command_odd (NF_READ_CMD2);                                       \
          Nf_wait_busy_odd()
    
    #define Nf_read_open_spare_area_odd(address_sector, nb_byte)                    \
          Nf_send_command_odd (NF_READ_CMD);                                        \
          Nf_send_address_odd ( nb_byte );                                          \
          Nf_send_address_odd ( NF_SPARE_PAGE );                                    \
          Nf_send_address_odd ( ((Byte*)&address_sector)[3] );                      \
          Nf_send_address_odd ( ((Byte*)&address_sector)[2] );                      \
          if (NF_5_CYCLE_ADDRESS_BIT)                                           \
            Nf_send_address_odd ( ((Byte*)&address_sector)[1] );                    \
          Nf_send_command_odd (NF_READ_CMD2);                                       \
          Nf_wait_busy_odd()
    
    #define Nf_write_open_spare_area_odd(address_sector, nb_byte)                   \
          Nf_send_command_odd (NF_SEQUENTIAL_DATA_INPUT_CMD);                       \
          Nf_send_address_odd ( nb_byte );                                          \
          Nf_send_address_odd ( NF_SPARE_PAGE );                                    \ 
          Nf_send_address_odd ( ((Byte*)&address_sector)[3] );                      \
          Nf_send_address_odd ( ((Byte*)&address_sector)[2] );                      \
          if (NF_5_CYCLE_ADDRESS_BIT)                                           \
            Nf_send_address_odd ( ((Byte*)&address_sector)[1] )


  #define Nf_write_open_even(address_sector)                                           \
          Nf_send_command_even (NF_SEQUENTIAL_DATA_INPUT_CMD);                       \
          Nf_send_address_even ( 0x00 );                                             \        
          Nf_send_address_even ( 0x00 );                                             \
          Nf_send_address_even ( ((Byte*)&address_sector)[3] );                      \
          Nf_send_address_even ( ((Byte*)&address_sector)[2] );                      \
          if (NF_5_CYCLE_ADDRESS_BIT)                                           \
            Nf_send_address_even ( ((Byte*)&address_sector)[1] )
    
    #define Nf_read_open_even(address_sector)                                        \
          Nf_send_command_even (NF_READ_CMD);                                        \
          Nf_send_address_even ( 0x00 );                                             \        
          Nf_send_address_even ( 0x00 );                                             \        
          Nf_send_address_even ( ((Byte*)&address_sector)[3] );                      \
          Nf_send_address_even ( ((Byte*)&address_sector)[2] );                      \
          if (NF_5_CYCLE_ADDRESS_BIT)                                           \
            Nf_send_address_even ( ((Byte*)&address_sector)[1] );                    \
          Nf_send_command_even (NF_READ_CMD2);                                       \
          Nf_wait_busy_even()
    
    #define Nf_read_open_spare_area_even(address_sector, nb_byte)                    \
          Nf_send_command_even (NF_READ_CMD);                                        \
          Nf_send_address_even ( nb_byte );                                          \
          Nf_send_address_even ( NF_SPARE_PAGE );                                    \
          Nf_send_address_even ( ((Byte*)&address_sector)[3] );                      \
          Nf_send_address_even ( ((Byte*)&address_sector)[2] );                      \
          if (NF_5_CYCLE_ADDRESS_BIT)                                           \
            Nf_send_address_even ( ((Byte*)&address_sector)[1] );                    \
          Nf_send_command_even (NF_READ_CMD2);                                       \
          Nf_wait_busy_even()
    
    #define Nf_write_open_spare_area_even(address_sector, nb_byte)                   \
          Nf_send_command_even (NF_SEQUENTIAL_DATA_INPUT_CMD);                       \
          Nf_send_address_even ( nb_byte );                                          \
          Nf_send_address_even ( NF_SPARE_PAGE );                                    \ 
          Nf_send_address_even ( ((Byte*)&address_sector)[3] );                      \
          Nf_send_address_even ( ((Byte*)&address_sector)[2] );                      \
          if (NF_5_CYCLE_ADDRESS_BIT)                                           \
            Nf_send_address_even ( ((Byte*)&address_sector)[1] )
#else

  #if NF_5_CYCLE_ADDRESS == 0
  
    #define Nf_write_open(address_sector)                                       \
          Nf_send_command (NF_SEQUENTIAL_DATA_INPUT_CMD);                       \
          Nf_send_address ( 0x00 );                                             \        
          Nf_send_address ( 0x00 );                                             \
          Nf_send_address ( ((Byte*)&address_sector)[3] );                      \
          Nf_send_address ( ((Byte*)&address_sector)[2] )
    
    #define Nf_read_open(address_sector)                                        \
          Nf_send_command (NF_READ_CMD);                                        \
          Nf_send_address ( 0x00 );                                             \        
          Nf_send_address ( 0x00 );                                             \        
          Nf_send_address ( ((Byte*)&address_sector)[3] );                      \
          Nf_send_address ( ((Byte*)&address_sector)[2] );                      \
          Nf_send_command (NF_READ_CMD2);                                       \
          Nf_wait_busy()
    
    #define Nf_read_open_spare_area(address_sector, nb_byte)                    \
          Nf_send_command (NF_READ_CMD);                                        \
          Nf_send_address ( nb_byte );                                          \
          Nf_send_address ( NF_SPARE_PAGE );                                    \
          Nf_send_address ( ((Byte*)&address_sector)[3] );                      \
          Nf_send_address ( ((Byte*)&address_sector)[2] );                      \
          Nf_send_command (NF_READ_CMD2);                                       \
          Nf_wait_busy()
    
    #define Nf_write_open_spare_area(address_sector, nb_byte)                   \
          Nf_send_command (NF_SEQUENTIAL_DATA_INPUT_CMD);                       \
          Nf_send_address ( nb_byte );                                          \
          Nf_send_address ( NF_SPARE_PAGE );                                    \ 
          Nf_send_address ( ((Byte*)&address_sector)[3] );                      \
          Nf_send_address ( ((Byte*)&address_sector)[2] )
  
  #else
  
    #define Nf_write_open(address_sector)                                       \
          Nf_send_command (NF_SEQUENTIAL_DATA_INPUT_CMD);                       \
          Nf_send_address ( 0x00 );                                             \        
          Nf_send_address ( 0x00 );                                             \
          Nf_send_address ( ((Byte*)&address_sector)[3] );                      \
          Nf_send_address ( ((Byte*)&address_sector)[2] );                      \
          Nf_send_address ( ((Byte*)&address_sector)[1] )
    
    #define Nf_read_open(address_sector)                                        \
          Nf_send_command (NF_READ_CMD);                                        \
          Nf_send_address ( 0x00 );                                             \        
          Nf_send_address ( 0x00 );                                             \        
          Nf_send_address ( ((Byte*)&address_sector)[3] );                      \
          Nf_send_address ( ((Byte*)&address_sector)[2] );                      \
          Nf_send_address ( ((Byte*)&address_sector)[1] );                      \
          Nf_send_command (NF_READ_CMD2);                                       \
          Nf_wait_busy()
    
    #define Nf_read_open_spare_area(address_sector, nb_byte)                    \
          Nf_send_command (NF_READ_CMD);                                        \
          Nf_send_address ( nb_byte );                                          \
          Nf_send_address ( NF_SPARE_PAGE );                                    \
          Nf_send_address ( ((Byte*)&address_sector)[3] );                      \
          Nf_send_address ( ((Byte*)&address_sector)[2] );                      \
          Nf_send_address ( ((Byte*)&address_sector)[1] );                      \
          Nf_send_command (NF_READ_CMD2);                                       \
          Nf_wait_busy()
    
    #define Nf_write_open_spare_area(address_sector, nb_byte)                   \
          Nf_send_command (NF_SEQUENTIAL_DATA_INPUT_CMD);                       \
          Nf_send_address ( nb_byte );                                          \
          Nf_send_address ( NF_SPARE_PAGE );                                    \ 
          Nf_send_address ( ((Byte*)&address_sector)[3] );                      \
          Nf_send_address ( ((Byte*)&address_sector)[2] );                      \
          Nf_send_address ( ((Byte*)&address_sector)[1] )
  #endif
#endif

/*_____ D E C L A R A T I O N ______________________________________________*/
extern  void  nf_init_buffer(void);     /* Initialize the buffer gl_buffer with 0xFF */
extern  void  nf_download_buffer(void); /* Copy the content of gl_buffer on the card */
extern  void  nf_upload_buffer(void);   /* Load the content of the card on gl_buffer */

void  nf_copy_block_head(void);         /* Copy the first sectors of a block */
void  nf_copy_block_tail(bit);          /* Copy the last sectors of a block */
void  nf_reassign_block(void);          /* reassign the physical block on the look up table */
bit   nf_block_erase (Uint32);          /* Erase one block */
bit   nf_erase_all_block(void);         /* Erase all block */
void  nf_init_spare(void);              /* Init the first redundant data of a block */
void  nf_calc_logical_block();          /* Calulate the value of logical block in spare area */
void  nf_update_spare_data(void);       /* Write only the redundant information */
bit   nf_read_spare_byte(void);         /* LUT generation */


#endif /* _NF_DRV_H_ */

⌨️ 快捷键说明

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