Lepton Maker Community / Forum / Installation and getting started / Topics / Good testing I2C modifications.

Good testing I2C modifications.

Tagged: 

This topic contains 7 replies, has 2 voices, and was last updated by Profile photo of Antonio Antonio 9 months, 3 weeks ago.

Viewing 8 posts - 1 through 8 (of 8 total)

  • Author

    Posts

  • #16382

    Profile photo of Anthony
    Anthony

    Participant

    I have been working with the SDK to port some access to code to an ARM processor.
    I can read from the device, get camera uptime, and some temperatures, but I can’t seem to modify things like telemetry. I always get a -3 return from the device.
    Is there an “unlock” command I need to send before making modification to FLIR settings?
    Its rather frustrating.

    Are there any known to ALWAYS operate settings I can change that would help me validate my LEP_I2C_SetAttribute() functions?

    Tony

    #16386

    Profile photo of Anthony
    Anthony

    Participant

    Well, I think I figured this out. It seems that I didn’t have a low level “wait for i2C tx to complete” option in my code.
    Once I added a wait after the transmit of the data, things have seemed to calm down.

    User error it seems at the moment.

    #16422

    Profile photo of Antonio
    Antonio

    Participant

    Good afternoon, excuse me for asking this, but I’m new to the C language development task. Could you explain to me what you did to correctly import the .h and .c files that the Lepton SDK gives you? In my case, if I try to include them in the “main.c” of my project I get a lot of errors, especially not defining references.

    I’m trying to manage these libraries from Windows before starting on Linux/raspbian.

    Thanks for your time and sorry for the inconvenience.

    #16423

    Profile photo of Anthony
    Anthony

    Participant

    Well, I will attempt to help where I can.
    First, what kind of computer are you attempting to build this project? I ask this because the library is designed for getting information in and out from a Lepton using the I2C bus.
    When you said Windows , I just couldn’t understand how you could put this together to do anything at all.

    I suppose , if you just want to build them, just to build them, and not actually have them do any work, that might be possible.

    The essential part to make this library work is the creation of some abstraction functions for running the I2C bus.
    You need to create the following functions I believe, just to get it to completely compile:

    DEV_I2C_MasterInit
    DEV_I2C_MasterClose
    DEV_I2C_MasterReset
    LEP_RESULT DEV_I2C_MasterReadData(LEP_UINT16  portID,               // User-defined port ID
                                      LEP_UINT8   deviceAddress,        // Lepton Camera I2C Device Address
                                      LEP_UINT16  regAddress,           // Lepton Register Address
                                      LEP_UINT16 *readDataPtr,          // Read DATA buffer pointer
                                      LEP_UINT16  wordsToRead,          // Number of 16-bit words to Read
                                      LEP_UINT16 *numWordsRead,         // Number of 16-bit words actually Read
                                      LEP_UINT16 *status                // Transaction Status
                                     )
    LEP_RESULT DEV_I2C_MasterWriteData(LEP_UINT16  portID,              // User-defined port ID
                                       LEP_UINT8   deviceAddress,       // Lepton Camera I2C Device Address
                                       LEP_UINT16  regAddress,          // Lepton Register Address
                                       LEP_UINT16 *writeDataPtr,        // Write DATA buffer pointer
                                       LEP_UINT16  wordsToWrite,        // Number of 16-bit words to Write
                                       LEP_UINT16 *numWordsWritten,     // Number of 16-bit words actually written
                                       LEP_UINT16 *status)              // Transaction Status
    LEP_RESULT DEV_I2C_MasterReadRegister( LEP_UINT16 portID,
                                           LEP_UINT8  deviceAddress, 
                                           LEP_UINT16 regAddress,
                                           LEP_UINT16 *regValue,     // Number of 16-bit words actually written
                                           LEP_UINT16 *status
                                         )
    LEP_RESULT DEV_I2C_MasterReadRegister( LEP_UINT16 portID,
                                           LEP_UINT8  deviceAddress, 
                                           LEP_UINT16 regAddress,
                                           LEP_UINT16 *regValue,     // Number of 16-bit words actually written
                                           LEP_UINT16 *status
                                         )
    LEP_RESULT DEV_I2C_MasterWriteRegister( LEP_UINT16 portID,
                                            LEP_UINT8  deviceAddress, 
                                            LEP_UINT16 regAddress,
                                            LEP_UINT16 regValue,     // Number of 16-bit words actually written
                                            LEP_UINT16 *status
                                          )
    
    LEP_RESULT DEV_I2C_MasterStatus(void )
    

    #16424

    Profile photo of Anthony
    Anthony

    Participant

    Wow, that looks unreadable, hopefully you can copy and past out of this forum and get the essentials.

    #16428

    Profile photo of Antonio
    Antonio

    Participant

    Ah, damn it. So I understand you need the BreakBoard with the corresponding pins, right?

    I thought there was a way to make that library work with the USB protocol. Like with the SDK made in C#.

    #16431

    Profile photo of Anthony
    Anthony

    Participant

    Yes, the SDK I am talking about is a low level parts of the SDK. The purethermal guys have all the information on their Git repository for managing the USB part of it, however I believe they just make it show up as a special camera so that you can pipe it into standard camera applications.<br />
    I haven’t looked at the USB portion, since I was connecting to a specific ARM M4 CPU.

    • This reply was modified 9 months, 3 weeks ago by Profile photo of Anthony Anthony.

    #16434

    Profile photo of Antonio
    Antonio

    Participant

    I see, it seems I haven’t been focusing my efforts well. I really appreciate the time you’ve taken to talk to me.

    Greetings

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.