dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_iap.h
Go to the documentation of this file.
1 
16 /*
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation; either version 3 of the License, or
20  * (at your option) any later version.
21  *
22  * This program is distributed in the hope that it will be useful, but
23  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
24  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
25  * for more details.
26  *
27  * You should have received a copy of the GNU General Public License along
28  * with this program; if not, see <http://www.gnu.org/licenses/>
29  */
30 
31 #ifndef PIOS_IAP_H_
32 #define PIOS_IAP_H_
33 
34 
35 /****************************************************************************************
36  * Header files
37  ****************************************************************************************/
38 
39 /*****************************************************************************************
40  * Public Definitions/Macros
41  ****************************************************************************************/
42 #if defined(STM32F4XX) || defined(STM32F30X)
43 #define MAGIC_REG_1 RTC_BKP_DR1
44 #define MAGIC_REG_2 RTC_BKP_DR2
45 #define IAP_BOOTCOUNT RTC_BKP_DR3
46 #else
47 #define MAGIC_REG_1 BKP_DR1
48 #define MAGIC_REG_2 BKP_DR2
49 #define IAP_BOOTCOUNT BKP_DR3
50 #endif
51 
52 /****************************************************************************************
53  * Public Functions
54  ****************************************************************************************/
55 void PIOS_IAP_Init(void);
56 uint32_t PIOS_IAP_CheckRequest( void );
57 uint32_t PIOS_Boot_CheckRequest( void );
58 void PIOS_IAP_SetRequest1(void);
59 void PIOS_IAP_SetRequest2(void);
60 void PIOS_IAP_SetRequest3(void);
61 void PIOS_IAP_ClearRequest(void);
62 uint16_t PIOS_IAP_ReadBootCount(void);
63 void PIOS_IAP_WriteBootCount(uint16_t);
64 
65 /****************************************************************************************
66  * Public Data
67  ****************************************************************************************/
68 
69 #endif /* PIOS_IAP_H_ */
uint32_t PIOS_IAP_CheckRequest(void)
Determines if an In-Application-Programming request has been made.
Definition: pios_iap.c:57
uint16_t PIOS_IAP_ReadBootCount(void)
Definition: pios_iap.c:93
void PIOS_IAP_Init(void)
PIOS_IAP_Init - performs required initializations for iap module.
Definition: pios_iap.c:44
void PIOS_IAP_SetRequest3(void)
Definition: pios_iap.c:84
void PIOS_IAP_ClearRequest(void)
Definition: pios_iap.c:89
uint32_t PIOS_Boot_CheckRequest(void)
Determines if a boot request has been made.
Definition: pios_iap.c:63
void PIOS_IAP_WriteBootCount(uint16_t)
Definition: pios_iap.c:98
void PIOS_IAP_SetRequest2(void)
Definition: pios_iap.c:79
void PIOS_IAP_SetRequest1(void)
Sets the 1st word of the request sequence.
Definition: pios_iap.c:74