Is there a general I2C command to see if a device is still present on the bus?

تعرفه تبلیغات در سایت
عنوان عکس عنوان عکس عنوان عکس عنوان عکس
عنوان عکس عنوان عکس عنوان عکس عنوان عکس
عنوان عکس عنوان عکس عنوان عکس عنوان عکس
عنوان عکس عنوان عکس عنوان عکس عنوان عکس
عنوان عکس عنوان عکس عنوان عکس عنوان عکس

آرشیو مطالب

جستجوگر

یافته ها در جستجو

    امکانات وب

    برچسب ها

    Is there a general I2C command to see if a device is still present on the bus after it is initialized once? For example an OLED display. The reason I ask this is to avoid the main program will freeze (when a device is disconnected) because of infinite loops present in the library code, in for example, the Wire library.

    At startup of the MCU I want to check if a device is available or not and initialized when it is available. I do this with this function and works fine .....

    bool MyClass::isPnpDeviceAvailable( uint8_t iAddress, bool bIsInitOnce = false )
    {
         // Try to start connection
        Wire.beginTransmission( iAddress );
    
         // End connection without STOP command if already is initialized
        return ( Wire.endTransmission( !bIsInitOnce ) == 0x00 ); // No Error?, return true
    }
    
    

    .... however, when I want to check if a device is still there, before I perform an update, when I do this:

    // 1.
    if( isPnpDeviceAvailable( 0x3C, true )) 
     { /* Cause program hang */ }
    // 2.
    if( isPnpDeviceAvailable( 0x3C )) 
     { /* Cause display to turn off  */ }
    
    

    Is there a general command available, to say/send just a "Hello, are you there" and wait for a reply without sending START and STOP commands and without interrupting device/bus status?


    Here is the proto-type device I made with attached (optional PNP I2C) display.

    Device with PNP I2C display

  • مطالب مرتبط
  • Android : There's no route in routing table, but still online. Why?
  • Is there an alternative so that Garbage Collection don't take much time to free up the memory?
  • Representation of objects
  • Wrapping NSArray manipulations with '@synchronized', still crash
  • Is there a tool for putting together multiple SVGs onto one co-ordinate canvas?
  • excel 2013 is there a way to create a drop down within a drop down?
  • نویسنده : استخدام کار بازدید : 13 تاريخ : دوشنبه 13 شهريور 1396 ساعت: 16:28
    برچسب‌ها :