|
| 1 | +/* |
| 2 | + * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | + * or more contributor license agreements. See the NOTICE file |
| 4 | + * distributed with this work for additional information |
| 5 | + * regarding copyright ownership. The ASF licenses this file |
| 6 | + * to you under the Apache License, Version 2.0 (the |
| 7 | + * "License"); you may not use this file except in compliance |
| 8 | + * with the License. You may obtain a copy of the License at |
| 9 | + * |
| 10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, |
| 13 | + * software distributed under the License is distributed on an |
| 14 | + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | + * KIND, either express or implied. See the License for the |
| 16 | + * specific language governing permissions and limitations |
| 17 | + * under the License. |
| 18 | + */ |
| 19 | + |
| 20 | +#ifndef _BSP_H_ |
| 21 | +#define _BSP_H_ |
| 22 | + |
| 23 | +#include <inttypes.h> |
| 24 | + |
| 25 | +#ifdef __cplusplus |
| 26 | +extern "C" { |
| 27 | +#endif |
| 28 | + |
| 29 | +/* Define special stackos sections */ |
| 30 | +#define sec_data_core __attribute__((section(".data.core"))) |
| 31 | +#define sec_bss_core __attribute__((section(".bss.core"))) |
| 32 | +#define sec_bss_nz_core __attribute__((section(".bss.core.nz"))) |
| 33 | + |
| 34 | +/* More convenient section placement macros. */ |
| 35 | +#define bssnz_t sec_bss_nz_core |
| 36 | + |
| 37 | +extern uint8_t _ram_start[]; |
| 38 | +#define RAM_SIZE 0x10000 |
| 39 | + |
| 40 | +/* LED pins */ |
| 41 | +#define LED_RED (28) |
| 42 | +#define LED_GREEN (30) |
| 43 | +#define LED_BLUE (43) |
| 44 | +#define LED_1 (LED_GREEN) |
| 45 | +#define LED_2 (LED_RED) |
| 46 | +#define LED_3 (LED_BLUE) |
| 47 | +#define LED_BLINK_PIN (LED_1) |
| 48 | + |
| 49 | +/* Buttons */ |
| 50 | +#define BUTTON_1 (4) |
| 51 | +#define BUTTON_2 (22) |
| 52 | + |
| 53 | +/* MikroBUS(R) pins */ |
| 54 | +#define MIKROBUS_1_PIN_AN (26) /* P0_26 */ |
| 55 | +#define MIKROBUS_1_PIN_CS (11) /* P0_11 */ |
| 56 | +#define MIKROBUS_1_PIN_SCK (8) /* P0_08 */ |
| 57 | +#define MIKROBUS_1_PIN_MISO (10) /* P0_10 */ |
| 58 | +#define MIKROBUS_1_PIN_MOSI (9) /* P0_09 */ |
| 59 | +#define MIKROBUS_1_PIN_PWM (12) /* P0_12 */ |
| 60 | +#define MIKROBUS_1_PIN_INT (25) /* P0_25 */ |
| 61 | +#define MIKROBUS_1_PIN_RX (6) /* P0_06 */ |
| 62 | +#define MIKROBUS_1_PIN_TX (27) /* P0_27 */ |
| 63 | +#define MIKROBUS_1_PIN_SCL (35) /* P1_03 */ |
| 64 | +#define MIKROBUS_1_PIN_SDA (34) /* P1_02 */ |
| 65 | + |
| 66 | +#define MIKROBUS_2_PIN_AN (5) /* P0_05 */ |
| 67 | +#define MIKROBUS_2_PIN_CS (37) /* P1_05 */ |
| 68 | +#define MIKROBUS_2_PIN_SCK (24) /* P0_24 */ |
| 69 | +#define MIKROBUS_2_PIN_MISO (38) /* P1_06 */ |
| 70 | +#define MIKROBUS_2_PIN_MOSI (39) /* P1_07 */ |
| 71 | +#define MIKROBUS_2_PIN_PWM (29) /* P0_29 */ |
| 72 | +#define MIKROBUS_2_PIN_INT (32) /* P1_00 */ |
| 73 | +#define MIKROBUS_2_PIN_RX (33) /* P1_01 */ |
| 74 | +#define MIKROBUS_2_PIN_TX (31) /* P0_31 */ |
| 75 | +#define MIKROBUS_2_PIN_SCL (35) /* P1_03 */ |
| 76 | +#define MIKROBUS_2_PIN_SDA (34) /* P1_02 */ |
| 77 | + |
| 78 | +/* QWIIC */ |
| 79 | +#define QWICC_PIN_SCL (35) /* P1_03 */ |
| 80 | +#define QWICC_PIN_SDA (34) /* P1_02 */ |
| 81 | + |
| 82 | +/* UART CP2105 ECI */ |
| 83 | +#define CP2105_ECI_RXD 44 |
| 84 | +#define CP2105_ECI_TXD 45 |
| 85 | +#define CP2105_ECI_CTS 46 |
| 86 | +#define CP2105_ECI_RTS 47 |
| 87 | + |
| 88 | +/* UART CP2105 SCI */ |
| 89 | +#define CP2105_SCI_RXD 20 |
| 90 | +#define CP2105_SCI_TXD 23 |
| 91 | +#define CP2105_SCI_RTS 19 |
| 92 | +#define CP2105_SCI_CTS 21 |
| 93 | + |
| 94 | +#ifdef __cplusplus |
| 95 | +} |
| 96 | +#endif |
| 97 | + |
| 98 | +#endif /* _BSP_H_ */ |
0 commit comments