|
| 1 | +/* mbed Microcontroller Library |
| 2 | + * Copyright (c) 2006-2018 ARM Limited |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | +/**************************************************************************** |
| 17 | + * |
| 18 | + * Copyright 2019 Samsung Electronics All Rights Reserved. |
| 19 | + * SPDX-License-Identifier: Apache-2.0 |
| 20 | + * |
| 21 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 22 | + * you may not use this file except in compliance with the License. |
| 23 | + * You may obtain a copy of the License at |
| 24 | + * |
| 25 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 26 | + * |
| 27 | + * Unless required by applicable law or agreed to in writing, |
| 28 | + * software distributed under the License is distributed on an |
| 29 | + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, |
| 30 | + * either express or implied. See the License for the specific |
| 31 | + * language governing permissions and limitations under the License. |
| 32 | + * |
| 33 | + ****************************************************************************/ |
| 34 | +/* @file : port_api.c |
| 35 | + * @brief : GPIO port API source code |
| 36 | + * @date : June 2019 |
| 37 | + * |
| 38 | + * @note : Add chip dependent feature and control hardware GPIO port |
| 39 | + * |
| 40 | + */ |
| 41 | +#include "port_api.h" |
| 42 | +#include "pinmap.h" |
| 43 | +#include "gpio_api.h" |
| 44 | + |
| 45 | +PinName port_pin(PortName port, int pin_n) |
| 46 | +{ |
| 47 | + return (PinName)((port << PORT_SHIFT) | pin_n); |
| 48 | +} |
| 49 | + |
| 50 | +void port_init(port_t *obj, PortName port, int mask, PinDirection dir) |
| 51 | +{ |
| 52 | + |
| 53 | +} |
| 54 | + |
| 55 | +void port_mode(port_t *obj, PinMode mode) |
| 56 | +{ |
| 57 | + |
| 58 | +} |
| 59 | + |
| 60 | +void port_dir(port_t *obj, PinDirection dir) |
| 61 | +{ |
| 62 | + |
| 63 | +} |
| 64 | + |
| 65 | +void port_write(port_t *obj, int value) |
| 66 | +{ |
| 67 | + *obj->reg_in = value; |
| 68 | +} |
| 69 | + |
| 70 | +int port_read(port_t *obj) |
| 71 | +{ |
| 72 | + return (*obj->reg_in); |
| 73 | +} |
| 74 | + |
0 commit comments