npub19z…spj90 on Nostr: Because I2C has been a thorn in my side for my entire embedded career, I'm working on ...
Because I2C has been a thorn in my side for my entire embedded career, I'm working on the I2C analyzer I've always wanted to buy but never could.
Here's a nice trick for writing complex test fixtures in Rust: define a simple character-driven language for expressing them, and embed a string. This test ASCII-arts the (D)ata and (C)lock waves of an I2C transaction and labels moments in time with the (E)vents that should be decoded.
I think it's way more legible than a big array of structs. #rust
Published at
2024-03-19 16:20:55Event JSON
{
"id": "513b9b3f542bdcd8057c76f32d87c35d008971507ab18c4f09657007a625ec1e",
"pubkey": "28a63c87dc548704b010a77b18468afd4214ccc4e4ce15a8e4e7e766fac533ce",
"created_at": 1710865255,
"kind": 1,
"tags": [
[
"t",
"rust"
],
[
"proxy",
"https://hachyderm.io/users/cliffle/statuses/112123265390768471",
"activitypub"
]
],
"content": "Because I2C has been a thorn in my side for my entire embedded career, I'm working on the I2C analyzer I've always wanted to buy but never could.\n\nHere's a nice trick for writing complex test fixtures in Rust: define a simple character-driven language for expressing them, and embed a string. This test ASCII-arts the (D)ata and (C)lock waves of an I2C transaction and labels moments in time with the (E)vents that should be decoded.\n\nI think it's way more legible than a big array of structs. #rust\n\nhttps://media.hachyderm.io/media_attachments/files/112/123/251/186/843/189/original/ea79326532476a57.png",
"sig": "aa45b8a2a907730bf1a7d1ba58b122e5817c01be2e0020c6b3a415f97e3dfc437d0d9683f4a3d448c34b3629337fe6908edbd1865dd3a51dce463214f33f609b"
}