Writing to I2C through UEFI application

Discussion in 'General Discussion' started by Ruvim P, Jul 27, 2022.

Tags:
  1. Ruvim P

    Ruvim P UDOOer

    Joined:
    Jul 27, 2022
    Messages:
    2
    Likes Received:
    0
    I am writing a program to talk to a device in the UEFI shell through Edk2. I've successfully been able to write and read to the bus through EFI_I2C_MASTER_PROTOCOL but for whatever reason at the end of every write it sends an extra byte of 0. I am wondering if it has to do with SmBus appending a byte for PEC but regardless is there any way to write without that extra byte?

    Thank you for your time, have a great day!
     
  2. gordontcp

    gordontcp UDOOer

    Joined:
    Aug 15, 2022
    Messages:
    1
    Likes Received:
    0
    Hi, how can you write and read to the bus through EFI_I2C_MASTER_PROTOCOL ? Is there any sample code? Does it need to set acpi table?
     
  3. Ruvim P

    Ruvim P UDOOer

    Joined:
    Jul 27, 2022
    Messages:
    2
    Likes Received:
    0
    I didn't have to set the acpi table. I was able to just call LocateHandleBuffer and OpenProtocol on the Udoo x86. Then I would use the StartRequest api with the parameters I prefer.

    i2c_master_protocol->StartRequest
     

Share This Page