|
| 1 | +/**************************************************************************** |
| 2 | +** |
| 3 | +** Copyright (C) ${COPYRIGHT_YEAR} MikroElektronika d.o.o. |
| 4 | +** Contact: https://www.mikroe.com/contact |
| 5 | +** |
| 6 | +** This file is part of the mikroSDK package |
| 7 | +** |
| 8 | +** Commercial License Usage |
| 9 | +** |
| 10 | +** Licensees holding valid commercial NECTO compilers AI licenses may use this |
| 11 | +** file in accordance with the commercial license agreement provided with the |
| 12 | +** Software or, alternatively, in accordance with the terms contained in |
| 13 | +** a written agreement between you and The MikroElektronika Company. |
| 14 | +** For licensing terms and conditions see |
| 15 | +** https://www.mikroe.com/legal/software-license-agreement. |
| 16 | +** For further information use the contact form at |
| 17 | +** https://www.mikroe.com/contact. |
| 18 | +** |
| 19 | +** |
| 20 | +** GNU Lesser General Public License Usage |
| 21 | +** |
| 22 | +** Alternatively, this file may be used for |
| 23 | +** non-commercial projects under the terms of the GNU Lesser |
| 24 | +** General Public License version 3 as published by the Free Software |
| 25 | +** Foundation: https://www.gnu.org/licenses/lgpl-3.0.html. |
| 26 | +** |
| 27 | +** The above copyright notice and this permission notice shall be |
| 28 | +** included in all copies or substantial portions of the Software. |
| 29 | +** |
| 30 | +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 31 | +** OF MERCHANTABILITY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED |
| 32 | +** TO THE WARRANTIES FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 33 | +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| 34 | +** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT |
| 35 | +** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE |
| 36 | +** OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 37 | +** |
| 38 | +****************************************************************************/ |
| 39 | +/*! |
| 40 | + * @file board.h |
| 41 | + * @brief Main board pin mapping. |
| 42 | + */ |
| 43 | + |
| 44 | +#ifndef _BOARD_H_ |
| 45 | +#define _BOARD_H_ |
| 46 | + |
| 47 | +#ifdef __cplusplus |
| 48 | +extern "C" |
| 49 | +{ |
| 50 | +#endif |
| 51 | + |
| 52 | +#define BOARD_NAME "Explorer 8 Development Kit" |
| 53 | + |
| 54 | +#include "mikrobus.h" |
| 55 | +#ifdef _MSDK_MCU_CARD_NAME_ |
| 56 | +#include "pim_socket.h" |
| 57 | +#else |
| 58 | +#include "dip_socket.h" |
| 59 | +#endif |
| 60 | + |
| 61 | +// Mapping |
| 62 | +#define MIKROBUS_1 1 |
| 63 | +#define MIKROBUS_2 2 |
| 64 | + |
| 65 | +#ifdef _MSDK_MCU_CARD_NAME_ |
| 66 | +#define MIKROBUS_1_AN PIM_PIN_21 |
| 67 | +#define MIKROBUS_1_RST PIM_PIN_47 |
| 68 | +#define MIKROBUS_1_CS PIM_PIN_34 |
| 69 | +#define MIKROBUS_1_SCK PIM_PIN_44 |
| 70 | +#define MIKROBUS_1_MISO PIM_PIN_45 |
| 71 | +#define MIKROBUS_1_MOSI PIM_PIN_46 |
| 72 | +#define MIKROBUS_1_PWM PIM_PIN_35 |
| 73 | +#define MIKROBUS_1_INT PIM_PIN_57 |
| 74 | +#define MIKROBUS_1_RX PIM_PIN_38 |
| 75 | +#define MIKROBUS_1_TX PIM_PIN_37 |
| 76 | +#define MIKROBUS_1_SCL PIM_PIN_44 |
| 77 | +#define MIKROBUS_1_SDA PIM_PIN_43 |
| 78 | + |
| 79 | +#define MIKROBUS_2_AN PIM_PIN_04 |
| 80 | +#define MIKROBUS_2_RST PIM_PIN_63 |
| 81 | +#define MIKROBUS_2_CS PIM_PIN_78 |
| 82 | +#define MIKROBUS_2_SCK PIM_PIN_64 |
| 83 | +#define MIKROBUS_2_MISO PIM_PIN_65 |
| 84 | +#define MIKROBUS_2_MOSI PIM_PIN_66 |
| 85 | +#define MIKROBUS_2_PWM PIM_PIN_36 |
| 86 | +#define MIKROBUS_2_INT PIM_PIN_58 |
| 87 | +#define MIKROBUS_2_RX PIM_PIN_07 |
| 88 | +#define MIKROBUS_2_TX PIM_PIN_06 |
| 89 | +#define MIKROBUS_2_SCL PIM_PIN_44 |
| 90 | +#define MIKROBUS_2_SDA PIM_PIN_45 |
| 91 | + |
| 92 | +#define LED_1 PIM_PIN_72 |
| 93 | +#define LED_2 PIM_PIN_69 |
| 94 | +#define LED_3 PIM_PIN_68 |
| 95 | +#define LED_4 PIM_PIN_67 |
| 96 | +#define LED_5 PIM_PIN_58 |
| 97 | +#define LED_6 PIM_PIN_57 |
| 98 | +#define LED_7 PIM_PIN_56 |
| 99 | +#define LED_8 PIM_PIN_55 |
| 100 | +#else |
| 101 | +#define MIKROBUS_1_AN MIKROBUS_1_DIP_AN |
| 102 | +#define MIKROBUS_1_RST MIKROBUS_1_DIP_RST |
| 103 | +#define MIKROBUS_1_CS MIKROBUS_1_DIP_CS |
| 104 | +#define MIKROBUS_1_SCK MIKROBUS_1_DIP_SCK |
| 105 | +#define MIKROBUS_1_MISO MIKROBUS_1_DIP_MISO |
| 106 | +#define MIKROBUS_1_MOSI MIKROBUS_1_DIP_MOSI |
| 107 | +#define MIKROBUS_1_PWM MIKROBUS_1_DIP_PWM |
| 108 | +#define MIKROBUS_1_INT MIKROBUS_1_DIP_INT |
| 109 | +#define MIKROBUS_1_RX MIKROBUS_1_DIP_RX |
| 110 | +#define MIKROBUS_1_TX MIKROBUS_1_DIP_TX |
| 111 | +#define MIKROBUS_1_SCL MIKROBUS_1_DIP_SCL |
| 112 | +#define MIKROBUS_1_SDA MIKROBUS_1_DIP_SDA |
| 113 | + |
| 114 | +#define MIKROBUS_2_AN MIKROBUS_2_DIP_AN |
| 115 | +#define MIKROBUS_2_RST MIKROBUS_2_DIP_RST |
| 116 | +#define MIKROBUS_2_CS MIKROBUS_2_DIP_CS |
| 117 | +#define MIKROBUS_2_SCK MIKROBUS_2_DIP_SCK |
| 118 | +#define MIKROBUS_2_MISO MIKROBUS_2_DIP_MISO |
| 119 | +#define MIKROBUS_2_MOSI MIKROBUS_2_DIP_MOSI |
| 120 | +#define MIKROBUS_2_PWM MIKROBUS_2_DIP_PWM |
| 121 | +#define MIKROBUS_2_INT MIKROBUS_2_DIP_INT |
| 122 | +#define MIKROBUS_2_RX MIKROBUS_2_DIP_RX |
| 123 | +#define MIKROBUS_2_TX MIKROBUS_2_DIP_TX |
| 124 | +#define MIKROBUS_2_SCL MIKROBUS_2_DIP_SCL |
| 125 | +#define MIKROBUS_2_SDA MIKROBUS_2_DIP_SDA |
| 126 | + |
| 127 | +#ifdef GPIO_PD0 |
| 128 | +#define LED_1 GPIO_PD0 |
| 129 | +#endif |
| 130 | +#ifdef GPIO_PD1 |
| 131 | +#define LED_2 GPIO_PD1 |
| 132 | +#endif |
| 133 | +#ifdef GPIO_PD2 |
| 134 | +#define LED_3 GPIO_PD2 |
| 135 | +#endif |
| 136 | +#ifdef GPIO_PD3 |
| 137 | +#define LED_4 GPIO_PD3 |
| 138 | +#endif |
| 139 | +#ifdef GPIO_PB0 |
| 140 | +#define LED_5 GPIO_PB0 |
| 141 | +#endif |
| 142 | +#ifdef GPIO_PB1 |
| 143 | +#define LED_6 GPIO_PB1 |
| 144 | +#endif |
| 145 | +#ifdef GPIO_PB2 |
| 146 | +#define LED_7 GPIO_PB2 |
| 147 | +#endif |
| 148 | +#ifdef GPIO_PB3 |
| 149 | +#define LED_8 GPIO_PB3 |
| 150 | +#endif |
| 151 | +#endif |
| 152 | + |
| 153 | +#ifdef __cplusplus |
| 154 | +} |
| 155 | +#endif |
| 156 | + |
| 157 | +#endif // _BOARD_H_ |
| 158 | +// ------------------------------------------------------------------------- END |
0 commit comments