tdse-tp3_04-interactive_menu

Index Commits Files Refs
app/inc/board.h (4669B)
   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_F303R8        (1)
  51 #define NUCLEO_F401RE        (2)
  52 #define NUCLEO_F446RE        (3)
  53 #define NUCLEO_F413ZH        (4)
  54 #define NUCLEO_F429ZI        (5)
  55 #define NUCLEO_F439ZI        (6)
  56 #define NUCLEO_F767ZI        (7)
  57 #define STM32F407G_DISC1    (8)
  58 #define STM32F429I_DISC1    (9)
  59 
  60 #define BOARD (NUCLEO_F103RC)
  61 
  62 /* STM32 Nucleo Boards - 32 Pins */
  63 #if (BOARD == NUCLEO_F303R8)
  64 
  65 #endif
  66 
  67 /* STM32 Nucleo Boards - 64 Pins */
  68 #if ((BOARD == NUCLEO_F103RC) || (BOARD == NUCLEO_F401RE) || (BOARD == NUCLEO_F446RE))
  69 
  70 #define BTN_A_PIN        B1_Pin
  71 #define BTN_A_PORT        B1_GPIO_Port
  72 #define BTN_A_PRESSED    GPIO_PIN_RESET
  73 #define BTN_A_HOVER        GPIO_PIN_SET
  74 
  75 #define BTN_ENT_PIN        D10_Pin
  76 #define BTN_ENT_PORT    D10_GPIO_Port
  77 #define BTN_ENT_PRESSED    GPIO_PIN_RESET
  78 #define BTN_ENT_HOVER    GPIO_PIN_SET
  79 
  80 #define BTN_NEX_PIN        D11_Pin
  81 #define BTN_NEX_PORT    D11_GPIO_Port
  82 #define BTN_NEX_PRESSED    GPIO_PIN_RESET
  83 #define BTN_NEX_HOVER    GPIO_PIN_SET
  84 
  85 #define BTN_ESC_PIN        D12_Pin
  86 #define BTN_ESC_PORT    D12_GPIO_Port
  87 #define BTN_ESC_PRESSED    GPIO_PIN_RESET
  88 #define BTN_ESC_HOVER    GPIO_PIN_SET
  89 
  90 #define LED_A_PIN        LD2_Pin
  91 #define LED_A_PORT        LD2_GPIO_Port
  92 #define LED_A_ON        GPIO_PIN_SET
  93 #define LED_A_OFF        GPIO_PIN_RESET
  94 
  95 #endif
  96 
  97 /* STM32 Nucleo Boards - 144 Pins */
  98 #if ((BOARD == NUCLEO_F413ZH) || (BOARD == NUCLEO_F429ZI) || (BOARD == NUCLEO_F439ZI) || (BOARD == NUCLEO_F767ZI))
  99 
 100 #define BTN_A_PIN        USER_Btn_Pin
 101 #define BTN_A_PORT        USER_Btn_GPIO_Port
 102 #define BTN_A_PRESSED    GPIO_PIN_SET
 103 #define BTN_A_HOVER        GPIO_PIN_RESET
 104 
 105 #define LED_A_PIN        LD1_Pin
 106 #define LED_A_PORT        LD1_GPIO_Port
 107 #define LED_A_ON        GPIO_PIN_SET
 108 #define LED_A_OFF        GPIO_PIN_RESET
 109 
 110 #endif
 111 
 112 /* STM32 Discovery Kits */
 113 #if ((BOARD == STM32F407G_DISC1) || (BOARD == STM32F429I_DISC1))
 114 
 115 #define BTN_A_PIN        B1_Pin
 116 #define BTN_A_PORT        B1_GPIO_Port
 117 #define BTN_A_PRESSED    GPIO_PIN_SET
 118 #define BTN_A_HOVER        GPIO_PIN_RESET
 119 
 120 #define LED_A_PIN        LD3_Pin
 121 #define LED_A_PORT        LD3_GPIO_Port
 122 #define LED_A_ON        GPIO_PIN_SET
 123 #define LED_A_OFF        GPIO_PIN_RESET
 124 
 125 #endif
 126 
 127 /********************** typedef **********************************************/
 128 
 129 /********************** external data declaration ****************************/
 130 
 131 /********************** external functions declaration ***********************/
 132 
 133 /********************** End of CPP guard *************************************/
 134 #ifdef __cplusplus
 135 }
 136 #endif
 137 
 138 #endif /* BOARD_INC_BOARD_H_ */
 139 
 140 /********************** end of file ******************************************/