TI's CC3100 host driver and demo. Experimental and a work in progress.

Dependencies:   mbed

Committer:
dflet
Date:
Wed Nov 19 23:04:04 2014 +0000
Revision:
2:a3e52cf86086
Parent:
0:bbe98578d4c0
Added more boards!

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dflet 0:bbe98578d4c0 1 /*
dflet 0:bbe98578d4c0 2 * flowcont.c - CC31xx/CC32xx Host Driver Implementation
dflet 0:bbe98578d4c0 3 *
dflet 0:bbe98578d4c0 4 * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
dflet 0:bbe98578d4c0 5 *
dflet 0:bbe98578d4c0 6 *
dflet 0:bbe98578d4c0 7 * Redistribution and use in source and binary forms, with or without
dflet 0:bbe98578d4c0 8 * modification, are permitted provided that the following conditions
dflet 0:bbe98578d4c0 9 * are met:
dflet 0:bbe98578d4c0 10 *
dflet 0:bbe98578d4c0 11 * Redistributions of source code must retain the above copyright
dflet 0:bbe98578d4c0 12 * notice, this list of conditions and the following disclaimer.
dflet 0:bbe98578d4c0 13 *
dflet 0:bbe98578d4c0 14 * Redistributions in binary form must reproduce the above copyright
dflet 0:bbe98578d4c0 15 * notice, this list of conditions and the following disclaimer in the
dflet 0:bbe98578d4c0 16 * documentation and/or other materials provided with the
dflet 0:bbe98578d4c0 17 * distribution.
dflet 0:bbe98578d4c0 18 *
dflet 0:bbe98578d4c0 19 * Neither the name of Texas Instruments Incorporated nor the names of
dflet 0:bbe98578d4c0 20 * its contributors may be used to endorse or promote products derived
dflet 0:bbe98578d4c0 21 * from this software without specific prior written permission.
dflet 0:bbe98578d4c0 22 *
dflet 0:bbe98578d4c0 23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
dflet 0:bbe98578d4c0 24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
dflet 0:bbe98578d4c0 25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
dflet 0:bbe98578d4c0 26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
dflet 0:bbe98578d4c0 27 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
dflet 0:bbe98578d4c0 28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
dflet 0:bbe98578d4c0 29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
dflet 0:bbe98578d4c0 30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
dflet 0:bbe98578d4c0 31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
dflet 0:bbe98578d4c0 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
dflet 0:bbe98578d4c0 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dflet 0:bbe98578d4c0 34 *
dflet 0:bbe98578d4c0 35 */
dflet 0:bbe98578d4c0 36
dflet 0:bbe98578d4c0 37
dflet 0:bbe98578d4c0 38
dflet 0:bbe98578d4c0 39 /*****************************************************************************/
dflet 0:bbe98578d4c0 40 /* Include files */
dflet 0:bbe98578d4c0 41 /*****************************************************************************/
dflet 0:bbe98578d4c0 42 #include "cc3100_simplelink.h"
dflet 0:bbe98578d4c0 43 #include "cc3100_protocol.h"
dflet 0:bbe98578d4c0 44 #include "cc3100_driver.h"
dflet 0:bbe98578d4c0 45 #include "cc3100_flowcont.h"
dflet 0:bbe98578d4c0 46
dflet 0:bbe98578d4c0 47
dflet 0:bbe98578d4c0 48 /*****************************************************************************/
dflet 0:bbe98578d4c0 49 /* _SlDrvFlowContInit */
dflet 0:bbe98578d4c0 50 /*****************************************************************************/
dflet 0:bbe98578d4c0 51 void _SlDrvFlowContInit(void)
dflet 0:bbe98578d4c0 52 {
dflet 0:bbe98578d4c0 53 g_pCB->FlowContCB.TxPoolCnt = FLOW_CONT_MIN;
dflet 0:bbe98578d4c0 54
dflet 0:bbe98578d4c0 55 OSI_RET_OK_CHECK(sl_LockObjCreate(&g_pCB->FlowContCB.TxLockObj, "TxLockObj"));
dflet 0:bbe98578d4c0 56
dflet 0:bbe98578d4c0 57 OSI_RET_OK_CHECK(sl_SyncObjCreate(&g_pCB->FlowContCB.TxSyncObj, "TxSyncObj"));
dflet 0:bbe98578d4c0 58 }
dflet 0:bbe98578d4c0 59
dflet 0:bbe98578d4c0 60 /*****************************************************************************/
dflet 0:bbe98578d4c0 61 /* _SlDrvFlowContDeinit */
dflet 0:bbe98578d4c0 62 /*****************************************************************************/
dflet 0:bbe98578d4c0 63 void _SlDrvFlowContDeinit(void)
dflet 0:bbe98578d4c0 64 {
dflet 0:bbe98578d4c0 65 g_pCB->FlowContCB.TxPoolCnt = 0;
dflet 0:bbe98578d4c0 66
dflet 0:bbe98578d4c0 67 OSI_RET_OK_CHECK(sl_LockObjDelete(&g_pCB->FlowContCB.TxLockObj));
dflet 0:bbe98578d4c0 68
dflet 0:bbe98578d4c0 69 OSI_RET_OK_CHECK(sl_SyncObjDelete(&g_pCB->FlowContCB.TxSyncObj));
dflet 0:bbe98578d4c0 70 }
dflet 0:bbe98578d4c0 71
dflet 0:bbe98578d4c0 72