The yu-capteurs version of function i2c_master_write doesn't transfer nonblockingly correctly. The return value of `I2C_MasterTransferNonBlocking(EXAMPLE_I2C_MASTER, &g_m_handle, masterXfer)` is not `kStatus_Success`.
After modifying the oximeter2_init function and changing the EXAMPLE_I2C_MASTER's MSTDAT value to 0x46(the correct value), the value goes back to the previous wrong value after `I2C_MasterTransferNonBlocking` in `i2c_master_write`.
To be more precise, 0x46 is changed to 200 after `I2C_EnableInterrupts(base, (uint32_t)kI2C_MasterIrqFlags)` in function `I2C_MasterTransferNonBlocking`.
Another observation is that the value `final_result` read in function oximeter2_logs_results is always 92, regardless if the click sensor oximeter2 is connected to the board or not.
The I2C_MasterTransferNonBlocking in function i2c_master_write_then_read would return kStatus_I2C_Busy because the transaction is in progress. This is related to the problem of being stuck in `while(!g_MasterCompletionFlag)` (for the moment this while loop is commented out).
The library "oximeter2.h" on branch yu-capteurs is essentially the same thing as the [example code](https://github.com/MikroElektronika/mikrosdk_click_v2/blob/master/clicks/oximeter2/example/main.c) from the official github repo of MikroElektronika except a few modifications.
There are modifications because the cod on this gitlab branch yu doesn't use the "drv" libraries. The code connecting the drivers of the [nxp mcu sdk](https://github.com/NXPmicro/mcux-sdk/blob/main/drivers/i2c/fsl_i2c.h) and the example code provided by mikroelektronika has to be reinvened.
**Problem/Confusion:**
The function oximeter2_read_data from the MikroElektro official oximeter2 library has 4 register value catchers catching readings from the 4 channels(PD_{1,2,3,4}).
I received warnings of "variable 'reg_addr{1,3}' set but not used".
Will removing these two variables affecting anything?
> "The I2C interface of the codec is routed to Flexcomm 4 of the LPC55Sxx, the same connection as used for the other I2C devices on the board." (from "LPCXpresso55S16 Development Boards User Manual")
Donc "I2C_MasterTransferCreateHandle(I2C4, &a_i2c_master_handle_t, i2c_master_callback, NULL);"
## Oximeter 2
Oximeter 2 utilise l'ADPD144RI pour la détection par photopléthysmographie de l'oxygénation du sang.
### ADPD144RI
Son adresse d'esclave est 0x64.
Il n'a pas un who_am_i.
> The ADPD144RI samples bursts of synchronous pulses in two independent time slots, Time Slot A and Time Slot B, which occur sequentially within a sample period.
> A burst accumulator sums the pulse energies into a 20-bit value. The number of pulses in each time slot is set in the top octet of Register 0x31 for Time Slot A and Register 0x36 for Time Slot B. Each time slot can contain 1 to 255 pulses.