Board support library for C027
Dependents: IoTWorkshopLCD IoTWorkshopBuzzer IoTWorkshopSensors C027_USSDTest ... more
Fork of C027 by
C027.h@20:89c45165ee87, 2014-05-09 (annotated)
- Committer:
- mazgch
- Date:
- Fri May 09 11:25:28 2014 +0000
- Revision:
- 20:89c45165ee87
- Parent:
- 19:61d31c12230d
Remove pinlist (is now part of the platform)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mazgch | 2:b7bd3660ff64 | 1 | /* Platform header file, for the u-blox C27-C20/U20/G35 |
mazgch | 2:b7bd3660ff64 | 2 | * mbed Internet of Things Starter Kit |
mazgch | 2:b7bd3660ff64 | 3 | * http://mbed.org/platforms/u-blox-C027/ |
mazgch | 2:b7bd3660ff64 | 4 | * |
mazgch | 2:b7bd3660ff64 | 5 | */ |
mazgch | 2:b7bd3660ff64 | 6 | |
mazgch | 2:b7bd3660ff64 | 7 | #pragma once |
mazgch | 2:b7bd3660ff64 | 8 | |
mazgch | 6:e11bf54dd344 | 9 | #include "mbed.h" |
mazgch | 5:ff17f16cf70a | 10 | |
mazgch | 20:89c45165ee87 | 11 | #if !defined(TARGET_UBLOX_C027) |
mazgch | 19:61d31c12230d | 12 | #warning "this library is indended to be used only with the C027 board" |
mazgch | 19:61d31c12230d | 13 | #else |
mazgch | 19:61d31c12230d | 14 | |
mazgch | 16:3ce62caf4518 | 15 | //#define C027_REVA // select this define if you use revision A boards. |
mazgch | 7:e3eab86f1de9 | 16 | |
mazgch | 18:06d5a702779c | 17 | /** C027 Helper class to control the power supply and interface |
mazgch | 18:06d5a702779c | 18 | signals of the extended peripherials |
mazgch | 18:06d5a702779c | 19 | */ |
mazgch | 6:e11bf54dd344 | 20 | class C027 |
mazgch | 6:e11bf54dd344 | 21 | { |
mazgch | 6:e11bf54dd344 | 22 | public: |
mazgch | 18:06d5a702779c | 23 | /** Constructor, this function initialized the control pins. |
mazgch | 18:06d5a702779c | 24 | */ |
mazgch | 6:e11bf54dd344 | 25 | C027(); |
mazgch | 6:e11bf54dd344 | 26 | |
mazgch | 18:06d5a702779c | 27 | /** Enable the power supply of the Modem (MDM) |
mazgch | 18:06d5a702779c | 28 | */ |
mazgch | 6:e11bf54dd344 | 29 | void mdmPower(bool enable); |
mazgch | 18:06d5a702779c | 30 | |
mazgch | 18:06d5a702779c | 31 | /** Activate the Usb Interface on LISA-C or LISA-U modems. For LISA-C this |
mazgch | 18:06d5a702779c | 32 | function must be called before its supply is enabled. |
mazgch | 18:06d5a702779c | 33 | \param enable true if supply should be truned on, false if off |
mazgch | 18:06d5a702779c | 34 | */ |
mazgch | 18:06d5a702779c | 35 | void mdmUsbEnable(bool enable); |
mazgch | 18:06d5a702779c | 36 | |
mazgch | 18:06d5a702779c | 37 | /** Reset the Modem |
mazgch | 18:06d5a702779c | 38 | \attention use with care and only a last resort. |
mazgch | 18:06d5a702779c | 39 | */ |
mazgch | 6:e11bf54dd344 | 40 | void mdmReset(void); |
mazgch | 18:06d5a702779c | 41 | |
mazgch | 18:06d5a702779c | 42 | /** Wakeup the Modem when in off mode. |
mazgch | 18:06d5a702779c | 43 | */ |
mazgch | 8:a356376db984 | 44 | void mdmWakeup(void); |
mazgch | 18:06d5a702779c | 45 | |
mazgch | 18:06d5a702779c | 46 | /** Some Modem can be commanded in sleep mode |
mazgch | 18:06d5a702779c | 47 | by setting the power pin low for a long period. |
mazgch | 18:06d5a702779c | 48 | */ |
mazgch | 8:a356376db984 | 49 | void mdmSleep(void); |
mazgch | 18:06d5a702779c | 50 | |
mazgch | 18:06d5a702779c | 51 | /** Enable the GPS Power supply |
mazgch | 18:06d5a702779c | 52 | \param enable true if supply should be truned on, false if off. |
mazgch | 18:06d5a702779c | 53 | */ |
mazgch | 7:e3eab86f1de9 | 54 | void gpsPower(bool enable); |
mazgch | 18:06d5a702779c | 55 | |
mazgch | 18:06d5a702779c | 56 | /** Reset the GPS |
mazgch | 18:06d5a702779c | 57 | \attention use with care and only a last resort. |
mazgch | 18:06d5a702779c | 58 | */ |
mazgch | 6:e11bf54dd344 | 59 | void gpsReset(void); |
mazgch | 6:e11bf54dd344 | 60 | |
mazgch | 6:e11bf54dd344 | 61 | private: |
mazgch | 7:e3eab86f1de9 | 62 | // modem pins |
mazgch | 18:06d5a702779c | 63 | DigitalOut mdmEn; //!< The modem LDO enable pin |
mazgch | 18:06d5a702779c | 64 | DigitalOut mdmRst; //!< The modem reset pin |
mazgch | 18:06d5a702779c | 65 | DigitalOut mdmPwrOn; //!< The power constrol pin of the modem |
mazgch | 18:06d5a702779c | 66 | DigitalOut mdmLvlOe; //!< The modem IO level shifter output enable (UART, GPIOs, active low) |
mazgch | 18:06d5a702779c | 67 | DigitalOut mdmILvlOe; //!< The modem I2C level shifter output enable (I2C, active high) |
mazgch | 18:06d5a702779c | 68 | DigitalOut mdmUsbDet; //!< The USB interface enable (active high) |
mazgch | 18:06d5a702779c | 69 | bool mdmIsEnabled; //!< Flag to remember if modem was enabled |
mazgch | 18:06d5a702779c | 70 | bool mdmUseUsb; //!< Flag to remember if USB pins were enabled |
mazgch | 7:e3eab86f1de9 | 71 | // gps pins |
mazgch | 18:06d5a702779c | 72 | DigitalOut gpsEn; //!< The GPS LDO enable pin |
mazgch | 18:06d5a702779c | 73 | DigitalOut gpsRst; //!< The GPS reset pin |
mazgch | 18:06d5a702779c | 74 | bool gpsIsEnabled; //!< Flag to remember if GPS was enabled |
mazgch | 6:e11bf54dd344 | 75 | }; |
mazgch | 19:61d31c12230d | 76 | #endif |