cc3100_Socket_Wifi_Server with Ethernet Interface not working
Dependencies: EthernetInterface mbed-rtos mbed
Fork of cc3100_Test_Demo by
simplelink/cc3100_driver.h@9:fd9f64918306, 2017-05-26 (annotated)
- Committer:
- artpes
- Date:
- Fri May 26 10:03:00 2017 +0000
- Revision:
- 9:fd9f64918306
- Parent:
- 6:778b081f6a13
Wifi Server
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dflet | 6:778b081f6a13 | 1 | /* |
dflet | 6:778b081f6a13 | 2 | * driver.h - CC31xx/CC32xx Host Driver Implementation |
dflet | 6:778b081f6a13 | 3 | * |
dflet | 6:778b081f6a13 | 4 | * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/ |
dflet | 6:778b081f6a13 | 5 | * |
dflet | 6:778b081f6a13 | 6 | * |
dflet | 6:778b081f6a13 | 7 | * Redistribution and use in source and binary forms, with or without |
dflet | 6:778b081f6a13 | 8 | * modification, are permitted provided that the following conditions |
dflet | 6:778b081f6a13 | 9 | * are met: |
dflet | 6:778b081f6a13 | 10 | * |
dflet | 6:778b081f6a13 | 11 | * Redistributions of source code must retain the above copyright |
dflet | 6:778b081f6a13 | 12 | * notice, this list of conditions and the following disclaimer. |
dflet | 6:778b081f6a13 | 13 | * |
dflet | 6:778b081f6a13 | 14 | * Redistributions in binary form must reproduce the above copyright |
dflet | 6:778b081f6a13 | 15 | * notice, this list of conditions and the following disclaimer in the |
dflet | 6:778b081f6a13 | 16 | * documentation and/or other materials provided with the |
dflet | 6:778b081f6a13 | 17 | * distribution. |
dflet | 6:778b081f6a13 | 18 | * |
dflet | 6:778b081f6a13 | 19 | * Neither the name of Texas Instruments Incorporated nor the names of |
dflet | 6:778b081f6a13 | 20 | * its contributors may be used to endorse or promote products derived |
dflet | 6:778b081f6a13 | 21 | * from this software without specific prior written permission. |
dflet | 6:778b081f6a13 | 22 | * |
dflet | 6:778b081f6a13 | 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
dflet | 6:778b081f6a13 | 24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
dflet | 6:778b081f6a13 | 25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
dflet | 6:778b081f6a13 | 26 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
dflet | 6:778b081f6a13 | 27 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
dflet | 6:778b081f6a13 | 28 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
dflet | 6:778b081f6a13 | 29 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
dflet | 6:778b081f6a13 | 30 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
dflet | 6:778b081f6a13 | 31 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
dflet | 6:778b081f6a13 | 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
dflet | 6:778b081f6a13 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
dflet | 6:778b081f6a13 | 34 | * |
dflet | 6:778b081f6a13 | 35 | */ |
dflet | 6:778b081f6a13 | 36 | |
dflet | 6:778b081f6a13 | 37 | #ifndef DRIVER_INT_H_ |
dflet | 6:778b081f6a13 | 38 | #define DRIVER_INT_H_ |
dflet | 6:778b081f6a13 | 39 | |
dflet | 6:778b081f6a13 | 40 | #include "cc3100_simplelink.h" |
dflet | 6:778b081f6a13 | 41 | |
dflet | 6:778b081f6a13 | 42 | #include "cc3100_protocol.h" |
dflet | 6:778b081f6a13 | 43 | #include "cc3100_nonos.h" |
dflet | 6:778b081f6a13 | 44 | #include "cc3100_spi.h" |
dflet | 6:778b081f6a13 | 45 | #include "cc3100_netapp.h" |
dflet | 6:778b081f6a13 | 46 | #include "cc3100.h" |
dflet | 6:778b081f6a13 | 47 | |
dflet | 6:778b081f6a13 | 48 | |
dflet | 6:778b081f6a13 | 49 | /*****************************************************************************/ |
dflet | 6:778b081f6a13 | 50 | /* Macro declarations */ |
dflet | 6:778b081f6a13 | 51 | /*****************************************************************************/ |
dflet | 6:778b081f6a13 | 52 | |
dflet | 6:778b081f6a13 | 53 | /* 2 LSB of the N2H_SYNC_PATTERN are for sequence number |
dflet | 6:778b081f6a13 | 54 | only in SPI interface |
dflet | 6:778b081f6a13 | 55 | support backward sync pattern */ |
dflet | 6:778b081f6a13 | 56 | #define N2H_SYNC_PATTERN_SEQ_NUM_BITS ((uint32_t)0x00000003) /* Bits 0..1 - use the 2 LBS for seq num */ |
dflet | 6:778b081f6a13 | 57 | #define N2H_SYNC_PATTERN_SEQ_NUM_EXISTS ((uint32_t)0x00000004) /* Bit 2 - sign that sequence number exists in the sync pattern */ |
dflet | 6:778b081f6a13 | 58 | #define N2H_SYNC_PATTERN_MASK ((uint32_t)0xFFFFFFF8) /* Bits 3..31 - constant SYNC PATTERN */ |
dflet | 6:778b081f6a13 | 59 | #define N2H_SYNC_SPI_BUGS_MASK ((uint32_t)0x7FFF7F7F) /* Bits 7,15,31 - ignore the SPI (8,16,32 bites bus) error bits */ |
dflet | 6:778b081f6a13 | 60 | #define BUF_SYNC_SPIM(pBuf) ((*(uint32_t *)(pBuf)) & N2H_SYNC_SPI_BUGS_MASK) |
dflet | 6:778b081f6a13 | 61 | #define N2H_SYNC_SPIM (N2H_SYNC_PATTERN & N2H_SYNC_SPI_BUGS_MASK) |
dflet | 6:778b081f6a13 | 62 | #define N2H_SYNC_SPIM_WITH_SEQ(TxSeqNum) ((N2H_SYNC_SPIM & N2H_SYNC_PATTERN_MASK) | N2H_SYNC_PATTERN_SEQ_NUM_EXISTS | ((TxSeqNum) & (N2H_SYNC_PATTERN_SEQ_NUM_BITS))) |
dflet | 6:778b081f6a13 | 63 | #define MATCH_WOUT_SEQ_NUM(pBuf) ( BUF_SYNC_SPIM(pBuf) == N2H_SYNC_SPIM ) |
dflet | 6:778b081f6a13 | 64 | #define MATCH_WITH_SEQ_NUM(pBuf, TxSeqNum) ( BUF_SYNC_SPIM(pBuf) == (N2H_SYNC_SPIM_WITH_SEQ(TxSeqNum)) ) |
dflet | 6:778b081f6a13 | 65 | #define N2H_SYNC_PATTERN_MATCH(pBuf, TxSeqNum) \ |
dflet | 6:778b081f6a13 | 66 | ( \ |
dflet | 6:778b081f6a13 | 67 | ( (*((uint32_t *)pBuf) & N2H_SYNC_PATTERN_SEQ_NUM_EXISTS) && ( MATCH_WITH_SEQ_NUM(pBuf, TxSeqNum) ) ) || \ |
dflet | 6:778b081f6a13 | 68 | ( !(*((uint32_t *)pBuf) & N2H_SYNC_PATTERN_SEQ_NUM_EXISTS) && ( MATCH_WOUT_SEQ_NUM(pBuf ) ) ) \ |
dflet | 6:778b081f6a13 | 69 | ) |
dflet | 6:778b081f6a13 | 70 | |
dflet | 6:778b081f6a13 | 71 | #define OPCODE(_ptr) (((_SlResponseHeader_t *)(_ptr))->GenHeader.Opcode) |
dflet | 6:778b081f6a13 | 72 | #define RSP_PAYLOAD_LEN(_ptr) (((_SlResponseHeader_t *)(_ptr))->GenHeader.Len - _SL_RESP_SPEC_HDR_SIZE) |
dflet | 6:778b081f6a13 | 73 | #define SD(_ptr) (((_SocketAddrResponse_u *)(_ptr))->IpV4.sd) |
dflet | 6:778b081f6a13 | 74 | /* Actual size of Recv/Recvfrom response data */ |
dflet | 6:778b081f6a13 | 75 | #define ACT_DATA_SIZE(_ptr) (((_SocketAddrResponse_u *)(_ptr))->IpV4.statusOrLen) |
dflet | 6:778b081f6a13 | 76 | |
dflet | 6:778b081f6a13 | 77 | #define _SL_PROTOCOL_ALIGN_SIZE(msgLen) (((msgLen)+3) & (~3)) |
dflet | 6:778b081f6a13 | 78 | #define _SL_IS_PROTOCOL_ALIGNED_SIZE(msgLen) (!((msgLen) & 3)) |
dflet | 6:778b081f6a13 | 79 | #define _SL_PROTOCOL_CALC_LEN(pCmdCtrl,pCmdExt) ((pCmdExt) ? \ |
dflet | 6:778b081f6a13 | 80 | (_SL_PROTOCOL_ALIGN_SIZE(pCmdCtrl->TxDescLen) + _SL_PROTOCOL_ALIGN_SIZE(pCmdExt->TxPayloadLen)) : \ |
dflet | 6:778b081f6a13 | 81 | (_SL_PROTOCOL_ALIGN_SIZE(pCmdCtrl->TxDescLen))) |
dflet | 6:778b081f6a13 | 82 | |
dflet | 6:778b081f6a13 | 83 | |
dflet | 6:778b081f6a13 | 84 | namespace mbed_cc3100 { |
dflet | 6:778b081f6a13 | 85 | |
dflet | 6:778b081f6a13 | 86 | class cc3100; |
dflet | 6:778b081f6a13 | 87 | |
dflet | 6:778b081f6a13 | 88 | /*****************************************************************************/ |
dflet | 6:778b081f6a13 | 89 | /* Structure/Enum declarations */ |
dflet | 6:778b081f6a13 | 90 | /*****************************************************************************/ |
dflet | 6:778b081f6a13 | 91 | //typedef void(*_SlSpawnEntryFunc_t)(void* pValue); |
dflet | 6:778b081f6a13 | 92 | |
dflet | 6:778b081f6a13 | 93 | typedef struct { |
dflet | 6:778b081f6a13 | 94 | _SlOpcode_t Opcode; |
dflet | 6:778b081f6a13 | 95 | _SlArgSize_t TxDescLen; |
dflet | 6:778b081f6a13 | 96 | _SlArgSize_t RxDescLen; |
dflet | 6:778b081f6a13 | 97 | } _SlCmdCtrl_t; |
dflet | 6:778b081f6a13 | 98 | |
dflet | 6:778b081f6a13 | 99 | typedef struct { |
dflet | 6:778b081f6a13 | 100 | uint16_t TxPayloadLen; |
dflet | 6:778b081f6a13 | 101 | int16_t RxPayloadLen; |
dflet | 6:778b081f6a13 | 102 | int16_t ActualRxPayloadLen; |
dflet | 6:778b081f6a13 | 103 | uint8_t *pTxPayload; |
dflet | 6:778b081f6a13 | 104 | uint8_t *pRxPayload; |
dflet | 6:778b081f6a13 | 105 | } _SlCmdExt_t; |
dflet | 6:778b081f6a13 | 106 | |
dflet | 6:778b081f6a13 | 107 | |
dflet | 6:778b081f6a13 | 108 | typedef struct _SlArgsData_t { |
dflet | 6:778b081f6a13 | 109 | uint8_t *pArgs; |
dflet | 6:778b081f6a13 | 110 | uint8_t *pData; |
dflet | 6:778b081f6a13 | 111 | } _SlArgsData_t; |
dflet | 6:778b081f6a13 | 112 | |
dflet | 6:778b081f6a13 | 113 | |
dflet | 6:778b081f6a13 | 114 | typedef struct _SlPoolObj_t { |
dflet | 6:778b081f6a13 | 115 | _SlSyncObj_t SyncObj; |
dflet | 6:778b081f6a13 | 116 | uint8_t *pRespArgs; |
dflet | 6:778b081f6a13 | 117 | uint8_t ActionID; |
dflet | 6:778b081f6a13 | 118 | uint8_t AdditionalData; /* use for socketID and one bit which indicate supprt IPV6 or not (1=support, 0 otherwise) */ |
dflet | 6:778b081f6a13 | 119 | uint8_t NextIndex; |
dflet | 6:778b081f6a13 | 120 | |
dflet | 6:778b081f6a13 | 121 | } _SlPoolObj_t; |
dflet | 6:778b081f6a13 | 122 | |
dflet | 6:778b081f6a13 | 123 | |
dflet | 6:778b081f6a13 | 124 | typedef enum { |
dflet | 6:778b081f6a13 | 125 | SOCKET_0, |
dflet | 6:778b081f6a13 | 126 | SOCKET_1, |
dflet | 6:778b081f6a13 | 127 | SOCKET_2, |
dflet | 6:778b081f6a13 | 128 | SOCKET_3, |
dflet | 6:778b081f6a13 | 129 | SOCKET_4, |
dflet | 6:778b081f6a13 | 130 | SOCKET_5, |
dflet | 6:778b081f6a13 | 131 | SOCKET_6, |
dflet | 6:778b081f6a13 | 132 | SOCKET_7, |
dflet | 6:778b081f6a13 | 133 | MAX_SOCKET_ENUM_IDX, |
dflet | 6:778b081f6a13 | 134 | #ifndef SL_TINY_EXT |
dflet | 6:778b081f6a13 | 135 | ACCEPT_ID = MAX_SOCKET_ENUM_IDX, |
dflet | 6:778b081f6a13 | 136 | CONNECT_ID, |
dflet | 6:778b081f6a13 | 137 | #else |
dflet | 6:778b081f6a13 | 138 | CONNECT_ID = MAX_SOCKET_ENUM_IDX, |
dflet | 6:778b081f6a13 | 139 | #endif |
dflet | 6:778b081f6a13 | 140 | #ifndef SL_TINY_EXT |
dflet | 6:778b081f6a13 | 141 | SELECT_ID, |
dflet | 6:778b081f6a13 | 142 | #endif |
dflet | 6:778b081f6a13 | 143 | GETHOSYBYNAME_ID, |
dflet | 6:778b081f6a13 | 144 | #ifndef SL_TINY_EXT |
dflet | 6:778b081f6a13 | 145 | GETHOSYBYSERVICE_ID, |
dflet | 6:778b081f6a13 | 146 | PING_ID, |
dflet | 6:778b081f6a13 | 147 | #endif |
dflet | 6:778b081f6a13 | 148 | START_STOP_ID, |
dflet | 6:778b081f6a13 | 149 | RECV_ID |
dflet | 6:778b081f6a13 | 150 | } _SlActionID_e; |
dflet | 6:778b081f6a13 | 151 | |
dflet | 6:778b081f6a13 | 152 | typedef struct _SlActionLookup_t { |
dflet | 6:778b081f6a13 | 153 | uint8_t ActionID; |
dflet | 6:778b081f6a13 | 154 | uint16_t ActionAsyncOpcode; |
dflet | 6:778b081f6a13 | 155 | _SlSpawnEntryFunc_t AsyncEventHandler; |
dflet | 6:778b081f6a13 | 156 | |
dflet | 6:778b081f6a13 | 157 | } _SlActionLookup_t; |
dflet | 6:778b081f6a13 | 158 | |
dflet | 6:778b081f6a13 | 159 | |
dflet | 6:778b081f6a13 | 160 | typedef struct { |
dflet | 6:778b081f6a13 | 161 | uint8_t TxPoolCnt; |
dflet | 6:778b081f6a13 | 162 | _SlLockObj_t TxLockObj; |
dflet | 6:778b081f6a13 | 163 | _SlSyncObj_t TxSyncObj; |
dflet | 6:778b081f6a13 | 164 | } _SlFlowContCB_t; |
dflet | 6:778b081f6a13 | 165 | |
dflet | 6:778b081f6a13 | 166 | typedef enum { |
dflet | 6:778b081f6a13 | 167 | RECV_RESP_CLASS, |
dflet | 6:778b081f6a13 | 168 | CMD_RESP_CLASS, |
dflet | 6:778b081f6a13 | 169 | ASYNC_EVT_CLASS, |
dflet | 6:778b081f6a13 | 170 | DUMMY_MSG_CLASS |
dflet | 6:778b081f6a13 | 171 | } _SlRxMsgClass_e; |
dflet | 6:778b081f6a13 | 172 | |
dflet | 6:778b081f6a13 | 173 | typedef struct { |
dflet | 6:778b081f6a13 | 174 | uint8_t *pAsyncBuf; /* place to write pointer to buffer with CmdResp's Header + Arguments */ |
dflet | 6:778b081f6a13 | 175 | uint8_t ActionIndex; |
dflet | 6:778b081f6a13 | 176 | _SlSpawnEntryFunc_t AsyncEvtHandler; /* place to write pointer to AsyncEvent handler (calc-ed by Opcode) */ |
dflet | 6:778b081f6a13 | 177 | _SlRxMsgClass_e RxMsgClass; /* type of Rx message */ |
dflet | 6:778b081f6a13 | 178 | } AsyncExt_t; |
dflet | 6:778b081f6a13 | 179 | |
dflet | 6:778b081f6a13 | 180 | typedef struct { |
dflet | 6:778b081f6a13 | 181 | _SlCmdCtrl_t *pCmdCtrl; |
dflet | 6:778b081f6a13 | 182 | uint8_t *pTxRxDescBuff; |
dflet | 6:778b081f6a13 | 183 | _SlCmdExt_t *pCmdExt; |
dflet | 6:778b081f6a13 | 184 | AsyncExt_t AsyncExt; |
dflet | 6:778b081f6a13 | 185 | } _SlFunctionParams_t; |
dflet | 6:778b081f6a13 | 186 | |
dflet | 6:778b081f6a13 | 187 | typedef void (*P_INIT_CALLBACK)(uint32_t Status); |
dflet | 6:778b081f6a13 | 188 | |
dflet | 6:778b081f6a13 | 189 | typedef struct { |
dflet | 6:778b081f6a13 | 190 | _SlFd_t FD; |
dflet | 6:778b081f6a13 | 191 | _SlLockObj_t GlobalLockObj; |
dflet | 6:778b081f6a13 | 192 | _SlCommandHeader_t TempProtocolHeader; |
dflet | 6:778b081f6a13 | 193 | P_INIT_CALLBACK pInitCallback; |
dflet | 6:778b081f6a13 | 194 | |
dflet | 6:778b081f6a13 | 195 | _SlPoolObj_t ObjPool[MAX_CONCURRENT_ACTIONS]; |
dflet | 6:778b081f6a13 | 196 | uint8_t FreePoolIdx; |
dflet | 6:778b081f6a13 | 197 | uint8_t PendingPoolIdx; |
dflet | 6:778b081f6a13 | 198 | uint8_t ActivePoolIdx; |
dflet | 6:778b081f6a13 | 199 | uint32_t ActiveActionsBitmap; |
dflet | 6:778b081f6a13 | 200 | _SlLockObj_t ProtectionLockObj; |
dflet | 6:778b081f6a13 | 201 | |
dflet | 6:778b081f6a13 | 202 | _SlSyncObj_t CmdSyncObj; |
dflet | 6:778b081f6a13 | 203 | uint8_t IsCmdRespWaited; |
dflet | 6:778b081f6a13 | 204 | _SlFlowContCB_t FlowContCB; |
dflet | 6:778b081f6a13 | 205 | uint8_t TxSeqNum; |
dflet | 6:778b081f6a13 | 206 | uint8_t RxDoneCnt; |
dflet | 6:778b081f6a13 | 207 | uint8_t SocketNonBlocking; |
dflet | 6:778b081f6a13 | 208 | uint8_t SocketTXFailure; |
dflet | 6:778b081f6a13 | 209 | /* for stack reduction the parameters are globals */ |
dflet | 6:778b081f6a13 | 210 | _SlFunctionParams_t FunctionParams; |
dflet | 6:778b081f6a13 | 211 | |
dflet | 6:778b081f6a13 | 212 | uint8_t ActionIndex; |
dflet | 6:778b081f6a13 | 213 | }_SlDriverCb_t; |
dflet | 6:778b081f6a13 | 214 | |
dflet | 6:778b081f6a13 | 215 | extern volatile uint8_t RxIrqCnt; |
dflet | 6:778b081f6a13 | 216 | |
dflet | 6:778b081f6a13 | 217 | extern _SlDriverCb_t* g_pCB; |
dflet | 6:778b081f6a13 | 218 | typedef uint8_t _SlSd_t; |
dflet | 6:778b081f6a13 | 219 | |
dflet | 6:778b081f6a13 | 220 | class cc3100_driver |
dflet | 6:778b081f6a13 | 221 | { |
dflet | 6:778b081f6a13 | 222 | |
dflet | 6:778b081f6a13 | 223 | public: |
dflet | 6:778b081f6a13 | 224 | |
dflet | 6:778b081f6a13 | 225 | cc3100_driver(cc3100_nonos &nonos, cc3100_netapp &netapp, cc3100_flowcont &flowcont, cc3100_spi &spi); |
dflet | 6:778b081f6a13 | 226 | |
dflet | 6:778b081f6a13 | 227 | ~cc3100_driver(); |
dflet | 6:778b081f6a13 | 228 | |
dflet | 6:778b081f6a13 | 229 | |
dflet | 6:778b081f6a13 | 230 | /*****************************************************************************/ |
dflet | 6:778b081f6a13 | 231 | /* Function prototypes */ |
dflet | 6:778b081f6a13 | 232 | /*****************************************************************************/ |
dflet | 6:778b081f6a13 | 233 | typedef _SlDriverCb_t pDriver; |
dflet | 6:778b081f6a13 | 234 | |
dflet | 6:778b081f6a13 | 235 | uint8_t _SlDrvProtectAsyncRespSetting(uint8_t *pAsyncRsp, uint8_t ActionID, uint8_t SocketID); |
dflet | 6:778b081f6a13 | 236 | |
dflet | 6:778b081f6a13 | 237 | bool _SL_PENDING_RX_MSG(pDriver* pDriverCB); |
dflet | 6:778b081f6a13 | 238 | |
dflet | 6:778b081f6a13 | 239 | void _SlDrvDriverCBInit(void); |
dflet | 6:778b081f6a13 | 240 | |
dflet | 6:778b081f6a13 | 241 | void _SlDrvDriverCBDeinit(void); |
dflet | 6:778b081f6a13 | 242 | |
dflet | 6:778b081f6a13 | 243 | void _SlDrvRxIrqHandler(void *pValue); |
dflet | 6:778b081f6a13 | 244 | |
dflet | 6:778b081f6a13 | 245 | _SlReturnVal_t _SlDrvCmdOp(_SlCmdCtrl_t *pCmdCtrl , void* pTxRxDescBuff , _SlCmdExt_t* pCmdExt); |
dflet | 6:778b081f6a13 | 246 | |
dflet | 6:778b081f6a13 | 247 | _SlReturnVal_t _SlDrvCmdSend(_SlCmdCtrl_t *pCmdCtrl , void* pTxRxDescBuff , _SlCmdExt_t* pCmdExt); |
dflet | 6:778b081f6a13 | 248 | |
dflet | 6:778b081f6a13 | 249 | _SlReturnVal_t _SlDrvDataReadOp(_SlSd_t Sd, _SlCmdCtrl_t *pCmdCtrl , void* pTxRxDescBuff , _SlCmdExt_t* pCmdExt); |
dflet | 6:778b081f6a13 | 250 | |
dflet | 6:778b081f6a13 | 251 | _SlReturnVal_t _SlDrvDataWriteOp(_SlSd_t Sd, _SlCmdCtrl_t *pCmdCtrl , void* pTxRxDescBuff , _SlCmdExt_t* pCmdExt); |
dflet | 6:778b081f6a13 | 252 | #ifndef SL_TINY_EXT |
dflet | 6:778b081f6a13 | 253 | int16_t _SlDrvBasicCmd(_SlOpcode_t Opcode); |
dflet | 6:778b081f6a13 | 254 | #endif |
dflet | 6:778b081f6a13 | 255 | uint8_t _SlDrvWaitForPoolObj(uint8_t ActionID, uint8_t SocketID); |
dflet | 6:778b081f6a13 | 256 | |
dflet | 6:778b081f6a13 | 257 | void _SlDrvReleasePoolObj(uint8_t pObj); |
dflet | 6:778b081f6a13 | 258 | |
dflet | 6:778b081f6a13 | 259 | // void _SlDrvObjInit(void); |
dflet | 6:778b081f6a13 | 260 | |
dflet | 6:778b081f6a13 | 261 | _SlReturnVal_t _SlDrvMsgRead(void); |
dflet | 6:778b081f6a13 | 262 | |
dflet | 6:778b081f6a13 | 263 | _SlReturnVal_t _SlDrvMsgWrite(_SlCmdCtrl_t *pCmdCtrl,_SlCmdExt_t *pCmdExt, uint8_t *pTxRxDescBuff); |
dflet | 6:778b081f6a13 | 264 | |
dflet | 6:778b081f6a13 | 265 | // _SlReturnVal_t _SlDrvMsgWrite(void); |
dflet | 6:778b081f6a13 | 266 | |
dflet | 6:778b081f6a13 | 267 | _SlReturnVal_t _SlDrvMsgReadCmdCtx(void); |
dflet | 6:778b081f6a13 | 268 | |
dflet | 6:778b081f6a13 | 269 | _SlReturnVal_t _SlDrvMsgReadSpawnCtx_(void *pValue); |
dflet | 6:778b081f6a13 | 270 | |
dflet | 6:778b081f6a13 | 271 | void _SlDrvClassifyRxMsg(_SlOpcode_t Opcode ); |
dflet | 6:778b081f6a13 | 272 | |
dflet | 6:778b081f6a13 | 273 | _SlReturnVal_t _SlDrvRxHdrRead(uint8_t *pBuf, uint8_t *pAlignSize); |
dflet | 6:778b081f6a13 | 274 | |
dflet | 6:778b081f6a13 | 275 | void _SlDrvShiftDWord(uint8_t *pBuf); |
dflet | 6:778b081f6a13 | 276 | |
dflet | 6:778b081f6a13 | 277 | void _SlAsyncEventGenericHandler(void); |
dflet | 6:778b081f6a13 | 278 | |
dflet | 6:778b081f6a13 | 279 | void _SlDrvObjDeInit(void); |
dflet | 6:778b081f6a13 | 280 | |
dflet | 6:778b081f6a13 | 281 | void _SlRemoveFromList(uint8_t* ListIndex, uint8_t ItemIndex); |
dflet | 6:778b081f6a13 | 282 | |
dflet | 6:778b081f6a13 | 283 | _SlReturnVal_t _SlFindAndSetActiveObj(_SlOpcode_t Opcode, uint8_t Sd); |
dflet | 6:778b081f6a13 | 284 | |
dflet | 6:778b081f6a13 | 285 | uint16_t _SlDrvAlignSize(uint16_t msgLen); |
dflet | 6:778b081f6a13 | 286 | void _SlDrvSyncObjWaitForever(_SlSyncObj_t *pSyncObj); |
dflet | 6:778b081f6a13 | 287 | void _SlDrvSyncObjSignal(_SlSyncObj_t *pSyncObj); |
dflet | 6:778b081f6a13 | 288 | void _SlDrvObjLock(_SlLockObj_t *pLockObj, _SlTime_t Timeout); |
dflet | 6:778b081f6a13 | 289 | void _SlDrvObjLockWaitForever(_SlLockObj_t *pLockObj); |
dflet | 6:778b081f6a13 | 290 | void _SlDrvProtectionObjLockWaitForever(); |
dflet | 6:778b081f6a13 | 291 | void _SlDrvObjUnLock(_SlLockObj_t *pLockObj); |
dflet | 6:778b081f6a13 | 292 | void _SlDrvProtectionObjUnLock(); |
dflet | 6:778b081f6a13 | 293 | void _SlDrvMemZero(void* Addr, uint16_t size); |
dflet | 6:778b081f6a13 | 294 | void _SlDrvResetCmdExt(_SlCmdExt_t* pCmdExt); |
dflet | 6:778b081f6a13 | 295 | |
dflet | 6:778b081f6a13 | 296 | |
dflet | 6:778b081f6a13 | 297 | private: |
dflet | 6:778b081f6a13 | 298 | |
dflet | 6:778b081f6a13 | 299 | cc3100_nonos &_nonos; |
dflet | 6:778b081f6a13 | 300 | cc3100_netapp &_netapp; |
dflet | 6:778b081f6a13 | 301 | cc3100_flowcont &_flowcont; |
dflet | 6:778b081f6a13 | 302 | cc3100_spi &_spi; |
dflet | 6:778b081f6a13 | 303 | |
dflet | 6:778b081f6a13 | 304 | };//class |
dflet | 6:778b081f6a13 | 305 | |
dflet | 6:778b081f6a13 | 306 | }//namespace mbed_cc3100 |
dflet | 6:778b081f6a13 | 307 | |
dflet | 6:778b081f6a13 | 308 | #endif /* __DRIVER_INT_H__ */ |
dflet | 6:778b081f6a13 | 309 |