David Fletcher
/
CC3000WebServer
A Port of TI's Webserver for the CC3000
CC3000Spi/spi.h@0:6ad60d78b315, 2013-09-14 (annotated)
- Committer:
- dflet
- Date:
- Sat Sep 14 17:38:41 2013 +0000
- Revision:
- 0:6ad60d78b315
Mostly working will serve the default pages index.html and config.html, but config.html is not woring at present.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dflet | 0:6ad60d78b315 | 1 | /***************************************************************************** |
dflet | 0:6ad60d78b315 | 2 | * |
dflet | 0:6ad60d78b315 | 3 | * spi.h - CC3000 Host Driver Implementation. |
dflet | 0:6ad60d78b315 | 4 | * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ |
dflet | 0:6ad60d78b315 | 5 | * |
dflet | 0:6ad60d78b315 | 6 | * Redistribution and use in source and binary forms, with or without |
dflet | 0:6ad60d78b315 | 7 | * modification, are permitted provided that the following conditions |
dflet | 0:6ad60d78b315 | 8 | * are met: |
dflet | 0:6ad60d78b315 | 9 | * |
dflet | 0:6ad60d78b315 | 10 | * Redistributions of source code must retain the above copyright |
dflet | 0:6ad60d78b315 | 11 | * notice, this list of conditions and the following disclaimer. |
dflet | 0:6ad60d78b315 | 12 | * |
dflet | 0:6ad60d78b315 | 13 | * Redistributions in binary form must reproduce the above copyright |
dflet | 0:6ad60d78b315 | 14 | * notice, this list of conditions and the following disclaimer in the |
dflet | 0:6ad60d78b315 | 15 | * documentation and/or other materials provided with the |
dflet | 0:6ad60d78b315 | 16 | * distribution. |
dflet | 0:6ad60d78b315 | 17 | * |
dflet | 0:6ad60d78b315 | 18 | * Neither the name of Texas Instruments Incorporated nor the names of |
dflet | 0:6ad60d78b315 | 19 | * its contributors may be used to endorse or promote products derived |
dflet | 0:6ad60d78b315 | 20 | * from this software without specific prior written permission. |
dflet | 0:6ad60d78b315 | 21 | * |
dflet | 0:6ad60d78b315 | 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
dflet | 0:6ad60d78b315 | 23 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
dflet | 0:6ad60d78b315 | 24 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
dflet | 0:6ad60d78b315 | 25 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
dflet | 0:6ad60d78b315 | 26 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
dflet | 0:6ad60d78b315 | 27 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
dflet | 0:6ad60d78b315 | 28 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
dflet | 0:6ad60d78b315 | 29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
dflet | 0:6ad60d78b315 | 30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
dflet | 0:6ad60d78b315 | 31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
dflet | 0:6ad60d78b315 | 32 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
dflet | 0:6ad60d78b315 | 33 | * |
dflet | 0:6ad60d78b315 | 34 | *****************************************************************************/ |
dflet | 0:6ad60d78b315 | 35 | |
dflet | 0:6ad60d78b315 | 36 | |
dflet | 0:6ad60d78b315 | 37 | #ifndef __SPI_H__ |
dflet | 0:6ad60d78b315 | 38 | #define __SPI_H__ |
dflet | 0:6ad60d78b315 | 39 | |
dflet | 0:6ad60d78b315 | 40 | #include <string.h> |
dflet | 0:6ad60d78b315 | 41 | #include <stdlib.h> |
dflet | 0:6ad60d78b315 | 42 | #include <stdio.h> |
dflet | 0:6ad60d78b315 | 43 | |
dflet | 0:6ad60d78b315 | 44 | |
dflet | 0:6ad60d78b315 | 45 | |
dflet | 0:6ad60d78b315 | 46 | //***************************************************************************** |
dflet | 0:6ad60d78b315 | 47 | // |
dflet | 0:6ad60d78b315 | 48 | // If building with a C++ compiler, make all of the definitions in this header |
dflet | 0:6ad60d78b315 | 49 | // have a C binding. |
dflet | 0:6ad60d78b315 | 50 | // |
dflet | 0:6ad60d78b315 | 51 | //***************************************************************************** |
dflet | 0:6ad60d78b315 | 52 | #ifdef __cplusplus |
dflet | 0:6ad60d78b315 | 53 | extern "C" { |
dflet | 0:6ad60d78b315 | 54 | #endif |
dflet | 0:6ad60d78b315 | 55 | |
dflet | 0:6ad60d78b315 | 56 | typedef void (*gcSpiHandleRx)(void *p); |
dflet | 0:6ad60d78b315 | 57 | typedef void (*gcSpiHandleTx)(void); |
dflet | 0:6ad60d78b315 | 58 | |
dflet | 0:6ad60d78b315 | 59 | extern unsigned char wlan_tx_buffer[]; |
dflet | 0:6ad60d78b315 | 60 | |
dflet | 0:6ad60d78b315 | 61 | //***************************************************************************** |
dflet | 0:6ad60d78b315 | 62 | // |
dflet | 0:6ad60d78b315 | 63 | // Prototypes for the APIs. |
dflet | 0:6ad60d78b315 | 64 | // |
dflet | 0:6ad60d78b315 | 65 | //***************************************************************************** |
dflet | 0:6ad60d78b315 | 66 | extern void SpiOpen(gcSpiHandleRx pfRxHandler); |
dflet | 0:6ad60d78b315 | 67 | extern void SpiClose(void); |
dflet | 0:6ad60d78b315 | 68 | extern long SpiWrite(unsigned char *pUserBuffer, unsigned short usLength); |
dflet | 0:6ad60d78b315 | 69 | extern void SpiResumeSpi(void); |
dflet | 0:6ad60d78b315 | 70 | //extern void SpiConfigureHwMapping( unsigned long ulPioPortAddress, |
dflet | 0:6ad60d78b315 | 71 | // unsigned long ulPort, |
dflet | 0:6ad60d78b315 | 72 | // unsigned long ulSpiCs, |
dflet | 0:6ad60d78b315 | 73 | // unsigned long ulPortInt, |
dflet | 0:6ad60d78b315 | 74 | // unsigned long uluDmaPort, |
dflet | 0:6ad60d78b315 | 75 | // unsigned long ulSsiPortAddress, |
dflet | 0:6ad60d78b315 | 76 | // unsigned long ulSsiTx, |
dflet | 0:6ad60d78b315 | 77 | // unsigned long ulSsiRx, |
dflet | 0:6ad60d78b315 | 78 | // unsigned long ulSsiClck); |
dflet | 0:6ad60d78b315 | 79 | extern void SpiCleanGPIOISR(void); |
dflet | 0:6ad60d78b315 | 80 | extern int init_spi(void); |
dflet | 0:6ad60d78b315 | 81 | extern void ReadWriteFrame(unsigned char *pTxBuffer, unsigned char *pRxBuffer, unsigned short size); |
dflet | 0:6ad60d78b315 | 82 | extern long TXBufferIsEmpty(void); |
dflet | 0:6ad60d78b315 | 83 | extern long RXBufferIsEmpty(void); |
dflet | 0:6ad60d78b315 | 84 | |
dflet | 0:6ad60d78b315 | 85 | extern void WlanInterruptDisable(void); |
dflet | 0:6ad60d78b315 | 86 | extern void WlanInterruptEnable(void); |
dflet | 0:6ad60d78b315 | 87 | extern int ReadWlanInterruptPin(void); |
dflet | 0:6ad60d78b315 | 88 | extern void WriteWlanPin( unsigned char val ); |
dflet | 0:6ad60d78b315 | 89 | extern void IntSpiGPIOHandler(void); |
dflet | 0:6ad60d78b315 | 90 | //***************************************************************************** |
dflet | 0:6ad60d78b315 | 91 | // |
dflet | 0:6ad60d78b315 | 92 | // Mark the end of the C bindings section for C++ compilers. |
dflet | 0:6ad60d78b315 | 93 | // |
dflet | 0:6ad60d78b315 | 94 | //***************************************************************************** |
dflet | 0:6ad60d78b315 | 95 | #ifdef __cplusplus |
dflet | 0:6ad60d78b315 | 96 | } |
dflet | 0:6ad60d78b315 | 97 | #endif // __cplusplus |
dflet | 0:6ad60d78b315 | 98 | |
dflet | 0:6ad60d78b315 | 99 | #endif |
dflet | 0:6ad60d78b315 | 100 | |
dflet | 0:6ad60d78b315 | 101 |