{
 "GPIO 與 libgpiod:取代 sysfs 的新介面#1": {
  "type": "cards",
  "reveal": [
   0,
   2,
   3
  ],
  "cards": [
   {
    "title": "輸出",
    "points": [
     "點亮 LED",
     "驅動繼電器"
    ]
   },
   {
    "title": "輸入",
    "points": [
     "讀取按鈕",
     "感測器開關狀態"
    ]
   },
   {
    "title": "注意",
    "points": [
     "3.3 V 邏輯",
     "每支腳只有幾 mA",
     "不可直推馬達、不可接 5 V"
    ]
   }
  ]
 },
 "GPIO 與 libgpiod:取代 sysfs 的新介面#2": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   3,
   4
  ],
  "nodes": [
   {
    "label": "GPIO 控制器",
    "color": 0
   },
   {
    "label": "gpiochip",
    "sub": "一個 chip",
    "color": 1
   },
   {
    "label": "line",
    "sub": "偏移量編號",
    "color": 2
   },
   {
    "label": "/dev/gpiochipN",
    "sub": "字元裝置",
    "color": 3
   }
  ]
 },
 "GPIO 與 libgpiod:取代 sysfs 的新介面#3": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   0,
   0,
   1,
   2,
   3
  ],
  "nodes": [
   {
    "label": "寫入 export",
    "sub": "17",
    "color": 0
   },
   {
    "label": "寫入 direction",
    "sub": "out",
    "color": 1
   },
   {
    "label": "寫入 value",
    "sub": "1",
    "color": 2
   }
  ]
 },
 "GPIO 與 libgpiod:取代 sysfs 的新介面#5": {
  "type": "table",
  "head": [
   "工具",
   "用途"
  ],
  "rows": [
   [
    "gpiodetect",
    "列出所有 GPIO chip"
   ],
   [
    "gpioinfo",
    "列出每條線的名稱、方向、使用者、狀態"
   ],
   [
    "gpioget",
    "讀取輸入線的值"
   ]
  ],
  "widths": [
   2,
   4
  ],
  "reveal": [
   0,
   0,
   1,
   2,
   3
  ]
 },
 "GPIO 與 libgpiod:取代 sysfs 的新介面#7": {
  "type": "table",
  "head": [
   "指令",
   "說明"
  ],
  "rows": [
   [
    "gpioget gpiochip0 17",
    "讀第 17 線,回傳 0 為低電位"
   ],
   [
    "gpioset gpiochip0 17=1",
    "輸出高電位"
   ],
   [
    "--mode=time --sec=2",
    "維持兩秒"
   ],
   [
    "gpiomon --rising-edge gpiochip0 22",
    "監看第 22 線上升邊緣"
   ]
  ],
  "widths": [
   3,
   3
  ],
  "reveal": [
   0,
   1,
   1,
   2,
   3,
   4
  ]
 },
 "用 C 程式與 LED 子系統控制 GPIO#1": {
  "type": "cards",
  "reveal": [
   0,
   1,
   1,
   2,
   2,
   2
  ],
  "cards": [
   {
    "title": "LED 子系統",
    "points": [
     "裝置樹宣告 gpio-leds",
     "kernel 管理這顆燈",
     "sysfs 的 leds 類別介面"
    ]
   },
   {
    "title": "libgpiod 函式庫",
    "points": [
     "程式自己持有 GPIO 線",
     "適合按鈕輸入",
     "一般用途控制"
    ]
   }
  ]
 },
 "用 C 程式與 LED 子系統控制 GPIO#3": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "nodes": [
   {
    "label": "trigger",
    "sub": "寫入 none",
    "color": 0
   },
   {
    "label": "brightness",
    "sub": "寫入 1",
    "color": 1
   },
   {
    "label": "trigger",
    "sub": "寫入 timer",
    "color": 2
   }
  ]
 },
 "用 C 程式與 LED 子系統控制 GPIO#4": {
  "type": "bar",
  "labels": [
   "delay_on",
   "delay_off"
  ],
  "values": [
   200,
   800
  ],
  "unit": " ms",
  "reveal": [
   0,
   1,
   2
  ]
 },
 "用 C 程式與 LED 子系統控制 GPIO#5": {
  "type": "flow",
  "layout": "snake",
  "reveal": [
   0,
   0,
   1,
   2,
   3,
   4
  ],
  "nodes": [
   {
    "label": "開啟 chip",
    "sub": "gpiochip0",
    "color": 0
   },
   {
    "label": "取得 line",
    "sub": "第 17 號線",
    "color": 1
   },
   {
    "label": "要求輸出",
    "sub": "led-demo,初始 0",
    "color": 2
   },
   {
    "label": "迴圈 10 次",
    "sub": "切換 0 和 1,睡半秒",
    "color": 3
   }
  ]
 },
 "I2C:i2c-tools 與 /dev/i2c-N#1": {
  "type": "bar",
  "labels": [
   "標準",
   "快速"
  ],
  "values": [
   100,
   400
  ],
  "unit": " kHz",
  "reveal": [
   0,
   0,
   2,
   2,
   2,
   2
  ]
 },
 "I2C:i2c-tools 與 /dev/i2c-N#3": {
  "type": "table",
  "head": [
   "掃描結果",
   "意義"
  ],
  "rows": [
   [
    "--",
    "沒有回應"
   ],
   [
    "數字(如 48)",
    "該位址有裝置回應"
   ],
   [
    "UU",
    "已被 kernel 驅動佔用"
   ]
  ],
  "widths": [
   2,
   3
  ],
  "reveal": [
   0,
   0,
   3,
   3,
   3
  ]
 },
 "I2C:i2c-tools 與 /dev/i2c-N#6": {
  "type": "table",
  "head": [
   "指令",
   "說明"
  ],
  "rows": [
   [
    "i2cget -y 1 0x48 0x00 w",
    "讀暫存器 0x00,w 為 16 位元字組"
   ],
   [
    "i2cset -y 1 0x48 0x01 0x60",
    "寫入暫存器 0x01"
   ],
   [
    "i2cdump -y 1 0x48",
    "傾印整個裝置的暫存器"
   ]
  ],
  "widths": [
   3,
   3
  ],
  "reveal": [
   0,
   1,
   2,
   3
  ]
 },
 "I2C:i2c-tools 與 /dev/i2c-N#7": {
  "type": "flow",
  "layout": "snake",
  "reveal": [
   0,
   0,
   2,
   4,
   5,
   5
  ],
  "nodes": [
   {
    "label": "open",
    "sub": "/dev/i2c-1",
    "color": 0
   },
   {
    "label": "ioctl",
    "sub": "I2C_SLAVE 選位址 0x48",
    "color": 1
   },
   {
    "label": "write",
    "sub": "先寫暫存器位址",
    "color": 2
   },
   {
    "label": "read",
    "sub": "讀回 2 位元組",
    "color": 3
   },
   {
    "label": "組合原始值",
    "sub": "取 12 位元,乘 0.0625",
    "color": 4
   }
  ]
 },
 "SPI 與 UART:spidev 與序列埠存取#1": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "cards": [
   {
    "title": "模式",
    "points": [
     "0 到 3 共四種",
     "CPOL 與 CPHA 組合"
    ]
   },
   {
    "title": "最大時脈",
    "points": [
     "頻率上限"
    ]
   },
   {
    "title": "每字位元數",
    "points": [
     "通常是 8"
    ]
   },
   {
    "title": "位元順序",
    "points": [
     "通常 MSB 先送"
    ]
   }
  ]
 },
 "SPI 與 UART:spidev 與序列埠存取#4": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   3,
   4,
   4,
   4
  ],
  "nodes": [
   {
    "label": "MOSI",
    "sub": "主出從入",
    "color": 0
   },
   {
    "label": "跳線短接",
    "color": 2
   },
   {
    "label": "MISO",
    "sub": "主入從出",
    "color": 1
   },
   {
    "label": "比對",
    "sub": "收到和送出相同",
    "color": 3
   }
  ]
 }
}