Stepper-Motor-Control  v3.0.0
System on a Chip 2014 - Group 04
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
dataTypes.h
Go to the documentation of this file.
1 /**
2  ******************************************************************************
3  * @file dataTypes.h
4  * @author Michael Riedel
5  * @author Marc Kossmann
6  * @version v1.0.0
7  * @date 13.11.2014
8  * @brief Header file for all own data types
9  ******************************************************************************
10  * @par History:
11  * @details v1.0.0 13.11.2014 Kossmann
12  * - put all own data types together in one file
13  ******************************************************************************
14  */
15 
16 #ifndef __DATATYPES_H__
17 #define __DATATYPES_H__
18 
19 /** @brief general state of system */
20 typedef enum state {
21  ERROR = 0, //!< system is not working properly
22  FUNCTIONAL = 1, //!< everything is full functional
23  DEBUG = 2, //!< debugging is active
24 } state_t;
25 
26 /** @brief general state of system */
27 typedef enum useCases {
28  STOP = 0, //!< Motor not moving
29  QUARTER_ROTATION = 1, //!< Motor turning 1/4 rotation
30  HALF_ROTATION = 2, //!< Motor turning 1/2 rotation
31  FULL_ROTATION = 3, //!< Motor turning one rotation
32  DOUBLE_ROTATION = 4, //!< Motor turning two rotation
33  CONTINOUS = 5 //!< Motor is continously running
34 } useCases_t;
35 
36 /** @brief Struct to store state of system and use case information */
37 typedef struct systemState {
38  state_t operationalStatus; //!< operational status
39  useCases_t activeUseCase; //!< active use case
41 
42 /** @brief Motor direction */
43 typedef enum direction {
44  LEFT = 0, RIGHT = 1
45 } direction_t;
46 
47 /** @brief Datatype of global variable for transmitting information from InputTask
48  * to OutputTask */
49 typedef struct outputTaskData {
50  systemState_t systemState; //!< stores state of system
51  uint32_t stepsReg; //!< copy of steps register
52  uint8_t ctrlReg; //!< copy control register
53  uint8_t speedReg; //!< copy of speed register
55 
56 /**
57  * @brief The state-machine for the heartbeat.
58  *
59  * @details | state | red LED9 | HEX3-display |
60  * | ------ | -------- | ------------ |
61  * | FIRST | on | LINE |
62  * | SECOND | off | LOWER_O |
63  * | THIRD | on | LINE |
64  * | FOURTH | off | UPPDER_O |
65  */
66 typedef enum heartbeatState {
67  FIRST = 1, SECOND = 2, THIRD = 3, FOURTH = 4
69 
70 
71 #endif
enum heartbeatState heartbeatState_t
The state-machine for the heartbeat.
Struct to store state of system and use case information.
Definition: dataTypes.h:37
Motor not moving.
Definition: dataTypes.h:28
heartbeatState
The state-machine for the heartbeat.
Definition: dataTypes.h:66
uint8_t ctrlReg
copy control register
Definition: dataTypes.h:52
useCases
general state of system
Definition: dataTypes.h:27
Motor turning one rotation.
Definition: dataTypes.h:31
state_t operationalStatus
operational status
Definition: dataTypes.h:38
debugging is active
Definition: dataTypes.h:23
everything is full functional
Definition: dataTypes.h:22
uint8_t speedReg
copy of speed register
Definition: dataTypes.h:53
systemState_t systemState
stores state of system
Definition: dataTypes.h:50
Motor turning 1/2 rotation.
Definition: dataTypes.h:30
Motor is continously running.
Definition: dataTypes.h:33
enum state state_t
general state of system
struct outputTaskData outputTaskData_t
Datatype of global variable for transmitting information from InputTask to OutputTask.
Motor turning 1/4 rotation.
Definition: dataTypes.h:29
direction
Motor direction.
Definition: dataTypes.h:43
enum useCases useCases_t
general state of system
enum direction direction_t
Motor direction.
state
general state of system
Definition: dataTypes.h:20
system is not working properly
Definition: dataTypes.h:21
uint32_t stepsReg
copy of steps register
Definition: dataTypes.h:51
Motor turning two rotation.
Definition: dataTypes.h:32
useCases_t activeUseCase
active use case
Definition: dataTypes.h:39
struct systemState systemState_t
Struct to store state of system and use case information.
Datatype of global variable for transmitting information from InputTask to OutputTask.
Definition: dataTypes.h:49