Describes predefine macros for mbed online compiler (armcc)

Committer:
MACRUM
Date:
Thu Mar 16 21:58:09 2017 +0900
Revision:
6:40e873bbc5f7
Add licence header info

Who changed what in which revision?

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