Stepper-Motor-Control  v3.0.0
System on a Chip 2014 - Group 04
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
auxilaryFunctions.h
Go to the documentation of this file.
1 /**
2  ******************************************************************************
3  * @file auxilaryFunctions.h
4  * @author Michael Riedel
5  * @author Marc Kossmann
6  * @version v2.0.0
7  * @date 18.11.2014
8  * @brief Header file for auxilaryFunctions.c
9  * @details Contains defines, includes, typedefs and declarations needed for
10  * auxilary functions.
11  ******************************************************************************
12  * @par History:
13  * @details v0.1.0 22.10.2014 Kossmann
14  * - first draft for milestone 1b
15  * @details v0.1.1 27.10.2014 Riedel & Kossmann
16  * - using lcdDOGM162.h
17  * @details v0.1.2 27.10.2014 Riedel & Kossmann
18  * - clear display function added
19  * @details v0.1.3 03.11.2014 Kossmann
20  * - finished documentation
21  * @details v1.0.1 14.11.2014 Kossmann
22  * - added init rx,tx functions for access to global ipc var
23  * for transmitting data between UserInput- and UserOuputTask
24  * @details v2.0.0 18.11.2014 Riedel & Kossmann
25  * - verified functionality -> release MS2
26  ******************************************************************************
27  */
28 
29 #ifndef __AUXILARY_FUNCTIONS_H__
30 #define __AUXILARY_FUNCTIONS_H__
31 
32 #include <stdio.h>
33 #include <stdarg.h>
34 #include <system.h>
35 #include "includes.h"
36 #include "lcdDOGM162.h"
37 #include "altera_avalon_lcd_16207_regs.h"
38 #include "dataTypes.h"
39 
40 #define VERSION "2.0.0" //!< global version definition
41 #define DATE "18.11.2014" //!< global date definition
42 
43 #define MUTEX_PRIORITY 4 /*!< Priority for Mutexes */
44 
45 /**
46  * @brief Initializes the interprocess communication between OutputTask and
47  * InputTask
48  * @details Transmission is done via global variable and secured by mutex.
49  * @retval err System wide error code
50  */
51 uint8_t init_outputTaskDataTxRx(void);
52 
53 /**
54  * @brief Sends data to ipc channel
55  * @details Stores data in global variable. `outputTaskDataMutex` must be
56  * initialized before.
57  * @param data Data to store in global var.
58  * @retval err System wide error code. "OS_ERR_INVALID_OPT" means param
59  * was NULL.
60  */
62 
63 /**
64  * @brief Received data from ipc channel
65  * @details Reads data of global variable. `outputTaskDataMutex` must be
66  * initialized before.
67  * @param [out] data Pointer to the content of the global var.
68  * @retval err System wide error code. "OS_ERR_INVALID_OPT" means param
69  * was NULL.
70  */
71 uint8_t outputTaskDataRx(outputTaskData_t *data);
72 
73 /**
74  * @brief Initializes terminal output
75  * @details Opens stream to JTAG-UART-device in write mode.
76  * @retval none
77  */
78 void init_term(void);
79 
80 /**
81  * @brief Initializes lcd output
82  * @details Calling specific lcd init functions which sends initializisation
83  * sequence to lcd. Also opens stream to lcd-device in write mode.
84  * @retval none
85  */
86 void init_lcd(void);
87 
88 /**
89  * @brief Clears display
90  * @details Sends clear sequence to display.
91  * @retval none
92  */
93 void clear_lcd(void);
94 
95 /**
96  * @brief Sets the cursor position on display
97  * @details The display supports 2 rows and 16 columns where the cursor can be set
98  *
99  * @param row The number of row to position.
100  * @param col The number of col to position.
101  */
102 void setPos_lcd(int32_t row, int32_t col);
103 
104 /**
105  * @brief Sets the cursor-mode
106  * @details @see lcdDOGM162.h for more info
107  *
108  * @param cursorMode new Cursor mode, can be
109  * @arg LCD_CURSOR_OFF
110  * @arg LCD_CURSOR_ON
111  * @arg LCD_BLINK
112  */
113 void setCursorMode_lcd(int32_t cursorMode);
114 
115 /**
116  * @brief Writes formated string to terminal.
117  * @details Usage like common printf.
118  * @retval none
119  */
120 void printf_term(const char *, ...);
121 
122 /**
123  * @brief Writes formated string to lcd
124  * @details Usage like common printf.
125  * @retval none
126  */
127 void printf_lcd(const char *, ...);
128 
129 /**
130  * @brief Writes buffed data to terminal
131  * @details Writes any buffed data to terminal stream.
132  * @retval none
133  */
134 void fflush_term();
135 
136 /**
137  * @brief Writes buffed data to lcd
138  * @details Writes any buffed data to lcd stream.
139  * @retval none
140  */
141 void fflush_lcd();
142 
143 #endif // __AUXILARY_FUNCTIONS_H__
void printf_term(const char *,...)
Writes formated string to terminal.
void fflush_lcd()
Writes buffed data to lcd.
Header for Initialization program for LCD DOGM162. Qsys uses Altera LCD component "altera_avalon_lcd_...
void clear_lcd(void)
Clears display.
void setCursorMode_lcd(int32_t cursorMode)
Sets the cursor-mode.
uint8_t outputTaskDataTx(outputTaskData_t data)
Sends data to ipc channel.
uint8_t outputTaskDataRx(outputTaskData_t *data)
Received data from ipc channel.
void init_term(void)
Initializes terminal output.
void init_lcd(void)
Initializes lcd output.
void printf_lcd(const char *,...)
Writes formated string to lcd.
uint8_t init_outputTaskDataTxRx(void)
Initializes the interprocess communication between OutputTask and InputTask.
void setPos_lcd(int32_t row, int32_t col)
Sets the cursor position on display.
void fflush_term()
Writes buffed data to terminal.
Header file for all own data types.
Datatype of global variable for transmitting information from InputTask to OutputTask.
Definition: dataTypes.h:49