Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • pmrust/pmrust.pages.upb.ro
  • genan.omer/pmrust.pages.upb.ro
  • vladut.chintoiu/pmrust.pages.upb.ro
  • petru.nania/website-pmrust-fork
  • sofia.huzan/pmrust.pages.upb.ro
  • ionut.pruteanu2308/arcade-game
  • luana.militaru/pong-game
  • sebastian.scrob/project
  • matei.bejinaru/website-bejinaru-matei
  • adragomir2806/website-dragomir-alexandru
  • fatemehsadat/pmrust.pages.upb.ro
  • razvan.costea2205/pmrust.pages.upb.ro
  • darius_gabriel.iuga/pm-website
  • andrei.neagu1910/pmrust.pages.upb.ro
  • irina.chiorean/pmrust.pages.upb.ro
  • adrian_costin.lungu/pmrust.pages.upb.ro
16 results
Show changes
Commits on Source (18)
Showing
with 4 additions and 663 deletions
......@@ -27,7 +27,7 @@ Lecture 5
---
# UART & SPI
used by RP2040
used by RP2350
- Direct Memory Access
- Buses
......@@ -35,7 +35,9 @@ used by RP2040
- Serial Peripheral Interface
- Analog and Digital Sensors
<!-- DMA -->
<!--
DMA
-->
---
src: ../../resources/dma/slides.md
......
{
"reg": [
{
"bits": 8,
"name": "lower address",
"type": 5,
"attr": [
"address"
]
},
{
"bits": 1,
"name": "R/W",
"type": 3,
"attr": [
"1 - Read",
"0 - Write"
]
},
{
"bits": 2,
"name": "upper address",
"type": 5,
"attr": [
"address"
]
},
{
"bits": 5,
"name": 0x1e,
"type": 1,
"attr": [
"signal usage of 10 bit address"
]
}
]
}
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="84" viewBox="0 0 800 84" class="WaveDrom"><g transform="translate(0.5,0.5)" text-anchor="middle" font-size="14" font-family="sans-serif" font-weight="normal"><g transform="translate(4,21)"><g stroke="black" stroke-width="1" stroke-linecap="round"><line x2="791"/><line y2="31"/><line x2="791" y1="31" y2="31"/><line x1="791" x2="791" y2="31"/><line x1="742" x2="742" y2="3"/><line x1="742" x2="742" y1="31" y2="28"/><line x1="692" x2="692" y2="3"/><line x1="692" x2="692" y1="31" y2="28"/><line x1="643" x2="643" y2="3"/><line x1="643" x2="643" y1="31" y2="28"/><line x1="593" x2="593" y2="3"/><line x1="593" x2="593" y1="31" y2="28"/><line x1="544" x2="544" y2="3"/><line x1="544" x2="544" y1="31" y2="28"/><line x1="494" x2="494" y2="3"/><line x1="494" x2="494" y1="31" y2="28"/><line x1="445" x2="445" y2="3"/><line x1="445" x2="445" y1="31" y2="28"/><line x1="396" x2="396" y2="31"/><line x1="346" x2="346" y2="31"/><line x1="297" x2="297" y2="3"/><line x1="297" x2="297" y1="31" y2="28"/><line x1="247" x2="247" y2="31"/><line x1="198" x2="198" y2="3"/><line x1="198" x2="198" y1="31" y2="28"/><line x1="148" x2="148" y2="3"/><line x1="148" x2="148" y1="31" y2="28"/><line x1="99" x2="99" y2="3"/><line x1="99" x2="99" y1="31" y2="28"/><line x1="49" x2="49" y2="3"/><line x1="49" x2="49" y1="31" y2="28"/></g><g><g><rect x="396" width="396" height="31" field="lower address" style="fill-opacity:0.1;fill:#ffbf00"/><rect x="346" width="49" height="31" field="R/W" style="fill-opacity:0.1;fill:#aaff00"/><rect x="247" width="99" height="31" field="upper address" style="fill-opacity:0.1;fill:#ffbf00"/><rect width="247" height="31" field="30" style="fill-opacity:0.1"/></g><g transform="translate(25,-11)"><g transform="translate(742)"><text y="6">0</text></g><g transform="translate(396)"><text y="6">7</text></g><g transform="translate(346)"><text y="6">8</text></g><g transform="translate(297)"><text y="6">9</text></g><g transform="translate(247)"><text y="6">10</text></g><g transform="translate(198)"><text y="6">11</text></g><g transform="translate(0)"><text y="6">15</text></g></g><g transform="translate(25,15)"><g transform="translate(569)"><text y="6"><tspan>lower address</tspan></text></g><g transform="translate(346)"><text y="6"><tspan>R/W</tspan></text></g><g transform="translate(272)"><text y="6"><tspan>upper address</tspan></text></g><g><g transform="translate(198)"><text y="6">0</text></g><g transform="translate(148)"><text y="6">1</text></g><g transform="translate(99)"><text y="6">1</text></g><g transform="translate(49)"><text y="6">1</text></g><g transform="translate(0)"><text y="6">1</text></g></g></g><g transform="translate(25,39)"><g><g transform="translate(569)"><text y="6"><tspan>address</tspan></text></g></g><g><g transform="translate(346)"><text y="6"><tspan>1 - Read</tspan></text></g><g transform="translate(346,14)"><text y="6"><tspan>0 - Write</tspan></text></g></g><g><g transform="translate(272)"><text y="6"><tspan>address</tspan></text></g></g><g><g transform="translate(99)"><text y="6"><tspan>signal usage of 10 bit address</tspan></text></g></g></g></g></g></g></svg>
\ No newline at end of file
{
"signal": [
{
"name": "SCL",
"wave": "h..01010101010101010101010101010101010101010101010101."
},
{
"name": "SDA",
"wave": "1..0.1.......0.4.4.7.2.4.4.4.4.4.4.4.4.2.9......|..2.01.",
"data": ["a9", "a8",
"r/w",
"ack",
"a7",
"a6",
"a5",
"a4",
"a3",
"a2",
"a1",
"a0",
"ack",
"byte1 | byte2 ... ",
"ack"
],
"phase": 1.5
},
{
"name": "data",
"wave": "xx3.xxxxxxxxxxx4...7.x.4...............x.9.......|.xx5.x",
"data": [
"start",
"upper addr",
"cmd",
"lower address",
"payload bytes",
"stop"
],
"phase": 1.5
}
],
"config": {
"skin": "narrow"
}
}
{
"reg": [
{
"bits": 1,
"name": "R/W",
"type": 3,
"attr": [
"1 - Read",
"0 - Write"
]
},
{
"bits": 7,
"name": "7 bit address",
"type": 5,
"attr": [
"Address"
]
}
]
}
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="84" viewBox="0 0 800 84" class="WaveDrom"><g transform="translate(0.5,0.5)" text-anchor="middle" font-size="14" font-family="sans-serif" font-weight="normal"><g transform="translate(4,21)"><g stroke="black" stroke-width="1" stroke-linecap="round"><line x2="791"/><line y2="31"/><line x2="791" y1="31" y2="31"/><line x1="791" x2="791" y2="31"/><line x1="692" x2="692" y2="31"/><line x1="593" x2="593" y2="3"/><line x1="593" x2="593" y1="31" y2="28"/><line x1="494" x2="494" y2="3"/><line x1="494" x2="494" y1="31" y2="28"/><line x1="396" x2="396" y2="3"/><line x1="396" x2="396" y1="31" y2="28"/><line x1="297" x2="297" y2="3"/><line x1="297" x2="297" y1="31" y2="28"/><line x1="198" x2="198" y2="3"/><line x1="198" x2="198" y1="31" y2="28"/><line x1="99" x2="99" y2="3"/><line x1="99" x2="99" y1="31" y2="28"/></g><g><g><rect x="692" width="99" height="31" field="R/W" style="fill-opacity:0.1;fill:#aaff00"/><rect width="692" height="31" field="7 bit address" style="fill-opacity:0.1;fill:#ffbf00"/></g><g transform="translate(49,-11)"><g transform="translate(692)"><text y="6">0</text></g><g transform="translate(593)"><text y="6">1</text></g><g transform="translate(0)"><text y="6">7</text></g></g><g transform="translate(49,15)"><g transform="translate(692)"><text y="6"><tspan>R/W</tspan></text></g><g transform="translate(297)"><text y="6"><tspan>7 bit address</tspan></text></g></g><g transform="translate(49,39)"><g><g transform="translate(692)"><text y="6"><tspan>1 - Read</tspan></text></g><g transform="translate(692,14)"><text y="6"><tspan>0 - Write</tspan></text></g></g><g><g transform="translate(297)"><text y="6"><tspan>Address</tspan></text></g></g></g></g></g></g></svg>
\ No newline at end of file
{
"signal": [
{
"name": "SCL",
"wave": "h..01010101010101010101010101010101.."
},
{
"name": "SDA",
"wave": "1..0.4.4.4.4.4.4.4.7.2.9..|2.9..|2.01.",
"data": [
"a6",
"a5",
"a4",
"a3",
"a2",
"a1",
"a0",
"r/w",
"ack",
"byte 1 ",
"ack",
"byte 2 ",
"ack"
],
"phase": 1.5
},
{
"name": "data",
"wave": "xx3.x4.............7.x.9.......|.xx5.x",
"data": [
"start",
"address",
"cmd",
"payload bytes",
"stop"
],
"phase": 1.5
}
],
"config": {
"skin": "narrow"
}
}
{
"signal": [
{
"name": "SCL",
"wave": "h..0101010|.101010101010|.101."
},
{
"name": "SDA",
"wave": "xx3.x4.....|.7.2.9.......|.2.5.x",
"data": [
"start",
"address ",
"cmd",
"ack",
"payload bytes",
"ack",
"stop"
],
"phase": 1.5
}
],
"config": {
"skin": "narrow"
}
}
\ No newline at end of file
This diff is collapsed.
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="691px" height="221px" viewBox="-0.5 -0.5 691 221"><defs><style>@keyframes ge-flow-animation-3A4r2VhsrRmw3uIDTLah {&#xa; to {&#xa; stroke-dashoffset: 0;&#xa; }&#xa;}</style></defs><g><g><path d="M 130.1 37.5 L 420 37.5 L 420 149.9" fill="none" stroke="#3a7e86" stroke-width="3" stroke-miterlimit="10" pointer-events="stroke" stroke-dasharray="8" style="animation: 1000ms ease-in-out 0s infinite alternate none running ge-flow-animation-3A4r2VhsrRmw3uIDTLah; stroke-dashoffset: 16px;"/><path d="M 123.35 37.5 L 132.35 33 L 130.1 37.5 L 132.35 42 Z" fill="#3a7e86" stroke="#3a7e86" stroke-width="3" stroke-miterlimit="10" pointer-events="all"/><path d="M 420 156.65 L 415.5 147.65 L 420 149.9 L 424.5 147.65 Z" fill="#3a7e86" stroke="#3a7e86" stroke-width="3" stroke-miterlimit="10" pointer-events="all"/></g><g><path d="M 130.1 37.5 L 280 37.5 L 280 149.9" fill="none" stroke="#3a7e86" stroke-width="3" stroke-miterlimit="10" pointer-events="stroke" stroke-dasharray="8" style="animation: 1000ms ease-in-out 0s infinite alternate none running ge-flow-animation-3A4r2VhsrRmw3uIDTLah; stroke-dashoffset: 16px;"/><path d="M 123.35 37.5 L 132.35 33 L 130.1 37.5 L 132.35 42 Z" fill="#3a7e86" stroke="#3a7e86" stroke-width="3" stroke-miterlimit="10" pointer-events="all"/><path d="M 280 156.65 L 275.5 147.65 L 280 149.9 L 284.5 147.65 Z" fill="#3a7e86" stroke="#3a7e86" stroke-width="3" stroke-miterlimit="10" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 24px; margin-left: 165px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: #4c7c85; background-color: rgb(255, 255, 255); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(76, 124, 133); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;">SDA</div></div></div></foreignObject><text x="165" y="27" fill="#4c7c85" font-family="Helvetica" font-size="11px" text-anchor="middle">SDA</text></switch></g></g><g><path d="M 130.1 37.5 L 600 37.5 L 600 149.9" fill="none" stroke="#3a7e86" stroke-width="3" stroke-miterlimit="10" pointer-events="stroke" stroke-dasharray="8" style="animation: 1000ms ease-in-out 0s infinite alternate none running ge-flow-animation-3A4r2VhsrRmw3uIDTLah; stroke-dashoffset: 16px;"/><path d="M 123.35 37.5 L 132.35 33 L 130.1 37.5 L 132.35 42 Z" fill="#3a7e86" stroke="#3a7e86" stroke-width="3" stroke-miterlimit="10" pointer-events="all"/><path d="M 600 156.65 L 595.5 147.65 L 600 149.9 L 604.5 147.65 Z" fill="#3a7e86" stroke="#3a7e86" stroke-width="3" stroke-miterlimit="10" pointer-events="all"/></g><g><path d="M 120 112.5 L 340 112.5 L 340 153.63" fill="none" stroke="#009900" stroke-miterlimit="10" pointer-events="stroke" stroke-dasharray="8" style="animation: 500ms linear 0s infinite normal none running ge-flow-animation-3A4r2VhsrRmw3uIDTLah; stroke-dashoffset: 16px;"/><path d="M 340 158.88 L 336.5 151.88 L 340 153.63 L 343.5 151.88 Z" fill="#009900" stroke="#009900" stroke-miterlimit="10" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 101px; margin-left: 165px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: #009900; background-color: rgb(255, 255, 255); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 153, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;">SCL</div></div></div></foreignObject><text x="165" y="104" fill="#009900" font-family="Helvetica" font-size="11px" text-anchor="middle">SCL</text></switch></g></g><g><path d="M 120 112.5 L 480 112.5 L 480 153.63" fill="none" stroke="#009900" stroke-miterlimit="10" pointer-events="stroke" stroke-dasharray="8" style="animation: 500ms linear 0s infinite normal none running ge-flow-animation-3A4r2VhsrRmw3uIDTLah; stroke-dashoffset: 16px;"/><path d="M 480 158.88 L 476.5 151.88 L 480 153.63 L 483.5 151.88 Z" fill="#009900" stroke="#009900" stroke-miterlimit="10" pointer-events="all"/></g><g><path d="M 120 112.5 L 660 112.5 L 660 153.63" fill="none" stroke="#009900" stroke-miterlimit="10" pointer-events="stroke" stroke-dasharray="8" style="animation: 500ms linear 0s infinite normal none running ge-flow-animation-3A4r2VhsrRmw3uIDTLah; stroke-dashoffset: 16px;"/><path d="M 660 158.88 L 656.5 151.88 L 660 153.63 L 663.5 151.88 Z" fill="#009900" stroke="#009900" stroke-miterlimit="10" pointer-events="all"/></g><g><rect x="0" y="0" width="120" height="150" rx="18" ry="18" fill="#ffcc99" stroke="#36393d" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 75px; margin-left: 1px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Controller</div></div></div></foreignObject><text x="60" y="79" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Controller</text></switch></g></g><g><rect x="390" y="160" width="120" height="60" rx="9" ry="9" fill="#b0e3e6" stroke="#0e8088" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 190px; margin-left: 391px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"><div>Target</div>@0x12</div></div></div></foreignObject><text x="450" y="194" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Target@0x12</text></switch></g></g><g><rect x="250" y="160" width="120" height="60" rx="9" ry="9" fill="#b0e3e6" stroke="#0e8088" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 190px; margin-left: 251px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"><div>Target</div>@0x17</div></div></div></foreignObject><text x="310" y="194" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Target@0x17</text></switch></g></g><g><rect x="570" y="160" width="120" height="60" rx="9" ry="9" fill="#b0e3e6" stroke="#0e8088" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 190px; margin-left: 571px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"><div>Target</div>@0x5e</div></div></div></foreignObject><text x="630" y="194" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Target@0x5e</text></switch></g></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Text is not SVG - cannot display</text></a></switch></svg>
\ No newline at end of file
slides/lectures/fils_en/06/i2c/raspberry_pi_pico_pins.jpg

431 KiB

---
layout: section
---
# I2C
Inter-Integrated Circuit
---
---
# Bibliography
for this section
1. **Raspberry Pi Ltd**, *[RP2040 Datasheet](https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf)*
- Chapter 4 - *Peripherals*
- Chapter 4.3 - *I2C*
2. **Paul Denisowski**, *[Understanding I2C](https://www.youtube.com/watch?v=CAvawEcxoPU)*
---
---
# I2C
a.k.a *I square C*
- Used for communication between integrated circuits
- Sensors usually expose an *SPI* and an *I2C* interface
- Two device types:
- *controller* (master) - initiates the communication (usually MCU)
- *target* (slave) - receive and transmit data when the *controller* requests (usually the sensor)
<div align="center">
<img src="/i2c/i2c_network.svg" class="rounded w-120">
</div>
---
---
# Wires & Addresses
- *SDA* - **S**erial **DA**ta line - carries data from the **controller** to the **target** or from the **target** to the **controller**
- *SCL* - **S**erial **CL**ock line - the clock signal generated by the **controller**, **targets**
- *sample* data when the clock is *low*
- *write* data to the bus only when the clock is *high*
- each *target* has a unique address of **7 bits** or **10 bits**
- wires are never driven with `LOW` or `HIGH`
- are always *pull-up*, which is `HIGH`
- devices *pull down* the lines to *write* `LOW`
<div grid="~ cols-2 gap-5">
<div align="center">
<br>
<img src="/i2c/i2c_example.svg" class="rounded w-12f0">
</div>
<div align="center">
<img src="/i2c/i2c_network.svg" class="rounded w-120">
</div>
</div>
---
# Transmission Example
7 bit address
<style>
img {
background: #ffffff;
}
</style>
<div grid="~ cols-2 gap-5">
<v-clicks>
1. **controller** issues a `START` condition
- pulls the `SDA` line `LOW`
- waits for ~ 1/2 clock periods and starts the clock
2. **controller** sends the address of the **target**
3. **controller** sends the command bit (`R/W`)
4. **target** sends `ACK` / `NACK` to **controller**
</v-clicks>
<div>
<v-clicks>
5. **controller** or **target** sends data (depends on `R/W`)
- receives `ACK` / `NACK` after every byte
6. **controller** issues a `STOP` condition
- stops the clock
- pulls the `SDA` line `HIGH` while `CLK` is `HIGH`
</v-clicks>
Address Format
<div align="center">
<img src="/i2c/i2c_7bit_address_format.svg" class="rounded w-100">
</div>
</div>
</div>
Transmission
<div align="center">
<img src="/i2c/i2c_7bit_address_transmission.svg" class="rounded w-155">
</div>
**controller** writes each bit when `CLK` is `LOW`, **target** samples every bit when `CLK` is `HIGH`
---
# Transmission Example
10 bit address
<style>
img {
background: #ffffff;
}
</style>
<div grid="~ cols-2 gap-5">
<v-clicks>
1. **controller** issues a `START` condition
2. **controller** sends `11110` followed by the *upper address* of the **target**
3. **controller** sends the command bit (`R/W`)
4. **target** sends `ACK` / `NACK` to **controller**
5. **controller** sends the *lower address* of the **target**
6. **target** sends `ACK` / `NACK` to **controller**
</v-clicks>
<div>
<v-clicks>
7. **controller** or **target** sends data (depends on `R/W`)
- receives `ACK` / `NACK` after every byte
8. **controller** issues a `STOP` condition
</v-clicks>
Address Format
<div align="center">
<img src="/i2c/i2c_10bit_address_format.svg" class="rounded w-120">
</div>
</div>
</div>
Transmission
<div align="center">
<img src="/i2c/i2c_10bit_address_transmission.svg" class="rounded">
</div>
**controller** writes each bit when `CLK` is `LOW`, **target** samples every bit when `CLK` is `HIGH`
---
---
# I2C Modes
| Mode | Speed | Capacity | Drive | Direction |
|-|-|-|-|-|
| Standard mode (Sm) | 100 kbit/s | 400 pF | Open drain | Bidirectional |
| Fast mode (Fm) |400 kbit/s | 400 pF | Open drain | Bidirectional |
| Fast mode plus (Fm+) | 1 Mbit/s | 550 pF | Open drain | Bidirectional |
| High-speed mode (Hs) | 1.7 Mbit/s | 400 pF | Open drain | Bidirectional |
| High-speed mode (Hs) | 3.4 Mbit/s | 100 pF | Open drain | Bidirectional |
| Ultra-fast mode (UFm) | 5 Mbit/s | ? | Push–pull | Unidirectional |
---
---
# Facts
| | | |
|-|-|-|
| Transmission | *half duplex* | data must be sent in one direction at one time |
| Clock | *synchronized* | the **controller** and **target** use the same clock, there is no need for clock synchronization |
| Wires | *SDA* / *SCL* | the same read and write wire and a clock wire |
| Devices | *1 controller* <br> *several targets* | a receiver and a transmitter |
| Speed | *5 Mbit/s* | usually 100 Kbit/s, 400 Kbit/s and 1 Mbit/s |
---
---
# Usage
- sensors
- small displays
- RP2040 has two I2C devices
<div align="center">
<img src="/i2c/raspberry_pi_pico_pins.jpg" class="rounded m-5 w-120">
</div>
---
---
# Embassy API
for RP2040, synchronous
<div grid="~ cols-3 gap-5">
```rust {*}{lines: false}
pub struct Config {
/// Frequency.
pub frequency: u32,
}
```
```rust {*}{lines: false}
pub enum ConfigError {
/// Max i2c speed is 1MHz
FrequencyTooHigh,
ClockTooSlow,
ClockTooFast,
}
```
```rust {*}{lines: false}
pub enum Error {
Abort(AbortReason),
InvalidReadBufferLength,
InvalidWriteBufferLength,
AddressOutOfRange(u16),
AddressReserved(u16),
}
```
</div>
```rust{all|1|3,4|6|8,9|11,12}
use embassy_rp::i2c::Config as I2cConfig;
let sda = p.PIN_14;
let scl = p.PIN_15;
let mut i2c = i2c::I2c::new_blocking(p.I2C1, scl, sda, I2cConfig::default());
let tx_buf = [0x90];
i2c.write(0x5e, &tx_buf).unwrap();
let mut rx_buf = [0x00u8; 7];
i2c.read(0x5e, &mut rx_buf).unwrap();
```
---
---
# Embassy API
for RP2040, asynchronous
```rust{all|1|3-5|7,8|10|12,13|15,16}
use embassy_rp::i2c::Config as I2cConfig;
bind_interrupts!(struct Irqs {
I2C1_IRQ => InterruptHandler<I2C1>;
});
let sda = p.PIN_14;
let scl = p.PIN_15;
let mut i2c = i2c::I2c::new_async(p.I2C1, scl, sda, Irqs, I2cConfig::default());
let tx_buf = [0x90];
i2c.write(0x5e, &tx_buf).await.unwrap();
let mut rx_buf = [0x00u8; 7];
i2c.read(0x5e, &mut rx_buf).await.unwrap();
```
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="169px" height="96px" viewBox="-0.5 -0.5 169 96"><defs/><g><g/><g><path d="M 100 47.5 L 130 47.5 L 153.63 47.51" fill="none" stroke="#73a3a4" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 158.88 47.51 L 151.88 51.01 L 153.63 47.51 L 151.88 44.01 Z" fill="#73a3a4" stroke="#73a3a4" stroke-miterlimit="10" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 30px; margin-left: 130px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;"><div>Voltage </div><div>Output</div></div></div></div></foreignObject><text x="130" y="33" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">Voltage...</text></switch></g></g><g><rect x="0" y="0" width="100" height="95" rx="14.25" ry="14.25" fill="#f5f5f5" stroke="#666666" pointer-events="all"/></g><g><image x="4.5" y="2" width="90" height="90" xlink:href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgaGVpZ2h0PSI4MDBweCIgd2lkdGg9IjgwMHB4Ij4mI3hhOzxwYXRoIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2U9IiMwMDAwMDAiIGQ9Ik04LjQ2NDQ3IDE1LjUzNTVDNi41MTE4NSAxMy41ODI5IDYuNTExODUgMTAuNDE3MSA4LjQ2NDQ3IDguNDY0NDdNNS42MzU5MiAxOC4zNjRDMi4xMjEyIDE0Ljg0OTMgMi4xMjEyIDkuMTUwNzcgNS42MzU5MiA1LjYzNjA1TTE1LjUzNTUgMTUuNTM1NUMxNy40ODgxIDEzLjU4MjkgMTcuNDg4MSAxMC40MTcxIDE1LjUzNTUgOC40NjQ0N00xOC4zNjQgMTguMzY0QzIxLjg3ODggMTQuODQ5MyAyMS44Nzg4IDkuMTUwNzcgMTguMzY0IDUuNjM2MDVNMTMgMTIuMDAwMUMxMyAxMi41NTIzIDEyLjU1MjMgMTMuMDAwMSAxMiAxMy4wMDAxQzExLjQ0NzcgMTMuMDAwMSAxMSAxMi41NTIzIDExIDEyLjAwMDFDMTEgMTEuNDQ3OCAxMS40NDc3IDExLjAwMDEgMTIgMTEuMDAwMUMxMi41NTIzIDExLjAwMDEgMTMgMTEuNDQ3OCAxMyAxMi4wMDAxWiIvPiYjeGE7PC9zdmc+" preserveAspectRatio="none"/></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Text is not SVG - cannot display</text></a></switch></svg>
\ No newline at end of file
slides/lectures/fils_en/06/sensors/bmp280_registers.png

209 KiB

slides/lectures/fils_en/06/sensors/bmp280_schematics.png

121 KiB

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="401px" height="112px" viewBox="-0.5 -0.5 401 112"><defs/><g><g><rect x="0" y="0" width="300" height="110" rx="16.5" ry="16.5" fill="#b1ddf0" stroke="#10739e" pointer-events="all"/></g><g><rect x="120" y="7.5" width="100" height="92.5" rx="13.88" ry="13.88" fill="#ffe6cc" stroke="#d79b00" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 98px; height: 1px; padding-top: 54px; margin-left: 121px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"><div>MCU</div><div><br /></div><div><br /></div><div><br /></div><div><br /></div></div></div></div></foreignObject><text x="170" y="57" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">MCU...</text></switch></g></g><g><path d="M 300.1 53.76 L 340 53.82 L 379.9 53.96" fill="none" stroke="#73a3a4" stroke-width="3" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 293.35 53.75 L 302.36 49.27 L 300.1 53.76 L 302.35 58.27 Z" fill="#73a3a4" stroke="#73a3a4" stroke-width="3" stroke-miterlimit="10" pointer-events="all"/><path d="M 386.65 53.99 L 377.63 58.46 L 379.9 53.96 L 377.66 49.46 Z" fill="#73a3a4" stroke="#73a3a4" stroke-width="3" stroke-miterlimit="10" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 40px; margin-left: 340px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;"> I/O Bus </div></div></div></foreignObject><text x="340" y="43" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle"> I/O Bus </text></switch></g></g><g><rect x="230" y="7.5" width="60" height="92.5" rx="9" ry="9" fill="#fff2cc" stroke="#d6b656" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 58px; height: 1px; padding-top: 54px; margin-left: 231px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;"><div>Digital<br /></div><div>Interface</div><div><br /></div><div><br /></div><div><br /></div></div></div></div></foreignObject><text x="260" y="57" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Digital...</text></switch></g></g><g><path d="M 180 55 L 185.03 55.03 L 185.01 63.63" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 185 68.88 L 181.52 61.87 L 185.01 63.63 L 188.52 61.89 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/></g><g><path d="M 130 25 L 180 55 L 130 85 Z" fill="#b0e3e6" stroke="#0e8088" stroke-miterlimit="10" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 48px; height: 1px; padding-top: 55px; margin-left: 131px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">ADC </div></div></div></foreignObject><text x="155" y="59" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">ADC </text></switch></g></g><g><path d="M 110 55 L 123.63 55" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 128.88 55 L 121.88 58.5 L 123.63 55 L 121.88 51.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/></g><g><path d="M 210 80 L 215.03 80 L 215.03 53.82 L 223.63 53.78" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 228.88 53.76 L 221.9 57.29 L 223.63 53.78 L 221.87 50.29 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/></g><g><rect x="160" y="70" width="50" height="20" rx="3" ry="3" fill="#b0e3e6" stroke="#0e8088" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 48px; height: 1px; padding-top: 80px; margin-left: 161px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Cleanup</div></div></div></foreignObject><text x="185" y="84" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Cleanup</text></switch></g></g><g><rect x="235" y="50" width="50" height="20" rx="3" ry="3" fill="#d5e8d4" stroke="#82b366" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 48px; height: 1px; padding-top: 60px; margin-left: 236px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Reg1</div></div></div></foreignObject><text x="260" y="64" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Reg1</text></switch></g></g><g><rect x="235" y="74" width="50" height="20" rx="3" ry="3" fill="#d5e8d4" stroke="#82b366" pointer-events="all"/></g><g><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 48px; height: 1px; padding-top: 84px; margin-left: 236px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">RegN</div></div></div></foreignObject><text x="260" y="88" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">RegN</text></switch></g></g><g/><g><rect x="10" y="7.5" width="100" height="95" rx="14.25" ry="14.25" fill="#f5f5f5" stroke="#666666" pointer-events="all"/></g><g><image x="14.5" y="9.5" width="90" height="90" xlink:href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgaGVpZ2h0PSI4MDBweCIgd2lkdGg9IjgwMHB4Ij4mI3hhOzxwYXRoIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2U9IiMwMDAwMDAiIGQ9Ik04LjQ2NDQ3IDE1LjUzNTVDNi41MTE4NSAxMy41ODI5IDYuNTExODUgMTAuNDE3MSA4LjQ2NDQ3IDguNDY0NDdNNS42MzU5MiAxOC4zNjRDMi4xMjEyIDE0Ljg0OTMgMi4xMjEyIDkuMTUwNzcgNS42MzU5MiA1LjYzNjA1TTE1LjUzNTUgMTUuNTM1NUMxNy40ODgxIDEzLjU4MjkgMTcuNDg4MSAxMC40MTcxIDE1LjUzNTUgOC40NjQ0N00xOC4zNjQgMTguMzY0QzIxLjg3ODggMTQuODQ5MyAyMS44Nzg4IDkuMTUwNzcgMTguMzY0IDUuNjM2MDVNMTMgMTIuMDAwMUMxMyAxMi41NTIzIDEyLjU1MjMgMTMuMDAwMSAxMiAxMy4wMDAxQzExLjQ0NzcgMTMuMDAwMSAxMSAxMi41NTIzIDExIDEyLjAwMDFDMTEgMTEuNDQ3OCAxMS40NDc3IDExLjAwMDEgMTIgMTEuMDAwMUMxMi41NTIzIDExLjAwMDEgMTMgMTEuNDQ3OCAxMyAxMi4wMDAxWiIvPiYjeGE7PC9zdmc+" preserveAspectRatio="none"/></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Text is not SVG - cannot display</text></a></switch></svg>
\ No newline at end of file
---
layout: section
---
# Sensors
Analog and Digital Sensors
---
---
# Bibliography
for this section
**BOSCH**, *[BMP280 Digital Pressure Sensor](https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp280-ds001.pdf)*
- Chapter 3 - *Functional Description*
- Chapter 4 - *Global memory map and register description*
- Chapter 5 - *Digital Interfaces*
- Subchapter 5.2 - *I2C Interface*
---
---
# Sensors
analog and digital
<div grid="~ cols-2 gap-5">
<div>
### Analog
- only the transducer (the analog sensor)
- outputs (usually) voltage
- requires:
- an ADC to be read
- cleaning up the noise
<br>
<img src="/sensors/analog_sensor.svg" class="rounded">
</div>
<div>
### Digital
- consists of:
- a transducer (the analog sensor)
- an ADC
- an MCU for cleaning up the noise
- outputs data using a digital bus
<br>
<img src="/sensors/digital_sensor.svg" class="rounded">
</div>
</div>
---
---
# BMP280 Digital Pressure Sensor
schematics
<div align="center">
<img src="/sensors/bmp280_schematics.png" class="rounded w-150">
</div>
[Datasheet](https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp280-ds001.pdf)
---
---
# BMP280 Digital Pressure Sensor
registers map
<img src="/sensors/bmp280_registers.png" class="rounded">
[Datasheet](https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp280-ds001.pdf)
---
# Reading from a digital sensor
using synchronous/asynchronous I2C to read the `press_lsb` register of BMP280
<!-- <img src="/sensors/spi_read_register.svg" class="rounded w-200"> -->
<div grid="~ cols-2 gap-5">
```rust{all|1|1,2|4|6,7|9,10}
const DEVICE_ADDR: u8 = 0x77;
const REG_ADDR: u8 = 0xf8;
i2c.write(DEVICE_ADDR, &[REG_ADDR]).unwrap();
let mut buf = [0x00u8];
i2c.read(DEVICE_ADDR, &mut buf).unwrap();
// use the value
let pressure_lsb = buf[1];
```
```rust{none|all||1|1,2|4|6,7|9,10}
const DEVICE_ADDR: u8 = 0x77;
const REG_ADDR: u8 = 0xf8;
i2c.write(DEVICE_ADDR, &[REG_ADDR]).await.unwrap();
let mut buf = [0x00u8];
i2c.read(DEVICE_ADDR, &mut buf).await.unwrap();
// use the value
let pressure_lsb = buf[1];
```
</div>
---
---
# Writing to a digital sensor
using synchronous/asynchronous I2C to set up the `ctrl_meas` register of the BMP280 sensor
<!-- <img src="/sensors/spi_write_register.svg" class="rounded w-200"> -->
<div grid="~ cols-2 gap-5">
```rust{all|1|1,2|4,5|7|9,10}
const DEVICE_ADDR: u8 = 0x77;
const REG_ADDR: u8 = 0xf4;
// see subchapters 3.3.2, 3.3.1 and 3.6
let value = 0b100_010_11;
i2c.write(DEVICE_ADDR, &[REG_ADDR]);
let buf = [REG_ADDR, value];
i2c.write(DEVICE_ADDR, &buf).unwrap();
```
```rust{none|all|1|1,2|4,5|7|9,10}
const DEVICE_ADDR: u8 = 0x77;
const REG_ADDR: u8 = 0xf4;
// see subchapters 3.3.2, 3.3.1 and 3.6
let value = 0b100_010_11;
i2c.write(DEVICE_ADDR, &[REG_ADDR]);
let buf = [REG_ADDR, value];
i2c.write(DEVICE_ADDR, &buf).await.unwrap();
```
</div>
{
"signal": [
{
"name": "CS",
"wave": "1.0...................................1..",
"period": 1
},
{
"name": "Clock",
"wave": "l.PPPPPPPPl.PPPPPPPPl",
"phase": 1,
"period": 2
},
{
"name": "MOSI",
"wave": "zz6.5.5.5.5.5.5.5.xxxxxxxxxxxxxxxxxxxxz..",
"data": [
"1",
"1",
"1",
"1",
"1",
"0",
"0",
"0"
],
"period": 1
},
{
"name": "MISO",
"wave": "zzxxxxxxxxxxxxxxxxxxxx4.4.4.4.4.4.4.4.zzz",
"data": [
"b7",
"b6",
"b5",
"b4",
"b3",
"b2",
"b1",
"b0"
],
"period": 1
},
{
"name": "data",
"wave": "xx6.5.............xxxx4...............xxx",
"data": [
"r/w",
"register address (press_lsb, 0xf8)",
"register value (press_lsb)"
],
"period": 1
}
],
"config": {
"skin": "narrow"
}
}
\ No newline at end of file