source: projects/magnetic-tape-show/wiring.h @ 79

Last change on this file since 79 was 79, checked in by sven, 6 years ago

Magnetic Tape Show project, also called Univac9400Show, see https://labs.technikum29.de/wiki/Univac9400Show
This directory holds the source of a AVR uC project

File size: 1.4 KB
Line 
1/*
2 * wiring.h
3 *
4 * Created: 10.08.2013 13:55:53
5 *  Author: Sven
6 */ 
7
8
9#ifndef WIRING_H_
10#define WIRING_H_
11
12#define __AVR_ATmega644__       1
13/* Standard-8Mhz-Quarz des Boards */
14#define OSCSPEED        8000000UL               /* in Hz */
15#define F_CPU       OSCSPEED
16
17#include "avr/io.h"
18#include "avr/interrupt.h"
19
20// code copied mostly from PTNG2013
21
22// 1. Pin Input Names
23
24// PIN A: Relais Output
25// PIN B: Button
26#define PINB_BUT    PINB4
27#define is_button()  (!( PINB & (1 << PINB_BUT) ))
28// PIN C: Relais Output
29// PIN D: No RS232
30
31// 2. Port Output Names
32
33// PORT A: Realais Output 1-8, sic
34#define RELAIS_01  PORTA0
35#define RELAIS_02  PORTA1
36#define RELAIS_03  PORTA2
37#define RELAIS_04  PORTA3
38#define RELAIS_05  PORTA4
39#define RELAIS_06  PORTA5
40#define RELAIS_07  PORTA6
41#define RELAIS_08  PORTA7
42// PORT B: LED
43#define PORTB_LED  PORTB0
44// PORT C: Relais Output 9-16, sic umverdrehung!
45#define RELAIS_09  PORTC7
46#define RELAIS_10  PORTC6
47#define RELAIS_11  PORTC5
48#define RELAIS_12  PORTC4
49#define RELAIS_13  PORTC3
50#define RELAIS_14  PORTC2
51#define RELAIS_15  PORTC1
52#define RELAIS_16  PORTC0
53// PORT D: No RS232
54
55
56// sic! LED on Olimex devel board
57#define start_led()     ( PORTB &= ~(1 << PORTB_LED) )
58#define stop_led()      ( PORTB |= (1 << PORTB_LED) )
59#define is_led()        ( !(PINB & (1 << PINB0)) )
60#define toggle_led()    ( is_led() ? stop_led() : start_led() )
61
62
63
64#endif /* WIRING_H_ */
Note: See TracBrowser for help on using the repository browser.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License