Initial commit

Dependencies:   FastPWM

Committer:
lypinator
Date:
Wed Sep 16 01:11:49 2020 +0000
Revision:
0:bb348c97df44
Added PWM

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lypinator 0:bb348c97df44 1 /* mbed Microcontroller Library
lypinator 0:bb348c97df44 2 * Copyright (c) 2006-2013 ARM Limited
lypinator 0:bb348c97df44 3 *
lypinator 0:bb348c97df44 4 * Licensed under the Apache License, Version 2.0 (the "License");
lypinator 0:bb348c97df44 5 * you may not use this file except in compliance with the License.
lypinator 0:bb348c97df44 6 * You may obtain a copy of the License at
lypinator 0:bb348c97df44 7 *
lypinator 0:bb348c97df44 8 * http://www.apache.org/licenses/LICENSE-2.0
lypinator 0:bb348c97df44 9 *
lypinator 0:bb348c97df44 10 * Unless required by applicable law or agreed to in writing, software
lypinator 0:bb348c97df44 11 * distributed under the License is distributed on an "AS IS" BASIS,
lypinator 0:bb348c97df44 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
lypinator 0:bb348c97df44 13 * See the License for the specific language governing permissions and
lypinator 0:bb348c97df44 14 * limitations under the License.
lypinator 0:bb348c97df44 15 */
lypinator 0:bb348c97df44 16 #include "ublox_low_level_api.h"
lypinator 0:bb348c97df44 17
lypinator 0:bb348c97df44 18 #include <stdbool.h>
lypinator 0:bb348c97df44 19 #include "gpio_api.h"
lypinator 0:bb348c97df44 20
lypinator 0:bb348c97df44 21 void ublox_board_init(void) {
lypinator 0:bb348c97df44 22 gpio_t gpio;
lypinator 0:bb348c97df44 23
lypinator 0:bb348c97df44 24 // Enable power to 3V3
lypinator 0:bb348c97df44 25 gpio_init_inout(&gpio, PWR3V3, PIN_OUTPUT, OpenDrain, 1);
lypinator 0:bb348c97df44 26
lypinator 0:bb348c97df44 27 // start with modem disabled
lypinator 0:bb348c97df44 28 gpio_init_out_ex(&gpio, MDMRST, 0);
lypinator 0:bb348c97df44 29 #if defined(TARGET_UBLOX_C030_R410M)
lypinator 0:bb348c97df44 30 gpio_init_inout(&gpio, MDMPWRON, PIN_OUTPUT, OpenDrain, 1);
lypinator 0:bb348c97df44 31 #else
lypinator 0:bb348c97df44 32 gpio_init_out_ex(&gpio, MDMPWRON, 0);
lypinator 0:bb348c97df44 33 #endif
lypinator 0:bb348c97df44 34 gpio_init_out_ex(&gpio, MDMRTS, 0);
lypinator 0:bb348c97df44 35 gpio_init_in_ex(&gpio, MDMCURRENTSENSE, PullNone);
lypinator 0:bb348c97df44 36
lypinator 0:bb348c97df44 37 #if !defined (TARGET_UBLOX_C030_R410M)
lypinator 0:bb348c97df44 38 // start with GNSS disabled, this is ONLY TEMPORARY and that once the HW issue with the GNSSEN pin on the R410M board is resolved then this line will become default for all platforms.
lypinator 0:bb348c97df44 39 gpio_init_inout(&gpio, GNSSEN, PIN_OUTPUT, PushPullNoPull, 0);
lypinator 0:bb348c97df44 40 #endif
lypinator 0:bb348c97df44 41
lypinator 0:bb348c97df44 42 // power on SD card
lypinator 0:bb348c97df44 43 gpio_init_out_ex(&gpio, SDPWRON, 1);
lypinator 0:bb348c97df44 44
lypinator 0:bb348c97df44 45 // led should be off
lypinator 0:bb348c97df44 46 gpio_init_out_ex(&gpio, LED1, 1);
lypinator 0:bb348c97df44 47 gpio_init_out_ex(&gpio, LED2, 1);
lypinator 0:bb348c97df44 48 gpio_init_out_ex(&gpio, LED3, 1);
lypinator 0:bb348c97df44 49 gpio_init_out_ex(&gpio, LED4, 1);
lypinator 0:bb348c97df44 50 }
lypinator 0:bb348c97df44 51
lypinator 0:bb348c97df44 52 // End Of File