Gert van der Knokke
/
C1541III
C1541-III mbed edition
Diff: hardware.c
- Revision:
- 0:28557a4d2215
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hardware.c Mon Aug 22 05:48:51 2011 +0000 @@ -0,0 +1,74 @@ +/*----------------------------------------------------------------------------------*/ +/* 1541-III, Hardware control routines, Written by Jan Derogee */ +/*----------------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------------*/ + +/* History: + -------- + 2007-03-08 status of LED output was set to 1 (LED-ON) during config, must be 0 (LED-OFF) + 2006-06-22 changed baudrate to 115K2, this is more practical/compatible with the bootloader (currently) + 2006-06-21 added complete device configuration word, witout it the source is not complete + in previous versions the user had to set the configuration word within MPLAB + but to make this source independent, the configuration word must be included here!! + and NOT in the development environment. Doing it within the source also documents it. + 2006-04-12 enabled interrupt on RB0 (for ATN handling under interrupt) + 2006-03-28 change in IO-pin definiions required for new PCB design + 2006-02-04 added timer-0 (for the led blinking routines) + 2006-02-02 improvements in code layout... i.o.w. making it more readable + +*/ + +/* TO DO: + ------ +*/ + +/*----------------------------------------------------------------------------------*/ + + +/*--------------------------------------------------------*/ +/* includes */ +/*--------------------------------------------------------*/ +#include <mbed.h> +//#include <IEC_bus.h> + +#include <hardware.h> + +/*--------------------------------------------------------*/ +/* globals */ +/*--------------------------------------------------------*/ +bool std_out; /*this holds the destination of the putch- and printf-routines*/ +/*--------------------------------------------------------*/ + +/*****************************************************************************************************************/ +/*****************************************************************************************************************/ + +void HardwareInit(void) /*initialize processor here*/ +{ + + + +// INTEDG0 = 0; /*set interrupt trigger to falling edge*/ +// INT0IE = 0; /*disable interrupts on pin RB0 (INT0), this line is connected to the ATN line*/ + +// IPEN=1; /*enable priority for interrrupts*/ +// PEIE=1; +// GIE=1; +} + +extern void enable_ATN_interrupt(void); + +#define RS232 1 +#define LCD 0 + +/*redirect standard output to serial or LCD*/ +void putch(unsigned char ch) +{ + + putchar(ch); + } + + + +/* +The author of sourcecode without comments is the only one to fully understand the written code... for the first 3 months. +*/