2 * Hyper Operating System Application Framework
5 * @brief %jp{PC16550用デバイスドライバ}
7 * Copyright (C) 2006 by Project HOS
8 * http://sourceforge.jp/projects/hos/
12 #include "pc16550drv_local.h"
16 HANDLE Pc16550Drv_Open(C_DRVOBJ *pDrvObj, const char *pszPath, int iMode)
22 self = (C_PC16550DRV *)pDrvObj;
24 /* create file descriptor */
25 if ( (pFile = SysMem_Alloc(sizeof(*pFile))) == NULL )
29 ChrFile_Create(pFile, pDrvObj, NULL);
33 if ( self->iOpenCount++ == 0 )
35 Pc16550Hal_Setup(&self->Pc16550Hal);
36 Pc16550Hal_SetSpeed(&self->Pc16550Hal, 38400);
37 Pc16550Hal_EnableInterrupt(&self->Pc16550Hal, PC16550HAL_IER_ERBFI);
38 SysInt_Enable(self->iIntNum);