board.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2013 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
21 #include <stdint.h>
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
31 void _native_LED_GREEN_OFF(void);
32 void _native_LED_GREEN_ON(void);
33 void _native_LED_GREEN_TOGGLE(void);
34 void _native_LED_RED_OFF(void);
35 void _native_LED_RED_ON(void);
36 void _native_LED_RED_TOGGLE(void);
37 
38 #define LED0_ON (_native_LED_RED_ON())
39 #define LED0_OFF (_native_LED_RED_OFF())
40 #define LED0_TOGGLE (_native_LED_RED_TOGGLE())
41 #define LED1_ON (_native_LED_GREEN_ON())
42 #define LED1_OFF (_native_LED_GREEN_OFF())
43 #define LED1_TOGGLE (_native_LED_GREEN_TOGGLE())
46 #if defined(MODULE_MTD) || DOXYGEN
51 #ifndef MTD_PAGE_SIZE
52 #if defined(MODULE_FATFS) || defined(MODULE_LWEXT4)
53 #define MTD_PAGE_SIZE (512)
54 #else
55 #define MTD_PAGE_SIZE (256)
56 #endif
57 #endif
58 #ifndef MTD_SECTOR_SIZE
59 #if defined(MODULE_FATFS) || defined(MODULE_LWEXT4)
60 #define MTD_SECTOR_SIZE (512)
61 #else
62 #define MTD_SECTOR_SIZE (4096)
63 #endif
64 #endif
65 #ifndef MTD_SECTOR_NUM
66 #if defined(MODULE_FATFS) || defined(MODULE_LWEXT4)
67 #define MTD_SECTOR_NUM (32768)
68 #else
69 #define MTD_SECTOR_NUM (2048)
70 #endif
71 #endif
74 #ifndef MTD_WRITE_SIZE
75 #define MTD_WRITE_SIZE (1)
76 #endif
77 #ifndef MTD_NATIVE_FILENAME
78 #define MTD_NATIVE_FILENAME "MEMORY.bin"
79 #endif
83 #define MTD_0 mtd_dev_get(0)
84 #endif
85 
90 #ifndef FS_NATIVE_DIR
91 #define FS_NATIVE_DIR "native"
92 #endif
95 #if defined(MODULE_SPIFFS) || DOXYGEN
100 /* SPIFFS config flags */
101 #ifndef SPIFFS_READ_ONLY
102 #define SPIFFS_READ_ONLY (0)
103 #endif
104 #ifndef SPIFFS_SINGLETON
105 #define SPIFFS_SINGLETON (0)
106 #endif
107 #ifndef SPIFFS_HAL_CALLBACK_EXTRA
108 #define SPIFFS_HAL_CALLBACK_EXTRA (1)
109 #endif
110 #ifndef SPIFFS_CACHE
111 #define SPIFFS_CACHE (1)
112 #endif
113 
114 #if SPIFFS_SINGLETON == 1
115 /* MTD config if singleton is used */
116 #ifndef SPIFFS_CFG_PHYS_SZ
117 #define SPIFFS_CFG_PHYS_SZ(ignore) (MTD_SECTOR_SIZE * MTD_SECTOR_NUM)
118 #endif
119 #ifndef SPIFFS_CFG_PHYS_ERASE_SZ
120 #define SPIFFS_CFG_PHYS_ERASE_SZ(ignore) (MTD_SECTOR_SIZE)
121 #endif
122 #ifndef SPIFFS_CFG_PHYS_ADDR
123 #define SPIFFS_CFG_PHYS_ADDR(ignore) (0)
124 #endif
125 #ifndef SPIFFS_CFG_LOG_PAGE_SZ
126 #define SPIFFS_CFG_LOG_PAGE_SZ(ignore) (MTD_PAGE_SIZE)
127 #endif
128 #ifndef SPIFFS_CFG_LOG_BLOCK_SZ
129 #define SPIFFS_CFG_LOG_BLOCK_SZ(ignore) (MTD_SECTOR_SIZE)
130 #endif
131 #endif
132 
133 #if SPIFFS_HAL_CALLBACK_EXTRA == 0
134 /* Default MTD device if no callback parameter */
135 #ifndef SPIFFS_MTD_DEV
136 #define SPIFFS_MTD_DEV (MTD_0)
137 #endif
138 #endif
140 #endif
141 
146 /* on native, anything can happen... */
147 #define CONFIG_ZTIMER_USEC_MIN (64)
150 #ifdef __cplusplus
151 }
152 #endif
153