Files
motor_controller2/my_software/my_code.h
T
2021-11-05 00:26:34 +08:00

53 lines
1.1 KiB
C

/*
* my_code.h
*
* Created on: Oct 2, 2021
* Author: wuwenfeng
*/
#ifndef MY_CODE_H_
#define MY_CODE_H_
#include "main.h"
void my_code();
#define HC595_DCK(x) HAL_GPIO_WritePin(HC595_DLK_GPIO_Port, HC595_DLK_Pin, x)
#define HC595_RCK(x) HAL_GPIO_WritePin(HC595_RLK_GPIO_Port, HC595_RLK_Pin, x)
#define HC595_SCK(x) HAL_GPIO_WritePin(HC595_SLK_GPIO_Port, HC595_SLK_Pin, x)
#define HC595_SCK2(x) HAL_GPIO_WritePin(HC595_SLK2_GPIO_Port, HC595_SLK2_Pin, x)
#define READ_HC595_DCK HAL_GPIO_ReadPin(HC595_DLK_GPIO_Port,HC595_DLK_Pin)
#define MOT_IN1(x) HAL_GPIO_WritePin(MOT_IN1_GPIO_Port, MOT_IN1_Pin, x)
#define MOT_IN2(x) HAL_GPIO_WritePin(MOT_IN2_GPIO_Port, MOT_IN2_Pin, x)
#define READ_MOT_IN1 HAL_GPIO_ReadPin(MOT_IN1_GPIO_Port, MOT_IN1_Pin)
#define READ_MOT_IN2 HAL_GPIO_ReadPin(MOT_IN2_GPIO_Port, MOT_IN2_Pin)
typedef struct
{
char key_code[2];
char begin;
int time;
}config_setting;
struct display_penal
{
unsigned char d_num[4];
unsigned char button_flag[4];
char dot1;
char dot2;
char dot3;
char dot4;
char led_run;
char moto1a;
char moto1b;
char moto2a;
char moto2b;
}dis_buff;
#endif /* MY_CODE_H_ */