Public fork of mbed-src to add generic stm32f030k6 target
Fork of mbed-src by
targets/hal/TARGET_Atmel/TARGET_SAM21/PeripheralNames.h@596:d25a30803853, 2015-07-21 (annotated)
- Committer:
- ersatzavian
- Date:
- Tue Jul 21 14:09:45 2015 -0700
- Revision:
- 596:d25a30803853
- Parent:
- 592:a274ee790e56
added missing bracket probably I hope
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 579:53297373a894 | 1 | /* mbed Microcontroller Library |
mbed_official | 579:53297373a894 | 2 | * Copyright (c) 2006-2013 ARM Limited |
mbed_official | 579:53297373a894 | 3 | * |
mbed_official | 579:53297373a894 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
mbed_official | 579:53297373a894 | 5 | * you may not use this file except in compliance with the License. |
mbed_official | 579:53297373a894 | 6 | * You may obtain a copy of the License at |
mbed_official | 579:53297373a894 | 7 | * |
mbed_official | 579:53297373a894 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
mbed_official | 579:53297373a894 | 9 | * |
mbed_official | 579:53297373a894 | 10 | * Unless required by applicable law or agreed to in writing, software |
mbed_official | 579:53297373a894 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
mbed_official | 579:53297373a894 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
mbed_official | 579:53297373a894 | 13 | * See the License for the specific language governing permissions and |
mbed_official | 579:53297373a894 | 14 | * limitations under the License. |
mbed_official | 579:53297373a894 | 15 | */ |
mbed_official | 579:53297373a894 | 16 | #ifndef MBED_PERIPHERALNAMES_H |
mbed_official | 579:53297373a894 | 17 | #define MBED_PERIPHERALNAMES_H |
mbed_official | 579:53297373a894 | 18 | |
mbed_official | 579:53297373a894 | 19 | #include <compiler.h> |
mbed_official | 579:53297373a894 | 20 | #include "cmsis.h" |
mbed_official | 579:53297373a894 | 21 | #include "PinNames.h" |
mbed_official | 579:53297373a894 | 22 | |
mbed_official | 579:53297373a894 | 23 | #ifdef __cplusplus |
mbed_official | 579:53297373a894 | 24 | extern "C" { |
mbed_official | 579:53297373a894 | 25 | #endif |
mbed_official | 579:53297373a894 | 26 | |
mbed_official | 579:53297373a894 | 27 | #define _SERCOM_SPI_NAME(n, unused) \ |
mbed_official | 579:53297373a894 | 28 | SPI##n, |
mbed_official | 579:53297373a894 | 29 | |
mbed_official | 592:a274ee790e56 | 30 | #define _SERCOM_PAD_NAME(n, pad) \ |
mbed_official | 592:a274ee790e56 | 31 | SERCOM##n##_PAD##pad = ((n & 0xF) | ((pad & 0xF) << 4)), |
mbed_official | 592:a274ee790e56 | 32 | |
mbed_official | 579:53297373a894 | 33 | #define _SERCOM_I2C_NAME(n, unused) \ |
mbed_official | 579:53297373a894 | 34 | I2C##n, |
mbed_official | 579:53297373a894 | 35 | |
mbed_official | 579:53297373a894 | 36 | |
mbed_official | 579:53297373a894 | 37 | |
mbed_official | 579:53297373a894 | 38 | typedef enum { |
mbed_official | 579:53297373a894 | 39 | UART_0 = (int)0x42000800UL, // Base address of SERCOM0 |
mbed_official | 579:53297373a894 | 40 | UART_1 = (int)0x42000C00UL, // Base address of SERCOM1 |
mbed_official | 579:53297373a894 | 41 | UART_2 = (int)0x42001000UL, // Base address of SERCOM2 |
mbed_official | 579:53297373a894 | 42 | UART_3 = (int)0x42001400UL, // Base address of SERCOM3 |
mbed_official | 579:53297373a894 | 43 | UART_4 = (int)0x42001800UL, // Base address of SERCOM4 |
mbed_official | 579:53297373a894 | 44 | UART_5 = (int)0x42001C00UL // Base address of SERCOM5 |
mbed_official | 579:53297373a894 | 45 | } UARTName; |
mbed_official | 592:a274ee790e56 | 46 | |
mbed_official | 592:a274ee790e56 | 47 | typedef enum { // for each input control mux 4,5,6,7,16,17,10,11 used in R21 |
mbed_official | 592:a274ee790e56 | 48 | ADC_4 = 0x4ul, |
mbed_official | 592:a274ee790e56 | 49 | ADC_5 = 0x5ul, |
mbed_official | 592:a274ee790e56 | 50 | ADC_6 = 0x6ul, |
mbed_official | 592:a274ee790e56 | 51 | ADC_7 = 0x7ul, |
mbed_official | 592:a274ee790e56 | 52 | ADC_10 = 0xAul, |
mbed_official | 592:a274ee790e56 | 53 | ADC_11 = 0xBul, |
mbed_official | 592:a274ee790e56 | 54 | ADC_16 = 0x10ul, |
mbed_official | 592:a274ee790e56 | 55 | ADC_17 = 0x11ul |
mbed_official | 579:53297373a894 | 56 | } ADCName; |
mbed_official | 579:53297373a894 | 57 | |
mbed_official | 592:a274ee790e56 | 58 | typedef enum { // for each channel |
mbed_official | 592:a274ee790e56 | 59 | EXTINT_0 = 0, |
mbed_official | 592:a274ee790e56 | 60 | EXTINT_1, |
mbed_official | 592:a274ee790e56 | 61 | EXTINT_2, |
mbed_official | 592:a274ee790e56 | 62 | EXTINT_3, |
mbed_official | 592:a274ee790e56 | 63 | EXTINT_4, |
mbed_official | 592:a274ee790e56 | 64 | EXTINT_5, |
mbed_official | 592:a274ee790e56 | 65 | EXTINT_6, |
mbed_official | 592:a274ee790e56 | 66 | EXTINT_7, |
mbed_official | 592:a274ee790e56 | 67 | EXTINT_8, |
mbed_official | 592:a274ee790e56 | 68 | EXTINT_9, |
mbed_official | 592:a274ee790e56 | 69 | EXTINT_10, |
mbed_official | 592:a274ee790e56 | 70 | EXTINT_11, |
mbed_official | 592:a274ee790e56 | 71 | EXTINT_12, |
mbed_official | 592:a274ee790e56 | 72 | EXTINT_13, |
mbed_official | 592:a274ee790e56 | 73 | EXTINT_14, |
mbed_official | 592:a274ee790e56 | 74 | EXTINT_15 |
mbed_official | 592:a274ee790e56 | 75 | } EXTINTName; |
mbed_official | 592:a274ee790e56 | 76 | |
mbed_official | 592:a274ee790e56 | 77 | /* |
mbed_official | 579:53297373a894 | 78 | typedef enum { |
mbed_official | 579:53297373a894 | 79 | DAC_0 = 0 |
mbed_official | 579:53297373a894 | 80 | } DACName;*/ |
mbed_official | 579:53297373a894 | 81 | |
mbed_official | 579:53297373a894 | 82 | typedef enum { |
mbed_official | 579:53297373a894 | 83 | MREPEAT(SERCOM_INST_NUM, _SERCOM_SPI_NAME, ~) |
mbed_official | 579:53297373a894 | 84 | } SPIName; |
mbed_official | 579:53297373a894 | 85 | |
mbed_official | 579:53297373a894 | 86 | typedef enum { |
mbed_official | 579:53297373a894 | 87 | MREPEAT(SERCOM_INST_NUM, _SERCOM_I2C_NAME, ~) |
mbed_official | 579:53297373a894 | 88 | } I2CName; |
mbed_official | 592:a274ee790e56 | 89 | |
mbed_official | 592:a274ee790e56 | 90 | typedef enum { |
mbed_official | 592:a274ee790e56 | 91 | /* Pad 0 definitions */ |
mbed_official | 592:a274ee790e56 | 92 | MREPEAT(SERCOM_INST_NUM, _SERCOM_PAD_NAME, 0) |
mbed_official | 592:a274ee790e56 | 93 | |
mbed_official | 592:a274ee790e56 | 94 | /* Pad 1 definitions */ |
mbed_official | 592:a274ee790e56 | 95 | MREPEAT(SERCOM_INST_NUM, _SERCOM_PAD_NAME, 1) |
mbed_official | 592:a274ee790e56 | 96 | |
mbed_official | 592:a274ee790e56 | 97 | /* Pad 2 definitions */ |
mbed_official | 592:a274ee790e56 | 98 | MREPEAT(SERCOM_INST_NUM, _SERCOM_PAD_NAME, 2) |
mbed_official | 592:a274ee790e56 | 99 | |
mbed_official | 592:a274ee790e56 | 100 | /* Pad 3 definitions */ |
mbed_official | 592:a274ee790e56 | 101 | MREPEAT(SERCOM_INST_NUM, _SERCOM_PAD_NAME, 3) |
mbed_official | 592:a274ee790e56 | 102 | } SercomPadName; |
mbed_official | 579:53297373a894 | 103 | /* |
mbed_official | 579:53297373a894 | 104 | typedef enum { |
mbed_official | 579:53297373a894 | 105 | PWM_1 = 1, |
mbed_official | 579:53297373a894 | 106 | PWM_2, |
mbed_official | 579:53297373a894 | 107 | PWM_3, |
mbed_official | 579:53297373a894 | 108 | PWM_4, |
mbed_official | 579:53297373a894 | 109 | PWM_5, |
mbed_official | 579:53297373a894 | 110 | PWM_6 |
mbed_official | 579:53297373a894 | 111 | } PWMName; |
mbed_official | 579:53297373a894 | 112 | |
mbed_official | 579:53297373a894 | 113 | typedef enum { |
mbed_official | 579:53297373a894 | 114 | CAN_1 = (int)LPC_CAN1_BASE, |
mbed_official | 579:53297373a894 | 115 | CAN_2 = (int)LPC_CAN2_BASE |
mbed_official | 579:53297373a894 | 116 | } CANName;*/ |
mbed_official | 579:53297373a894 | 117 | |
mbed_official | 579:53297373a894 | 118 | #define STDIO_UART_TX USBTX |
mbed_official | 579:53297373a894 | 119 | #define STDIO_UART_RX USBRX |
mbed_official | 579:53297373a894 | 120 | #define STDIO_UART UART_0 |
mbed_official | 579:53297373a894 | 121 | |
mbed_official | 579:53297373a894 | 122 | // Default peripherals |
mbed_official | 579:53297373a894 | 123 | #define MBED_SPI0 p5, p6, p7, p8 |
mbed_official | 579:53297373a894 | 124 | #define MBED_SPI1 p11, p12, p13, p14 |
mbed_official | 579:53297373a894 | 125 | |
mbed_official | 579:53297373a894 | 126 | #define MBED_UART0 p9, p10 |
mbed_official | 579:53297373a894 | 127 | #define MBED_UART1 p13, p14 |
mbed_official | 579:53297373a894 | 128 | #define MBED_UART2 p28, p27 |
mbed_official | 579:53297373a894 | 129 | #define MBED_UARTUSB USBTX, USBRX |
mbed_official | 579:53297373a894 | 130 | |
mbed_official | 579:53297373a894 | 131 | #define MBED_I2C0 p28, p27 |
mbed_official | 579:53297373a894 | 132 | #define MBED_I2C1 p9, p10 |
mbed_official | 579:53297373a894 | 133 | |
mbed_official | 579:53297373a894 | 134 | #define MBED_CAN0 p30, p29 |
mbed_official | 579:53297373a894 | 135 | |
mbed_official | 579:53297373a894 | 136 | #define MBED_ANALOGOUT0 p18 |
mbed_official | 579:53297373a894 | 137 | |
mbed_official | 579:53297373a894 | 138 | #define MBED_ANALOGIN0 p15 |
mbed_official | 579:53297373a894 | 139 | #define MBED_ANALOGIN1 p16 |
mbed_official | 579:53297373a894 | 140 | #define MBED_ANALOGIN2 p17 |
mbed_official | 579:53297373a894 | 141 | #define MBED_ANALOGIN3 p18 |
mbed_official | 579:53297373a894 | 142 | #define MBED_ANALOGIN4 p19 |
mbed_official | 579:53297373a894 | 143 | #define MBED_ANALOGIN5 p20 |
mbed_official | 579:53297373a894 | 144 | |
mbed_official | 579:53297373a894 | 145 | #define MBED_PWMOUT0 p26 |
mbed_official | 579:53297373a894 | 146 | #define MBED_PWMOUT1 p25 |
mbed_official | 579:53297373a894 | 147 | #define MBED_PWMOUT2 p24 |
mbed_official | 579:53297373a894 | 148 | #define MBED_PWMOUT3 p23 |
mbed_official | 579:53297373a894 | 149 | #define MBED_PWMOUT4 p22 |
mbed_official | 579:53297373a894 | 150 | #define MBED_PWMOUT5 p21 |
mbed_official | 579:53297373a894 | 151 | |
mbed_official | 579:53297373a894 | 152 | #ifdef __cplusplus |
mbed_official | 579:53297373a894 | 153 | } |
mbed_official | 579:53297373a894 | 154 | #endif |
mbed_official | 579:53297373a894 | 155 | |
mbed_official | 579:53297373a894 | 156 | #endif |