change some io settings for TWR-K22F-120M

Dependents:   twr_helloworld

Committer:
Jasper_lee
Date:
Tue Dec 23 03:35:08 2014 +0000
Revision:
0:b16d94660a33
change some io setting used in TWR-K22F120M

Who changed what in which revision?

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