30
+ − 1 ///////////////////////////////////////////////////////////////////////////////
+ − 2 /// -*- coding: UTF-8 -*-
+ − 3 ///
+ − 4 /// \file BootLoader/Inc/base_bootloader.h
+ − 5 /// \brief Header for main.c module
+ − 6 /// \author MCD Application Team
+ − 7 /// \date 26-February-2014
+ − 8 ///
+ − 9 /// $Id$
+ − 10 ///////////////////////////////////////////////////////////////////////////////
+ − 11 /// \par Copyright (c) 2014-2018 Heinrichs Weikamp gmbh
+ − 12 ///
+ − 13 /// This program is free software: you can redistribute it and/or modify
+ − 14 /// it under the terms of the GNU General Public License as published by
+ − 15 /// the Free Software Foundation, either version 3 of the License, or
+ − 16 /// (at your option) any later version.
+ − 17 ///
+ − 18 /// This program is distributed in the hope that it will be useful,
+ − 19 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
+ − 20 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ − 21 /// GNU General Public License for more details.
+ − 22 ///
+ − 23 /// You should have received a copy of the GNU General Public License
+ − 24 /// along with this program. If not, see <http://www.gnu.org/licenses/>.
+ − 25 //////////////////////////////////////////////////////////////////////////////
+ − 26 /**
+ − 27 ******************************************************************************
+ − 28 * @attention
+ − 29 *
+ − 30 * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
+ − 31 *
+ − 32 * Redistribution and use in source and binary forms, with or without modification,
+ − 33 * are permitted provided that the following conditions are met:
+ − 34 * 1. Redistributions of source code must retain the above copyright notice,
+ − 35 * this list of conditions and the following disclaimer.
+ − 36 * 2. Redistributions in binary form must reproduce the above copyright notice,
+ − 37 * this list of conditions and the following disclaimer in the documentation
+ − 38 * and/or other materials provided with the distribution.
+ − 39 * 3. Neither the name of STMicroelectronics nor the names of its contributors
+ − 40 * may be used to endorse or promote products derived from this software
+ − 41 * without specific prior written permission.
+ − 42 *
+ − 43 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ − 44 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ − 45 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ − 46 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+ − 47 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ − 48 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ − 49 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ − 50 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ − 51 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ − 52 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ − 53 *
+ − 54 ******************************************************************************
+ − 55 */
+ − 56
+ − 57 /* Define to prevent recursive inclusion -------------------------------------*/
+ − 58 #ifndef BASE_BOOTLOADER_H
+ − 59 #define BASE_BOOTLOADER_H
+ − 60
+ − 61 /* Includes ------------------------------------------------------------------*/
+ − 62
+ − 63 #define STM32F429xx
+ − 64
+ − 65 #include "stm32f4xx_hal.h"
+ − 66
+ − 67 #include "tStructure.h"
+ − 68 #include "settings.h"
+ − 69
+ − 70 /* Exported types ------------------------------------------------------------*/
+ − 71 /* Exported constants --------------------------------------------------------*/
+ − 72
+ − 73 /* Exported macro ------------------------------------------------------------*/
+ − 74
+ − 75 #define TOP_LAYER 1
+ − 76 #define BACKGRD_LAYER 0
+ − 77
+ − 78 #define SURFMODE 1
+ − 79 #define DIVEMODE 2
+ − 80
+ − 81 typedef enum
+ − 82 {
+ − 83 ST_Boot = 0,
+ − 84 ST_Surface,
+ − 85 ST_Dive,
+ − 86 ST_Menu,
+ − 87 ST_END
+ − 88 } SState;
+ − 89
+ − 90 typedef enum
+ − 91 {
+ − 92 ACTION_IDLE_TICK = 0,
+ − 93 ACTION_IDLE_SECOND,
+ − 94 ACTION_MODE_CHANGE,
+ − 95 ACTION_TIMEOUT,
+ − 96 ACTION_BUTTON_CUSTOM,
+ − 97 ACTION_BUTTON_BACK,
+ − 98 ACTION_BUTTON_NEXT,
+ − 99 ACTION_BUTTON_ENTER,
+ − 100 ACTION_BUTTON_ENTER_FINAL,
+ − 101 ACTION_END
+ − 102 } SAction;
+ − 103
+ − 104 /* Exported macro ------------------------------------------------------------*/
+ − 105 /* Exported functions ------------------------------------------------------- */
+ − 106
+ − 107 uint32_t get_globalState(void);
+ − 108 void set_globalState(uint32_t newID);
+ − 109 void get_globalStateList(SStateList *output);
+ − 110 void set_globalState_Menu_Page(uint8_t page);
+ − 111 void set_globalState_Menu_Line(uint8_t line);
+ − 112 void get_idSpecificStateList(uint32_t id, SStateList *output);
+ − 113 void delayMicros(uint32_t micros);
+ − 114 void get_RTC_DateTime(RTC_DateTypeDef * sdatestructureget, RTC_TimeTypeDef * stimestructureget);
+ − 115 void set_RTC_DateTime(RTC_DateTypeDef * sdatestructure, RTC_TimeTypeDef * stimestructure);
+ − 116 uint8_t get_globalMode(void);
+ − 117 void set_globalMode(uint8_t newMode);
+ − 118 void set_globalState_Log_Page(uint8_t pageIsLine);
+ − 119 void set_globalState_Base(void);
+ − 120
+ − 121 void set_returnFromComm(void);
+ − 122
+ − 123 #endif /* BASE_BOOTLOADER_H */