JochiSt / OpenFlowMeter

Measuring Flow
GNU General Public License v3.0
6 stars 0 forks source link

implementation of I2C slave connection #25

Open JochiSt opened 1 year ago

JochiSt commented 1 year ago

as an additional connection option, the I2C bus is quite handy in its connectivity. This pull request will focus on the I2C slave implementation in order to make the configuration and measurements available via I2C.

JochiSt commented 1 year ago

The device gets found when doing and I2C scan

 01 -- 02 -- 03 -- 04 -- 05 -- 06 -- 07 -- 08 --
 09 -- 0a -- 0b -- 0c -- 0d -- 0e -- 0f -- 10 --
 11 -- 12 -- 13 -- 14 -- 15 -- 16 -- 17 -- 18 --
 19 -- 1a -- 1b -- 1c -- 1d -- 1e -- 1f -- 20 OK
 21 -- 22 -- 23 -- 24 -- 25 -- 26 -- 27 -- 28 --
 29 -- 2a -- 2b -- 2c -- 2d -- 2e -- 2f -- 30 --
 31 -- 32 -- 33 -- 34 -- 35 -- 36 -- 37 -- 38 --
 39 -- 3a -- 3b -- 3c -- 3d -- 3e -- 3f -- 40 --
 41 -- 42 -- 43 -- 44 -- 45 -- 46 -- 47 -- 48 --
 49 -- 4a -- 4b -- 4c -- 4d -- 4e -- 4f -- 50 --
 51 -- 52 -- 53 -- 54 -- 55 -- 56 -- 57 -- 58 --
 59 -- 5a -- 5b -- 5c -- 5d -- 5e -- 5f -- 60 --
 61 -- 62 -- 63 -- 64 -- 65 -- 66 -- 67 -- 68 --
 69 -- 6a -- 6b -- 6c -- 6d -- 6e -- 6f -- 70 OK
 71 -- 72 -- 73 -- 74 -- 75 -- 76 -- 77 -- 78 --
 79 -- 7a -- 7b -- 7c -- 7d -- 7e --

address 0x70 is a I2C multiplexer. 0x20 (64 = 0x40 right aligned) is the OFM.

JochiSt commented 1 year ago

Unfortunately, the read / write does not yet work. It seems, that the interrupts are not called. This needs further debugging.

JochiSt commented 1 year ago

I started a new project for just testing the I2C slave implementation: https://github.com/JochiSt/STM32_I2C_slave If the implementation is working there, I'll forward the findings into the OFM.