Use MPU9250 with nRF51822

Dependencies:   eMPL_MPU

Fork of Seeed_Tiny_BLE_Flash by Darren Huang

Committer:
yihui
Date:
Thu Dec 10 08:00:18 2015 +0000
Revision:
5:9b240c1d5251
get 9dof data from mpu9250

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yihui 5:9b240c1d5251 1 /* mbed Microcontroller Library
yihui 5:9b240c1d5251 2 * Copyright (c) 2006-2013 ARM Limited
yihui 5:9b240c1d5251 3 *
yihui 5:9b240c1d5251 4 * Licensed under the Apache License, Version 2.0 (the "License");
yihui 5:9b240c1d5251 5 * you may not use this file except in compliance with the License.
yihui 5:9b240c1d5251 6 * You may obtain a copy of the License at
yihui 5:9b240c1d5251 7 *
yihui 5:9b240c1d5251 8 * http://www.apache.org/licenses/LICENSE-2.0
yihui 5:9b240c1d5251 9 *
yihui 5:9b240c1d5251 10 * Unless required by applicable law or agreed to in writing, software
yihui 5:9b240c1d5251 11 * distributed under the License is distributed on an "AS IS" BASIS,
yihui 5:9b240c1d5251 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
yihui 5:9b240c1d5251 13 * See the License for the specific language governing permissions and
yihui 5:9b240c1d5251 14 * limitations under the License.
yihui 5:9b240c1d5251 15 */
yihui 5:9b240c1d5251 16 #ifndef MBED_GPIO_API_H
yihui 5:9b240c1d5251 17 #define MBED_GPIO_API_H
yihui 5:9b240c1d5251 18
yihui 5:9b240c1d5251 19 #include "device.h"
yihui 5:9b240c1d5251 20
yihui 5:9b240c1d5251 21 #ifdef __cplusplus
yihui 5:9b240c1d5251 22 extern "C" {
yihui 5:9b240c1d5251 23 #endif
yihui 5:9b240c1d5251 24
yihui 5:9b240c1d5251 25 /* Set the given pin as GPIO
yihui 5:9b240c1d5251 26 * @param pin The pin to be set as GPIO
yihui 5:9b240c1d5251 27 * @return The GPIO port mask for this pin
yihui 5:9b240c1d5251 28 **/
yihui 5:9b240c1d5251 29 uint32_t gpio_set(PinName pin);
yihui 5:9b240c1d5251 30
yihui 5:9b240c1d5251 31 /* Checks if gpio object is connected (pin was not initialized with NC)
yihui 5:9b240c1d5251 32 * @param pin The pin to be set as GPIO
yihui 5:9b240c1d5251 33 * @return 0 if port is initialized with NC
yihui 5:9b240c1d5251 34 **/
yihui 5:9b240c1d5251 35 int gpio_is_connected(const gpio_t *obj);
yihui 5:9b240c1d5251 36
yihui 5:9b240c1d5251 37 /* GPIO object */
yihui 5:9b240c1d5251 38 void gpio_init(gpio_t *obj, PinName pin);
yihui 5:9b240c1d5251 39
yihui 5:9b240c1d5251 40 void gpio_mode (gpio_t *obj, PinMode mode);
yihui 5:9b240c1d5251 41 void gpio_dir (gpio_t *obj, PinDirection direction);
yihui 5:9b240c1d5251 42
yihui 5:9b240c1d5251 43 void gpio_write(gpio_t *obj, int value);
yihui 5:9b240c1d5251 44 int gpio_read (gpio_t *obj);
yihui 5:9b240c1d5251 45
yihui 5:9b240c1d5251 46 // the following set of functions are generic and are implemented in the common gpio.c file
yihui 5:9b240c1d5251 47 void gpio_init_in(gpio_t* gpio, PinName pin);
yihui 5:9b240c1d5251 48 void gpio_init_in_ex(gpio_t* gpio, PinName pin, PinMode mode);
yihui 5:9b240c1d5251 49 void gpio_init_out(gpio_t* gpio, PinName pin);
yihui 5:9b240c1d5251 50 void gpio_init_out_ex(gpio_t* gpio, PinName pin, int value);
yihui 5:9b240c1d5251 51 void gpio_init_inout(gpio_t* gpio, PinName pin, PinDirection direction, PinMode mode, int value);
yihui 5:9b240c1d5251 52
yihui 5:9b240c1d5251 53 #ifdef __cplusplus
yihui 5:9b240c1d5251 54 }
yihui 5:9b240c1d5251 55 #endif
yihui 5:9b240c1d5251 56
yihui 5:9b240c1d5251 57 #endif