Stepper-Motor-Control  v3.0.0
System on a Chip 2014 - Group 04
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
auxilaryFunctions.h File Reference

Header file for auxilaryFunctions.c. More...

#include <stdio.h>
#include <stdarg.h>
#include <system.h>
#include "includes.h"
#include "lcdDOGM162.h"
#include "altera_avalon_lcd_16207_regs.h"
#include "dataTypes.h"
Include dependency graph for auxilaryFunctions.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define VERSION   "2.0.0"
 global version definition
 
#define DATE   "18.11.2014"
 global date definition
 
#define MUTEX_PRIORITY   4
 

Functions

uint8_t init_outputTaskDataTxRx (void)
 Initializes the interprocess communication between OutputTask and InputTask. More...
 
uint8_t outputTaskDataTx (outputTaskData_t data)
 Sends data to ipc channel. More...
 
uint8_t outputTaskDataRx (outputTaskData_t *data)
 Received data from ipc channel. More...
 
void init_term (void)
 Initializes terminal output. More...
 
void init_lcd (void)
 Initializes lcd output. More...
 
void clear_lcd (void)
 Clears display. More...
 
void setPos_lcd (int32_t row, int32_t col)
 Sets the cursor position on display. More...
 
void setCursorMode_lcd (int32_t cursorMode)
 Sets the cursor-mode. More...
 
void printf_term (const char *,...)
 Writes formated string to terminal. More...
 
void printf_lcd (const char *,...)
 Writes formated string to lcd. More...
 
void fflush_term ()
 Writes buffed data to terminal. More...
 
void fflush_lcd ()
 Writes buffed data to lcd. More...
 

Detailed Description

Header file for auxilaryFunctions.c.

Author
Michael Riedel
Marc Kossmann
Version
v2.0.0
Date
18.11.2014

Contains defines, includes, typedefs and declarations needed for auxilary functions.

History:

v0.1.0 22.10.2014 Kossmann

  • first draft for milestone 1b

v0.1.1 27.10.2014 Riedel & Kossmann

v0.1.2 27.10.2014 Riedel & Kossmann

  • clear display function added

v0.1.3 03.11.2014 Kossmann

  • finished documentation

v1.0.1 14.11.2014 Kossmann

  • added init rx,tx functions for access to global ipc var for transmitting data between UserInput- and UserOuputTask

v2.0.0 18.11.2014 Riedel & Kossmann

  • verified functionality -> release MS2

Definition in file auxilaryFunctions.h.

Macro Definition Documentation

#define MUTEX_PRIORITY   4

Priority for Mutexes

Definition at line 43 of file auxilaryFunctions.h.

Function Documentation

void clear_lcd ( void  )

Clears display.

Sends clear sequence to display.

Return values
none

Definition at line 97 of file auxilaryFunctions.c.

void fflush_lcd ( )

Writes buffed data to lcd.

Writes any buffed data to lcd stream.

Return values
none

Definition at line 127 of file auxilaryFunctions.c.

void fflush_term ( )

Writes buffed data to terminal.

Writes any buffed data to terminal stream.

Return values
none

Definition at line 124 of file auxilaryFunctions.c.

void init_lcd ( void  )

Initializes lcd output.

Calling specific lcd init functions which sends initializisation sequence to lcd. Also opens stream to lcd-device in write mode.

Return values
none

Definition at line 92 of file auxilaryFunctions.c.

Here is the call graph for this function:

uint8_t init_outputTaskDataTxRx ( void  )

Initializes the interprocess communication between OutputTask and InputTask.

Transmission is done via global variable and secured by mutex.

Return values
errSystem wide error code

Definition at line 37 of file auxilaryFunctions.c.

void init_term ( void  )

Initializes terminal output.

Opens stream to JTAG-UART-device in write mode.

Return values
none

Definition at line 88 of file auxilaryFunctions.c.

uint8_t outputTaskDataRx ( outputTaskData_t data)

Received data from ipc channel.

Reads data of global variable. outputTaskDataMutex must be initialized before.

Parameters
[out]dataPointer to the content of the global var.
Return values
errSystem wide error code. "OS_ERR_INVALID_OPT" means param was NULL.

Definition at line 71 of file auxilaryFunctions.c.

uint8_t outputTaskDataTx ( outputTaskData_t  data)

Sends data to ipc channel.

Stores data in global variable. outputTaskDataMutex must be initialized before.

Parameters
dataData to store in global var.
Return values
errSystem wide error code. "OS_ERR_INVALID_OPT" means param was NULL.

Definition at line 54 of file auxilaryFunctions.c.

void printf_lcd ( const char *  ,
  ... 
)

Writes formated string to lcd.

Usage like common printf.

Return values
none

Definition at line 117 of file auxilaryFunctions.c.

void printf_term ( const char *  ,
  ... 
)

Writes formated string to terminal.

Usage like common printf.

Return values
none

Definition at line 111 of file auxilaryFunctions.c.

void setCursorMode_lcd ( int32_t  cursorMode)

Sets the cursor-mode.

See also
lcdDOGM162.h for more info
Parameters
cursorModenew Cursor mode, can be
  • LCD_CURSOR_OFF
  • LCD_CURSOR_ON
  • LCD_BLINK

Definition at line 107 of file auxilaryFunctions.c.

Here is the call graph for this function:

void setPos_lcd ( int32_t  row,
int32_t  col 
)

Sets the cursor position on display.

The display supports 2 rows and 16 columns where the cursor can be set

Parameters
rowThe number of row to position.
colThe number of col to position.

Definition at line 102 of file auxilaryFunctions.c.