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