42 #include "IfxI2c_reg.h"
43 #include "IfxI2c_bf.h"
554 boolean free =
FALSE;
567 i2c->ERRIRQSC.U = (1 << IFX_I2C_ERRIRQSC_RXF_UFL_OFF) | (1 << IFX_I2C_ERRIRQSC_RXF_OFL_OFF) | (1 << IFX_I2C_ERRIRQSC_TXF_UFL_OFF) | (1 << IFX_I2C_ERRIRQSC_TXF_OFL_OFF);
573 i2c->PIRQSC.U = (1 << IFX_I2C_PIRQSC_AM_OFF) | (1 << IFX_I2C_PIRQSC_GC_OFF) | (1 << IFX_I2C_PIRQSC_MC_OFF) | (1 << IFX_I2C_PIRQSC_AL_OFF) | (1 << IFX_I2C_PIRQSC_NACK_OFF) | (1 << IFX_I2C_PIRQSC_TX_END_OFF) | (1 << IFX_I2C_PIRQSC_RX_OFF);
579 i2c->ICR.B.BREQ_INT = 1;
585 i2c->ERRIRQSC.U = (1 << source);
591 i2c->ICR.B.LBREQ_INT = 1;
597 i2c->ICR.B.LSREQ_INT = 1;
603 i2c->PIRQSC.U = (1 << source);
609 i2c->ICR.B.SREQ_INT = 1;
615 i2c->IMSC.B.BREQ_INT = 0;
621 i2c->IMSC.B.I2C_ERR_INT = 0;
627 i2c->ERRIRQSM.U &= ~(1 << source);
633 i2c->IMSC.B.LBREQ_INT = 0;
639 i2c->IMSC.B.LSREQ_INT = 0;
645 i2c->IMSC.B.I2C_P_INT = 0;
651 i2c->PIRQSM.U &= ~(1 << source);
657 i2c->IMSC.B.SREQ_INT = 0;
663 i2c->IMSC.B.BREQ_INT = 1;
669 i2c->IMSC.B.I2C_ERR_INT = 1;
675 i2c->ERRIRQSM.U |= (1 << source);
681 i2c->IMSC.B.LBREQ_INT = 1;
687 i2c->IMSC.B.LSREQ_INT = 1;
693 i2c->IMSC.B.I2C_P_INT = 1;
699 i2c->PIRQSM.U |= (1 << source);
705 i2c->IMSC.B.SREQ_INT = 1;
711 if (i2c == &MODULE_I2C0)
713 return &MODULE_SRC.I2C.I2C[0].BREQ;
717 return &MODULE_SRC.I2C.I2C[1].BREQ;
724 return i2c->RIS.B.BREQ_INT;
736 return i2c->RIS.B.I2C_ERR_INT;
742 return (i2c->ERRIRQSS.U & (1 << source)) ?
TRUE :
FALSE;
748 if (i2c == &MODULE_I2C0)
750 return &MODULE_SRC.I2C.I2C[0].ERR;
754 return &MODULE_SRC.I2C.I2C[1].ERR;
761 if (i2c == &MODULE_I2C0)
763 return &MODULE_SRC.I2C.I2C[0].LBREQ;
767 return &MODULE_SRC.I2C.I2C[1].LBREQ;
774 return i2c->RIS.B.LBREQ_INT;
780 if (i2c == &MODULE_I2C0)
782 return &MODULE_SRC.I2C.I2C[0].LSREQ;
786 return &MODULE_SRC.I2C.I2C[1].LSREQ;
793 return i2c->RIS.B.LSREQ_INT;
799 return i2c->RIS.B.I2C_P_INT;
805 return (i2c->PIRQSS.U & (1 << source)) ?
TRUE :
FALSE;
811 if (i2c == &MODULE_I2C0)
813 return &MODULE_SRC.I2C.I2C[0].P;
817 return &MODULE_SRC.I2C.I2C[1].P;
824 if (i2c == &MODULE_I2C0)
826 return &MODULE_SRC.I2C.I2C[0].SREQ;
830 return &MODULE_SRC.I2C.I2C[1].SREQ;
837 return i2c->RIS.B.SREQ_INT;
855 i2c->GPCTL.B.PISEL = pisel;
861 i2c->MRPSCTRL.B.MRPS = size;
867 i2c->ADDRCFG.B.ADR = address;
873 i2c->CLC1.B.EDIS = mode;
879 i2c->TPSCTRL.B.TPS = size;