Changeset 82 in projects for magnetic-tape-show/wiring.h


Ignore:
Timestamp:
Aug 13, 2013, 7:24:01 PM (6 years ago)
Author:
sven
Message:

Wiring/PSeudosprache fertiggeschrieben.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • magnetic-tape-show/wiring.h

    r80 r82  
    5454// PORT D: No RS232
    5555
     56// Relais zu daran angeschlossenen Geraete-Mapping:
     57//Rel. 1-4 (+15)    TAPE1   (ON, FORWARD, REWIND, OFF, LP=LOAD-POINT, READ)
     58//Rel. 5-8              TAPE2   (ebenso)
     59//Rel. 9-14             Tape0   (pneumatisches Laufwerk)
     60
     61// C99..
     62#define TRUE  1
     63#define FALSE 0
     64
     65#define set_bit(PORTi, RELAISj, WERT) (\
     66        (WERT == TRUE) ? \
     67          (PORTi &= ~(1 << RELAISj)) : \
     68          (PORTi |=  (1 << RELAISj))  )
     69         
     70// ON und OFF gehen immer in 1sec-Impulsen. Abkuerzen!
     71
     72#define  set_impuls(PORTi, RELAISj)  ({ \
     73        set_bit(PORTi, RELAISj, TRUE); \
     74        _delay_ms(1000); \
     75        set_bit(PORTi, RELAISj, FALSE); \
     76        })
     77
     78
     79#define tape1_on()                      set_impuls(PORTA, RELAIS_01)
     80#define tape1_for(v)            set_bit(PORTA, RELAIS_02, v)
     81#define tape1_rew(v)            set_bit(PORTA, RELAIS_03, v)
     82#define tape1_off()                     set_impuls(PORTA, RELAIS_04)
     83#define tape1_read(v)           set_bit(PORTA, RELAIS_15, v)
     84
     85#define tape2_on()                      set_impuls(PORTA, RELAIS_05)
     86#define tape2_for(v)            set_bit(PORTA, RELAIS_06, v)
     87#define tape2_rew(v)            set_bit(PORTA, RELAIS_07, v)
     88#define tape2_off()                     set_impuls(PORTA, RELAIS_08)
     89
     90#define tape0_on()                      set_impuls(PORTC, RELAIS_09)
     91#define tape0_for(v)            set_bit(PORTC, RELAIS_10, v)
     92#define tape0_read(v)           set_bit(PORTC, RELAIS_11, v)
     93#define tape0_rew(v)            set_bit(PORTC, RELAIS_12, v)
     94#define tape0_lp(v)                     set_bit(PORTC, RELAIS_13, v)
     95#define tape0_off()                     set_impuls(PORTC, RELAIS_14)
     96
     97#define sound_start(v)          set_bit(PORTC, RELAIS_16, v)
     98
     99
    56100
    57101// sic! LED on Olimex devel board
Note: See TracChangeset for help on using the changeset viewer.
© 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