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_DEFAULT_MALLOC malloc
68 
72 #define WICONNECT_DEFAULT_FREE free
73 
78 #define WICONNECT_DEFAULT_BAUD 115200
79 
83 #define WICONNECT_DEFAULT_TIMEOUT 3000 // ms
84 
88 #define WICONNECT_MAX_QUEUED_COMMANDS 8
89 
93 #define WICONNECT_DEFAULT_COMMAND_PROCESSING_PERIOD 50 // ms
94 
99 #define WICONNECT_DEFAULT_NONBLOCKING false
100 
101 
102 
103 // ----------------------------------------------------------------------------
104 
105 #define WICONNECT_GPIO_BASE_CLASS : DigitalOut
106 #define WICONNECT_SERIAL_BASE_CLASS : RawSerial
107 #define WICONNECT_PERIODIC_TIMER_BASE_CLASS : Ticker
108 #define WICONNECT_EXTERNAL_INTERRUPT_GPIO_BASE_CLASS : InterruptIn
109 
110 #define WICONNECT_MAX_PIN_IRQ_HANDLERS 3
111 
112 
117 #define PIN_NC NC
118 
123 typedef PinName Pin;
124 
130 {
131 public:
132  Pin rx;
133  Pin tx;
134  Pin cts;
135  Pin rts;
136  int baud;
137  void *serialRxBuffer;
138  int serialRxBufferSize;
139 
140  SerialConfig(Pin rx, Pin tx, Pin cts, Pin rts, int baud, int serialRxBufferSize, void *serialRxBuffer = NULL)
141  {
142  this->rx =rx;
143  this->tx =tx;
144  this->cts =cts;
145  this->rts =rts;
146  this->baud = baud;
147  this->serialRxBuffer =serialRxBuffer;
148  this->serialRxBufferSize =serialRxBufferSize;
149  }
150 
151  SerialConfig(Pin rx, Pin tx, int serialRxBufferSize, void *serialRxBuffer = NULL)
152  {
153  this->rx =rx;
154  this->tx =tx;
155  this->cts = PIN_NC;
156  this->rts = PIN_NC;
157  this->baud = WICONNECT_DEFAULT_BAUD;
158  this->serialRxBuffer =serialRxBuffer;
159  this->serialRxBufferSize =serialRxBufferSize;
160  }
161 
162  SerialConfig(Pin rx, Pin tx)
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 =NULL;
170  this->serialRxBufferSize =0;
171  }
172 
173 };
174 
175 
180 #define delayMs(ms) wait_ms(ms)
181 
182 
183 
184 
185 }
Host<->Wiconnect Module serial configuration.
Definition: sdk.h:129
PinName Pin
Pin name on HOST.
Definition: sdk.h:123
#define WICONNECT_DEFAULT_BAUD
The default Host<->Wiconnect Module serial BAUD rate.
Definition: sdk.h:78
#define PIN_NC
Default value for a pin, Not connected.
Definition: sdk.h:117