mbed library sources, include can_api for nucleo-f091rc
Dependents: CanNucleoF0_example
Fork of mbed-src by
Diff: targets/hal/TARGET_NXP/TARGET_LPC176X/TARGET_UBLOX_C027/mbed_overrides.c
- Revision:
- 136:f4bb33e41288
- Parent:
- 134:4fb64af58963
- Child:
- 194:718a82ebba31
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/targets/hal/TARGET_NXP/TARGET_LPC176X/TARGET_UBLOX_C027/mbed_overrides.c Tue Mar 25 11:45:07 2014 +0000 @@ -0,0 +1,43 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2013 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "gpio_api.h" +#include "wait_api.h" + +// called before main +void mbed_sdk_init() +{ + gpio_t modemEn, modemRst, modemPwrOn, modemLvlOe, modemILvlOe, modemUsbDet; + gpio_t gpsEn, gpsRst, led, modemRts; + + // start with modem disabled + gpio_init_out_ex(&modemEn, MDMEN, 0); + gpio_init_out_ex(&modemRst, MDMRST, 1); + gpio_init_out_ex(&modemPwrOn, MDMPWRON, 1); + gpio_init_out_ex(&modemLvlOe, MDMLVLOE, 1); + gpio_init_out_ex(&modemILvlOe, MDMILVLOE, 0); + gpio_init_out_ex(&modemUsbDet, MDMUSBDET, 0); + gpio_init_out_ex(&modemRts, MDMRTS, 0); + // start with gps disabled + gpio_init_out_ex(&gpsEn, GPSEN, 0); + gpio_init_out_ex(&gpsRst, GPSRST, 1); + // led should be off + gpio_init_out_ex(&led, LED, 0); + + wait_ms(50); // when USB cable is inserted the interface chip issues + // multiple resets to the target CPU We wait here for a short period to + // prevent those resets from propagating to the modem and other + // components. +}