Line No. | Rev | Author | Line |
---|---|---|---|
1 | 32 | kaklik | /****************************************************************************** |
2 | |||
3 | MRF24WB0M Driver Raw driver |
||
4 | Module for Microchip TCP/IP Stack |
||
5 | -Provides access to MRF24WB0M WiFi controller |
||
6 | -Reference: MRF24WB0M Data sheet, IEEE 802.11 Standard |
||
7 | |||
8 | ******************************************************************************* |
||
9 | FileName: WFRaw.h |
||
10 | Dependencies: TCP/IP Stack header files |
||
11 | Processor: PIC18, PIC24F, PIC24H, dsPIC30F, dsPIC33F, PIC32 |
||
12 | Compiler: Microchip C32 v1.10b or higher |
||
13 | Microchip C30 v3.22 or higher |
||
14 | Microchip C18 v3.34 or higher |
||
15 | Company: Microchip Technology, Inc. |
||
16 | |||
17 | Software License Agreement |
||
18 | |||
19 | Copyright (C) 2002-2010 Microchip Technology Inc. All rights reserved. |
||
20 | |||
21 | Microchip licenses to you the right to use, modify, copy, and distribute: |
||
22 | (i) the Software when embedded on a Microchip microcontroller or digital |
||
23 | signal controller product ("Device") which is integrated into |
||
24 | Licensee's product; or |
||
25 | (ii) ONLY the Software driver source files ENC28J60.c, ENC28J60.h, |
||
26 | ENCX24J600.c and ENCX24J600.h ported to a non-Microchip device used in |
||
27 | conjunction with a Microchip ethernet controller for the sole purpose |
||
28 | of interfacing with the ethernet controller. |
||
29 | |||
30 | You should refer to the license agreement accompanying this Software for |
||
31 | additional information regarding your rights and obligations. |
||
32 | |||
33 | THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY |
||
34 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY |
||
35 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND |
||
36 | NON-INFRINGEMENT. IN NO EVENT SHALL MICROCHIP BE LIABLE FOR ANY INCIDENTAL, |
||
37 | SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST |
||
38 | OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, ANY CLAIMS BY |
||
39 | THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), ANY CLAIMS |
||
40 | FOR INDEMNITY OR CONTRIBUTION, OR OTHER SIMILAR COSTS, WHETHER ASSERTED ON |
||
41 | THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE), BREACH OF WARRANTY, OR |
||
42 | OTHERWISE. |
||
43 | |||
44 | |||
45 | Author Date Comment |
||
46 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
47 | KH 27 Jan 2010 Updated for MRF24WB0M |
||
48 | ******************************************************************************/ |
||
49 | |||
50 | /* |
||
51 | ********************************************************************************************************* |
||
52 | * DEFINES |
||
53 | ********************************************************************************************************* |
||
54 | */ |
||
55 | #define RAW_ID_0 (0) |
||
56 | #define RAW_ID_1 (1) |
||
57 | |||
58 | // RAW0 used for Rx, RAW1 used for Tx |
||
59 | #define RAW_RX_ID RAW_ID_0 |
||
60 | #define RAW_TX_ID RAW_ID_1 |
||
61 | #define RAW_INVALID_ID (0xff) |
||
62 | |||
63 | // Source/Destination objects on the MRF24WB0M |
||
64 | #define RAW_MAC (0x00) /* Cmd processor (aka MRF24WB0M MAC) */ |
||
65 | #define RAW_MGMT_POOL (0x10) /* For 802.11 Management packets */ |
||
66 | #define RAW_DATA_POOL (0x20) /* Data Memory pool used for tx and rx operations */ |
||
67 | #define RAW_SCRATCH_POOL (0x30) /* Scratch object */ |
||
68 | #define RAW_STACK_MEM (0x40) /* single level stack to save state of RAW */ |
||
69 | #define RAW_COPY (0x70) /* RAW to RAW copy */ |
||
70 | |||
71 | /* 8-bit RAW registers */ |
||
72 | #define RAW_0_DATA_REG (0x20) |
||
73 | #define RAW_1_DATA_REG (0x21) |
||
74 | |||
75 | /* 16 bit RAW registers */ |
||
76 | #define RAW_0_CTRL_0_REG (0x25) |
||
77 | #define RAW_0_CTRL_1_REG (0x26) |
||
78 | #define RAW_0_INDEX_REG (0x27) |
||
79 | #define RAW_0_STATUS_REG (0x28) |
||
80 | #define RAW_1_CTRL_0_REG (0x29) |
||
81 | #define RAW_1_CTRL_1_REG (0x2a) |
||
82 | #define RAW_1_INDEX_REG (0x2b) |
||
83 | #define RAW_1_STATUS_REG (0x2c) |
||
84 | |||
85 | /* RAW Window states */ |
||
86 | #define WF_RAW_UNMOUNTED (0) |
||
87 | #define WF_SCRATCH_MOUNTED (1) |
||
88 | #define WF_RAW_DATA_MOUNTED (2) |
||
89 | #define WF_RAW_MGMT_MOUNTED (3) |
||
90 | |||
91 | #define SetRawWindowState(rawId, state) RawWindowState[rawId] = state |
||
92 | #define GetRawWindowState(rawId) RawWindowState[rawId] |
||
93 | |||
94 | /* |
||
95 | ********************************************************************************************************* |
||
96 | * GLOBALS |
||
97 | ********************************************************************************************************* |
||
98 | */ |
||
99 | extern BOOL g_HostRAWDataPacketReceived; |
||
100 | extern BOOL RawWindowReady[2]; /* for Tx and Rx, TRUE = ready for use, FALSE = not ready for use */ |
||
101 | extern UINT8 RawWindowState[2]; /* see RAW Window states above */ |
||
102 | |||
103 | |||
104 | /* |
||
105 | ********************************************************************************************************* |
||
106 | * FUNCTION PROTOTYPES |
||
107 | ********************************************************************************************************* |
||
108 | */ |
||
109 | void RawInit(void); |
||
110 | |||
111 | BOOL RawSetIndex(UINT16 rawId, UINT16 index); |
||
112 | UINT16 RawGetIndex(UINT16 rawId); |
||
113 | void RawGetByte(UINT16 rawId, UINT8 *pBuffer, UINT16 length); |
||
114 | void RawSetByte(UINT16 rawId, UINT8 *pBuffer, UINT16 length); |
||
115 | void RawSetByteROM(UINT16 rawId, ROM UINT8 *pBuffer, UINT16 length); |
||
116 | BOOL RawGetMgmtRxBuffer(UINT16 *p_numBytes); |
||
117 | void RawFreeRxMgmtBuffer(void); |
||
118 | void SetRawRxMgmtInProgress(BOOL action); |
||
119 | BOOL isRawRxMgmtInProgress(void); |
||
120 | void SendRAWDataFrame(UINT16 bufLen); |
||
121 | void PushRawWindow(UINT8 rawId); |
||
122 | UINT16 PopRawWindow(UINT8 rawId); |
||
123 | void ScratchUnmount(UINT8 rawId); |
||
124 | UINT16 ScratchMount(UINT8 rawId); |
||
125 | void RawRead(UINT8 rawId, UINT16 startIndex, UINT16 length, UINT8 *p_dest); |
||
126 | void RawWrite(UINT8 rawId, UINT16 startIndex, UINT16 length, UINT8 *p_src); |
||
127 | BOOL AllocateMgmtTxBuffer(UINT16 bytesNeeded); |
||
128 | void DeallocateMgmtRxBuffer(void); |
||
129 | BOOL AllocateDataTxBuffer(UINT16 bytesNeeded); |
||
130 | void DeallocateDataTxBuffer(void); |
||
131 | void DeallocateDataRxBuffer(void); |
||
132 | void RawSendTxBuffer(UINT16 len); |
||
133 | UINT16 RawMountRxBuffer(void); |
||
134 | void RawToRawCopy(UINT8 rawSourceId, UINT16 length); |
||
135 | #if 0 |
||
136 | /* Not needed for MCHP */ |
||
137 | void RawSendUntamperedData(UINT8 *pReq, UINT16 len); |
||
138 | #endif |
Powered by WebSVN v2.8.3