Ejemplo n.º 1
0
        internal virtual bool DeviceExecute(I2cXAction xAction)
        {
            try
            {
                DeviceBeginTransaction();

                foreach (I2cXActionUnit unit in xAction.XActionUnits)
                {
                    if (unit.IsRead)
                    {
                        DeviceRead(unit.Data);
                    }
                    else
                    {
                        DeviceWrite(unit.Data);
                    }
                }

                DeviceEndTransaction();
            }
            catch (Exception)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
        bool II2cDriver.Enqueue(I2cXAction xAction)
        {
            bool success = GetI2cDevice(xAction.Address).DeviceExecute(xAction);

            // We are emulating this synchronously, and the tranaction can only complete successfully or not at all.
            xAction.Status = (success) ? I2cStatus.Completed : I2cStatus.Aborted;

            Emulator.SetSystemEvents(Microsoft.SPOT.Emulator.Events.SystemEvents.I2C_XACTION);

            return(success);
        }
Ejemplo n.º 3
0
 internal override bool DeviceExecute(I2cXAction xAction)
 {
     return(false);
 }