Host library for controlling a WiConnect enabled Wi-Fi module.
Dependents: wiconnect-ota_example wiconnect-web_setup_example wiconnect-test-console wiconnect-tcp_server_example ... more
sdk/mbed/sdk.h
- Committer:
- dan_ackme
- Date:
- 2014-08-13
- Revision:
- 13:2b51f5267c92
- Parent:
- 11:ea484e1b7fc4
- Child:
- 16:7f1d6d359787
File content as of revision 13:2b51f5267c92:
/* * Copyright 2014, ACKme Networks * All Rights Reserved. * * This is UNPUBLISHED PROPRIETARY SOURCE CODE of ACKme Networks; * the contents of this file may not be disclosed to third parties, copied * or duplicated in any form, in whole or in part, without the prior * written permission of ACKme Networks. */ #pragma once #define MBED_SDK #include "mbed.h" namespace wiconnect { /** * @ingroup api_core_macro * @brief When defined enables asynchronous command processing */ #define WICONNECT_ASYNC_TIMER_ENABLED /** * @ingroup api_core_macro * @brief When defined enables user supplied dynamic memory allocation */ #define WICONNECT_ENABLE_MALLOC /** * @ingroup api_core_macro * @brief When defined enables Host<->Wiconnect Module serial RX buffering */ #define WICONNECT_SERIAL_RX_BUFFER /** * @ingroup api_core_macro * @brief When defined enables certain conversion API functions to use a default buffer to store string */ #define WICONNECT_USE_DEFAULT_STRING_BUFFERS /** * @ingroup api_core_macro * @brief When WICONNECT_ENABLE_MALLOC defined, this is the default malloc function */ #define WICONNECT_DEFAULT_MALLOC malloc /** * @ingroup api_core_macro * @brief When WICONNECT_ENABLE_MALLOC defined, this is the default free function */ #define WICONNECT_DEFAULT_FREE free /** * @ingroup api_core_macro * @brief The default Host<->Wiconnect Module serial BAUD rate */ #define WICONNECT_DEFAULT_BAUD 115200 /** * @ingroup api_core_macro * @brief The default command timeout (i.e max command executing time) */ #define WICONNECT_DEFAULT_TIMEOUT 3000 // ms /** * @ingroup api_core_macro * @brief When WICONNECT_ASYNC_TIMER_ENABLED, this specifies the max number of asynchronous commands that may be queued */ #define WICONNECT_MAX_QUEUED_COMMANDS 8 /** * @ingroup api_core_macro * @brief When WICONNECT_ASYNC_TIMER_ENABLED, this specifies the period in milliseconds commands should be processed */ #define WICONNECT_DEFAULT_COMMAND_PROCESSING_PERIOD 50 // ms /** * @ingroup api_core_macro * @brief The default blocking mode of the Library. */ #define WICONNECT_DEFAULT_NONBLOCKING false // ---------------------------------------------------------------------------- #define WICONNECT_GPIO_BASE_CLASS : DigitalOut #define WICONNECT_SERIAL_BASE_CLASS : RawSerial #define WICONNECT_PERIODIC_TIMER_BASE_CLASS : Ticker #define WICONNECT_EXTERNAL_INTERRUPT_GPIO_BASE_CLASS : InterruptIn #define WICONNECT_MAX_PIN_IRQ_HANDLERS 3 /** * @ingroup api_core_macro * @brief Default value for a pin, Not connected */ #define PIN_NC NC /** * @ingroup api_core_types * @brief Pin name on HOST */ typedef PinName Pin; /** * @ingroup api_core_types * @brief Host<->Wiconnect Module serial configuration */ class SerialConfig { public: Pin rx; Pin tx; Pin cts; Pin rts; int baud; void *serialRxBuffer; int serialRxBufferSize; SerialConfig(Pin rx, Pin tx, Pin cts, Pin rts, int baud, int serialRxBufferSize, void *serialRxBuffer = NULL) { this->rx =rx; this->tx =tx; this->cts =cts; this->rts =rts; this->baud = baud; this->serialRxBuffer =serialRxBuffer; this->serialRxBufferSize =serialRxBufferSize; } SerialConfig(Pin rx, Pin tx, int serialRxBufferSize, void *serialRxBuffer = NULL) { this->rx =rx; this->tx =tx; this->cts = PIN_NC; this->rts = PIN_NC; this->baud = WICONNECT_DEFAULT_BAUD; this->serialRxBuffer =serialRxBuffer; this->serialRxBufferSize =serialRxBufferSize; } SerialConfig(Pin rx, Pin tx) { this->rx =rx; this->tx =tx; this->cts =PIN_NC; this->rts =PIN_NC; this->baud = WICONNECT_DEFAULT_BAUD; this->serialRxBuffer =NULL; this->serialRxBufferSize =0; } }; /** * @ingroup api_core_macro * @brief Function to stop processor for specified number of milliseconds */ #define delayMs(ms) wait_ms(ms) }