GainSpan Wi-Fi library see: http://mbed.org/users/gsfan/notebook/gainspan_wifi/

Dependents:   GSwifi_httpd GSwifi_websocket GSwifi_tcpclient GSwifi_tcpserver ... more

Fork of GSwifi by gs fan

GainSpan Wi-Fi library

The GS1011 is an ultra low power 802.11b wireless module from GainSpan.

see: http://mbed.org/users/gsfan/notebook/gainspan_wifi/

/media/uploads/gsfan/gs_im_002.jpg /media/uploads/gsfan/gs1011m_2.jpg

ゲインスパン Wi-Fi モジュール ライブラリ

ゲインスパン社の低電力 Wi-Fiモジュール(無線LAN) GS1011 シリーズ用のライブラリです。

解説: http://mbed.org/users/gsfan/notebook/gainspan_wifi/

Files at this revision

API Documentation at this revision

Comitter:
gsfan
Date:
Wed Mar 13 01:22:38 2013 +0000
Parent:
32:e19538c1f13d
Child:
34:f5f40c92af00
Commit message:
support FRDM KL25Z

Changed in this revision

GSwifi.cpp Show annotated file Show diff for this revision Revisions of this file
GSwifi.h Show annotated file Show diff for this revision Revisions of this file
GSwifi_conf.h Show annotated file Show diff for this revision Revisions of this file
--- a/GSwifi.cpp	Tue Feb 26 07:39:58 2013 +0000
+++ b/GSwifi.cpp	Wed Mar 13 01:22:38 2013 +0000
@@ -58,6 +58,7 @@
     _reset = 0;
     _gs.baud(baud);
     _gs.attach(this, &GSwifi::isr_recv, Serial::RxIrq);
+    _rts = false;
 #if defined(TARGET_LPC1768) || defined(TARGET_LPC2368)
     if (p_cts == p12) { // CTS input (P0_17)
         LPC_UART1->MCR |= (1<<7); // CTSEN
@@ -69,8 +70,6 @@
         LPC_PINCON->PINSEL1 &= ~(3 << 12);
         LPC_PINCON->PINSEL1 |= (1 << 12); // UART RTS
         _rts = true;
-    } else {
-        _rts = false;
     }
 #elif defined(TARGET_LPC11U24)
     if (p_cts == p21) { // CTS input (P0_7)
@@ -83,8 +82,6 @@
         LPC_IOCON->PIO0_17 &= ~0x07;
         LPC_IOCON->PIO0_17 |= 0x01; // UART RTS
         _rts = true;
-    } else {
-        _rts = false;
     }
 #endif
 
@@ -116,7 +113,7 @@
     _reconnect_count = 0;
     _buf_cmd.flush();
 
-    wait_ms(10);
+    wait_ms(100);
     _reset.input(); // high
     _reset.mode(PullUp);
     wait_ms(500);
@@ -126,16 +123,9 @@
 void GSwifi::isr_recv () {
     static int len, mode;
     static char tmp[20];
-    char flg, dat;
-    
-#if defined(TARGET_LPC1768) || defined(TARGET_LPC2368)
-    flg = LPC_UART1->LSR;
-#elif defined(TARGET_LPC11U24)
-    flg = LPC_USART->LSR;
-#endif
+    char dat;
+
     dat = _gs_getc();
-    
-    if (flg & ((1 << 7)|(1 << 3)|(1 << 4))) return;
 #ifdef DEBUG_VIEW
     if (dat >= 0x20 && dat < 0x7f) {
         DBG("%c_", dat);
--- a/GSwifi.h	Tue Feb 26 07:39:58 2013 +0000
+++ b/GSwifi.h	Wed Mar 13 01:22:38 2013 +0000
@@ -40,8 +40,10 @@
 #elif defined(TARGET_LPC11U24)
 #define _gs_getc() LPC_USART->RBR
 #define _gs_putc(c) while(!(LPC_USART->LSR & (1<<5))); LPC_USART->THR = c
+#elif defined(TARGET_KL25Z)
+#error "no support GS_UART_DIRECT"
 #endif
-#else
+#else // GS_UART_DIRECT
 #define _gs_getc() _gs.getc()
 #define _gs_putc(c) _gs.putc(c)
 #endif
--- a/GSwifi_conf.h	Tue Feb 26 07:39:58 2013 +0000
+++ b/GSwifi_conf.h	Wed Mar 13 01:22:38 2013 +0000
@@ -3,7 +3,7 @@
 
 #define GS_BAUD 9600  // default module baud
 
-#define GS_UART_DIRECT
+//#define GS_UART_DIRECT
 #define GS_BULK
 
 #define GS_DNSNAME "setup.local"
@@ -18,6 +18,8 @@
 #define GS_DATA_SIZE 1024
 #elif defined(TARGET_LPC11U24)
 #define GS_DATA_SIZE 512
+#elif defined(TARGET_KL25Z)
+#define GS_DATA_SIZE 512
 #endif
 
 #define GS_SYSLOG // log for stdout