STM8 STVD 新手疑问
STM8S103F.h中定义有PAPBPCPD四组端口,我需要用到PD里的其中两个针脚,但是PD一共有6个针脚,我该怎么去获得我需要的两个脚呢?求教代码,不甚感激!不要建...
STM8S103F.h 中定义有PA PB PC PD四组端口,我需要用到PD里的其中两个针脚,但是PD一共有6个针脚,我该怎么去获得我需要的两个脚呢?求教代码,不甚感激!
不要建议我换开发环境,我确实不会啊!就这个stvd我都费了几天还没搞明白呢。。。 展开
不要建议我换开发环境,我确实不会啊!就这个stvd我都费了几天还没搞明白呢。。。 展开
1个回答
展开全部
IAR里面是这样定义的;
/*-------------------------------------------------------------------------
* Port D bit fields
*-----------------------------------------------------------------------*/
#ifdef __IAR_SYSTEMS_ICC__
#define PD_ODR_ODR0 PD_ODR_bit.ODR0
#define PD_ODR_ODR1 PD_ODR_bit.ODR1
#define PD_ODR_ODR2 PD_ODR_bit.ODR2
#define PD_ODR_ODR3 PD_ODR_bit.ODR3
#define PD_ODR_ODR4 PD_ODR_bit.ODR4
#define PD_ODR_ODR5 PD_ODR_bit.ODR5
#define PD_ODR_ODR6 PD_ODR_bit.ODR6
#define PD_ODR_ODR7 PD_ODR_bit.ODR7
#define PD_IDR_IDR0 PD_IDR_bit.IDR0
#define PD_IDR_IDR1 PD_IDR_bit.IDR1
#define PD_IDR_IDR2 PD_IDR_bit.IDR2
#define PD_IDR_IDR3 PD_IDR_bit.IDR3
#define PD_IDR_IDR4 PD_IDR_bit.IDR4
#define PD_IDR_IDR5 PD_IDR_bit.IDR5
#define PD_IDR_IDR6 PD_IDR_bit.IDR6
#define PD_IDR_IDR7 PD_IDR_bit.IDR7
#define PD_DDR_DDR0 PD_DDR_bit.DDR0
#define PD_DDR_DDR1 PD_DDR_bit.DDR1
#define PD_DDR_DDR2 PD_DDR_bit.DDR2
#define PD_DDR_DDR3 PD_DDR_bit.DDR3
#define PD_DDR_DDR4 PD_DDR_bit.DDR4
#define PD_DDR_DDR5 PD_DDR_bit.DDR5
#define PD_DDR_DDR6 PD_DDR_bit.DDR6
#define PD_DDR_DDR7 PD_DDR_bit.DDR7
#define PD_CR1_C10 PD_CR1_bit.C10
#define PD_CR1_C11 PD_CR1_bit.C11
#define PD_CR1_C12 PD_CR1_bit.C12
#define PD_CR1_C13 PD_CR1_bit.C13
#define PD_CR1_C14 PD_CR1_bit.C14
#define PD_CR1_C15 PD_CR1_bit.C15
#define PD_CR1_C16 PD_CR1_bit.C16
#define PD_CR1_C17 PD_CR1_bit.C17
#define PD_CR2_C20 PD_CR2_bit.C20
#define PD_CR2_C21 PD_CR2_bit.C21
#define PD_CR2_C22 PD_CR2_bit.C22
#define PD_CR2_C23 PD_CR2_bit.C23
#define PD_CR2_C24 PD_CR2_bit.C24
#define PD_CR2_C25 PD_CR2_bit.C25
#define PD_CR2_C26 PD_CR2_bit.C26
#define PD_CR2_C27 PD_CR2_bit.C27
#endif
比如你要PD1输出高电平就是 PD_ODR_ODR1 = 1;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询