Initial commit

Dependencies:   FastPWM

Committer:
lypinator
Date:
Wed Sep 16 01:11:49 2020 +0000
Revision:
0:bb348c97df44
Added PWM

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lypinator 0:bb348c97df44 1 /** \addtogroup platform */
lypinator 0:bb348c97df44 2 /** @{*/
lypinator 0:bb348c97df44 3 /**
lypinator 0:bb348c97df44 4 * \defgroup platform_preprocessor preprocessor macros
lypinator 0:bb348c97df44 5 * @{
lypinator 0:bb348c97df44 6 */
lypinator 0:bb348c97df44 7
lypinator 0:bb348c97df44 8 /* mbed Microcontroller Library
lypinator 0:bb348c97df44 9 * Copyright (c) 2006-2013 ARM Limited
lypinator 0:bb348c97df44 10 *
lypinator 0:bb348c97df44 11 * Licensed under the Apache License, Version 2.0 (the "License");
lypinator 0:bb348c97df44 12 * you may not use this file except in compliance with the License.
lypinator 0:bb348c97df44 13 * You may obtain a copy of the License at
lypinator 0:bb348c97df44 14 *
lypinator 0:bb348c97df44 15 * http://www.apache.org/licenses/LICENSE-2.0
lypinator 0:bb348c97df44 16 *
lypinator 0:bb348c97df44 17 * Unless required by applicable law or agreed to in writing, software
lypinator 0:bb348c97df44 18 * distributed under the License is distributed on an "AS IS" BASIS,
lypinator 0:bb348c97df44 19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
lypinator 0:bb348c97df44 20 * See the License for the specific language governing permissions and
lypinator 0:bb348c97df44 21 * limitations under the License.
lypinator 0:bb348c97df44 22 */
lypinator 0:bb348c97df44 23 #ifndef MBED_PREPROCESSOR_H
lypinator 0:bb348c97df44 24 #define MBED_PREPROCESSOR_H
lypinator 0:bb348c97df44 25
lypinator 0:bb348c97df44 26
lypinator 0:bb348c97df44 27 /** MBED_CONCAT
lypinator 0:bb348c97df44 28 * Concatenate tokens together
lypinator 0:bb348c97df44 29 *
lypinator 0:bb348c97df44 30 * @note
lypinator 0:bb348c97df44 31 * Expands tokens before concatenation
lypinator 0:bb348c97df44 32 *
lypinator 0:bb348c97df44 33 * @code
lypinator 0:bb348c97df44 34 * // Creates a unique label based on the line number
lypinator 0:bb348c97df44 35 * int MBED_CONCAT(UNIQUE_LABEL_, __LINE__) = 1;
lypinator 0:bb348c97df44 36 * @endcode
lypinator 0:bb348c97df44 37 */
lypinator 0:bb348c97df44 38 #define MBED_CONCAT(a, b) MBED_CONCAT_(a, b)
lypinator 0:bb348c97df44 39 #define MBED_CONCAT_(a, b) a##b
lypinator 0:bb348c97df44 40
lypinator 0:bb348c97df44 41 /** MBED_STRINGIFY
lypinator 0:bb348c97df44 42 * Converts tokens into strings
lypinator 0:bb348c97df44 43 *
lypinator 0:bb348c97df44 44 * @note
lypinator 0:bb348c97df44 45 * Expands tokens before stringification
lypinator 0:bb348c97df44 46 *
lypinator 0:bb348c97df44 47 * @code
lypinator 0:bb348c97df44 48 * // Creates a string based on the parameters
lypinator 0:bb348c97df44 49 * const char *c = MBED_STRINGIFY(This is a ridiculous way to create a string)
lypinator 0:bb348c97df44 50 * @endcode
lypinator 0:bb348c97df44 51 */
lypinator 0:bb348c97df44 52 #define MBED_STRINGIFY(a) MBED_STRINGIFY_(a)
lypinator 0:bb348c97df44 53 #define MBED_STRINGIFY_(a) #a
lypinator 0:bb348c97df44 54
lypinator 0:bb348c97df44 55 /** MBED_STRLEN
lypinator 0:bb348c97df44 56 * Reports string token length
lypinator 0:bb348c97df44 57 *
lypinator 0:bb348c97df44 58 * @note
lypinator 0:bb348c97df44 59 * Expands tokens before calculating length
lypinator 0:bb348c97df44 60 *
lypinator 0:bb348c97df44 61 * @code
lypinator 0:bb348c97df44 62 * // Get string length
lypinator 0:bb348c97df44 63 * const int len = MBED_STRLEN("Get the length")
lypinator 0:bb348c97df44 64 * @endcode
lypinator 0:bb348c97df44 65 */
lypinator 0:bb348c97df44 66 #define MBED_STRLEN(a) MBED_STRLEN_(a)
lypinator 0:bb348c97df44 67 #define MBED_STRLEN_(a) (sizeof(a) - 1)
lypinator 0:bb348c97df44 68
lypinator 0:bb348c97df44 69 /** MBED_COUNT_VA_ARGS(...)
lypinator 0:bb348c97df44 70 * Reports number of tokens passed
lypinator 0:bb348c97df44 71 *
lypinator 0:bb348c97df44 72 * @note
lypinator 0:bb348c97df44 73 * Token limit is 16
lypinator 0:bb348c97df44 74 *
lypinator 0:bb348c97df44 75 * @code
lypinator 0:bb348c97df44 76 * // Get number of arguments
lypinator 0:bb348c97df44 77 * const int count = MBED_COUNT_VA_ARGS("Address 0x%x, Data[0] = %d Data[1] = %d", 0x20001234, 10, 20)
lypinator 0:bb348c97df44 78 * @endcode
lypinator 0:bb348c97df44 79 */
lypinator 0:bb348c97df44 80 #define MBED_COUNT_VA_ARGS(...) GET_NTH_ARG_(__VA_ARGS__, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)
lypinator 0:bb348c97df44 81 #define GET_NTH_ARG_(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, N, ...) N
lypinator 0:bb348c97df44 82
lypinator 0:bb348c97df44 83 #endif
lypinator 0:bb348c97df44 84
lypinator 0:bb348c97df44 85 /** @}*/
lypinator 0:bb348c97df44 86 /** @}*/