From: johanknol Date: Fri, 2 Feb 2001 15:20:39 +0000 (+0000) Subject: added lcd i2c and rtc support for tinibios X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=7244686d3e82a14985c243927e9ac0663cc9a84f;p=fw%2Fsdcc added lcd i2c and rtc support for tinibios git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@560 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/device/include/tinibios.h b/device/include/tinibios.h index 8a8972b8..3e9bd3cc 100755 --- a/device/include/tinibios.h +++ b/device/include/tinibios.h @@ -49,6 +49,49 @@ void CpuSpeed(unsigned int speed); // The MOVX stretch cycles, see datasheet #define CPU_MOVX_STRETCH 0x01 +// from rtc390.c +static struct RTCDate{ + int year; + unsigned char month, day, weekDay, hour, minute, second, hundredth; +}; + +unsigned char RtcRead(struct RTCDate *rtcDate); +void RtcWrite(struct RTCDate *rtcDate); + +// from lcd390.c +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(xdata const char *format, ...) reentrant; +extern void LcdLPrintf(unsigned int collumnRow, xdata const char *format, ...) reentrant; + +// from i2c390.c +#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 I2CByteOut(char); +//extern void I2CDumpError(char); + +/* global transfer buffers */ +extern char i2cTransmitBuffer[I2C_BUFSIZE]; +extern char i2cReceiveBuffer[I2C_BUFSIZE]; + +// Macro for normal send transfer ending with a stop condition +#define I2CSend(addr, count) I2CSendStop(addr, count, 1) + + // internal functions used by tinibios.c unsigned char _sdcc_external_startup(void); void Serial0IrqHandler (void) interrupt 4;