Blame | Last modification | View Log | Download | RSS feed
ifndef __ez80i2cinc__ez80i2cinc equ 1__defi2c macro NUM,BaseI2C{NUM}_SAR port Base+0 ; I2C n Slave Address Register (r/w)if NUM<>"1"SLA_S equ 1 ; Slave addressSLA_M equ 127 << SLA_SGCE equ 1 << 0 ; Recognize General Call AddressendifI2C{NUM}_xSAR port Base+1 ; I2C n Extended Slave Address Register (r/w)I2C{NUM}_DR port Base+2 ; I2C n Data Register (r/w)I2C{NUM}_CTL port Base+3 ; I2C n Control Register (r/w)if NUM<>"1"IEN equ 1 << 7 ; Interrupt EnableENAB equ 1 << 6 ; Enable BusSTA equ 1 << 5 ; Send STARTSTP equ 1 << 4 ; Send STOPIFLG equ 1 << 3 ; Interrupt StatusACK equ 1 << 2 ; AcknowledgeendifI2C{NUM}_SR port Base+4 ; I2C n Status Register (r)if NUM<>"1"STAT_S equ 3 ; I2C statusSTAT_M equ 31 << STAT_SendifI2C{NUM}_CCR port Base+4 ; I2C n Clock Control Register (w)I2C{NUM}_SRR port Base+5 ; I2C n Software Reset Register (w)endm ; __defi2cendif ; __ez80i2cinc