2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

2021-12-31 AXI IIC > TX_FIFO書き込みに[66]を使っている理由

Posted at

axi_iic_ad[66]

FPGAの部屋さんの記事

Xilinx 社の AXI IIC IP で ADXL355 を使用する
https://marsee101.blog.fc2.com/blog-entry-5031.html

void acc_sensor_write(volatile uint32_t *axi_iic_ad, uint32_t device_addr, uint32_t write_addr, uint32_t write_data){
    idle_check(axi_iic_ad);
    axi_iic_ad[66] = 0x100 | (device_addr & 0xfe); // Slave IIC Write Address, address is 0x108, i2c_tx_fifo
    axi_iic_ad[66] = write_addr & 0xff;           // address
    axi_iic_ad[66] = 0x200 | (write_data & 0xff);      // data
}

axi_iic_ad[66]の66はどこから来たのか?

PG090

https://japan.xilinx.com/content/dam/xilinx/support/documentation/ip_documentation/axi_iic/v2_1/pg090-axi-iic.pdf#page=11
にRegister Spaceがある。

TX_FIFOとして108hがあるが、それは上の66とは異なる。

[66]の使用例

ZedBoard Linux のフレームバッファにカメラ画像を表示15(Linux既存のFBを使用)
https://marsee101.blog.fc2.com/blog-entry-2445.html

    cam_i2c = setup_io((off_t)XPAR_AXI_IIC_MT9D111_BASEADDR);
    axi_gpio = setup_io((off_t)XPAR_AXI_GPIO_0_BASEADDR);
    
    cam_i2c_control_reg = cam_i2c + 0x40; // 0x100番地
    cam_i2c_status_reg = cam_i2c + 0x41; // 0x104番地
    cam_i2c_tx_fifo = cam_i2c + 0x42; // 0x108番地
    cam_i2c_rx_fifo = cam_i2c + 0x43; // 0x10C番地

cam_i2cというベースアドレス?からの差分としてtx_fifoの位置が0x42(66)ということのようだ。
cam_i2cはsetup_io()内にてmmapして得られるアドレス。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?