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

📄 docsoc.c

📁 电子盘DEMO板程序
💻 C
📖 第 1 页 / 共 2 页
字号:
/*        vol                : Pointer identifying drive                        */
/*                                                                        */
/************************************************************************/

static void VppOff(FLSocket * pVol)
{
}

#endif        /* SOCKET_12_VOLTS */

/************************************************************************/
/* i n i t S o c k e t                                                        */
/*                                                                        */
/* Perform all necessary initializations of the socket or controller        */
/*                                                                        */
/* Parameters:                                                                */
/*        vol                : Pointer identifying drive                        */
/*                                                                        */
/* Returns:                                                                */
/*        FLStatus                : 0 on success, failed otherwise        */
/************************************************************************/

static FLStatus initSocket(FLSocket * pVol)
{
  return flOK;
}


/************************************************************************/
/* s e t W i n d o w                                                        */
/*                                                                        */
/* Sets in hardware all current window parameters: Base address, size,        */
/* speed and bus width.                                                 */
/* The requested settings are given in the 'vol.window' structure.      */
/*                                                                        */
/* If it is not possible to set the window size requested in                */
/* 'vol.window.size', the window size should be set to a larger value,  */
/* if possible. In any case, 'vol.window.size' should contain the       */
/* actual window size (in 4 KB units) on exit.                                */
/*                                                                        */
/* Parameters:                                                                */
/*        vol                : Pointer identifying drive                        */
/*                                                                        */
/************************************************************************/

static void setWindow(FLSocket * pVol)
{
}


/************************************************************************/
/* s e t M a p p i n g C o n t e x t                                        */
/*                                                                        */
/* Sets the window mapping register to a card address.                        */
/*                                                                        */
/* The window should be set to the value of 'vol.window.currentPage',        */
/* which is the card address divided by 4 KB. An address over 128KB,        */
/* (page over 32K) specifies an attribute-space address.                */
/*                                                                        */
/* The page to map is guaranteed to be on a full window-size boundary.        */
/*                                                                        */
/* Parameters:                                                          */
/*        vol                : Pointer identifying drive                        */
/*        page                : page to map                                        */
/*                                                                      */
/************************************************************************/

static void setMappingContext(FLSocket * pVol, unsigned page)
{
}


/************************************************************************/
/* g e t A n d C l e a r C a r d C h a n g e I n d i c a t o r                */
/*                                                                        */
/* Returns the hardware card-change indicator and clears it if set.        */
/*                                                                        */
/* Parameters:                                                                */
/*        vol                : Pointer identifying drive                        */
/*                                                                        */
/* Returns:                                                                */
/*        0 = Card not changed, other = card changed                        */
/************************************************************************/

static FLBoolean getAndClearCardChangeIndicator(FLSocket * pVol)
{
  /* Note: On the 365, the indicator is turned off by the act of reading */
  return FALSE;
}



/************************************************************************/
/* w r i t e P r o t e c t e d                                                */
/*                                                                        */
/* Returns the write-protect state of the media                         */
/*                                                                        */
/* Parameters:                                                                */
/*        vol                : Pointer identifying drive                        */
/*                                                                        */
/* Returns:                                                                */
/*        0 = not write-protected, other = write-protected                */
/************************************************************************/

static FLBoolean writeProtected(FLSocket * pVol)
{
  return FALSE;
}

#ifdef FL_EXIT

/************************************************************************/
/* f r e e S o c k e t                                                        */
/*                                                                        */
/* Free resources that were allocated for this socket.                        */
/* This function is called when TrueFFS exits.                                */
/*                                                                        */
/* Parameters:                                                          */
/*        vol                : Pointer identifying drive                        */
/*                                                                      */
/************************************************************************/

static void freeSocket(FLSocket * pVol)
{
#ifdef FL_PARALLEL_MTD_SUPPORT
  FLBoolean fSocketStateArr[MAX_PARA_SOCKETS] ;

  /*** Enable only one serial socket                           ***/ 
  tffsset (fSocketStateArr,FALSE,sizeof (FLBoolean)*MAX_PARA_SOCKETS) ;
  PARA_ActivateSockets (fSocketStateArr)  ;
#endif
   freePointer(pVol->window.base,pVol->window.size);
}

#endif  /* FL_EXIT */

void docSocketInit(FLSocket * pVol)
{
    pVol->cardDetected = cardDetected;
    pVol->VccOn        = VccOn;
    pVol->VccOff       = VccOff;
#ifdef SOCKET_12_VOLTS
    pVol->VppOn        = VppOn;
    pVol->VppOff       = VppOff;
#endif
    pVol->initSocket   = initSocket;
    pVol->setWindow    = setWindow;
    pVol->setMappingContext  = setMappingContext;
    pVol->getAndClearCardChangeIndicator = getAndClearCardChangeIndicator;
    pVol->writeProtected     = writeProtected;
    pVol->updateSocketParams = NULL /* updateSocketParameters */;

#ifdef FL_EXIT
    pVol->freeSocket = freeSocket;
#endif
}

⌨️ 快捷键说明

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