A Port of TI's Webserver for the CC3000

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers spi.h Source File

spi.h

00001 /*****************************************************************************
00002 *
00003 *  spi.h  - CC3000 Host Driver Implementation.
00004 *  Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
00005 *
00006 *  Redistribution and use in source and binary forms, with or without
00007 *  modification, are permitted provided that the following conditions
00008 *  are met:
00009 *
00010 *    Redistributions of source code must retain the above copyright
00011 *    notice, this list of conditions and the following disclaimer.
00012 *
00013 *    Redistributions in binary form must reproduce the above copyright
00014 *    notice, this list of conditions and the following disclaimer in the
00015 *    documentation and/or other materials provided with the   
00016 *    distribution.
00017 *
00018 *    Neither the name of Texas Instruments Incorporated nor the names of
00019 *    its contributors may be used to endorse or promote products derived
00020 *    from this software without specific prior written permission.
00021 *
00022 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
00023 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
00024 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00025 *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
00026 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
00027 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
00028 *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00029 *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00030 *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
00031 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
00032 *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033 *
00034 *****************************************************************************/
00035 
00036 
00037 #ifndef __SPI_H__
00038 #define __SPI_H__
00039 
00040 #include <string.h>
00041 #include <stdlib.h>
00042 #include <stdio.h>
00043 
00044 
00045 
00046 //*****************************************************************************
00047 //
00048 // If building with a C++ compiler, make all of the definitions in this header
00049 // have a C binding.
00050 //
00051 //*****************************************************************************
00052 #ifdef  __cplusplus
00053 extern "C" {
00054 #endif
00055 
00056 typedef void (*gcSpiHandleRx)(void *p);
00057 typedef void (*gcSpiHandleTx)(void);
00058 
00059 extern unsigned char wlan_tx_buffer[];
00060 
00061 //*****************************************************************************
00062 //
00063 // Prototypes for the APIs.
00064 //
00065 //*****************************************************************************
00066 extern void SpiOpen(gcSpiHandleRx pfRxHandler);
00067 extern void SpiClose(void);
00068 extern long SpiWrite(unsigned char *pUserBuffer, unsigned short usLength);
00069 extern void SpiResumeSpi(void);
00070 //extern void SpiConfigureHwMapping(    unsigned long ulPioPortAddress,
00071 //                                  unsigned long ulPort, 
00072 //                                  unsigned long ulSpiCs, 
00073 //                                  unsigned long ulPortInt, 
00074 //                                  unsigned long uluDmaPort,
00075 //                                  unsigned long ulSsiPortAddress,
00076 //                                  unsigned long ulSsiTx,
00077 //                                  unsigned long ulSsiRx,
00078 //                                  unsigned long ulSsiClck);
00079 extern void SpiCleanGPIOISR(void);
00080 extern int init_spi(void);
00081 extern void ReadWriteFrame(unsigned char *pTxBuffer, unsigned char *pRxBuffer, unsigned short size);
00082 extern long TXBufferIsEmpty(void);
00083 extern long RXBufferIsEmpty(void);
00084 
00085 extern void WlanInterruptDisable(void);
00086 extern void WlanInterruptEnable(void);
00087 extern int ReadWlanInterruptPin(void);
00088 extern void WriteWlanPin( unsigned char val );
00089 extern void IntSpiGPIOHandler(void);
00090 //*****************************************************************************
00091 //
00092 // Mark the end of the C bindings section for C++ compilers.
00093 //
00094 //*****************************************************************************
00095 #ifdef  __cplusplus
00096 }
00097 #endif // __cplusplus
00098 
00099 #endif
00100 
00101