Oops! It appears that you have disabled your Javascript. In order for you to see this page as it is meant to appear, we ask that you please re-enable your Javascript!

i2c Bus: Slave device 透過interrupt 通知master有事件發生

之前想要比較i2c與SMBus時, 提到”傳統的i2c Bus slave device並無法主動通知master有事件發生”,

應該是要這麼說, Slave無法直接透過i2c傳資料給Master

而是間接得透過 interupter 通知 Master (通常見內在SOC裡)

然後 Master 再去跟 slace 讀取資料

– 以Touch為例:
Step 0: 驅動程式 == Driver == Kernel Module == 以CPU為主角的程式

Step 1: Touch-driver 會向CPU註冊一個CPU’s GPIO Pin 用來傳遞interrupt

Step 2: HW會將CPU’s GPIO 連到 Touch-IC’s interupt Pin

Step 3: PinMux必須定義該CPU’s GPIO內容, ex: 對應function/pull_high/pull_low等等

Step 4: 手指碰到Panel資訊傳遞到 Touch-IC

Step 5: Touch-IC的firmeare開始處理座標數值計算以及發出Interrupt給CPU

Step 6: CPU透過GPIO收到Interrupt後, 就會叫I2C跟Touch-IC要資料

Step 7: CPU處理對應API