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

Collection of auxilary functions, mainly output functions. More...

Include dependency graph for auxilaryFunctions.c:

Go to the source code of this file.

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 *format,...)
 Writes formated string to terminal. More...
 
void printf_lcd (const char *format,...)
 Writes formated string to lcd. More...
 
void fflush_term ()
 Writes buffed data to terminal. More...
 
void fflush_lcd ()
 Writes buffed data to lcd. More...
 

Variables

FILE * term
 stream to write on terminal device
 
FILE * lcd
 stream to write lcd device
 
outputTaskData_t outputTaskData
 Variable for transmitting information from InputTask to OutputTask.
 
OS_EVENT * outputTaskDataMutex
 Mutex for secured variable acces.
 

Detailed Description

Collection of auxilary functions, mainly output functions.

Author
Michael Riedel
Marc Kossmann
Version
v2.0.0
Date
18.11.2014
History:

v0.1.0 28.10.2014 Riedel & Kossmann

  • added functions for using printf like lcd and term output

v0.1.1 31.10.2014 Riedel & Kossmann

  • added timeout for clearing display but not sure if needed
  • clear display function added

v0.1.2 06.11.2014 Riedel

  • implemented some functions for better display-usage

v1.0.0 06.11.2014 Riedel

  • implemented some functions for better display-usage

v1.1.0 14.11.2014 Kossmann

  • implemented 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

  • fixed all global var function parameters
  • verified functionality -> release MS2

Definition in file auxilaryFunctions.c.

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.