91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 5.45KB
    文件類型: .c
    金幣: 1
    下載: 0 次
    發布日期: 2021-03-27
  • 語言: 其他
  • 標簽: 其他??

資源簡介


STM32讀12位絕對式編碼器,本代碼的測試儀器為歐姆龍。

資源截圖

代碼片段和文件信息

#include?“stm32f10x.h“
#include?“stm32f10x_usart.h“
#include?
#include?
#include?

#define?CMD_BUFFER_LEN?100

GPIO_InitTypeDef?GPIO_InitStructure;
void?Delay(__IO?uint32_t?nCount)
{
??for(;?nCount?!=?0;?nCount--);
}
void?RCC_Config(void)
{
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA?ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC?ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1?ENABLE);
}

void?GPIO_Config(void)
{
//串口 ?PA9?PA10
GPIO_InitStructure.GPIO_Pin?=?GPIO_Pin_9;???????????????????????//管腳9?
GPIO_InitStructure.GPIO_Mode?=?GPIO_Mode_AF_PP;?????//復用推挽輸出?
GPIO_InitStructure.GPIO_Speed?=?GPIO_Speed_50MHz;
GPIO_Init(GPIOA?&GPIO_InitStructure);?????????????????????????????//TX初始化?
GPIO_InitStructure.GPIO_Pin?=?GPIO_Pin_10;?????????????????????//管腳10?
GPIO_InitStructure.GPIO_Mode?=?GPIO_Mode_IN_FLOATING;?//浮空輸入?
GPIO_InitStructure.GPIO_Speed?=?GPIO_Speed_50MHz;
GPIO_Init(GPIOA?&GPIO_InitStructure);??

評論

共有 條評論