1 /* 2 * Copyright (c) 2023 Juan Manuel Cruz <jcruz@fi.uba.ar>. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 15 * 3. Neither the name of the copyright holder nor the names of its 16 * contributors may be used to endorse or promote products derived from 17 * this software without specific prior written permission. 18 * 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 22 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 23 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 28 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 29 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 * POSSIBILITY OF SUCH DAMAGE. 31 * 32 * @file : board.h 33 * @date : Set 26, 2023 34 * @author : Juan Manuel Cruz <jcruz@fi.uba.ar> <jcruz@frba.utn.edu.ar> 35 * @version v1.0.0 36 */ 37 38 #ifndef BOARD_INC_BOARD_H_ 39 #define BOARD_INC_BOARD_H_ 40 41 /********************** CPP guard ********************************************/ 42 #ifdef __cplusplus 43 extern "C" { 44 #endif 45 46 /********************** inclusions *******************************************/ 47 48 /********************** macros ***********************************************/ 49 #define NUCLEO_F103RC (0) 50 #define NUCLEO_F401RE (1) 51 #define NUCLEO_F446RE (2) 52 #define NUCLEO_F429ZI (3) 53 #define NUCLEO_F439ZI (4) 54 #define NUCLEO_F413ZH (5) 55 #define STM32F429I_DISCO1 (6) 56 57 #define BOARD (NUCLEO_F103RC) 58 59 /* STM32 Nucleo Boards - 64 Pins */ 60 #if ((BOARD == NUCLEO_F103RC) || (BOARD == NUCLEO_F401RE) || (BOARD == NUCLEO_F446RE)) 61 62 #define BTN_A_PIN B1_Pin 63 #define BTN_A_PORT B1_GPIO_Port 64 #define BTN_A_PRESSED GPIO_PIN_RESET 65 #define BTN_A_HOVER GPIO_PIN_SET 66 67 #define LED_A_PIN LD2_Pin 68 #define LED_A_PORT LD2_GPIO_Port 69 #define LED_A_ON GPIO_PIN_SET 70 #define LED_A_OFF GPIO_PIN_RESET 71 72 #endif/* STM32 Nucleo Boards - 144 Pins */ 73 74 #if ((BOARD == NUCLEO_F429ZI) || (BOARD == NUCLEO_F439ZI) || (BOARD == NUCLEO_F413ZH)) 75 76 #define BTN_A_PIN USER_Btn_Pin 77 #define BTN_A_PORT USER_Btn_GPIO_Port 78 #define BTN_A_PRESSED GPIO_PIN_SET 79 #define BTN_A_HOVER GPIO_PIN_RESET 80 81 #define LED_A_PIN LD1_Pin 82 #define LED_A_PORT LD1_GPIO_Port 83 #define LED_A_ON GPIO_PIN_SET 84 #define LED_A_OFF GPIO_PIN_RESET 85 86 #endif 87 88 /* STM32 Discovery Kits */ 89 #if (BOARD == STM32F429I_DISCO1) 90 91 #define BTN_A_PIN B1_Pin 92 #define BTN_A_PORT B1_GPIO_Port 93 #define BTN_A_PRESSED GPIO_PIN_SET 94 #define BTN_A_HOVER GPIO_PIN_RESET 95 96 #define LED_A_PIN LD3_Pin 97 #define LED_A_PORT LD3_GPIO_Port 98 #define LED_A_ON GPIO_PIN_SET 99 #define LED_A_OFF GPIO_PIN_RESET 100 101 #endif 102 103 /********************** typedef **********************************************/ 104 105 /********************** external data declaration ****************************/ 106 107 /********************** external functions declaration ***********************/ 108 109 /********************** End of CPP guard *************************************/ 110 #ifdef __cplusplus 111 } 112 #endif 113 114 #endif /* BOARD_INC_BOARD_H_ */ 115 116 /********************** end of file ******************************************/
