OSDN Git Service

(none)
[hos/hos-v4a.git] / aplfw / driver / ether / lan9000 / lan9000hal.h
1 /** 
2  *  Hyper Operating System  Application Framework
3  *
4  * @file  lan9000hal.h
5  * @brief %jp{LAN9000シリーズ用ハードウェアアクセス層}
6  *
7  * Copyright (C) 2006-2007 by Project HOS
8  * http://sourceforge.jp/projects/hos/
9  */
10
11
12 #ifndef __HOS__lan9000hal_h__
13 #define __HOS__lan9000hal_h__
14
15
16
17 #define LAN9000HAL_ISTATUS_RCVINT                       0x0001
18 #define LAN9000HAL_ISTATUS_TXINT                        0x0002
19 #define LAN9000HAL_ISTATUS_TX_EMPTYINT          0x0004
20 #define LAN9000HAL_ISTATUS_ALLOCINT                     0x0008
21 #define LAN9000HAL_ISTATUS_RX_OVRNINT           0x0010
22 #define LAN9000HAL_ISTATUS_EPHINT                       0x0020
23 #define LAN9000HAL_ISTATUS_ERCVINT                      0x0040
24 #define LAN9000HAL_ISTATUS_MDINT                        0x0080
25
26 #define LAN9000HAL_IMASK_RCVINT                         0x0100
27 #define LAN9000HAL_IMASK_TXINT                          0x0200
28 #define LAN9000HAL_IMASK_TX_EMPTYINT            0x0400
29 #define LAN9000HAL_IMASK_ALLOCINT                       0x0800
30 #define LAN9000HAL_IMASK_RX_OVRNINT                     0x1000
31 #define LAN9000HAL_IMASK_EPHINT                         0x2000
32 #define LAN9000HAL_IMASK_ERCVINT                        0x4000
33 #define LAN9000HAL_IMASK_MDINT                          0x8000
34
35
36 /* ハードウェアアクセス層 */
37 typedef struct c_lan9000hal
38 {
39         void                    *pRegBase;                      /* レジスタのベースアドレス */
40         unsigned char   ubPhysicalAddr[6];      /* 物理アドレス */
41 } C_LAN9000HAL;
42
43
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47
48 void           Lan9000Hal_Create(C_LAN9000HAL *self, void *pRegAddr);                                                           /**< %jp{コンストラクタ} */
49 void           Lan9000Hal_Delete(C_LAN9000HAL *self);                                                                                           /**< %jp{デストラクタ} */
50 int            Lan9000Hal_Setup(C_LAN9000HAL *self);                                                                                            /**< %jp{初期化} */
51 void           Lan9000Hal_Stop(C_LAN9000HAL *self);                                                                                                     /**< %jp{停止} */
52 int            Lan9000Hal_Recv(C_LAN9000HAL *self, void *pBuf, int iSize);                                                      /**< %jp{パケット受信} */
53 int            Lan9000Hal_Send(C_LAN9000HAL *self, const void *pData, int iSize);                                       /**< %jp{パケット送信} */
54 void           Lan9000Hal_SetInterruptMask(C_LAN9000HAL *self, unsigned short uhIntMask);                       /**< %jp{割込みマスク設定} */
55 unsigned short Lan9000Hal_GetInterruptStatus(C_LAN9000HAL *self);                                                                       /**< %jp{割込み状態取得} */
56 void           Lan9000Hal_GetPhysicalAddr(C_LAN9000HAL *self, unsigned char ubPhysicalAddr[6]);         /**< %jp{物理アドレス取得} */
57
58 #ifdef __cplusplus
59 }
60 #endif
61
62
63 #endif  /* __HOS__lan9000hal_h__ */
64
65
66 /* end of file */