-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal.h
More file actions
79 lines (63 loc) · 1.96 KB
/
Copy pathglobal.h
File metadata and controls
79 lines (63 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef GLOBAL_H
#define GLOBAL_H
#include "stm32f4xx.h"
#include "stm32f4xx_gpio.h"
#include "stm32f4xx_rcc.h"
#include "stm32f4xx_usart.h"
#include "stm32f4xx_dma.h"
#include "stm32f4xx_i2c.h"
#include "stm32f4xx_iwdg.h"
#include "stdbool.h"
#include "string.h"
void Soft_Delay(volatile uint32_t number);
void stopWork();
void startPacking(uint16_t l, uint16_t w, uint16_t h);
void startInitSys();
void loadPellicle();
//__ERROR
#define ERROR_NO 0x00
#define ERROR_CMD 0x31
#define ERROR_DATA 0x32
#define ERROR_INIT_MOTOR 0x41
#define ERROR_INIT_SYS 0x42
#define ERROR_SENS_ENV 0x43
#define ERROR_PACKING 0x44
#define ERROR_SENS_MOTOR 0x45
#define ERROR_MOTOTR_2_RETURN_TO_HOME_POS 0x52
#define ERROR_MOTOTR_3_RETURN_TO_HOME_POS 0x53
#define ERROR_MOTOTR_4_RETURN_TO_HOME_POS 0x54
#define ERROR_SENS_1 0x61
#define ERROR_SENS_2 0x62
#define ERROR_SENS_3 0x63
#define ERROR_SENS_6 0x66
#define ERROR_SENS_10 0x60
//__STATE
#define __STATE_OK 0x30
#define __STATE_NO_INIT 0x10
#define __STATE_INIT 0x31
#define __STATE_INIT_MOTOR 0x32
#define __STATE_CRIT_ER 0x41
#define __STATE_PACKING 0x51
#define __STATE_LOAD_PELLICLE 0x52
#define __STATE_PACKING_END 0x53
//__TASK
#define TASK_INIT_MOTOR 0x50
#define TASK_INIT_SYS 0x51
#define NO_TASK 0x00
#define TASK_FENCE_GOODS 0x01
#define TASK_BROACH 0x02
#define TASK_CUT 0x03
#define TASK_CUT_2 0x04
#define TASK_GOODS_UP 0x05
#define TASK_PACKAGING 0x06
#define TASK_FINICH_PACKAGING 0x07
#define TASK_END 0x08
#define TASK_START_PACKAGING 0x09
//times
#define TIME_FOR_INIT_MOTOR 1000
#define TIME_FOR_INIT_SYS 10000
#define TIME_FOR_PACKING 5000
uint8_t __TASK;
uint8_t __ERROR;
uint8_t __STATE;
#endif