1 /**
2 ******************************************************************************
3 * @file  HAL_bkp.c
4 * @author  AE Team
5 * @version  V2.0.0
6 * @date  22/08/2017
7 * @brief  This file provides all the BKP firmware functions.
8 ******************************************************************************
9 * @copy
10 *
11 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
12 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
13 * TIME. AS A RESULT, MindMotion SHALL NOT BE HELD LIABLE FOR ANY
14 * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
15 * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
16 * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
17 *
18 * <h2><center>&copy; COPYRIGHT 2017 MindMotion</center></h2>
19 */
20 
21 /* Includes ------------------------------------------------------------------*/
22 #include "HAL_bkp.h"
23 
24 /** @addtogroup StdPeriph_Driver
25 * @{
26 */
27 
28 /** @defgroup BKP
29 * @brief BKP driver modules
30 * @{
31 */
32 
33 /**
34 * @brief  Writes user data to the specified Data Backup Register.
35 * @param BKP_DR: specifies the Data Backup Register.
36 *   This parameter can be BKP_DRx where x:[1, 42]
37 * @param Data: data to write
38 * @retval : None
39 */
BKP_WriteBackupRegister(uint16_t BKP_DR,uint16_t Data)40 void BKP_WriteBackupRegister(uint16_t BKP_DR, uint16_t Data)
41 {
42   /* Check the parameters */
43   assert_param(IS_BKP_DR(BKP_DR));
44   *(__IO uint16_t *) (BKP_BASE + BKP_DR) = Data;
45 }
46 
47 /**
48 * @brief  Reads data from the specified Data Backup Register.
49 * @param BKP_DR: specifies the Data Backup Register.
50 *   This parameter can be BKP_DRx where x:[1, 42]
51 * @retval : The content of the specified Data Backup Register
52 */
BKP_ReadBackupRegister(uint16_t BKP_DR)53 uint16_t BKP_ReadBackupRegister(uint16_t BKP_DR)
54 {
55   /* Check the parameters */
56   assert_param(IS_BKP_DR(BKP_DR));
57   return (*(__IO uint16_t *) (BKP_BASE + BKP_DR));
58 }
59 
60 /*-------------------------(C) COPYRIGHT 2017 MindMotion ----------------------*/
61