i2c: stm32_v2: restructure interrupt handling
i2c: stm32_v2: restructure interrupt handling

This patch restructures stm32_i2c_v2 drivers Interrupts:
- NACK failures trigger an I2C event interrupt, so move
handling of NACK failure from error isr to event isr.
- Extract logic of interrupt handling to static functions. Use
isr functions (event & error OR combined) to call these. This
reduces duplication between error isr and combined isr.
- Restructure the error interrupt handling, so that it has no effect
when no errors occured and thus can be called by combined isr.
- Change interrupt logic from if/else to pure ifs for each flag.
This reduces code paths and leads to one call of the isr handling
multiple interrupt conditions, if there's more than one I2C
interrupt flags set.
This is the way it's done e.g. in linux kernels (since 4.14)
drivers/i2c/busses/i2c-stm32f7.c

Signed-off-by: Daniel Wagenknecht <e5cd46a5444588e1e8fe4ad59b9c1970dc51f444@clage.de>

zephyrproject-rtos/zephyr,nashif/zephyr,Vudentz/zephyr,finikorg/zephyr,punitvara/zephyr,Vudentz/zephyr,explora26/zephyr,GiulianoFranchetto/zephyr,kraj/zephyr,ldts/zephyr,explora26/zephyr,explora26/zephyr,ldts/zephyr,nashif/zephyr,kraj/zephyr,nashif/zephyr,kraj/zephyr,galak/zephyr,nashif/zephyr,GiulianoFranchetto/zephyr,finikorg/zephyr,ldts/zephyr,GiulianoFranchetto/zephyr,Vudentz/zephyr,galak/zephyr,kraj/zephyr,Vudentz/zephyr,GiulianoFranchetto/zephyr,punitvara/zephyr,zephyrproject-rtos/zephyr,punitvara/zephyr,galak/zephyr,Vudentz/zephyr,GiulianoFranchetto/zephyr,finikorg/zephyr,nashif/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,explora26/zephyr,punitvara/zephyr,zephyrproject-rtos/zephyr,punitvara/zephyr,ldts/zephyr,finikorg/zephyr,galak/zephyr,kraj/zephyr,explora26/zephyr,zephyrproject-rtos/zephyr,ldts/zephyr,galak/zephyr