Board support library for C027

Dependents:   IoTWorkshopLCD IoTWorkshopBuzzer IoTWorkshopSensors C027_USSDTest ... more

Fork of C027 by u-blox

/media/uploads/ublox/c027_pinout_new.png

Committer:
mazgch
Date:
Tue Apr 08 12:15:07 2014 +0000
Revision:
16:3ce62caf4518
Parent:
14:e30f90b5447e
Child:
18:06d5a702779c
prepare for new native platform

Who changed what in which revision?

UserRevisionLine numberNew 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 16:3ce62caf4518 11 #ifdef TARGET_UBLOX_C027
mazgch 16:3ce62caf4518 12 // on the native platform the pins are already defined
mazgch 16:3ce62caf4518 13 #elif defined(TARGET_LPC1768)
mazgch 16:3ce62caf4518 14 // if not native we are using the pin definition file from this library
mazgch 16:3ce62caf4518 15 #include "C027_PinNames.h"
mazgch 16:3ce62caf4518 16 // we also need to override the mbed_die function
mazgch 16:3ce62caf4518 17 void mbed_die(void);
mazgch 16:3ce62caf4518 18 #else
mazgch 16:3ce62caf4518 19 #error "this library is indended to be used only with the C027 board"
mazgch 16:3ce62caf4518 20 #endif
mazgch 6:e11bf54dd344 21
mazgch 16:3ce62caf4518 22 //#define C027_REVA // select this define if you use revision A boards.
mazgch 7:e3eab86f1de9 23
mazgch 6:e11bf54dd344 24 class C027
mazgch 6:e11bf54dd344 25 {
mazgch 6:e11bf54dd344 26 public:
mazgch 6:e11bf54dd344 27 C027();
mazgch 6:e11bf54dd344 28
mazgch 6:e11bf54dd344 29 void mdmPower(bool enable);
mazgch 14:e30f90b5447e 30 void mdmUsbEnable(bool enable); // enable the USB interface
mazgch 6:e11bf54dd344 31 void mdmReset(void);
mazgch 8:a356376db984 32 void mdmWakeup(void);
mazgch 8:a356376db984 33 void mdmSleep(void);
mazgch 7:e3eab86f1de9 34 void gpsPower(bool enable);
mazgch 6:e11bf54dd344 35 void gpsReset(void);
mazgch 6:e11bf54dd344 36
mazgch 6:e11bf54dd344 37 private:
mazgch 7:e3eab86f1de9 38 // modem pins
mazgch 8:a356376db984 39 DigitalOut mdmEn;
mazgch 8:a356376db984 40 DigitalOut mdmRst;
mazgch 8:a356376db984 41 DigitalOut mdmPwrOn;
mazgch 8:a356376db984 42 DigitalOut mdmLvlOe;
mazgch 13:fb30e9923a7b 43 DigitalOut mdmILvlOe;
mazgch 8:a356376db984 44 DigitalOut mdmUsbDet;
mazgch 8:a356376db984 45 bool mdmIsEnabled;
mazgch 14:e30f90b5447e 46 bool mdmUseUsb;
mazgch 7:e3eab86f1de9 47 // gps pins
mazgch 8:a356376db984 48 DigitalOut gpsEn;
mazgch 8:a356376db984 49 DigitalOut gpsRst;
mazgch 8:a356376db984 50 bool gpsIsEnabled;
mazgch 6:e11bf54dd344 51 };