Dependents:   blinky_max32630fthr

Committer:
switches
Date:
Fri Dec 16 16:27:57 2016 +0000
Revision:
3:1198227e6421
Parent:
0:5c4d7b2438d3
Changed ADC scale for MAX32625 platforms to 1.2V full scale to match MAX32630 platforms

Who changed what in which revision?

UserRevisionLine numberNew contents of line
switches 0:5c4d7b2438d3 1 /* Copyright (c) 2010-2012 mbed.org, MIT License
switches 0:5c4d7b2438d3 2 *
switches 0:5c4d7b2438d3 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
switches 0:5c4d7b2438d3 4 * and associated documentation files (the "Software"), to deal in the Software without
switches 0:5c4d7b2438d3 5 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
switches 0:5c4d7b2438d3 6 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
switches 0:5c4d7b2438d3 7 * Software is furnished to do so, subject to the following conditions:
switches 0:5c4d7b2438d3 8 *
switches 0:5c4d7b2438d3 9 * The above copyright notice and this permission notice shall be included in all copies or
switches 0:5c4d7b2438d3 10 * substantial portions of the Software.
switches 0:5c4d7b2438d3 11 *
switches 0:5c4d7b2438d3 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
switches 0:5c4d7b2438d3 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
switches 0:5c4d7b2438d3 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
switches 0:5c4d7b2438d3 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
switches 0:5c4d7b2438d3 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
switches 0:5c4d7b2438d3 17 */
switches 0:5c4d7b2438d3 18
switches 0:5c4d7b2438d3 19 #ifndef WANDONGLE_H
switches 0:5c4d7b2438d3 20 #define WANDONGLE_H
switches 0:5c4d7b2438d3 21
switches 0:5c4d7b2438d3 22 #include "USBHostConf.h"
switches 0:5c4d7b2438d3 23
switches 0:5c4d7b2438d3 24 #ifdef USBHOST_3GMODULE
switches 0:5c4d7b2438d3 25
switches 0:5c4d7b2438d3 26 #include "USBHost.h"
switches 0:5c4d7b2438d3 27 #include "IUSBHostSerial.h"
switches 0:5c4d7b2438d3 28
switches 0:5c4d7b2438d3 29 #include "rtos.h"
switches 0:5c4d7b2438d3 30
switches 0:5c4d7b2438d3 31 #include "WANDongleSerialPort.h"
switches 0:5c4d7b2438d3 32 #include "WANDongleInitializer.h"
switches 0:5c4d7b2438d3 33 #include "IUSBEnumerator.h"
switches 0:5c4d7b2438d3 34
switches 0:5c4d7b2438d3 35 #define WANDONGLE_MAX_OUTEP_SIZE 64
switches 0:5c4d7b2438d3 36 #define WANDONGLE_MAX_INEP_SIZE 64
switches 0:5c4d7b2438d3 37
switches 0:5c4d7b2438d3 38 /** A class to use a WAN (3G/LTE) access dongle
switches 0:5c4d7b2438d3 39 *
switches 0:5c4d7b2438d3 40 */
switches 0:5c4d7b2438d3 41 class WANDongle : public IUSBEnumerator {
switches 0:5c4d7b2438d3 42 public:
switches 0:5c4d7b2438d3 43 /*
switches 0:5c4d7b2438d3 44 * Constructor
switches 0:5c4d7b2438d3 45 *
switches 0:5c4d7b2438d3 46 * @param rootdir mount name
switches 0:5c4d7b2438d3 47 */
switches 0:5c4d7b2438d3 48 WANDongle();
switches 0:5c4d7b2438d3 49
switches 0:5c4d7b2438d3 50 /*
switches 0:5c4d7b2438d3 51 * Destructor
switches 0:5c4d7b2438d3 52 */
switches 0:5c4d7b2438d3 53 virtual ~WANDongle();
switches 0:5c4d7b2438d3 54
switches 0:5c4d7b2438d3 55 /*
switches 0:5c4d7b2438d3 56 * Check if a serial port device is connected
switches 0:5c4d7b2438d3 57 *
switches 0:5c4d7b2438d3 58 * @return true if a serial device is connected
switches 0:5c4d7b2438d3 59 */
switches 0:5c4d7b2438d3 60 bool connected();
switches 0:5c4d7b2438d3 61
switches 0:5c4d7b2438d3 62 /*
switches 0:5c4d7b2438d3 63 * Try to connect device
switches 0:5c4d7b2438d3 64 *
switches 0:5c4d7b2438d3 65 * * @return true if connection was successful
switches 0:5c4d7b2438d3 66 */
switches 0:5c4d7b2438d3 67 bool tryConnect();
switches 0:5c4d7b2438d3 68
switches 0:5c4d7b2438d3 69 /*
switches 0:5c4d7b2438d3 70 * Disconnect device
switches 0:5c4d7b2438d3 71 *
switches 0:5c4d7b2438d3 72 * * @return true if disconnection was successful
switches 0:5c4d7b2438d3 73 */
switches 0:5c4d7b2438d3 74 bool disconnect();
switches 0:5c4d7b2438d3 75
switches 0:5c4d7b2438d3 76 int getDongleType();
switches 0:5c4d7b2438d3 77
switches 0:5c4d7b2438d3 78 IUSBHostSerial& getSerial(int index);
switches 0:5c4d7b2438d3 79 int getSerialCount();
switches 0:5c4d7b2438d3 80 bool addInitializer(WANDongleInitializer* pInitializer);
switches 0:5c4d7b2438d3 81
switches 0:5c4d7b2438d3 82 //From IUSBEnumerator
switches 0:5c4d7b2438d3 83
switches 0:5c4d7b2438d3 84 virtual void setVidPid(uint16_t vid, uint16_t pid);
switches 0:5c4d7b2438d3 85
switches 0:5c4d7b2438d3 86 virtual bool parseInterface(uint8_t intf_nb, uint8_t intf_class, uint8_t intf_subclass, uint8_t intf_protocol); //Must return true if the interface should be parsed
switches 0:5c4d7b2438d3 87
switches 0:5c4d7b2438d3 88 virtual bool useEndpoint(uint8_t intf_nb, ENDPOINT_TYPE type, ENDPOINT_DIRECTION dir); //Must return true if the endpoint will be used
switches 0:5c4d7b2438d3 89
switches 0:5c4d7b2438d3 90 protected:
switches 0:5c4d7b2438d3 91 USBHost * host;
switches 0:5c4d7b2438d3 92 USBDeviceConnected * dev;
switches 0:5c4d7b2438d3 93 bool dev_connected;
switches 0:5c4d7b2438d3 94
switches 0:5c4d7b2438d3 95 WANDongleInitializer* m_pInitializer;
switches 0:5c4d7b2438d3 96
switches 0:5c4d7b2438d3 97 void init();
switches 0:5c4d7b2438d3 98
switches 0:5c4d7b2438d3 99 WANDongleSerialPort m_serial[WANDONGLE_MAX_SERIAL_PORTS];
switches 0:5c4d7b2438d3 100 int m_serialCount;
switches 0:5c4d7b2438d3 101
switches 0:5c4d7b2438d3 102 int m_totalInitializers;
switches 0:5c4d7b2438d3 103 WANDongleInitializer* m_Initializers[WANDONGLE_MAX_INITIALIZERS];
switches 0:5c4d7b2438d3 104 };
switches 0:5c4d7b2438d3 105
switches 0:5c4d7b2438d3 106 #endif /* USBHOST_3GMODULE */
switches 0:5c4d7b2438d3 107
switches 0:5c4d7b2438d3 108 #endif