customized mbed library sources for nrf51822

Dependents:   Grove_Node Potentiometer BLE_Beacon I2C_Scanner

Committer:
yihui
Date:
Tue Nov 04 07:38:53 2014 +0000
Revision:
0:700cadd8b708
customized mbed-src library for nrf51822

Who changed what in which revision?

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