![](/media/cache/profiles/f93486bfff38ca69d76d85c089569a09.50x50_q85.jpg)
C1541-III mbed edition
Diff: IEC_bus.h
- Revision:
- 0:28557a4d2215
- Child:
- 1:0cbbb66a6100
diff -r 000000000000 -r 28557a4d2215 IEC_bus.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/IEC_bus.h Mon Aug 22 05:48:51 2011 +0000 @@ -0,0 +1,51 @@ +#ifndef IEC_BUS_INCLUDED +#define IEC_BUS_INCLUDED + + +/*defines*/ +/*-------*/ +/*IEC commandset: the talker requests the addresses device to become a ...-er*/ +#define LISTEN 0x20 /*base address, device 0-30*/ +#define UNLISTEN 0x3F /*base address, n/a*/ +#define TALK 0x40 /*base address, device 0-30*/ +#define UNTALK 0x5F /*base address, n/a*/ +#define DATA 0x60 /*base address, secondary address 0-15 (this is in some documentation also refered to as OPEN_CHANNEL)*/ +#define CLOSE 0xE0 /*base address, secondary address 0-15*/ +#define OPEN 0xF0 /*base address, secondary address 0-15*/ + +#define TIMINGS_DEFAULT 10 +#define TIMINGS_DTV 11 +#define TIMINGS_VIC20 12 +extern int IEC_CLOCK(); +extern int IEC_DATA(); +extern int IEC_ATN(); +extern void IEC_ATN_REL(); +extern void IEC_ATN_PULL(); +extern void IEC_DATA_REL(); +extern void IEC_CLOCK_REL(); +extern void IEC_DATA_PULL(); +extern void IEC_CLOCK_PULL(); + +/*routines*/ +/*--------*/ +void InitIEC(void); +void SetIEC_timings(unsigned char settings); +void FreeIEC(void); + +unsigned char IEC_receive(unsigned char frame_handshake); +unsigned char IEC_send(unsigned char data); +unsigned char IEC_monitor(void); +void IEC_send_string(const unsigned char *inputstring); +void IEC_send_number_as_ASCII(unsigned char number); +void IEC_turnaround(void); +void IEC_undoturnaround(void); +void IEC_letgo(void); +unsigned char CheckForCommand(unsigned char *outputcommand, unsigned char frame_handshake); + +#endif + + + + + +