본문 바로가기

프로그래밍/시스템

[WinCE BSP] 스트림 인터페이스 드라이버

* Registration

HANDLE RegisterDevice( LPCWSTR lpszType, DWORD dwIndex, LPCWSTR lpszLib, DWORD dwInfo )
BOOL DeregisterDevice( HANDLE hDevice )

HANDLE ActivateDevice( LPCWSTR lpszDevKey, DWORD dwClientInfo )
HANDLE ActivateDeviceEx( LPCWSTR lpszDevKey, LPPCVOID lpRegEnts,
                                        DWORD cRegEnts, DWORD lpvParam )
BOOL DeactivateDevice( HANDLE hDevice )


* Interface

DWORD xxx_Init( LPCTSTR pContext, DWORD dwBusContenxt )
BOOL xxx_PreDeinit( DWORD hDeviceContext )
BOOL xxx_Deinit( DWORD hDeviceContext )

DWORD xxx_Open( DWORD hDeviceContext, DWORD AccessCode, DWORD ShareMode )
BOOL xxx_PreClose( DWORD hOpenContext )
BOOL xxx_Close( DWORD hOpenContext )

void xxx_PowerUp( DWORD hDeviceContext )
void xxx_PowerDown( DWORD hDeviceContext )

DWORD xxx_Read( DWORD hOpenContext, LPVOID pBuffer, DWORD Count )
DWORD xxx_Seek( DWORD hOpenContext, long Amount, WORD Type )
DWORD xxx_Write( DWORD hOpenContext, LPCVOID pBuffer, DWORD Count )

BOOL xxx_IOControl( DWORD hOpenContext, DWORD dwCode,
                               PBYTE pBufIn, DWORD dwLenIn,
                               PBYTE pBufOut, DWORD dwLenOut,
                               PWORD pdwActualOut )


* IST - InterruptServiceThread

- prepare thread
CreateEvent()
CreateThread()
CeSetThreadPriority()
InterruptDisable()
InterruptInitialilze()

- finish thread
InterruptDisable()
WaitforSingleObject()
CloseHandle()
CloseHandle()


- thread
while ( 1 )
{
    WaitforSignelObject()
 
    if ( )
        break;
 
    InterruptDone()
}



Calendar
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Archives
Visits
Today
Yesterday