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 WANDONGLEINITIALIZER_H
switches 0:5c4d7b2438d3 20 #define WANDONGLEINITIALIZER_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 <stdint.h>
switches 0:5c4d7b2438d3 27
switches 0:5c4d7b2438d3 28 #include "USBHost.h"
switches 0:5c4d7b2438d3 29 #include "IUSBEnumerator.h"
switches 0:5c4d7b2438d3 30
switches 0:5c4d7b2438d3 31 // [TODO] move these declarations to a proper place
switches 0:5c4d7b2438d3 32 #define WANDONGLE_MAX_SERIAL_PORTS 2
switches 0:5c4d7b2438d3 33 #define WANDONGLE_MAX_INITIALIZERS 6
switches 0:5c4d7b2438d3 34
switches 0:5c4d7b2438d3 35 #define WAN_DONGLE_TYPE_UNKNOWN (-1)
switches 0:5c4d7b2438d3 36
switches 0:5c4d7b2438d3 37 class WANDongleInitializer : public IUSBEnumerator
switches 0:5c4d7b2438d3 38 {
switches 0:5c4d7b2438d3 39 protected:
switches 0:5c4d7b2438d3 40 WANDongleInitializer(USBHost* pHost) { m_pHost = pHost; }
switches 0:5c4d7b2438d3 41 USBHost* m_pHost;
switches 0:5c4d7b2438d3 42 uint8_t m_serialIntfMap[WANDONGLE_MAX_SERIAL_PORTS];
switches 0:5c4d7b2438d3 43
switches 0:5c4d7b2438d3 44 public:
switches 0:5c4d7b2438d3 45 virtual ~WANDongleInitializer() {}
switches 0:5c4d7b2438d3 46 virtual uint16_t getMSDVid() = 0;
switches 0:5c4d7b2438d3 47 virtual uint16_t getMSDPid() = 0;
switches 0:5c4d7b2438d3 48
switches 0:5c4d7b2438d3 49 virtual uint16_t getSerialVid() = 0;
switches 0:5c4d7b2438d3 50 virtual uint16_t getSerialPid() = 0;
switches 0:5c4d7b2438d3 51
switches 0:5c4d7b2438d3 52 virtual bool switchMode(USBDeviceConnected* pDev) = 0;
switches 0:5c4d7b2438d3 53
switches 0:5c4d7b2438d3 54 virtual USBEndpoint* getEp(USBDeviceConnected* pDev, int serialPortNumber, bool tx) {
switches 0:5c4d7b2438d3 55 return pDev->getEndpoint(m_serialIntfMap[serialPortNumber], BULK_ENDPOINT, tx ? OUT : IN, 0);
switches 0:5c4d7b2438d3 56 }
switches 0:5c4d7b2438d3 57
switches 0:5c4d7b2438d3 58 virtual int getSerialPortCount() = 0;
switches 0:5c4d7b2438d3 59
switches 0:5c4d7b2438d3 60 virtual void setVidPid(uint16_t vid, uint16_t pid) = 0;
switches 0:5c4d7b2438d3 61
switches 0:5c4d7b2438d3 62 virtual bool parseInterface(uint8_t intf_nb, uint8_t intf_class, uint8_t intf_subclass, uint8_t intf_protocol) = 0; //Must return true if the interface should be parsed
switches 0:5c4d7b2438d3 63
switches 0:5c4d7b2438d3 64 virtual bool useEndpoint(uint8_t intf_nb, ENDPOINT_TYPE type, ENDPOINT_DIRECTION dir) = 0; //Must return true if the endpoint will be used
switches 0:5c4d7b2438d3 65
switches 0:5c4d7b2438d3 66 virtual int getType() = 0;
switches 0:5c4d7b2438d3 67
switches 0:5c4d7b2438d3 68 virtual uint8_t getSerialIntf(int index) { return m_serialIntfMap[index]; }
switches 0:5c4d7b2438d3 69 };
switches 0:5c4d7b2438d3 70
switches 0:5c4d7b2438d3 71 #endif /* USBHOST_3GMODULE */
switches 0:5c4d7b2438d3 72
switches 0:5c4d7b2438d3 73 #endif