mbed-os for GR-LYCHEE

Dependents:   mbed-os-example-blinky-gr-lychee GR-Boads_Camera_sample GR-Boards_Audio_Recoder GR-Boads_Camera_DisplayApp ... more

Committer:
dkato
Date:
Fri Feb 02 05:42:23 2018 +0000
Revision:
0:f782d9c66c49
mbed-os for GR-LYCHEE

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dkato 0:f782d9c66c49 1
dkato 0:f782d9c66c49 2 /** \addtogroup hal */
dkato 0:f782d9c66c49 3 /** @{*/
dkato 0:f782d9c66c49 4 /* mbed Microcontroller Library
dkato 0:f782d9c66c49 5 * Copyright (c) 2006-2013 ARM Limited
dkato 0:f782d9c66c49 6 *
dkato 0:f782d9c66c49 7 * Licensed under the Apache License, Version 2.0 (the "License");
dkato 0:f782d9c66c49 8 * you may not use this file except in compliance with the License.
dkato 0:f782d9c66c49 9 * You may obtain a copy of the License at
dkato 0:f782d9c66c49 10 *
dkato 0:f782d9c66c49 11 * http://www.apache.org/licenses/LICENSE-2.0
dkato 0:f782d9c66c49 12 *
dkato 0:f782d9c66c49 13 * Unless required by applicable law or agreed to in writing, software
dkato 0:f782d9c66c49 14 * distributed under the License is distributed on an "AS IS" BASIS,
dkato 0:f782d9c66c49 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dkato 0:f782d9c66c49 16 * See the License for the specific language governing permissions and
dkato 0:f782d9c66c49 17 * limitations under the License.
dkato 0:f782d9c66c49 18 */
dkato 0:f782d9c66c49 19 #ifndef MBED_PORTMAP_H
dkato 0:f782d9c66c49 20 #define MBED_PORTMAP_H
dkato 0:f782d9c66c49 21
dkato 0:f782d9c66c49 22 #include "device.h"
dkato 0:f782d9c66c49 23
dkato 0:f782d9c66c49 24 #if DEVICE_PORTIN || DEVICE_PORTOUT
dkato 0:f782d9c66c49 25
dkato 0:f782d9c66c49 26 #ifdef __cplusplus
dkato 0:f782d9c66c49 27 extern "C" {
dkato 0:f782d9c66c49 28 #endif
dkato 0:f782d9c66c49 29
dkato 0:f782d9c66c49 30 /** Port HAL structure. port_s is declared in the target's HAL
dkato 0:f782d9c66c49 31 */
dkato 0:f782d9c66c49 32 typedef struct port_s port_t;
dkato 0:f782d9c66c49 33
dkato 0:f782d9c66c49 34 /**
dkato 0:f782d9c66c49 35 * \defgroup hal_port Port HAL functions
dkato 0:f782d9c66c49 36 * @{
dkato 0:f782d9c66c49 37 */
dkato 0:f782d9c66c49 38
dkato 0:f782d9c66c49 39 /** Get the pin name from the port's pin number
dkato 0:f782d9c66c49 40 *
dkato 0:f782d9c66c49 41 * @param port The port name
dkato 0:f782d9c66c49 42 * @param pin_n The pin number within the specified port
dkato 0:f782d9c66c49 43 * @return The pin name for the port's pin number
dkato 0:f782d9c66c49 44 */
dkato 0:f782d9c66c49 45 PinName port_pin(PortName port, int pin_n);
dkato 0:f782d9c66c49 46
dkato 0:f782d9c66c49 47 /** Initilize the port
dkato 0:f782d9c66c49 48 *
dkato 0:f782d9c66c49 49 * @param obj The port object to initialize
dkato 0:f782d9c66c49 50 * @param port The port name
dkato 0:f782d9c66c49 51 * @param mask The bitmask to identify which bits in the port should be included (0 - ignore)
dkato 0:f782d9c66c49 52 * @param dir The port direction
dkato 0:f782d9c66c49 53 */
dkato 0:f782d9c66c49 54 void port_init(port_t *obj, PortName port, int mask, PinDirection dir);
dkato 0:f782d9c66c49 55
dkato 0:f782d9c66c49 56 /** Set the input port mode
dkato 0:f782d9c66c49 57 *
dkato 0:f782d9c66c49 58 * @param obj The port object
dkato 0:f782d9c66c49 59 * @param mode THe port mode to be set
dkato 0:f782d9c66c49 60 */
dkato 0:f782d9c66c49 61 void port_mode(port_t *obj, PinMode mode);
dkato 0:f782d9c66c49 62
dkato 0:f782d9c66c49 63 /** Set port direction (in/out)
dkato 0:f782d9c66c49 64 *
dkato 0:f782d9c66c49 65 * @param obj The port object
dkato 0:f782d9c66c49 66 * @param dir The port direction to be set
dkato 0:f782d9c66c49 67 */
dkato 0:f782d9c66c49 68 void port_dir(port_t *obj, PinDirection dir);
dkato 0:f782d9c66c49 69
dkato 0:f782d9c66c49 70 /** Write value to the port
dkato 0:f782d9c66c49 71 *
dkato 0:f782d9c66c49 72 * @param obj The port object
dkato 0:f782d9c66c49 73 * @param value The value to be set
dkato 0:f782d9c66c49 74 */
dkato 0:f782d9c66c49 75 void port_write(port_t *obj, int value);
dkato 0:f782d9c66c49 76
dkato 0:f782d9c66c49 77 /** Read the current value on the port
dkato 0:f782d9c66c49 78 *
dkato 0:f782d9c66c49 79 * @param obj The port object
dkato 0:f782d9c66c49 80 * @return An integer with each bit corresponding to an associated port pin setting
dkato 0:f782d9c66c49 81 */
dkato 0:f782d9c66c49 82 int port_read(port_t *obj);
dkato 0:f782d9c66c49 83
dkato 0:f782d9c66c49 84 /**@}*/
dkato 0:f782d9c66c49 85
dkato 0:f782d9c66c49 86 #ifdef __cplusplus
dkato 0:f782d9c66c49 87 }
dkato 0:f782d9c66c49 88 #endif
dkato 0:f782d9c66c49 89 #endif
dkato 0:f782d9c66c49 90
dkato 0:f782d9c66c49 91 #endif
dkato 0:f782d9c66c49 92
dkato 0:f782d9c66c49 93 /** @}*/