g0b1vetx-board/Board/di-board.c
2584532475@qq.com 0f40dd8b17 网络自适应
2024-09-10 11:51:07 +08:00

50 lines
662 B
C

#include "main.h"
#include "di-board.h"
DIState_t MX_Din_Pull (int chann)
{
DIState_t ret;
switch (chann)
{
case 1:
{
ret = (DIState_t) HAL_GPIO_ReadPin (DI1_GPIO_Port, DI1_Pin);
break;
}
case 2:
{
ret = (DIState_t) HAL_GPIO_ReadPin (DI2_GPIO_Port, DI2_Pin);
break;
}
case 3:
{
ret = (DIState_t) HAL_GPIO_ReadPin (DI3_GPIO_Port, DI3_Pin);
break;
}
case 4:
{
ret = (DIState_t) HAL_GPIO_ReadPin (DI4_GPIO_Port, DI4_Pin);
break;
}
case 5:
{
ret = (DIState_t) HAL_GPIO_ReadPin (DI5_GPIO_Port, DI5_Pin);
break;
}
case 6:
{
ret = (DIState_t) HAL_GPIO_ReadPin (DI6_GPIO_Port, DI6_Pin);
break;
}
}
return ret;
}