123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- #ifndef TINIBIOS_H
- #define TINIBIOS_H
- #include <ds80c390.h>
- #include <time.h>
- void Serial0Init (unsigned long baud, unsigned char buffered);
- char Serial0GetChar(void);
- void Serial0PutChar(char);
- char Serial0CharArrived(void);
- void Serial0Baud(unsigned long baud);
- void Serial0SendBreak(void);
- void Serial0Flush(void);
- void Serial0SwitchToBuffered(void);
- void Serial1Init (unsigned long baud, unsigned char buffered);
- char Serial1GetChar(void);
- void Serial1PutChar(char);
- char Serial1CharArrived(void);
- void Serial1Baud(unsigned long baud);
- void Serial1SendBreak(void);
- void Serial1Flush(void);
- unsigned long ClockTicks();
- void ClockMilliSecondsDelay(unsigned long ms);
- void ClockMicroSecondsDelay(unsigned int us);
- #define SERIAL_0_BAUD 115200L
- #define SERIAL_1_BAUD 9600L
- #define SERIAL_0_RECEIVE_BUFFER_SIZE 1024
- #define SERIAL_1_RECEIVE_BUFFER_SIZE 64
- #if defined(__SDCC_ds400)
- # define OSCILLATOR 14745600L
- #else
- # define OSCILLATOR 18432000L
- #endif
- #define CPU_SPEED 2
- void CpuSpeed(unsigned int speed);
- #define CPU_MOVX_STRETCH 0x01
- #define HAVE_RTC
- unsigned char RtcRead(struct tm *rtcDate);
- void RtcWrite(struct tm *rtcDate);
- extern void LcdInit(void);
- extern void LcdOn(void);
- extern void LcdOff(void);
- extern void LcdClear(void);
- extern void LcdHome(void);
- extern void LcdGoto(unsigned int collumnRow);
- extern void LcdPutChar(char c);
- extern void LcdPutString(char *string);
- extern void LcdLPutString(unsigned int collumnRow, char *string);
- extern void LcdPrintf(const char *format, ...) __reentrant;
- extern void LcdLPrintf(unsigned int collumnRow, const char *format, ...) __reentrant;
- #define I2C_BUFSIZE 128
- extern char I2CReset(void);
- extern char I2CStart(void);
- extern char I2CStop(void);
- extern char I2CSendStop(char addr, char count,
- char send_stop);
- extern char I2CReceive(char addr, char count);
- extern char I2CSendReceive(char addr, char tx_count,
- char rx_count);
- extern char i2cTransmitBuffer[I2C_BUFSIZE];
- extern char i2cReceiveBuffer[I2C_BUFSIZE];
- #define I2CSend(addr, count) I2CSendStop(addr, count, 1)
- unsigned char _sdcc_external_startup(void);
- void Serial0IrqHandler (void) __interrupt 4;
- void Serial1IrqHandler (void) __interrupt 7;
- #if !defined(__SDCC_ds400)
- void ClockInit();
- void ClockIrqHandler (void) __interrupt 1 __naked;
- #endif
- #if defined(__SDCC_ds400)
- #define SPEED_1X 0 /* no clock multiplier, normal speed. */
- #define SPEED_2X 1 /* 2x clock multiplier. */
- #define SPEED_4X 2 /* 4x clock, DOESN'T WORK ON TINIm400! */
- unsigned char romInit(unsigned char noisy,
- char speed);
- void installInterrupt(void (*isrPtr)(void), unsigned char offset);
- #endif
- #endif /* TINIBIOS_H */
|