Integrating the ublox LISA C200 modem

Fork of SprintUSBModemHTTPClientTest by Donatien Garnier

Committer:
sam_grove
Date:
Thu Sep 26 00:44:20 2013 -0500
Revision:
5:3f93dd1d4cb3
Exported program and replaced contents of the repo with the source
to build and debug using keil mdk. Libs NOT upto date are lwip, lwip-sys
and socket. these have newer versions under mbed_official but were starting
from a know working point

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sam_grove 5:3f93dd1d4cb3 1 /* Copyright (C) 2012 mbed.org, MIT License
sam_grove 5:3f93dd1d4cb3 2 *
sam_grove 5:3f93dd1d4cb3 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
sam_grove 5:3f93dd1d4cb3 4 * and associated documentation files (the "Software"), to deal in the Software without restriction,
sam_grove 5:3f93dd1d4cb3 5 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
sam_grove 5:3f93dd1d4cb3 6 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
sam_grove 5:3f93dd1d4cb3 7 * furnished to do so, subject to the following conditions:
sam_grove 5:3f93dd1d4cb3 8 *
sam_grove 5:3f93dd1d4cb3 9 * The above copyright notice and this permission notice shall be included in all copies or
sam_grove 5:3f93dd1d4cb3 10 * substantial portions of the Software.
sam_grove 5:3f93dd1d4cb3 11 *
sam_grove 5:3f93dd1d4cb3 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
sam_grove 5:3f93dd1d4cb3 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
sam_grove 5:3f93dd1d4cb3 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
sam_grove 5:3f93dd1d4cb3 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
sam_grove 5:3f93dd1d4cb3 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
sam_grove 5:3f93dd1d4cb3 17 */
sam_grove 5:3f93dd1d4cb3 18 #ifndef __ARCH_SYS_ARCH_H__
sam_grove 5:3f93dd1d4cb3 19 #define __ARCH_SYS_ARCH_H__
sam_grove 5:3f93dd1d4cb3 20
sam_grove 5:3f93dd1d4cb3 21 #include "lwip/opt.h"
sam_grove 5:3f93dd1d4cb3 22
sam_grove 5:3f93dd1d4cb3 23 #if NO_SYS == 0
sam_grove 5:3f93dd1d4cb3 24 #include "cmsis_os.h"
sam_grove 5:3f93dd1d4cb3 25
sam_grove 5:3f93dd1d4cb3 26 // === SEMAPHORE ===
sam_grove 5:3f93dd1d4cb3 27 typedef struct {
sam_grove 5:3f93dd1d4cb3 28 osSemaphoreId id;
sam_grove 5:3f93dd1d4cb3 29 osSemaphoreDef_t def;
sam_grove 5:3f93dd1d4cb3 30 #ifdef CMSIS_OS_RTX
sam_grove 5:3f93dd1d4cb3 31 uint32_t data[2];
sam_grove 5:3f93dd1d4cb3 32 #endif
sam_grove 5:3f93dd1d4cb3 33 } sys_sem_t;
sam_grove 5:3f93dd1d4cb3 34
sam_grove 5:3f93dd1d4cb3 35 #define sys_sem_valid(x) (((*x).id == NULL) ? 0 : 1)
sam_grove 5:3f93dd1d4cb3 36 #define sys_sem_set_invalid(x) ( (*x).id = NULL)
sam_grove 5:3f93dd1d4cb3 37
sam_grove 5:3f93dd1d4cb3 38 // === MUTEX ===
sam_grove 5:3f93dd1d4cb3 39 typedef struct {
sam_grove 5:3f93dd1d4cb3 40 osMutexId id;
sam_grove 5:3f93dd1d4cb3 41 osMutexDef_t def;
sam_grove 5:3f93dd1d4cb3 42 #ifdef CMSIS_OS_RTX
sam_grove 5:3f93dd1d4cb3 43 int32_t data[3];
sam_grove 5:3f93dd1d4cb3 44 #endif
sam_grove 5:3f93dd1d4cb3 45 } sys_mutex_t;
sam_grove 5:3f93dd1d4cb3 46
sam_grove 5:3f93dd1d4cb3 47 // === MAIL BOX ===
sam_grove 5:3f93dd1d4cb3 48 #define MB_SIZE 8
sam_grove 5:3f93dd1d4cb3 49
sam_grove 5:3f93dd1d4cb3 50 typedef struct {
sam_grove 5:3f93dd1d4cb3 51 osMessageQId id;
sam_grove 5:3f93dd1d4cb3 52 osMessageQDef_t def;
sam_grove 5:3f93dd1d4cb3 53 #ifdef CMSIS_OS_RTX
sam_grove 5:3f93dd1d4cb3 54 uint32_t queue[MB_SIZE];
sam_grove 5:3f93dd1d4cb3 55 #endif
sam_grove 5:3f93dd1d4cb3 56 } sys_mbox_t;
sam_grove 5:3f93dd1d4cb3 57
sam_grove 5:3f93dd1d4cb3 58 #define SYS_MBOX_NULL ((uint32_t) NULL)
sam_grove 5:3f93dd1d4cb3 59 #define sys_mbox_valid(x) (((*x).id == NULL) ? 0 : 1 )
sam_grove 5:3f93dd1d4cb3 60 #define sys_mbox_set_invalid(x) ( (*x).id = NULL )
sam_grove 5:3f93dd1d4cb3 61
sam_grove 5:3f93dd1d4cb3 62 #if ((DEFAULT_RAW_RECVMBOX_SIZE) > (MB_SIZE)) || \
sam_grove 5:3f93dd1d4cb3 63 ((DEFAULT_UDP_RECVMBOX_SIZE) > (MB_SIZE)) || \
sam_grove 5:3f93dd1d4cb3 64 ((DEFAULT_TCP_RECVMBOX_SIZE) > (MB_SIZE)) || \
sam_grove 5:3f93dd1d4cb3 65 ((DEFAULT_ACCEPTMBOX_SIZE) > (MB_SIZE)) || \
sam_grove 5:3f93dd1d4cb3 66 ((TCPIP_MBOX_SIZE) > (MB_SIZE))
sam_grove 5:3f93dd1d4cb3 67 # error Mailbox size not supported
sam_grove 5:3f93dd1d4cb3 68 #endif
sam_grove 5:3f93dd1d4cb3 69
sam_grove 5:3f93dd1d4cb3 70 // === THREAD ===
sam_grove 5:3f93dd1d4cb3 71 typedef struct {
sam_grove 5:3f93dd1d4cb3 72 osThreadId id;
sam_grove 5:3f93dd1d4cb3 73 osThreadDef_t def;
sam_grove 5:3f93dd1d4cb3 74 } sys_thread_data_t;
sam_grove 5:3f93dd1d4cb3 75 typedef sys_thread_data_t* sys_thread_t;
sam_grove 5:3f93dd1d4cb3 76
sam_grove 5:3f93dd1d4cb3 77 #define SYS_THREAD_POOL_N 6
sam_grove 5:3f93dd1d4cb3 78 #define SYS_DEFAULT_THREAD_STACK_DEPTH DEFAULT_STACK_SIZE
sam_grove 5:3f93dd1d4cb3 79
sam_grove 5:3f93dd1d4cb3 80 // === PROTECTION ===
sam_grove 5:3f93dd1d4cb3 81 typedef int sys_prot_t;
sam_grove 5:3f93dd1d4cb3 82
sam_grove 5:3f93dd1d4cb3 83 #else
sam_grove 5:3f93dd1d4cb3 84 #ifdef __cplusplus
sam_grove 5:3f93dd1d4cb3 85 extern "C" {
sam_grove 5:3f93dd1d4cb3 86 #endif
sam_grove 5:3f93dd1d4cb3 87
sam_grove 5:3f93dd1d4cb3 88 /** \brief Init systick to 1ms rate
sam_grove 5:3f93dd1d4cb3 89 *
sam_grove 5:3f93dd1d4cb3 90 * This init the systick to 1ms rate. This function is only used in standalone
sam_grove 5:3f93dd1d4cb3 91 * systems.
sam_grove 5:3f93dd1d4cb3 92 */
sam_grove 5:3f93dd1d4cb3 93 void SysTick_Init(void);
sam_grove 5:3f93dd1d4cb3 94
sam_grove 5:3f93dd1d4cb3 95
sam_grove 5:3f93dd1d4cb3 96 /** \brief Get the current systick time in milliSeconds
sam_grove 5:3f93dd1d4cb3 97 *
sam_grove 5:3f93dd1d4cb3 98 * Returns the current systick time in milliSeconds. This function is only
sam_grove 5:3f93dd1d4cb3 99 * used in standalone systems.
sam_grove 5:3f93dd1d4cb3 100 *
sam_grove 5:3f93dd1d4cb3 101 * /returns current systick time in milliSeconds
sam_grove 5:3f93dd1d4cb3 102 */
sam_grove 5:3f93dd1d4cb3 103 uint32_t SysTick_GetMS(void);
sam_grove 5:3f93dd1d4cb3 104
sam_grove 5:3f93dd1d4cb3 105 /** \brief Delay for the specified number of milliSeconds
sam_grove 5:3f93dd1d4cb3 106 *
sam_grove 5:3f93dd1d4cb3 107 * For standalone systems. This function will block for the specified
sam_grove 5:3f93dd1d4cb3 108 * number of milliSconds. For RTOS based systems, this function will delay
sam_grove 5:3f93dd1d4cb3 109 * the task by the specified number of milliSeconds.
sam_grove 5:3f93dd1d4cb3 110 *
sam_grove 5:3f93dd1d4cb3 111 * \param[in] ms Time in milliSeconds to delay
sam_grove 5:3f93dd1d4cb3 112 */
sam_grove 5:3f93dd1d4cb3 113 void osDelay(uint32_t ms);
sam_grove 5:3f93dd1d4cb3 114
sam_grove 5:3f93dd1d4cb3 115 #ifdef __cplusplus
sam_grove 5:3f93dd1d4cb3 116 }
sam_grove 5:3f93dd1d4cb3 117 #endif
sam_grove 5:3f93dd1d4cb3 118 #endif
sam_grove 5:3f93dd1d4cb3 119
sam_grove 5:3f93dd1d4cb3 120 #endif /* __ARCH_SYS_ARCH_H__ */