mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Fri Jan 31 09:00:05 2014 +0000
Revision:
81:a9456fdf72fa
Child:
83:5a6f638110fe
Synchronized with git revision 2a782f50677ef823f25764c76cfed1bec98740be

Full URL: https://github.com/mbedmicro/mbed/commit/2a782f50677ef823f25764c76cfed1bec98740be/

Remove unnecessary semicolons.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 81:a9456fdf72fa 1
mbed_official 81:a9456fdf72fa 2 #include "gpio_api.h"
mbed_official 81:a9456fdf72fa 3 #include "wait_api.h"
mbed_official 81:a9456fdf72fa 4
mbed_official 81:a9456fdf72fa 5 // called before main
mbed_official 81:a9456fdf72fa 6 void mbed_main()
mbed_official 81:a9456fdf72fa 7 {
mbed_official 81:a9456fdf72fa 8 gpio_t modemEn, modemRst, modemPwrOn, modemLvlOe, modemILvlOe, modemUsbDet;
mbed_official 81:a9456fdf72fa 9 gpio_t gpsEn, gpsRst, led, modemRts;
mbed_official 81:a9456fdf72fa 10
mbed_official 81:a9456fdf72fa 11 gpio_init(&modemEn, MDMEN, PIN_OUTPUT);
mbed_official 81:a9456fdf72fa 12 gpio_init(&modemRst, MDMRST, PIN_OUTPUT);
mbed_official 81:a9456fdf72fa 13 gpio_init(&modemPwrOn, MDMPWRON, PIN_OUTPUT);
mbed_official 81:a9456fdf72fa 14 gpio_init(&modemLvlOe, MDMLVLOE, PIN_OUTPUT);
mbed_official 81:a9456fdf72fa 15 gpio_init(&modemILvlOe, MDMILVLOE, PIN_OUTPUT);
mbed_official 81:a9456fdf72fa 16 gpio_init(&modemUsbDet, MDMUSBDET, PIN_OUTPUT);
mbed_official 81:a9456fdf72fa 17 gpio_init(&gpsEn, GPSEN, PIN_OUTPUT);
mbed_official 81:a9456fdf72fa 18 gpio_init(&gpsRst, GPSRST, PIN_OUTPUT);
mbed_official 81:a9456fdf72fa 19 gpio_init(&led, LED, PIN_OUTPUT);
mbed_official 81:a9456fdf72fa 20 gpio_init(&modemRts, MDMRTS, PIN_OUTPUT);
mbed_official 81:a9456fdf72fa 21
mbed_official 81:a9456fdf72fa 22 gpio_write(&led, 0); // LED1: 0=off
mbed_official 81:a9456fdf72fa 23 gpio_write(&modemRts, 0); // RTS: 0=ready to send
mbed_official 81:a9456fdf72fa 24 // we start with the gps disabled
mbed_official 81:a9456fdf72fa 25 gpio_write(&gpsEn, 0); // LDOEN: 1=on,0=off
mbed_official 81:a9456fdf72fa 26 gpio_write(&gpsRst, 0); // RESET: 0=reset,1=operating
mbed_official 81:a9456fdf72fa 27 // we start with the modem disabled
mbed_official 81:a9456fdf72fa 28 gpio_write(&modemLvlOe, 1); // LVLEN: 1=disabled (uart/gpio)
mbed_official 81:a9456fdf72fa 29 gpio_write(&modemILvlOe, 0); // ILVLEN: 0=disabled (i2c)
mbed_official 81:a9456fdf72fa 30 gpio_write(&modemUsbDet, 0); // USBDET: 0=disabled
mbed_official 81:a9456fdf72fa 31 gpio_write(&modemPwrOn, 1); // PWRON: 1=idle, 0=action
mbed_official 81:a9456fdf72fa 32 gpio_write(&modemEn, 0); // LDOEN: 1=on, 0=off
mbed_official 81:a9456fdf72fa 33 gpio_write(&modemRst, 0); // RESET: 0=reset, 1=operating
mbed_official 81:a9456fdf72fa 34
mbed_official 81:a9456fdf72fa 35 wait_ms(50); // when USB cable is inserted the interface chip issues
mbed_official 81:a9456fdf72fa 36 // multiple resets to the target CPU We wait here for a short period to
mbed_official 81:a9456fdf72fa 37 // prevent those resets from propagating to the modem and other
mbed_official 81:a9456fdf72fa 38 // components.
mbed_official 81:a9456fdf72fa 39 }