本文整理汇总了C++中BKP_WriteBackupRegister函数的典型用法代码示例。如果您正苦于以下问题:C++ BKP_WriteBackupRegister函数的具体用法?C++ BKP_WriteBackupRegister怎么用?C++ BKP_WriteBackupRegister使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BKP_WriteBackupRegister函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Write_Flash_GPS_Info
/***********************************************************
* 函数名:Write_GPS_Info
* 描述 :把GPS信息从CPU写入Flash
* 输入 : 无
* 输出 : 无
***********************************************************/
void Write_Flash_GPS_Info(void)
{
FLASHStatus = FLASH_COMPLETE;
MemoryProgramStatus = PASSED;
FLASH_Unlock(); //FLASH解锁
FLASH_ClearFlag(FLASH_FLAG_BSY | FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR);//清标志位
NbrOfPage = (EndAddr[10] - StartAddr[10]) / FLASH_PAGE_SIZE; //页面擦除子程序
FLASHStatus = FLASH_ErasePage(StartAddr[10] + (FLASH_PAGE_SIZE * NbrOfPage));
FlashAddress = StartAddr[10];
FLASHStatus = FLASH_ProgramWord(FlashAddress, jingdu);
FlashAddress = FlashAddress + 4;
FLASHStatus = FLASH_ProgramWord(FlashAddress, weidu);
FlashAddress = FlashAddress + 4;
FLASHStatus = FLASH_ProgramWord(FlashAddress, sog);
FlashAddress = FlashAddress + 4;
FLASHStatus = FLASH_ProgramWord(FlashAddress, direction);
BKP_WriteBackupRegister(BKP_DR4,(u16)(jingdu >> 16));
BKP_WriteBackupRegister(BKP_DR5,(u16)(weidu >> 16));
BKP_WriteBackupRegister(BKP_DR7,(u16)jingdu);
BKP_WriteBackupRegister(BKP_DR8,(u16)weidu);
BKP_WriteBackupRegister(BKP_DR9,sog);
BKP_WriteBackupRegister(BKP_DR10,direction);
}
开发者ID:baidcwsse,项目名称:NETMARK_W100,代码行数:33,代码来源:flashwr.c
示例2: SetRTCTime
/*********************************
**函数名:SetRTCTime
**功能:设置时间,除了把Real_Time的值改变外,还要把时分秒转换为RTC计数值,年月日存到后备寄存器上
**注意事项:函数内会自动根据年月日计算星期,并且返回到*time上
**********************************/
void SetRTCTime(T_STRUCT* time)
{
u32 count;
RTC_ITConfig(RTC_IT_SEC, DISABLE); //关闭秒中断
RTC_WaitForLastTask();
//付时间值到Real_Time上
Real_Time.year=time->year;
Real_Time.month=time->month;
Real_Time.day=time->day;
Real_Time.hour=time->hour;
Real_Time.minute=time->minute;
Real_Time.sec=time->sec;
//计算星期
time->date=Real_Time.date=GetDate(time);
//把新的年月日存到掉电寄存器上
BKP_WriteBackupRegister(BKP_TIME_DATE,Real_Time.date);
// RTC_WaitForLastTask();
BKP_WriteBackupRegister(BKP_TIME_DAY,Real_Time.day);
// RTC_WaitForLastTask();
BKP_WriteBackupRegister(BKP_TIME_MONTH,Real_Time.month);
// RTC_WaitForLastTask();
BKP_WriteBackupRegister(BKP_TIME_YEAR,Real_Time.year);
// RTC_WaitForLastTask();
//计算新的RTC count值
count=Real_Time.hour*3600+Real_Time.minute*60+Real_Time.sec;
RTC_WaitForLastTask();
RTC_SetCounter(count);
RTC_WaitForLastTask();
RTC_ITConfig(RTC_IT_SEC, ENABLE); //打开秒中断
}
开发者ID:jiangtaojiang,项目名称:bloodpressure,代码行数:39,代码来源:RTC.c
示例3: ReadflashMPeriod
/***********************************************************
* 函数名:ReadflashMPeriod
* 描述 :把msequence_poly从Flash读入CPU
* 输入 : 无
* 输出 : 无
***********************************************************/
void ReadflashMPeriod(void) //记录发射间隔次数固定值
{
FlashAddress = StartAddr[4];
gps_invalid = *(u16*)FlashAddress;
FlashAddress += 4;
intervalA = *(u16*)FlashAddress;
FlashAddress += 4;
intervalB = *(u16*)FlashAddress;
FlashAddress += 4;
interval_num = *(u16*)FlashAddress;
FlashAddress += 4;
//time_o = *(u16*)FlashAddress;
FlashAddress += 4;
interval_s = *(u16*)FlashAddress;
BKP_WriteBackupRegister(BKP_DR1,interval_num);
// BKP_WriteBackupRegister(BKP_DR2,time_o);
BKP_WriteBackupRegister(BKP_DR3,interval_s);
// interval_num = BKP_ReadBackupRegister(BKP_DR1);
// gps_invalid_num = BKP_ReadBackupRegister(BKP_DR2);
// interval_s = BKP_ReadBackupRegister(BKP_DR3);
}
开发者ID:baidcwsse,项目名称:NETMARK_W100,代码行数:35,代码来源:flashwr.c
示例4: WriteflashMPeriod
/***********************************************************
* 函数名:WriteflashMPeriod
* 描述 :把interval_s从CPU写入Flash
* 输入 : 无
* 输出 : 无
***********************************************************/
void WriteflashMPeriod(void)
{
FLASHStatus = FLASH_COMPLETE;
MemoryProgramStatus = PASSED;
FLASH_Unlock(); //FLASH解锁
FLASH_ClearFlag(FLASH_FLAG_BSY | FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR);//清标志位
NbrOfPage = (EndAddr[4] - StartAddr[4]) / FLASH_PAGE_SIZE;//页面擦除子程序
FLASHStatus = FLASH_ErasePage(StartAddr[4] + (FLASH_PAGE_SIZE * NbrOfPage));
FlashAddress = StartAddr[4];
FLASHStatus = FLASH_ProgramWord(FlashAddress, gps_invalid);
FlashAddress = FlashAddress + 4;
FLASHStatus = FLASH_ProgramWord(FlashAddress, intervalA);
FlashAddress = FlashAddress + 4;
FLASHStatus = FLASH_ProgramWord(FlashAddress, intervalB);
FlashAddress = FlashAddress + 4;
FLASHStatus = FLASH_ProgramWord(FlashAddress, interval_num);
FlashAddress = FlashAddress + 4;
// FLASHStatus = FLASH_ProgramWord(FlashAddress, time_o);
FlashAddress = FlashAddress + 4;
FLASHStatus = FLASH_ProgramHalfWord(FlashAddress, interval_s);
BKP_WriteBackupRegister(BKP_DR1,interval_num);
//BKP_WriteBackupRegister(BKP_DR2,time_o);
BKP_WriteBackupRegister(BKP_DR3,interval_s);
}
开发者ID:baidcwsse,项目名称:NETMARK_W100,代码行数:38,代码来源:flashwr.c
示例5: PVD_IRQHandler
void PVD_IRQHandler(void)
{
unsigned poweroff_cnt;
unsigned long time;
EXTI->PR = EXTI_Line16; //EXTI_ClearITPendingBit(EXTI_Line16);
/* 系统上电前500ms, 不认为是掉电; 若已处于系统掉电状态, 将不再处理 */
if ((rt_tick_get() < 50) || (NULL == rtc_dev) || is_system_powerdown) {
return;
}
/*
lcd_bl_led_off();
buzzer_off(buzzer_gpio, buzzer_pin);
*/
is_system_powerdown = 1;
sys_powerdown_delay4confirm = rt_tick_get();
PWR_BackupAccessCmd(ENABLE);
poweroff_cnt = BKP_ReadBackupRegister(RX_POWEROFF_CNT_BKP16BITS);
BKP_WriteBackupRegister(RX_POWEROFF_CNT_BKP16BITS, ++poweroff_cnt);
rt_device_control(rtc_dev, RT_DEVICE_CTRL_RTC_GET_TIME, &time);
BKP_WriteBackupRegister(RX_POWEROFF_N_BKP16BITS_H, (time>>16) & 0xffff);
BKP_WriteBackupRegister(RX_POWEROFF_N_BKP16BITS_L, (time) & 0xffff);
PWR_BackupAccessCmd(DISABLE);
//rt_kprintf("%s", __FUNCTION__);
return;
}
开发者ID:malooei,项目名称:yeejoin-workspace,代码行数:34,代码来源:stm32f10x_it.c
示例6: save_2g_err
void save_2g_err( unsigned char force, GPRS_REASON reason)
{
u16 result_temp ;
//force=1: save to BK reg even BKP_DR1 have data, force=0: don't save if have data
//BKP_DR1, ERR index: 15~12:MCU reset
// 11~8:upgrade fw failure code
// 7~4:GPRS failure reason
// 3~0:GSM module poweroff reason
//BKP_DR4, GPRS failure time (UTC Time) high
//BKP_DR5, GPRS failure time (UTC Time) low
if ( (BKP_ReadBackupRegister(BKP_DR1))&0x00F0 ) {//have data
if ( !force ) {//don't cover if have data
return ;
}
}
result_temp = (BKP_ReadBackupRegister(BKP_DR1))&0xFF0F;
result_temp = result_temp | ((reason<<4)&0xF0) ;
BKP_WriteBackupRegister(BKP_DR1, result_temp);
BKP_WriteBackupRegister(BKP_DR4, ((RTC_GetCounter( ))>>16)&0xFFFF);//high
BKP_WriteBackupRegister(BKP_DR5, (RTC_GetCounter( ))&0xFFFF);//low
}
开发者ID:bg8wj,项目名称:icar-firmware,代码行数:28,代码来源:drv_mg323.c
示例7: SaveTouchAdjInfo
/**************************************************************
** 函数名:SaveTouchAdjInfo
** 功能:保存触摸校正信息(4变量)
** 注意事项:触摸定位四变量,保存在后备寄存器中,并标志化后备寄存器2
***************************************************************/
void SaveTouchAdjInfo(void)
{
BKP_WriteBackupRegister(BKP_TOUCH_X_BEGIN,LCDX_Begin_AD );
BKP_WriteBackupRegister(BKP_TOUCH_LENGTH,LCD_Length_AD );
BKP_WriteBackupRegister(BKP_TOUCH_Y_BEGIN,LCDY_Begin_AD );
BKP_WriteBackupRegister(BKP_TOUCH_HEIGHT,LCD_Height_AD );
//标志化2
BKP_WriteBackupRegister(BKP_TOUCH_SET,0xA55A);
}
开发者ID:jiangtaojiang,项目名称:bloodpressure,代码行数:15,代码来源:DX_Touch.c
示例8: HAL_Core_System_Reset_Ex
void HAL_Core_System_Reset_Ex(int reason, uint32_t data, void *reserved)
{
if (HAL_Feature_Get(FEATURE_RESET_INFO))
{
// Save reset info to backup registers
BKP_WriteBackupRegister(BKP_DR2, reason);
BKP_WriteBackupRegister(BKP_DR3, data >> 16);
BKP_WriteBackupRegister(BKP_DR4, data & 0xffff);
}
HAL_Core_System_Reset();
}
开发者ID:spark,项目名称:firmware,代码行数:11,代码来源:core_hal.c
示例9: backupSave
void backupSave() {
PWR_BackupAccessCmd(ENABLE);
BKP_ClearFlag();
BKP_WriteBackupRegister(BKP_DR1, BACKUP_MARKER);
BKP_WriteBackupRegister(BKP_DR2, (gUtcOffset >> 16) & 0xFFFF);
BKP_WriteBackupRegister(BKP_DR3, gUtcOffset & 0xFFFF);
BKP_WriteBackupRegister(BKP_DR4, gGridOc.TIM_Pulse);
PWR_BackupAccessCmd(DISABLE);
}
开发者ID:arantius,项目名称:vfd-clock,代码行数:11,代码来源:main.c
示例10: rtc_setTime
void rtc_setTime(char * argv[], int argc)
{
if(argc > 4)
{
t_print("Setting time\n");
mHour = t_atoi(argv[0]);
mMinute = t_atoi(argv[1]);
s_DateStructVar.Day = t_atoi(argv[2]);
s_DateStructVar.Month = t_atoi(argv[3]);
s_DateStructVar.Year = t_atoi(argv[4]);
uint32_t CounterValue = ((mHour * 3600)+ (mMinute * 60));
RTC_WaitForLastTask();
RTC_SetCounter(CounterValue);
RTC_WaitForLastTask();
BKP_WriteBackupRegister(BKP_DR2,s_DateStructVar.Day);
BKP_WriteBackupRegister(BKP_DR3,s_DateStructVar.Month);
BKP_WriteBackupRegister(BKP_DR4,s_DateStructVar.Year);
}
else if(argc > 1)
{
mHour = t_atoi(argv[0]);
mMinute = t_atoi(argv[1]);
uint32_t CounterValue = ((mHour * 3600)+ (mMinute * 60));
RTC_WaitForLastTask();
RTC_SetCounter(CounterValue);
RTC_WaitForLastTask();
}
t_print("Time: ");
d_print(mHour);
t_print(":");
d_print(mMinute);
t_print(":");
d_print(mSecond);
t_print(" ");
d_print(s_DateStructVar.Day);
t_print("-");
d_print(s_DateStructVar.Month);
t_print("-");
d_print(s_DateStructVar.Year);
t_print("\n");
}
开发者ID:JanusErasmus,项目名称:stm-discovery-feeder,代码行数:52,代码来源:rtc.c
示例11: HAL_Core_Enter_Bootloader
void HAL_Core_Enter_Bootloader(bool persist)
{
if (persist)
{
BKP_WriteBackupRegister(BKP_DR10, 0xFFFF);
FLASH_OTA_Update_SysFlag = 0xFFFF;
Save_SystemFlags();
}
else
{
BKP_WriteBackupRegister(BKP_DR1, ENTER_DFU_APP_REQUEST);
}
HAL_Core_System_Reset();
}
开发者ID:spark,项目名称:firmware,代码行数:15,代码来源:core_hal.c
示例12: HAL_Core_Enter_Stop_Mode
void HAL_Core_Enter_Stop_Mode(uint16_t wakeUpPin, uint16_t edgeTriggerMode, long seconds)
{
if (seconds > 0) {
HAL_RTC_Cancel_UnixAlarm();
HAL_RTC_Set_UnixAlarm((time_t) seconds);
}
if ((wakeUpPin < TOTAL_PINS) && (edgeTriggerMode <= FALLING))
{
uint16_t BKP_DR9_Data = wakeUpPin;//set wakeup pin mumber
BKP_DR9_Data |= (edgeTriggerMode << 8);//set edge trigger mode
BKP_DR9_Data |= (0xA << 12);//set stop mode flag
/*************************************************/
//BKP_DR9_Data: 0xAXXX
// ||||
// ||----- octet wakeUpPin number
// |------ nibble edgeTriggerMode
// ------- nibble stop mode flag
/*************************************************/
/* Execute Stop mode on next system reset */
BKP_WriteBackupRegister(BKP_DR9, BKP_DR9_Data);
/* Reset System */
NVIC_SystemReset();
}
}
开发者ID:spark,项目名称:firmware,代码行数:28,代码来源:core_hal.c
示例13: SysSetTime
/*设置系统时间*/
void SysSetTime(FUN_BLOCK **funBlock)
{
DIS_SING *sing_temp;
GetSubFunBlock(&pfunSubBlock);
sing_temp = (DIS_SING *)(pfunSubBlock->current_display);
pfunSubBlock->data_type = ZINUM;//显示属性
RTC_ITConfig(RTC_IT_SEC, DISABLE); //关RTC中断,防止systmtime被修改
strcpy(sing_temp->y2 , "请输入时间");
/*取得VIRTUAL_NUM_LENGTH位数的箱门数*/
if(CANCEL == KeyDisplay(pfunSubBlock , 10))
{
FreeMem();
return;
}
/*读取时间值*/
systmtime.tm_year = 2000 + (sing_temp->y3[0]-'0')*10 + sing_temp->y3[1]-'0';
systmtime.tm_mon = (sing_temp->y3[2]-'0')*10 + sing_temp->y3[3]-'0';
systmtime.tm_mday = (sing_temp->y3[4]-'0')*10 + sing_temp->y3[5]-'0';
systmtime.tm_hour = (sing_temp->y3[6]-'0')*10 + sing_temp->y3[7]-'0';
systmtime.tm_min = (sing_temp->y3[8]-'0')*10 + sing_temp->y3[9]-'0';
memset(sing_temp->y3 , 0 , 10);
/*写入时间*/
RTC_Configuration();
Time_Adjust(&systmtime);//写入系统时间
BKP_WriteBackupRegister(BKP_DR1, 0xA5A5);
strcpy(sing_temp->y2 , "系统时间修改成功");
DisplaySubBlock(pfunSubBlock);
FreeMem();
}
开发者ID:eseawind,项目名称:touchCabinet,代码行数:34,代码来源:sysfunction.c
示例14: Date_PreAdjust
/*******************************************************************************
* Function Name : Date_PreAdjust
* Description : Pre-Adjusts the current date (MM/DD/YYYY).
* Input : None
* Output : None
* Return : None
*******************************************************************************/
static void Date_PreAdjust(void)
{
uint32_t tmp = 0, pressedkey = 0;
/* Clear the LCD */
LCD_Clear(White);
LCD_SetBackColor(Blue);
LCD_SetTextColor(White);
if(BKP_ReadBackupRegister(BKP_DR1) != 0xA5A5)
{
LCD_DisplayStringLine(Line7, "Time and Date Config");
LCD_DisplayStringLine(Line8, "Select: Press SEL ");
LCD_DisplayStringLine(Line9, "Abort: Press Any Key");
while(1)
{
pressedkey = ReadKey();
if(pressedkey == SEL)
{
/* Adjust Time */
Time_PreAdjust();
/* Clear the LCD */
LCD_Clear(White);
return;
}
else if (pressedkey != NOKEY)
{
return;
}
}
}
else
{
/* Display the current date */
Date_Display(date_s.year, date_s.month, date_s.day);
/* Change the current date */
Date_Regulate();
BKP_WriteBackupRegister(BKP_DR2, date_s.year);
tmp = date_s.month << 8;
tmp |= date_s.day;
BKP_WriteBackupRegister(BKP_DR3, tmp);
BKP_WriteBackupRegister(BKP_DR4, daycolumn);
BKP_WriteBackupRegister(BKP_DR5, dayline);
}
}
开发者ID:freemanqiu,项目名称:STM3210E_Demo,代码行数:54,代码来源:calendar.c
示例15: RTC_Init
/**
* @file RTC_Init
* @brief RTC Initialization
* @param 无
* @retval 无
*/
void RTC_Init(void)
{
if (BKP_ReadBackupRegister(BKP_DR1)!= 0xA5A5)
{
/* Backup data register value is not correct or not yet programmed (when
the first time the program is executed) */
printf("RTC not yet configured....\r\n");
/* RTC Configuration */
RTC_Configuration();
Time_Regulate();
/* Adjust time by values entred by the user on the hyperterminal */
printf("RTC configured....\r\n");
BKP_WriteBackupRegister(BKP_DR1, 0xA5A5);
}
else
{
/* Check if the Power On Reset flag is set */
if (RCC_GetFlagStatus(RCC_FLAG_PORRST) != RESET)
{
printf("Power On Reset occurred....\r\n");
}
/* Check if the Pin Reset flag is set */
else if (RCC_GetFlagStatus(RCC_FLAG_PINRST) != RESET)
{
printf("External Reset occurred....\r\n");
}
printf("No need to configure RTC....\r\n");
/* Wait for RTC registers synchronization */
RTC_WaitForSynchro();
/* Enable the RTC Second */
RTC_ITConfig(RTC_IT_SEC, ENABLE);
/* Wait until last write operation on RTC registers has finished */
RTC_WaitForLastTask();
}
/* NVIC configuration */
NVIC_Configuration();
#ifdef RTCClockOutput_Enable
/* Enable PWR and BKP clocks */
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR | RCC_APB1Periph_BKP, ENABLE);
/* Allow access to BKP Domain */
PWR_BackupAccessCmd(ENABLE);
/* Disable the Tamper Pin */
BKP_TamperPinCmd(DISABLE); /* To output RTCCLK/64 on Tamper pin, the tamper
functionality must be disabled */
/* Enable RTC Clock Output on Tamper Pin */
BKP_RTCOutputConfig(BKP_RTCOutputSource_CalibClock);
#endif
/* Clear reset flags */
RCC_ClearFlag();
return;
}
开发者ID:pyjhhh,项目名称:stm32_f1x,代码行数:65,代码来源:rtc.c
示例16: BKP_storeWord
void BKP_storeWord(uint16_t bkpidx,uint16_t value)
{
if (bkpidx >= BKP_DR_NUMBER)
return;
vPortEnterCritical();
BKP_WriteBackupRegister(BKPDataReg[bkpidx],value);
vPortExitCritical();
}
开发者ID:pandc,项目名称:unitek,代码行数:8,代码来源:backup.c
示例17: HAL_Core_Enter_Standby_Mode
void HAL_Core_Enter_Standby_Mode(void)
{
/* Execute Standby mode on next system reset */
BKP_WriteBackupRegister(BKP_DR9, 0xA5A5);
/* Reset System */
NVIC_SystemReset();
}
开发者ID:RobertNewkirk,项目名称:particle,代码行数:8,代码来源:core_hal.c
示例18: PIOS_BKP_WriteRegister
void PIOS_BKP_WriteRegister(uint32_t regnumber, uint16_t data)
{
if (PIOS_BKP_REGISTERS_COUNT < regnumber) {
PIOS_Assert(0);
} else {
BKP_WriteBackupRegister(pios_bkp_registers_map[regnumber], (uint32_t)data);
}
}
开发者ID:Alex-Rongzhen-Huang,项目名称:OpenPilot,代码行数:8,代码来源:pios_bkp.c
示例19: WriteToBackupReg
/**
* @brief Writes data Backup DRx registers.
* @param FirstBackupData: data to be written to Backup data registers.
* @retval None
*/
void WriteToBackupReg(uint16_t FirstBackupData)
{
uint32_t index = 0;
for (index = 0; index < BKP_DR_NUMBER; index++)
{
BKP_WriteBackupRegister(BKPDataReg[index], FirstBackupData + (index * 0x5A));
}
}
开发者ID:phungyen,项目名称:stm32f10x_stdperiph_lib,代码行数:14,代码来源:main.c
示例20: BKP_storeDWord
void BKP_storeDWord(uint16_t bkpidx,uint32_t value)
{
if (bkpidx >= (BKP_DR_NUMBER-1))
return;
vPortEnterCritical();
BKP_WriteBackupRegister(BKPDataReg[bkpidx],(uint16_t)(value >> 16));
BKP_WriteBackupRegister(BKPDataReg[bkpidx+1],(uint16_t)value);
vPortExitCritical();
}
开发者ID:pandc,项目名称:unitek,代码行数:9,代码来源:backup.c
注:本文中的BKP_WriteBackupRegister函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论