添加MDK工程

程序存在一个问题:开机没有自检
添加立创PCB

Signed-off-by: kevin <kevin@lmve.net>
This commit is contained in:
2021-03-12 04:45:11 +08:00
parent b80a019242
commit c70a004b2a
822 changed files with 354740 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
#include "interface_595.h"
void ds_in_or_out(char a)//0in 1out //ÔOÖÃÒýÄ_Ý”ÈëÝ”³ö
{
GPIO_InitTypeDef GPIO_InitStruct = {0};
GPIO_InitStruct.Pin = HC595_DS_Pin;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
if(a==0)
{
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
}
if(a==1)
{
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
}
HAL_GPIO_Init(HC595_DS_GPIO_Port, &GPIO_InitStruct);
}
uint8_t Read_Ds()
{
ds_in_or_out(0);
if(read_hc595_ds){return 0;}else{return 1;}
}