Added mutex for multiple SPI devices on the same SPI bus

Fork of cc3000_hostdriver_mbedsocket by Martin Kojtal

Committer:
Kojto
Date:
Thu Oct 03 17:15:45 2013 +0200
Revision:
20:30b6ed7bf8fd
Parent:
0:615c697c33b0
UNIX line endings

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 20:30b6ed7bf8fd 1 /*****************************************************************************
Kojto 20:30b6ed7bf8fd 2 *
Kojto 20:30b6ed7bf8fd 3 * C++ interface/implementation created by Martin Kojtal (0xc0170). Thanks to
Kojto 20:30b6ed7bf8fd 4 * Jim Carver and Frank Vannieuwkerke for their inital cc3000 mbed port and
Kojto 20:30b6ed7bf8fd 5 * provided help.
Kojto 20:30b6ed7bf8fd 6 *
Kojto 20:30b6ed7bf8fd 7 * This version of "host driver" uses CC3000 Host Driver Implementation. Thus
Kojto 20:30b6ed7bf8fd 8 * read the following copyright:
Kojto 20:30b6ed7bf8fd 9 *
Kojto 20:30b6ed7bf8fd 10 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
Kojto 20:30b6ed7bf8fd 11 *
Kojto 20:30b6ed7bf8fd 12 * Redistribution and use in source and binary forms, with or without
Kojto 20:30b6ed7bf8fd 13 * modification, are permitted provided that the following conditions
Kojto 20:30b6ed7bf8fd 14 * are met:
Kojto 20:30b6ed7bf8fd 15 *
Kojto 20:30b6ed7bf8fd 16 * Redistributions of source code must retain the above copyright
Kojto 20:30b6ed7bf8fd 17 * notice, this list of conditions and the following disclaimer.
Kojto 20:30b6ed7bf8fd 18 *
Kojto 20:30b6ed7bf8fd 19 * Redistributions in binary form must reproduce the above copyright
Kojto 20:30b6ed7bf8fd 20 * notice, this list of conditions and the following disclaimer in the
Kojto 20:30b6ed7bf8fd 21 * documentation and/or other materials provided with the
Kojto 20:30b6ed7bf8fd 22 * distribution.
Kojto 20:30b6ed7bf8fd 23 *
Kojto 20:30b6ed7bf8fd 24 * Neither the name of Texas Instruments Incorporated nor the names of
Kojto 20:30b6ed7bf8fd 25 * its contributors may be used to endorse or promote products derived
Kojto 20:30b6ed7bf8fd 26 * from this software without specific prior written permission.
Kojto 20:30b6ed7bf8fd 27 *
Kojto 20:30b6ed7bf8fd 28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Kojto 20:30b6ed7bf8fd 29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Kojto 20:30b6ed7bf8fd 30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Kojto 20:30b6ed7bf8fd 31 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
Kojto 20:30b6ed7bf8fd 32 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
Kojto 20:30b6ed7bf8fd 33 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
Kojto 20:30b6ed7bf8fd 34 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
Kojto 20:30b6ed7bf8fd 35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
Kojto 20:30b6ed7bf8fd 36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
Kojto 20:30b6ed7bf8fd 37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 20:30b6ed7bf8fd 38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 20:30b6ed7bf8fd 39 *
Kojto 20:30b6ed7bf8fd 40 *****************************************************************************/
Kojto 20:30b6ed7bf8fd 41 #ifndef CC3000_NVMEM_H
Kojto 20:30b6ed7bf8fd 42 #define CC3000_NVMEM_H
Kojto 20:30b6ed7bf8fd 43
Kojto 20:30b6ed7bf8fd 44 #define NVMEM_READ_PARAMS_LEN (12)
Kojto 20:30b6ed7bf8fd 45 #define NVMEM_CREATE_PARAMS_LEN (8)
Kojto 20:30b6ed7bf8fd 46 #define NVMEM_WRITE_PARAMS_LEN (16)
Kojto 20:30b6ed7bf8fd 47
Kojto 20:30b6ed7bf8fd 48
Kojto 20:30b6ed7bf8fd 49 /****************************************************************************
Kojto 20:30b6ed7bf8fd 50 **
Kojto 20:30b6ed7bf8fd 51 ** Definitions for File IDs
Kojto 20:30b6ed7bf8fd 52 **
Kojto 20:30b6ed7bf8fd 53 ****************************************************************************/
Kojto 20:30b6ed7bf8fd 54 /* --------------------------------------------------------- EEPROM FAT table ---------------------------------------------------------
Kojto 20:30b6ed7bf8fd 55
Kojto 20:30b6ed7bf8fd 56 File ID Offset File Size Used Size Parameter
Kojto 20:30b6ed7bf8fd 57 # ID address (bytes) (bytes)
Kojto 20:30b6ed7bf8fd 58 --------------------------------------------------------------------------------------------------------------------------------------
Kojto 20:30b6ed7bf8fd 59 0 NVMEM_NVS_FILEID 0x50 0x1A0 0x1A RF Calibration results table(generated automatically by TX Bip)
Kojto 20:30b6ed7bf8fd 60 1 NVMEM_NVS_SHADOW_FILEID 0x1F0 0x1A0 0x1A NVS Shadow
Kojto 20:30b6ed7bf8fd 61 2 NVMEM_WLAN_CONFIG_FILEID 0x390 0x1000 0x64 WLAN configuration
Kojto 20:30b6ed7bf8fd 62 3 NVMEM_WLAN_CONFIG_SHADOW_FILEID 0x1390 0x1000 0x64 WLAN configuration shadow
Kojto 20:30b6ed7bf8fd 63 4 NVMEM_WLAN_DRIVER_SP_FILEID 0x2390 0x2000 variable WLAN Driver ROM Patches
Kojto 20:30b6ed7bf8fd 64 5 NVMEM_WLAN_FW_SP_FILEID 0x4390 0x2000 variable WLAN FW Patches
Kojto 20:30b6ed7bf8fd 65 6 NVMEM_MAC_FILEID 0x6390 0x10 0x10 6 bytes of MAC address
Kojto 20:30b6ed7bf8fd 66 7 NVMEM_FRONTEND_VARS_FILEID 0x63A0 0x10 0x10 Frontend Vars
Kojto 20:30b6ed7bf8fd 67 8 NVMEM_IP_CONFIG_FILEID 0x63B0 0x40 0x40 IP configuration
Kojto 20:30b6ed7bf8fd 68 9 NVMEM_IP_CONFIG_SHADOW_FILEID 0x63F0 0x40 0x40 IP configuration shadow
Kojto 20:30b6ed7bf8fd 69 10 NVMEM_BOOTLOADER_SP_FILEID 0x6430 0x400 variable Bootloader Patches
Kojto 20:30b6ed7bf8fd 70 11 NVMEM_RM_FILEID 0x6830 0x200 0x7F Radio parameters
Kojto 20:30b6ed7bf8fd 71 12 NVMEM_AES128_KEY_FILEID 0x6A30 0x10 0x10 AES128 key file
Kojto 20:30b6ed7bf8fd 72 13 NVMEM_SHARED_MEM_FILEID 0x6A40 0x50 0x44 Host-CC3000 shared memory file
Kojto 20:30b6ed7bf8fd 73 14 NVMEM_USER_FILE_1_FILEID 0x6A90 variable variable 1st user file
Kojto 20:30b6ed7bf8fd 74 15 NVMEM_USER_FILE_2_FILEID variable variable variable 2nd user file
Kojto 20:30b6ed7bf8fd 75 */
Kojto 20:30b6ed7bf8fd 76 /* NVMEM file ID - system files*/
Kojto 20:30b6ed7bf8fd 77 #define NVMEM_NVS_FILEID (0)
Kojto 20:30b6ed7bf8fd 78 #define NVMEM_NVS_SHADOW_FILEID (1)
Kojto 20:30b6ed7bf8fd 79 #define NVMEM_WLAN_CONFIG_FILEID (2)
Kojto 20:30b6ed7bf8fd 80 #define NVMEM_WLAN_CONFIG_SHADOW_FILEID (3)
Kojto 20:30b6ed7bf8fd 81 #define NVMEM_WLAN_DRIVER_SP_FILEID (4)
Kojto 20:30b6ed7bf8fd 82 #define NVMEM_WLAN_FW_SP_FILEID (5)
Kojto 20:30b6ed7bf8fd 83 #define NVMEM_MAC_FILEID (6)
Kojto 20:30b6ed7bf8fd 84 #define NVMEM_FRONTEND_VARS_FILEID (7)
Kojto 20:30b6ed7bf8fd 85 #define NVMEM_IP_CONFIG_FILEID (8)
Kojto 20:30b6ed7bf8fd 86 #define NVMEM_IP_CONFIG_SHADOW_FILEID (9)
Kojto 20:30b6ed7bf8fd 87 #define NVMEM_BOOTLOADER_SP_FILEID (10)
Kojto 20:30b6ed7bf8fd 88 #define NVMEM_RM_FILEID (11)
Kojto 20:30b6ed7bf8fd 89
Kojto 20:30b6ed7bf8fd 90 /* NVMEM file ID - user files*/
Kojto 20:30b6ed7bf8fd 91 #define NVMEM_AES128_KEY_FILEID (12)
Kojto 20:30b6ed7bf8fd 92 #define NVMEM_SHARED_MEM_FILEID (13)
Kojto 20:30b6ed7bf8fd 93 #define NVMEM_USER_FILE_1_FILEID (14)
Kojto 20:30b6ed7bf8fd 94 #define NVMEM_USER_FILE_2_FILEID (15)
Kojto 20:30b6ed7bf8fd 95
Kojto 20:30b6ed7bf8fd 96 /* max entry in order to invalid nvmem */
Kojto 20:30b6ed7bf8fd 97 #define NVMEM_MAX_ENTRY (16)
Kojto 20:30b6ed7bf8fd 98
Kojto 20:30b6ed7bf8fd 99
Kojto 20:30b6ed7bf8fd 100 #endif