RTLib
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
example_config.h
Go to the documentation of this file.
1 
9 /*
10  * This file is part of RTLib.
11  *
12  * Copyright (C) 2017-2018 Derppening <david.18.19.21@gmail.com>
13  *
14  * RTLib is free software: you can redistribute it and/or modify
15  * it under the terms of the GNU Lesser General Public License as published by
16  * the Free Software Foundation, either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * RTLib is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU Lesser General Public License for more details.
23  *
24  * You should have received a copy of the GNU Lesser General Public License
25  * along with RTLib. If not, see <http://www.gnu.org/licenses/>.
26  */
27 
28 #ifndef RTLIB_CONFIG_EXAMPLE_CONFIG_H_
29 #define RTLIB_CONFIG_EXAMPLE_CONFIG_H_
30 
31 // Use !defined(...) to check if the appropriate device is targeted before proceeding
32 // Replace ... in the brackets to the MCU model of your target device.
33 #if !defined(STM32F103VCT6)
34 #error "This configuration is designed for a STM32F103VCT6 device. (Did you set DEVICE in CMakeLists.txt correctly?)"
35 #endif // !defined(STM32F103VCT6)
36 
37 // You must define all LIB_USE_*. If your board does not have the feature, or you do not intend to expose the API to
38 // other users, set the macro to 0. A compilation error will occur if a user tries to include a library which is
39 // disabled in this file.
40 #define LIB_USE_BUTTON 0
41 #define LIB_USE_LED 1
42 
43 // To use wrapper classes for any devices under lib, define all pin outputs here.
44 // The format of the macro is
45 // #define LIB_DEVICEx_PINOUT {GPIO, GPIO_PIN}
46 // where DEVICE is the device under lib, x is the ID of the device, GPIO is the GPIO, and GPIO_PIN is the pin.
47 // All devices IDs in this file start from 0, and corresponds to 0 in Config structs.
48 #define LIB_LED0_PINOUT {GPIOB, GPIO0}
49 
50 // Other devices may require more than one pinout. These will also be defined here.
51 // TODO(Derppening): Add example from UART
52 
53 #endif // RTLIB_CONFIG_EXAMPLE_CONFIG_H_