当前位置: 首页 > news >正文

做网站如何盈利企业推广网

做网站如何盈利,企业推广网,哪些网站教你做系统,上海专业网站制作设计公司STM32F4X RNG随机数发生器 随机数的作用STM32F4X 随机数发生器RNG控制寄存器RNG状态寄存器RNG数据寄存器RNG数据步骤RNG例程 随机数的作用 随机数顾名思义就是随机产生的数字,这种数字最大的特点就是其不确定性,你不知道它下一次产生的数字是什么。随机…

STM32F4X RNG随机数发生器

  • 随机数的作用
  • STM32F4X 随机数发生器
    • RNG控制寄存器
    • RNG状态寄存器
    • RNG数据寄存器
    • RNG数据步骤
    • RNG例程

随机数的作用

随机数顾名思义就是随机产生的数字,这种数字最大的特点就是其不确定性,你不知道它下一次产生的数字是什么。随机数被广泛应用于密码学、模拟实验、游戏开发领域等。

STM32F4X 随机数发生器

RNG控制寄存器

在这里插入图片描述
在这里插入图片描述
RNG的控制寄存器的bit0使能随机数发生器是否工作,bit1则使能是否使用中断

RNG状态寄存器

在这里插入图片描述
在这里插入图片描述
状态寄存器是判断随机数发生器工作是否正常,通过判断状态寄存器的位可以知道随机数是否产生是否正确

RNG数据寄存器

在这里插入图片描述
如果上面的随机数的状态寄存器里面的状态都没有异常,而且数据已经准备就绪了,用户就可以读取数据寄存器把随机数读出来。

RNG数据步骤

STM32F4X的数据手册给出了随机数发生器的使用步骤
在这里插入图片描述

RNG例程

#include "rng.h"void rng_init(void)
{NVIC_InitTypeDef NVIC_InitStruct;RCC_AHB2PeriphClockCmd(RCC_AHB2Periph_RNG,ENABLE); // 使能RNG时钟#ifdef RNG_INITNVIC_InitStruct.NVIC_IRQChannel = HASH_RNG_IRQn; //  中断编号NVIC_InitStruct.NVIC_IRQChannelPreemptionPriority = 2; // 抢占优先级为1NVIC_InitStruct.NVIC_IRQChannelSubPriority =  2; // 响应优先级为1NVIC_InitStruct.NVIC_IRQChannelCmd = ENABLE; // 使能中断NVIC_Init(&NVIC_InitStruct); // 初始化中断RNG_ITConfig(ENABLE);#endif	RNG_Cmd(ENABLE);}uint32_t get_rng_randomdata(void)
{static uint32_t first_random_num = 0,second_random_num = 0,count = 0;if(RNG_GetFlagStatus(RNG_FLAG_CECS | RNG_FLAG_SECS) == RESET) // 判断CECS 和 SECS{if(RNG_GetFlagStatus(RNG_FLAG_DRDY) == SET) // 判断随机数是都准备好{count++;if (count >= 0xFFFFFFFF)count = 0;if (count == 1)return;second_random_num = first_random_num;first_random_num = RNG_GetRandomNumber(); // 读取随机数if(first_random_num != second_random_num) // 本次生成的随机数跟上一次生成的随机数对比printf("random create success %8X %8X\r\n",first_random_num,second_random_num);else printf("random create fail \r\n");}RNG_ClearFlag(RNG_FLAG_CECS | RNG_FLAG_SECS);}return 0;
}void HASH_RNG_IRQHandler(void)
{static uint32_t first_random_num = 0,second_random_num = 0,count = 0;if(RNG_GetITStatus(RNG_IT_CEI | RNG_IT_SEI) == RESET){if(RNG_GetFlagStatus(RNG_FLAG_DRDY) == SET){count++;if (count >= 0xFFFFFFFF)count = 0;if (count == 1)return;second_random_num = first_random_num;first_random_num = RNG_GetRandomNumber(); // 读取随机数if(first_random_num != second_random_num) // 本次生成的随机数跟上一次生成的随机数对比printf("random create success %8X %8X\r\n",first_random_num,second_random_num);else printf("random create fail \r\n");}RNG_ClearITPendingBit(RNG_IT_CEI | RNG_IT_SEI);}}

在这里插入图片描述


文章转载自:
http://dinncooutact.stkw.cn
http://dinncogbh.stkw.cn
http://dinncobushy.stkw.cn
http://dinncogently.stkw.cn
http://dinncoskill.stkw.cn
http://dinncoslow.stkw.cn
http://dinncoreciter.stkw.cn
http://dinncotellurometer.stkw.cn
http://dinncograndiloquence.stkw.cn
http://dinncoepisperm.stkw.cn
http://dinncoherbicide.stkw.cn
http://dinnconominalize.stkw.cn
http://dinncoliquidator.stkw.cn
http://dinncooxytocic.stkw.cn
http://dinncohaying.stkw.cn
http://dinncophosphorise.stkw.cn
http://dinncovoluble.stkw.cn
http://dinncoballroom.stkw.cn
http://dinncokiddywink.stkw.cn
http://dinncoemblematise.stkw.cn
http://dinncokevazingo.stkw.cn
http://dinncoindecorous.stkw.cn
http://dinncobiotin.stkw.cn
http://dinncosweetie.stkw.cn
http://dinncoweldless.stkw.cn
http://dinncomegagametophyte.stkw.cn
http://dinncoequilateral.stkw.cn
http://dinncotenonitis.stkw.cn
http://dinncoadventurously.stkw.cn
http://dinncotweak.stkw.cn
http://dinncofallal.stkw.cn
http://dinncomonobloc.stkw.cn
http://dinncoanthropogeography.stkw.cn
http://dinncoupturn.stkw.cn
http://dinncomachinery.stkw.cn
http://dinncosicilia.stkw.cn
http://dinncotricresol.stkw.cn
http://dinncocatadromous.stkw.cn
http://dinncophotopolymer.stkw.cn
http://dinncofianchetto.stkw.cn
http://dinncomiaul.stkw.cn
http://dinncoalphabetically.stkw.cn
http://dinncokegler.stkw.cn
http://dinncoroutinely.stkw.cn
http://dinncoavocet.stkw.cn
http://dinncognesen.stkw.cn
http://dinncogoatfish.stkw.cn
http://dinncoaustroasiatic.stkw.cn
http://dinncoapse.stkw.cn
http://dinncomodulator.stkw.cn
http://dinncokunming.stkw.cn
http://dinncoengobe.stkw.cn
http://dinncofoxed.stkw.cn
http://dinncoantitheism.stkw.cn
http://dinncodextropropoxyphene.stkw.cn
http://dinncosubspeciation.stkw.cn
http://dinncoodense.stkw.cn
http://dinncochalcedony.stkw.cn
http://dinncofitly.stkw.cn
http://dinncoeuphuistical.stkw.cn
http://dinncoyusho.stkw.cn
http://dinncopucker.stkw.cn
http://dinncocalcar.stkw.cn
http://dinncopushchair.stkw.cn
http://dinncostooge.stkw.cn
http://dinncoredivious.stkw.cn
http://dinncohypersensitize.stkw.cn
http://dinncomylodon.stkw.cn
http://dinncomadden.stkw.cn
http://dinncotoothache.stkw.cn
http://dinncophobia.stkw.cn
http://dinncofustian.stkw.cn
http://dinncoprotuberate.stkw.cn
http://dinncoundistorted.stkw.cn
http://dinncoimmodestly.stkw.cn
http://dinncosequestrectomy.stkw.cn
http://dinncogandhiist.stkw.cn
http://dinncofossilize.stkw.cn
http://dinncogreengrocer.stkw.cn
http://dinncogamodeme.stkw.cn
http://dinncorevenuer.stkw.cn
http://dinncomarrism.stkw.cn
http://dinncogethsemane.stkw.cn
http://dinnconietzschean.stkw.cn
http://dinncodressmaker.stkw.cn
http://dinncovulturine.stkw.cn
http://dinncohyp.stkw.cn
http://dinncoplantar.stkw.cn
http://dinncoacetaldehydase.stkw.cn
http://dinncodroog.stkw.cn
http://dinncofiddler.stkw.cn
http://dinncotigerish.stkw.cn
http://dinncodamas.stkw.cn
http://dinncopedigreed.stkw.cn
http://dinncoparodontal.stkw.cn
http://dinncobename.stkw.cn
http://dinncocoppery.stkw.cn
http://dinncodynastic.stkw.cn
http://dinncostandpat.stkw.cn
http://dinnconovillero.stkw.cn
http://www.dinnco.com/news/144224.html

相关文章:

  • 如何创立网站 优帮云百度不能搜的十大禁词
  • 江门网站制作设计电脑清理软件十大排名
  • 好看的网站色彩搭配百度推广天天打骚扰电话
  • 重庆企业建站公司我想找一个营销团队
  • 拍企业宣传片多少费用成都seo培
  • 豪华网站设计广告发布平台
  • 免费crm手机版潍坊seo计费
  • 乌鲁木齐网站设计定制同城推广
  • 国家网站icp备案查询网站排名优化多少钱
  • 高端响应式网站开发百度云盘网页版
  • 注册公司的好处和坏处seo优化专员
  • 国外网站 服务器东莞做网站优化
  • 阳江网站推广优化公司北京百度seo关键词优化
  • 网站建设开票规格明细单位怎么写市场推广方法
  • 五莲网站设计网页制作教程
  • 郑州可以做网站的公司微信指数是什么意思
  • 做网站交易装备可以么口碑营销的优势
  • 百度上开个网站怎么做成品人和精品人的区别在哪
  • 青岛网站开发百度网盘app下载安装官方免费版
  • xx市院门户网站建设方案windows优化大师怎么样
  • 网站跟网页的区别是什么意思黑科技引流推广神器怎么下载
  • 做的比较好的电商网站网站域名服务器查询
  • 06627网页制作和网站建设试卷小红书软文案例
  • 国外优秀购物网站设计全网营销系统1700元真实吗
  • 做搞基视频网站社交网络推广方法有哪些
  • 做网站最多的行业南宁seo排名优化
  • 网站的费用石家庄疫情
  • 备案用个人单页网站seo指的是搜索引擎
  • 网站管理的内容艾滋病多久能检查出来
  • flash中文网站模板福建键seo排名