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

Functions for accessing hardware connected through pio´s and registers. More...

#include <stdint.h>
#include <system.h>
#include <altera_avalon_pio_regs.h>
Include dependency graph for hardwareAccess.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PIO_KEY_RS_IR0_MSK   (0b0001)
 Run/Stop mask for PIO-Key.
 
#define PIO_KEY_MINUS_IR2_MSK   (0b0100)
 Increase steps mask for PIO-Key.
 
#define PIO_KEY_PLUS_IR3_MSK   (0b1000)
 Decreses steps mask for PIO-Key.
 
#define PIO_SW_LR_MSK   (0b0000000001)
 Left/Right mask for PIO-Switches.
 
#define PIO_SW_MODE_MSK   (0b0000011110)
 Mode mask for PIO-Switches.
 
#define PIO_SW_DEBUG_MSK   (0b1000000000)
 Debug mask for PIO-Switches.
 

Functions

keys
static __inline__ void PIO_KEY_SetIRMsk (uint32_t enablebits)
 Function to enable interrupts for pio key. More...
 
static __inline__ void PIO_KEY_ClearEdgeCptBits (uint32_t clearbits)
 Function to clear bits of keys edgecapture register. More...
 
static __inline__ uint32_t PIO_KEY_GetEdgeCpt (void)
 Function to read content of keys edgecapture register. More...
 
sliding switches
static __inline__ void PIO_SW_SetIRMsk (uint32_t enablebits)
 Function to enable interrupts for pio sw. More...
 
static __inline__ void PIO_SW_ClearEdgeCptBits (uint32_t clearbits)
 Function to clear bits of switches edgecapture register. More...
 
static __inline__ uint32_t PIO_SW_GetValues (void)
 Function to read content of switches data register. More...
 
red LED_9 (heartbeat)
static __inline__ void PIO_LED9_Set (uint32_t ledValue)
 Function to set led9 for heartbeat. More...
 
7-segment hex displays
static __inline__ void PIO_HEX0_Set (uint32_t segmentValues)
 Function to set segments on hex0 display. More...
 
static __inline__ void PIO_HEX1_Set (uint32_t segmentValues)
 Function to set segments on hex1 display. More...
 
static __inline__ void PIO_HEX2_Set (uint32_t segmentValues)
 Function to set segments on hex2 display. More...
 
static __inline__ void PIO_HEX3_Set (uint32_t segmentValues)
 Function to set segments on hex3 display. More...
 

Detailed Description

Functions for accessing hardware connected through pio´s and registers.

Author
Michael Riedel
Marc Kossmann
Version
v1.0.0
Date
11.11.2014
History:

v0.1.0 21.10.2014 Riedel & Kossmann

  • first draft for milestone 1b

v0.1.1 29.10.2014 Kossmann

  • renewed complete pio access concept

v0.1.2 31.10.2014 Riedel & Kossmann

  • added missing var type in hex functions

v1.0.0 31.10.2014 Kossmann

  • added function to clear edgecapture of switches

Definition in file hardwareAccess.h.

Function Documentation

static __inline__ void PIO_HEX0_Set ( uint32_t  segmentValues)
static

Function to set segments on hex0 display.

Parameters
segmentValues: Values for all seven segments
  • 0 = segment OFF
  • 1 = segment ON
Return values
none

Definition at line 125 of file hardwareAccess.h.

static __inline__ void PIO_HEX1_Set ( uint32_t  segmentValues)
static

Function to set segments on hex1 display.

Parameters
segmentValues: Values for all seven segments
  • 0 = segment OFF
  • 1 = segment ON
Return values
none

Definition at line 136 of file hardwareAccess.h.

static __inline__ void PIO_HEX2_Set ( uint32_t  segmentValues)
static

Function to set segments on hex2 display.

Parameters
segmentValues: Values for all seven segments
  • 0 = segment OFF
  • 1 = segment ON
Return values
none

Definition at line 147 of file hardwareAccess.h.

static __inline__ void PIO_HEX3_Set ( uint32_t  segmentValues)
static

Function to set segments on hex3 display.

Parameters
segmentValues: Values for all seven segments
  • 0 = segment OFF
  • 1 = segment ON
Return values
none

Definition at line 158 of file hardwareAccess.h.

static __inline__ void PIO_KEY_ClearEdgeCptBits ( uint32_t  clearbits)
static

Function to clear bits of keys edgecapture register.

Parameters
clearbits: set bits to 1 for enable interrupt
Return values
none

Definition at line 55 of file hardwareAccess.h.

static __inline__ uint32_t PIO_KEY_GetEdgeCpt ( void  )
static

Function to read content of keys edgecapture register.

Return values
pressedKeys: When edge was detected, bit is 1

Definition at line 63 of file hardwareAccess.h.

static __inline__ void PIO_KEY_SetIRMsk ( uint32_t  enablebits)
static

Function to enable interrupts for pio key.

Parameters
enablebits: set bits to 1 for enable interrupt
Return values
None

Definition at line 46 of file hardwareAccess.h.

static __inline__ void PIO_LED9_Set ( uint32_t  ledValue)
static

Function to set led9 for heartbeat.

Parameters
ledValue: Value for LED9
  • 0 = LED OFF
  • 1 = LED ON
Return values
none

Definition at line 110 of file hardwareAccess.h.

static __inline__ void PIO_SW_ClearEdgeCptBits ( uint32_t  clearbits)
static

Function to clear bits of switches edgecapture register.

Parameters
clearbits: set bits to 1 for clearing interrupt
Return values
none

Definition at line 85 of file hardwareAccess.h.

static __inline__ uint32_t PIO_SW_GetValues ( void  )
static

Function to read content of switches data register.

Return values
switchesValues: Values of all switches
  • 0 = Switch OFF
  • 1 = Switch ON

Definition at line 95 of file hardwareAccess.h.

static __inline__ void PIO_SW_SetIRMsk ( uint32_t  enablebits)
static

Function to enable interrupts for pio sw.

Parameters
enablebits: set bits to 1 for enable interrupt
Return values
None

Definition at line 76 of file hardwareAccess.h.