For STM32 follow the instructions on this page adapting it for the board in use: https://wiki.st.com/stm32mcu/wiki/Getting_started_with_I2C
For other boards: contact Noam on Slack.
The setup instructions are intentionally not in c as to be adaptable for the varied implementations I2C is being used for and to better accommodate future developments and decisions.
In such a case as there is a SEU affecting the I2C bus, the bit passed on from each column shall be the one that has been received last.
In the unlikely event of TMR not being sufficient, the packet shall not be salvaged and the Ground Station Shall receive a log.
For each packet to be sent across I2C bus, send three times, with a delay that shall not exceed one second between packets.
For each received packet, save to struct with dimension 3x8 bits.
Apply to each column of the struct the following
Apply to each column of the struct a function defined by the following requirements:
Let $b_1, b_2, b_3$ be the values of a given column.
If $b_1 = b_2 = b_3$
Then continue with the value of $b_3$ as the bit in question
If $b_1 != b_2 = b_3$
Then continue with the value of $b_3$ as the bit in question
If $b_1 = b_2 != b_3$
Then continue with the value of $b_2$ as the bit in question
If $b_1 != b_3 = b_2$
Then continue with the value of $b_3$ as the bit in question
Else discard packets and return high SEU level.