![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Color Oled(SSD1331) connect to STMicroelectronics Nucleo-F466
mbed-os/targets/TARGET_Atmel/TARGET_SAM_CortexM0P/pinmap_function.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 | /* mbed Microcontroller Library |
kadonotakashi | 0:8fdf9a60065b | 2 | * Copyright (c) 2006-2015 ARM Limited |
kadonotakashi | 0:8fdf9a60065b | 3 | * |
kadonotakashi | 0:8fdf9a60065b | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
kadonotakashi | 0:8fdf9a60065b | 5 | * you may not use this file except in compliance with the License. |
kadonotakashi | 0:8fdf9a60065b | 6 | * You may obtain a copy of the License at |
kadonotakashi | 0:8fdf9a60065b | 7 | * |
kadonotakashi | 0:8fdf9a60065b | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
kadonotakashi | 0:8fdf9a60065b | 9 | * |
kadonotakashi | 0:8fdf9a60065b | 10 | * Unless required by applicable law or agreed to in writing, software |
kadonotakashi | 0:8fdf9a60065b | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
kadonotakashi | 0:8fdf9a60065b | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
kadonotakashi | 0:8fdf9a60065b | 13 | * See the License for the specific language governing permissions and |
kadonotakashi | 0:8fdf9a60065b | 14 | * limitations under the License. |
kadonotakashi | 0:8fdf9a60065b | 15 | */ |
kadonotakashi | 0:8fdf9a60065b | 16 | #ifndef PINMAP_FUNCTION_H |
kadonotakashi | 0:8fdf9a60065b | 17 | #define PINMAP_FUNCTION_H |
kadonotakashi | 0:8fdf9a60065b | 18 | |
kadonotakashi | 0:8fdf9a60065b | 19 | #include <compiler.h> |
kadonotakashi | 0:8fdf9a60065b | 20 | #include "cmsis.h" |
kadonotakashi | 0:8fdf9a60065b | 21 | #include "PinNames.h" |
kadonotakashi | 0:8fdf9a60065b | 22 | #include "pinmux.h" |
kadonotakashi | 0:8fdf9a60065b | 23 | #include "pinmap.h" |
kadonotakashi | 0:8fdf9a60065b | 24 | |
kadonotakashi | 0:8fdf9a60065b | 25 | #include "PeripheralPins.h" |
kadonotakashi | 0:8fdf9a60065b | 26 | |
kadonotakashi | 0:8fdf9a60065b | 27 | #ifdef __cplusplus |
kadonotakashi | 0:8fdf9a60065b | 28 | extern "C" { |
kadonotakashi | 0:8fdf9a60065b | 29 | #endif |
kadonotakashi | 0:8fdf9a60065b | 30 | |
kadonotakashi | 0:8fdf9a60065b | 31 | enum sercom_pad_selection { |
kadonotakashi | 0:8fdf9a60065b | 32 | SERCOM_USE_DEFAULT_PAD, |
kadonotakashi | 0:8fdf9a60065b | 33 | SERCOM_USE_EXTENDED_PAD, |
kadonotakashi | 0:8fdf9a60065b | 34 | }; |
kadonotakashi | 0:8fdf9a60065b | 35 | |
kadonotakashi | 0:8fdf9a60065b | 36 | /** Find the SERCOM peripheral of given pin |
kadonotakashi | 0:8fdf9a60065b | 37 | * |
kadonotakashi | 0:8fdf9a60065b | 38 | * Find and return the SERCOM peripheral of input pin, either from default pas, or from extended pads |
kadonotakashi | 0:8fdf9a60065b | 39 | * @param[in] pin1 First pin |
kadonotakashi | 0:8fdf9a60065b | 40 | * @param[in] pad_select Second pin |
kadonotakashi | 0:8fdf9a60065b | 41 | * @return SERCOM peripheral if found, else, NC |
kadonotakashi | 0:8fdf9a60065b | 42 | */ |
kadonotakashi | 0:8fdf9a60065b | 43 | uint32_t pinmap_find_peripheral_from_pad(PinName pin, enum sercom_pad_selection pad_select); |
kadonotakashi | 0:8fdf9a60065b | 44 | |
kadonotakashi | 0:8fdf9a60065b | 45 | /** Find the common SERCOM shared by two pins |
kadonotakashi | 0:8fdf9a60065b | 46 | * |
kadonotakashi | 0:8fdf9a60065b | 47 | * Finds the common SERCOM index of two input pins. |
kadonotakashi | 0:8fdf9a60065b | 48 | * If swapping the input argument gives different result, it means, two SERCOMs share both pins |
kadonotakashi | 0:8fdf9a60065b | 49 | * @param[in] pin1 First pin |
kadonotakashi | 0:8fdf9a60065b | 50 | * @param[in] pin2 Second pin |
kadonotakashi | 0:8fdf9a60065b | 51 | * @return SERCOM index if found, else, NC |
kadonotakashi | 0:8fdf9a60065b | 52 | */ |
kadonotakashi | 0:8fdf9a60065b | 53 | uint32_t pinmap_merge_sercom(PinName pin1, PinName pin2); |
kadonotakashi | 0:8fdf9a60065b | 54 | |
kadonotakashi | 0:8fdf9a60065b | 55 | /** Find the common SERCOM shared by four pins |
kadonotakashi | 0:8fdf9a60065b | 56 | * |
kadonotakashi | 0:8fdf9a60065b | 57 | * Finds the common SERCOM index shared by four input pins. |
kadonotakashi | 0:8fdf9a60065b | 58 | * If reversing the input argument order gives different result, it means, two SERCOMs share the pins |
kadonotakashi | 0:8fdf9a60065b | 59 | * @param[in] pin1 First pin |
kadonotakashi | 0:8fdf9a60065b | 60 | * @param[in] pin2 Second pin |
kadonotakashi | 0:8fdf9a60065b | 61 | * @param[in] pin3 Third pin |
kadonotakashi | 0:8fdf9a60065b | 62 | * @param[in] pin4 Fourth pin |
kadonotakashi | 0:8fdf9a60065b | 63 | * @return SERCOM index if found, else, NC |
kadonotakashi | 0:8fdf9a60065b | 64 | */ |
kadonotakashi | 0:8fdf9a60065b | 65 | uint32_t pinmap_find_sercom(PinName pin1, PinName pin2, PinName pin3, PinName pin4); |
kadonotakashi | 0:8fdf9a60065b | 66 | |
kadonotakashi | 0:8fdf9a60065b | 67 | /** Find the MUX function of input pin specific to given SERCOM index |
kadonotakashi | 0:8fdf9a60065b | 68 | * |
kadonotakashi | 0:8fdf9a60065b | 69 | * @param[in] pin Pin whose function is to be found out |
kadonotakashi | 0:8fdf9a60065b | 70 | * @param[in] sercom_index SERCOM index |
kadonotakashi | 0:8fdf9a60065b | 71 | * @return MUX function if found, else, NC |
kadonotakashi | 0:8fdf9a60065b | 72 | */ |
kadonotakashi | 0:8fdf9a60065b | 73 | uint32_t pinmap_function_sercom(PinName pin, uint32_t sercom_index); |
kadonotakashi | 0:8fdf9a60065b | 74 | |
kadonotakashi | 0:8fdf9a60065b | 75 | /** Find the MUX pad of input pin specific to given SERCOM index |
kadonotakashi | 0:8fdf9a60065b | 76 | * |
kadonotakashi | 0:8fdf9a60065b | 77 | * @param[in] pin Pin whose function is to be found out |
kadonotakashi | 0:8fdf9a60065b | 78 | * @param[in] sercom_index SERCOM index |
kadonotakashi | 0:8fdf9a60065b | 79 | * @return MUX pad if found, else, NC |
kadonotakashi | 0:8fdf9a60065b | 80 | */ |
kadonotakashi | 0:8fdf9a60065b | 81 | uint32_t pinmap_pad_sercom(PinName pin, uint32_t sercom_index); |
kadonotakashi | 0:8fdf9a60065b | 82 | |
kadonotakashi | 0:8fdf9a60065b | 83 | /** Find the MUX function of input pin specific to given SERCOM index |
kadonotakashi | 0:8fdf9a60065b | 84 | * |
kadonotakashi | 0:8fdf9a60065b | 85 | * @param[in] pin unused |
kadonotakashi | 0:8fdf9a60065b | 86 | * @param[in] sercom_index SERCOM index |
kadonotakashi | 0:8fdf9a60065b | 87 | * @return base address to SERCOM if found, else NC |
kadonotakashi | 0:8fdf9a60065b | 88 | */ |
kadonotakashi | 0:8fdf9a60065b | 89 | uint32_t pinmap_peripheral_sercom(PinName pin, uint32_t sercom_index); |
kadonotakashi | 0:8fdf9a60065b | 90 | |
kadonotakashi | 0:8fdf9a60065b | 91 | /** Find the channel index of a pin specific to a PWM instance |
kadonotakashi | 0:8fdf9a60065b | 92 | * |
kadonotakashi | 0:8fdf9a60065b | 93 | * @param[in] pin pin name |
kadonotakashi | 0:8fdf9a60065b | 94 | * @param[in] pwm pwm peripheral (unused now) |
kadonotakashi | 0:8fdf9a60065b | 95 | * @return Channel index of the specified pin |
kadonotakashi | 0:8fdf9a60065b | 96 | */ |
kadonotakashi | 0:8fdf9a60065b | 97 | uint32_t pinmap_channel_pwm(PinName pin, PWMName pwm); |
kadonotakashi | 0:8fdf9a60065b | 98 | |
kadonotakashi | 0:8fdf9a60065b | 99 | #ifdef __cplusplus |
kadonotakashi | 0:8fdf9a60065b | 100 | } |
kadonotakashi | 0:8fdf9a60065b | 101 | #endif |
kadonotakashi | 0:8fdf9a60065b | 102 | |
kadonotakashi | 0:8fdf9a60065b | 103 | #endif /* PINMAP_FUNCTION_H */ |