mbed-drivers
pinmap_common.h
1 /*
2  * Copyright (c) 2015-2016, ARM Limited, All Rights Reserved
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License"); you may
6  * not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 #ifndef PINMAP_COMMON_H
18 #define PINMAP_COMMON_H
19 
20 #include <stdint.h>
21 #include "PinNames.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 typedef struct {
28  PinName pin;
29  int peripheral;
30  int function;
31 } PinMap;
32 
33 uint32_t pinmap_peripheral(PinName pin, const PinMap* map);
34 uint32_t pinmap_function(PinName pin, const PinMap* map);
35 uint32_t pinmap_merge(uint32_t a, uint32_t b);
36 void pinmap_pinout(PinName pin, const PinMap *map);
37 uint32_t pinmap_find_peripheral(PinName pin, const PinMap* map);
38 uint32_t pinmap_find_function(PinName pin, const PinMap* map);
58 uint32_t pinmap_peripheral_instance(uint32_t peripheral, const PinMap* map);
59 
60 #ifdef __cplusplus
61 }
62 #endif
63 
64 #endif
Definition: pinmap_common.h:27