Optocoupling in CMOS