完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
目前棘手求助问题: 在飞思卡尔头文件中有如下定义 #define SIM_BASE (0x40047000u) /** Peripheral SIM base pointer */ #define SIM ((SIM_Type *)SIM_BASE) typedef struct { __IO uint32_t SOPT1; /**< System Options Register 1, offset: 0x0 */ __IO uint32_t SOPT1CFG; /**< SOPT1 Configuration Register, offset: 0x4 */ uint8_t RESERVED_0[4092]; __IO uint32_t SOPT2; /**< System Options Register 2, offset: 0x1004 */ uint8_t RESERVED_1[4]; __IO uint32_t SOPT4; /**< System Options Register 4, offset: 0x100C */ __IO uint32_t SOPT5; /**< System Options Register 5, offset: 0x1010 */ uint8_t RESERVED_2[4]; __IO uint32_t SOPT7; /**< System Options Register 7, offset: 0x1018 */ uint8_t RESERVED_3[8]; __I uint32_t SDID; /**< System Device Identification Register, offset: 0x1024 */ uint8_t RESERVED_4[12]; __IO uint32_t SCGC4; /**< System Clock Gating Control Register 4, offset: 0x1034 */ __IO uint32_t SCGC5; /**< System Clock Gating Control Register 5, offset: 0x1038 */ __IO uint32_t SCGC6; /**< System Clock Gating Control Register 6, offset: 0x103C */ __IO uint32_t SCGC7; /**< System Clock Gating Control Register 7, offset: 0x1040 */ __IO uint32_t CLKDIV1; /**< System Clock Divider Register 1, offset: 0x1044 */ uint8_t RESERVED_5[4]; __IO uint32_t FCFG1; /**< Flash Configuration Register 1, offset: 0x104C */ __I uint32_t FCFG2; /**< Flash Configuration Register 2, offset: 0x1050 */ uint8_t RESERVED_6[4]; __I uint32_t UIDMH; /**< Unique Identification Register Mid-High, offset: 0x1058 */ __I uint32_t UIDML; /**< Unique Identification Register Mid Low, offset: 0x105C */ __I uint32_t UIDL; /**< Unique Identification Register Low, offset: 0x1060 */ uint8_t RESERVED_7[156]; __IO uint32_t COPC; /**< COP Control Register, offset: 0x1100 */ __O uint32_t SRVCOP; /**< Service COP Register, offset: 0x1104 */ } SIM_Type; 问题是: #define SIM_BASE (0x40047000u)中0x40047000u最后面的u是什么含义? #define SIM ((SIM_Type *)SIM_BASE)中 ((SIM_Type *)SIM_BASE)什么意思,是代表((SIM_Type*)(0x40047000u)的意思么?中间*是什么作用?指针的意思?是指向了那个地址? 往期问题与解答: 今天拿到开发板经过一番折腾导入固件升级后,终于好了。开始跟着视频想搭建工程文件问题出现了,没发现飞思卡尔芯片类型,求大神指导,不废话了,直接上图。
|
|
相关推荐
17 个讨论
|
|
|
|
|
|
|
|
|
|
|
|
#include
void delay(int n){ int i; for(i=0;i } int main(void){ SIM->SCGC5 |=0x0400; PORTB->PCR[18]=0x0100; FPTB->PDOR=0x40000; FPTB->PDDR=0x40000; while(1){ FPTB->PCOR=0x40000; delay(5000000); FPTB->PSOR=0x40000; delay(5000000); } } 这个是之前红灯闪的程序,我改成如下程序想变成蓝灯亮,为毛不行呢,求大家指导 #include void delay(int n){ int i; for(i=0;i } int main(void){ SIM->SCGC5 |=0x0400; /*PORTB->PCR[18]=0x0100;*/ PORTB->PCR[19]=0x0100; FPTB->PDOR=0x80000; FPTB->PDDR=0x80000; while(1){ FPTB->PCOR=0x40000; delay(5000000); FPTB->PSOR=0x40000; delay(5000000); } } |
|
|
|
|
|
|
|
|
在群里问了大神之后发现这两句没有修改,还是把18编号的针脚数据位拿来操作了,如下: FPTB->PCOR=0x40000; delay(5000000); FPTB->PSOR=0x40000; delay(5000000); 应该修改为: FPTB->PCOR=0x80000; delay(5000000); FPTB->PSOR=0x80000; delay(5000000); 这样就是操作了19编号的针脚数据。 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
问题是:
#define SIM_BASE (0x40047000u)中0x40047000u最后面的u是什么含义? #define SIM ((SIM_Type *)SIM_BASE)中 ((SIM_Type *)SIM_BASE)什么意思,是代表((SIM_Type*)(0x40047000u)的意思么?中间*是什么作用?指针的意思?是指向了那个地址? ------u表示无符号整型或者实数型。(unsigned int )------*表示强制类型转换。 将物理地址0x40047000 强制转换成 ”指向SIM_Type形式结构体的指针“。 具体可百度”K60头文件分析“。 |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
2135个成员聚集在这个小组
加入小组我的项目我做主,使用GN+Ninja来完成构建系统(VSCode开发RT106X)
37379 浏览 0 评论
NXP IMX8应用处理器快速入门必备:技巧、使用、设计指南
6778 浏览 1 评论
7796 浏览 1 评论
7646 浏览 0 评论
NXP i.MX6UL开发板(linux系统烧录+规格+硬件+模块移植)使用手册
5074 浏览 0 评论
1558浏览 2评论
关于NINA-W132 Wi-Fi模块SPI通信遇到的疑问求解
1211浏览 2评论
如何在MPC PowerPC MCU上首次刷写后禁用BDM?
750浏览 1评论
将HFREFR和LFREFR寄存器值设置为错误的值来将故障注入CMU,但CMU_ISR值始终为零,为什么?
737浏览 1评论
将SPSDK for FRDM-MCX-W71 SDK与VS一起安装时出现hidapi构建错误怎么解决?
681浏览 1评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-3 02:56 , Processed in 1.024184 second(s), Total 97, Slave 80 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
4499