|
| 1 | +/* |
| 2 | + * Copyright (c) 2023, Xiaoyu Hong |
| 3 | + * |
| 4 | + * Permission to use, copy, modify, and/or distribute this software |
| 5 | + * for any purpose with or without fee is hereby granted, provided |
| 6 | + * that the above copyright notice and this permission notice |
| 7 | + * appear in all copies. |
| 8 | + * |
| 9 | + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 10 | + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 11 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 12 | + * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR |
| 13 | + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM |
| 14 | + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, |
| 15 | + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN |
| 16 | + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 17 | + */ |
| 18 | + |
| 19 | +#ifndef CONFIG_H_INCLUDED |
| 20 | +#define CONFIG_H_INCLUDED |
| 21 | + |
| 22 | +#ifndef APP_BASE_ADDRESS |
| 23 | +#define APP_BASE_ADDRESS (0x08000000 + BOOTLOADER_OFFSET) |
| 24 | +#endif |
| 25 | +#ifndef FLASH_SIZE_OVERRIDE |
| 26 | +#define FLASH_SIZE_OVERRIDE 0x20000 |
| 27 | +#endif |
| 28 | +#ifndef FLASH_PAGE_SIZE |
| 29 | +#define FLASH_PAGE_SIZE 1024 |
| 30 | +#endif |
| 31 | +#ifndef DFU_UPLOAD_AVAILABLE |
| 32 | +#define DFU_UPLOAD_AVAILABLE 1 |
| 33 | +#endif |
| 34 | +#ifndef DFU_DOWNLOAD_AVAILABLE |
| 35 | +#define DFU_DOWNLOAD_AVAILABLE 1 |
| 36 | +#endif |
| 37 | + |
| 38 | +#ifndef HAVE_LED |
| 39 | +#define HAVE_LED 1 |
| 40 | +#endif |
| 41 | +#ifndef LED_ACTIVE_HIGH |
| 42 | +#define LED_ACTIVE_HIGH 1 |
| 43 | +#endif |
| 44 | +#ifndef LED_OPEN_DRAIN |
| 45 | +#define LED_OPEN_DRAIN 0 |
| 46 | +#endif |
| 47 | +#ifndef LED_GPIO_PORT |
| 48 | +#define LED_GPIO_PORT GPIOB |
| 49 | +#endif |
| 50 | +#ifndef LED_GPIO_PIN |
| 51 | +#define LED_GPIO_PIN GPIO5 |
| 52 | +#endif |
| 53 | + |
| 54 | +#ifndef HAVE_BUTTON |
| 55 | +#define HAVE_BUTTON 1 |
| 56 | +#endif |
| 57 | +#ifndef BUTTON_ACTIVE_HIGH |
| 58 | +#define BUTTON_ACTIVE_HIGH 1 |
| 59 | +#endif |
| 60 | +#ifndef BUTTON_GPIO_PORT |
| 61 | +#define BUTTON_GPIO_PORT GPIOB |
| 62 | +#endif |
| 63 | +#ifndef BUTTON_GPIO_PIN |
| 64 | +#define BUTTON_GPIO_PIN GPIO2 |
| 65 | +#endif |
| 66 | + |
| 67 | +#ifndef BUTTON_USES_PULL |
| 68 | +#define BUTTON_USES_PULL 0 |
| 69 | +#endif |
| 70 | + |
| 71 | +#ifndef BUTTON_SAMPLE_DELAY_CYCLES |
| 72 | +#define BUTTON_SAMPLE_DELAY_CYCLES 1440000 |
| 73 | +#endif |
| 74 | + |
| 75 | +#ifndef HAVE_USB_PULLUP_CONTROL |
| 76 | +#define HAVE_USB_PULLUP_CONTROL 1 |
| 77 | +#endif |
| 78 | +#ifndef USB_PULLUP_GPIO_PORT |
| 79 | +#define USB_PULLUP_GPIO_PORT GPIOA |
| 80 | +#endif |
| 81 | +#ifndef USB_PULLUP_GPIO_PIN |
| 82 | +#define USB_PULLUP_GPIO_PIN GPIO15 |
| 83 | +#endif |
| 84 | +#ifndef USB_PULLUP_ACTIVE_HIGH |
| 85 | +#define USB_PULLUP_ACTIVE_HIGH 1 |
| 86 | +#endif |
| 87 | +#ifndef USB_PULLUP_OPEN_DRAIN |
| 88 | +#define USB_PULLUP_OPEN_DRAIN 0 |
| 89 | +#endif |
| 90 | + |
| 91 | +#ifndef USES_GPIOA |
| 92 | +#define USES_GPIOA 1 |
| 93 | +#endif |
| 94 | + |
| 95 | +#ifndef USES_GPIOB |
| 96 | +#define USES_GPIOB 1 |
| 97 | +#endif |
| 98 | + |
| 99 | +#ifndef USES_GPIOC |
| 100 | +#define USES_GPIOC 1 |
| 101 | +#endif |
| 102 | + |
| 103 | +#ifndef USES_HSE_12M |
| 104 | +#define USES_HSE_12M 1 |
| 105 | +#endif |
| 106 | + |
| 107 | +#endif |
0 commit comments