ACKme Logo WiConnect Host Library- API Reference Guide
 
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
sdk.h
1 
29 #pragma once
30 
31 
32 #define MBED_SDK
33 
34 #include "mbed.h"
35 
36 
37 
38 
39 namespace wiconnect
40 {
41 
46 #define WICONNECT_ASYNC_TIMER_ENABLED
47 
51 #define WICONNECT_ENABLE_MALLOC
52 
56 #define WICONNECT_SERIAL_RX_BUFFER
57 
61 #define WICONNECT_USE_DEFAULT_STRING_BUFFERS
62 
67 #define WICONNECT_GPIO_IRQ_ENABLED
68 
73 #define WICONNECT_DEFAULT_MALLOC malloc
74 
78 #define WICONNECT_DEFAULT_FREE free
79 
84 #define WICONNECT_DEFAULT_BAUD 115200
85 
89 #define WICONNECT_DEFAULT_TIMEOUT 3000 // ms
90 
94 #define WICONNECT_MAX_QUEUED_COMMANDS 8
95 
99 #define WICONNECT_DEFAULT_COMMAND_PROCESSING_PERIOD 50 // ms
100 
105 #define WICONNECT_DEFAULT_NONBLOCKING false
106 
111 #define WICONNECT_ENABLE_DEBUGGING
112 
113 
114 // ----------------------------------------------------------------------------
115 
116 #define WICONNECT_GPIO_BASE_CLASS : DigitalOut
117 #define WICONNECT_SERIAL_BASE_CLASS : RawSerial
118 #define WICONNECT_PERIODIC_TIMER_BASE_CLASS : Ticker
119 #define WICONNECT_EXTERNAL_INTERRUPT_GPIO_BASE_CLASS : InterruptIn
120 
121 #define WICONNECT_MAX_PIN_IRQ_HANDLERS 3
122 
123 
128 #define PIN_NC NC
129 
134 typedef PinName Pin;
135 
141 {
142 public:
143  Pin rx;
144  Pin tx;
145  Pin cts;
146  Pin rts;
147  int baud;
148  void *serialRxBuffer;
149  int serialRxBufferSize;
150 
151  SerialConfig(Pin rx, Pin tx, Pin cts, Pin rts, int baud, int serialRxBufferSize, void *serialRxBuffer = NULL)
152  {
153  this->rx =rx;
154  this->tx =tx;
155  this->cts =cts;
156  this->rts =rts;
157  this->baud = baud;
158  this->serialRxBuffer =serialRxBuffer;
159  this->serialRxBufferSize =serialRxBufferSize;
160  }
161 
162  SerialConfig(Pin rx, Pin tx, int serialRxBufferSize, void *serialRxBuffer = NULL)
163  {
164  this->rx =rx;
165  this->tx =tx;
166  this->cts = PIN_NC;
167  this->rts = PIN_NC;
168  this->baud = WICONNECT_DEFAULT_BAUD;
169  this->serialRxBuffer =serialRxBuffer;
170  this->serialRxBufferSize =serialRxBufferSize;
171  }
172 
173  SerialConfig(Pin rx, Pin tx)
174  {
175  this->rx =rx;
176  this->tx =tx;
177  this->cts =PIN_NC;
178  this->rts =PIN_NC;
179  this->baud = WICONNECT_DEFAULT_BAUD;
180  this->serialRxBuffer =NULL;
181  this->serialRxBufferSize =0;
182  }
183 
184 };
185 
186 
191 #define delayMs(ms) wait_ms(ms)
192 
193 
194 
195 
196 }
Host<->Wiconnect Module serial configuration.
Definition: sdk.h:140
PinName Pin
Pin name on HOST.
Definition: sdk.h:134
#define WICONNECT_DEFAULT_BAUD
The default Host<->Wiconnect Module serial BAUD rate.
Definition: sdk.h:84
#define PIN_NC
Default value for a pin, Not connected.
Definition: sdk.h:128