diff --git a/devices/Mcp25xxx/Can/CanController.cs b/devices/Mcp25xxx/Can/CanController.cs new file mode 100644 index 0000000000..f3b3b2c213 --- /dev/null +++ b/devices/Mcp25xxx/Can/CanController.cs @@ -0,0 +1,395 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Iot.Device.Mcp25xxx.Register; +using Iot.Device.Mcp25xxx.Register.CanControl; +using Iot.Device.Mcp25xxx.Register.Interrupt; +using Iot.Device.Mcp25xxx.Tests.Register.CanControl; +using System; +using System.Diagnostics; +using System.Threading; + +namespace Iot.Device.Mcp25xxx.Can +{ + /// + /// Represents a CAN controller on the system. + /// + public class CanController : ICanController + { + byte MCP_SIDH = 0; + byte MCP_SIDL = 1; + byte MCP_EID8 = 2; + byte MCP_EID0 = 3; + byte MCP_DLC = 4; + byte DLC_MASK = 0x0F; + byte TXB_EXIDE_MASK = 0x08; + + private Mcp25xxx _mcp25xxx; + + /// + /// + /// + /// + public void Initialize(Mcp25xxx mcp25xxx) + { + _mcp25xxx = mcp25xxx; + } + + /// + /// Write message to CAN Bus. + /// + /// CAN mesage to write in CAN Bus. + public void WriteMessage(CanMessage message) + { + + } + + /// + /// Get next available in the _ internal buffer. + /// If there are no more messages available null will be returned. + /// + /// + /// A or null if there are no more messages available. + /// + public CanMessage GetMessage() + { + var status = _mcp25xxx.ReadStatus(); + + if (status.HasFlag(ReadStatusResponse.Rx0If)) + { // message in buffer 0 + return ReadDataMessage(0); + } + else if (status.HasFlag(ReadStatusResponse.Rx1If)) + { // message in buffer 1 + return ReadDataMessage(1); + } + else + { // no messages available + return null; + } + } + + /// + /// Clear all receive buffers. + /// + public void Reset() + { + Debug.WriteLine("Reset Instruction"); + _mcp25xxx.Reset(); + + Thread.Sleep(10); + + // Clear control buffers + byte[] data14 = new byte[14]; + _mcp25xxx.Write(Address.TxB0Ctrl, data14); + _mcp25xxx.Write(Address.TxB1Ctrl, data14); + _mcp25xxx.Write(Address.TxB2Ctrl, data14); + + _mcp25xxx.WriteByte(Address.RxB0Ctrl, 0); + _mcp25xxx.WriteByte(Address.RxB1Ctrl, 0); + + + _mcp25xxx.WriteByte(Address.CanIntE, (byte)(InterruptEnable.RXB0 | InterruptEnable.RXB1 | InterruptEnable.ERR | InterruptEnable.MSG_ERR)); + + // receives all valid messages using either Standard or Extended Identifiers that + // meet filter criteria. RXF0 is applied for RXB0, RXF1 is applied for RXB1 + _mcp25xxx.BitModify(Address.RxB0Ctrl, + 0x60 | 0x04 | 0x07, // moet die laatste niet 0x03 zijn? Geprobeerd maar doet niets.. + 0x00 | 0x04 | 0x00); + _mcp25xxx.BitModify(Address.RxB1Ctrl, + 0x60 | 0x07, + 0x00 | 0x01); + + // clear filters and masks + // do not filter any standard frames for RXF0 used by RXB0 + // do not filter any extended frames for RXF1 used by RXB1 + byte[] zeros12 = new byte[12]; + _mcp25xxx.Write(Address.RxF0Sidh, zeros12); + _mcp25xxx.Write(Address.RxF3Sidh, zeros12); + + byte[] zeros8 = new byte[8]; + _mcp25xxx.Write(Address.RxM0Sidh, zeros8); + } + + private CanMessage ReadDataMessage(int bufferNumber) + { + var sidh_reg = bufferNumber == 0 ? Address.RxB0Sidh : Address.RxB1Sidh; + var sidl_reg = bufferNumber == 0 ? Address.RxB0Sidl : Address.RxB1Sidl; + + var dlc_reg = bufferNumber == 0 ? Address.RxB0Dlc : Address.RxB1Dlc; + + + var ctrl_reg = bufferNumber == 0 ? Address.RxB0Ctrl : Address.RxB1Ctrl; + var data_reg = bufferNumber == 0 ? Address.RxB0D0 : Address.RxB1D0; //.RXB0DATA RXB1DATA + var int_flag = bufferNumber == 0 ? ReadStatusResponse.Rx0If : ReadStatusResponse.Rx1If; + + // read 5 bytes + var buffer = _mcp25xxx.Read(sidh_reg, 5); + + int id = (buffer[MCP_SIDH] << 3) + (buffer[MCP_SIDL] >> 5); + + bool isExtended = false; + + // check to see if it's an extended ID + if ((buffer[MCP_SIDL] & TXB_EXIDE_MASK) == TXB_EXIDE_MASK) + { + id = (id << 2) + (buffer[MCP_SIDL] & 0x03); + id = (id << 8) + buffer[MCP_EID8]; + id = (id << 8) + buffer[MCP_EID0]; + isExtended = true; + } + + byte dataLengthCode = (byte)(buffer[MCP_DLC] & DLC_MASK); + if (dataLengthCode > 8) throw new Exception($"DLC of {dataLengthCode} is > 8 bytes"); + + // see if it's a remote transmission request + //var isRemoteTransmitRequest = false; + //var ctrl = ReadRegister(ctrl_reg)[0]; + //if ((ctrl & RXBnCTRL_RTR) == RXBnCTRL_RTR) + //{ + // isRemoteTransmitRequest = true; + //} + + // create the CANMessag + CanMessage frame; + + if (isExtended) + { + //if (isRemoteTransmitRequest) + //{ + // frame = new ExtendedRtrFrame + // { + // ID = id, + // }; + //} + //else + //{ + frame = new CanMessage((uint)id, + CanMessageIdType.EID, + CanMessageFrameType.Data, + _mcp25xxx.Read(data_reg, dataLengthCode)); + + //} + } + else + { + //if (isRemoteTransmitRequest) + //{ + // frame = new StandardRtrFrame + // { + // ID = id, + // }; + //} + //else + //{ + frame = new CanMessage((uint)id, + CanMessageIdType.SID, + CanMessageFrameType.Data, + _mcp25xxx.Read(data_reg, dataLengthCode)); + + // read the frame data + //} + //} + + + } + // clear the interrupt flag + //if (InterruptPort != null) + //{ + //ClearInterrupt(int_flag); + ClearInterrupt(bufferNumber); // int_flag); + + return frame; + } + + private void ClearInterrupt(int bufferNumber) + { + var canIntf = new CanIntF(_mcp25xxx.Read(Address.CanIntF)); + if (bufferNumber == 0) + { + canIntf.ReceiveBuffer0FullInterruptFlag = false; + } + else + { + canIntf.ReceiveBuffer1FullInterruptFlag = false; + } + + // Write the modified value back to the CanCtrl register + _mcp25xxx.WriteByte(canIntf); + } + + class Config + { + public long ClockFrequency { get; set; } + public long BaudRate { get; set; } + public byte[] Cnf { get; set; } + } + + /// + /// + /// + /// CAN baudrate. For example 250.000 + /// mcp2515 clock frequency. For example 8.000.000 + public void SetBitRate(int baudRate, int clockFrequency) + { + var mode = GetOperationMode(); + if(mode != OperationMode.Configuration) + { + SetOperationMode(OperationMode.Configuration); + } + + var CNF_MAPPER = new Config[] + { + new() { ClockFrequency = 8_000_000L, BaudRate = 1_000_000L, Cnf = new byte[] { 0x00, 0x80, 0x00 } }, + new() { ClockFrequency = 8_000_000L, BaudRate = 666_666L, Cnf = new byte[] { 0xC0, 0xB8, 0x01 } }, + new() { ClockFrequency = 8_000_000L, BaudRate = 500_000L, Cnf = new byte[] { 0x00, 0x90, 0x02 } }, + new() { ClockFrequency = 8_000_000L, BaudRate = 250_000L, Cnf = new byte[] { 0x00, 0xB1, 0x05 } }, + new() { ClockFrequency = 8_000_000L, BaudRate = 200_000L, Cnf = new byte[] { 0x00, 0xB4, 0x06 } }, + new() { ClockFrequency = 8_000_000L, BaudRate = 125_000L, Cnf = new byte[] { 0x01, 0xB1, 0x05 } }, + new() { ClockFrequency = 8_000_000L, BaudRate = 100_000L, Cnf = new byte[] { 0x01, 0xB4, 0x06 } }, + new() { ClockFrequency = 8_000_000L, BaudRate = 80_000L, Cnf = new byte[] { 0x01, 0xBF, 0x07 } }, + new() { ClockFrequency = 8_000_000L, BaudRate = 50_000L, Cnf = new byte[] { 0x03, 0xB4, 0x06 } }, + new() { ClockFrequency = 8_000_000L, BaudRate = 40_000L, Cnf = new byte[] { 0x03, 0xBF, 0x07 } }, + new() { ClockFrequency = 8_000_000L, BaudRate = 20_000L, Cnf = new byte[] { 0x07, 0xBF, 0x07 } }, + new() { ClockFrequency = 8_000_000L, BaudRate = 10_000L, Cnf = new byte[] { 0x0F, 0xBF, 0x07 } }, + new() { ClockFrequency = 8_000_000L, BaudRate = 5_000L, Cnf = new byte[] { 0x1F, 0xBF, 0x07 } }, + new() { ClockFrequency = 16_000_000L, BaudRate = 1_000_000L, Cnf = new byte[] { 0x00, 0xD0, 0x82 } }, + new() { ClockFrequency = 16_000_000L, BaudRate = 666_666L, Cnf = new byte[] { 0xC0, 0xF8, 0x81 } }, + new() { ClockFrequency = 16_000_000L, BaudRate = 500_000L, Cnf = new byte[] { 0x00, 0xF0, 0x86 } }, + new() { ClockFrequency = 16_000_000L, BaudRate = 250_000L, Cnf = new byte[] { 0x41, 0xF1, 0x85 } }, + new() { ClockFrequency = 16_000_000L, BaudRate = 200_000L, Cnf = new byte[] { 0x01, 0xFA, 0x87 } }, + new() { ClockFrequency = 16_000_000L, BaudRate = 125_000L, Cnf = new byte[] { 0x03, 0xF0, 0x86 } }, + new() { ClockFrequency = 16_000_000L, BaudRate = 100_000L, Cnf = new byte[] { 0x03, 0xFA, 0x87 } }, + new() { ClockFrequency = 16_000_000L, BaudRate = 80_000L, Cnf = new byte[] { 0x03, 0xFF, 0x87 } }, + new() { ClockFrequency = 16_000_000L, BaudRate = 50_000L, Cnf = new byte[] { 0x07, 0xFA, 0x87 } }, + new() { ClockFrequency = 16_000_000L, BaudRate = 40_000L, Cnf = new byte[] { 0x07, 0xFF, 0x87 } }, + new() { ClockFrequency = 16_000_000L, BaudRate = 20_000L, Cnf = new byte[] { 0x0F, 0xFF, 0x87 } }, + new() { ClockFrequency = 16_000_000L, BaudRate = 10_000L, Cnf = new byte[] { 0x1F, 0xFF, 0x87 } }, + new() { ClockFrequency = 16_000_000L, BaudRate = 5_000L, Cnf = new byte[] { 0x3F, 0xFF, 0x87 } }, + }; + + byte[] cnf = null; + + foreach (var mapper in CNF_MAPPER) + { + if (mapper.ClockFrequency == clockFrequency && mapper.BaudRate == baudRate) + { + cnf = mapper.Cnf; + break; + } + } + + _mcp25xxx.WriteByte(Address.Cnf1, cnf[0]); + _mcp25xxx.WriteByte(Address.Cnf2, cnf[1]); + _mcp25xxx.WriteByte(Address.Cnf3, cnf[2]); + + SetFilterMask(MASK.MASK0, false, 0x7ff); + SetFilter(RXF.RXF0, false, 0x154); + SetFilterMask(MASK.MASK1, false, 0x7ff); + SetFilter(RXF.RXF0, false, 0x154); + + SetOperationMode(OperationMode.NormalOperation); + } + + public bool SetFilter(RXF num, bool ext, uint ulData) + { + var mode = GetOperationMode(); + SetOperationMode(OperationMode.Configuration); + + Address reg; + + switch (num) + { + case RXF.RXF0: reg = Address.RxF0Sidh; break; + case RXF.RXF1: reg = Address.RxF1Sidh; break; + case RXF.RXF2: reg = Address.RxF2Sidh; break; + case RXF.RXF3: reg = Address.RxF3Sidh; break; + case RXF.RXF4: reg = Address.RxF4Sidh; break; + case RXF.RXF5: reg = Address.RxF5Sidh; break; + default: + return false; + } + + SpanByte tbufdata = new byte[4]; + PrepareId(tbufdata, ext, ulData); + _mcp25xxx.Write(reg, tbufdata); + + SetOperationMode(mode); + + return true; + } + + void PrepareId(SpanByte buffer, bool ext, uint id) + { + ushort canid = (ushort)(id & 0x0FFFF); + + if (ext) + { + buffer[MCP_EID0] = (byte)(canid & 0xFF); + buffer[MCP_EID8] = (byte)(canid >> 8); + canid = (ushort)(id >> 16); + buffer[MCP_SIDL] = (byte)(canid & 0x03); + buffer[MCP_SIDL] += (byte)((canid & 0x1C) << 3); + buffer[MCP_SIDL] |= TXB_EXIDE_MASK; + buffer[MCP_SIDH] = (byte)(canid >> 5); + } + else + { + buffer[MCP_SIDH] = (byte)(canid >> 3); + buffer[MCP_SIDL] = (byte)((canid & 0x07) << 5); + buffer[MCP_EID0] = 0; + buffer[MCP_EID8] = 0; + } + } + + private bool SetFilterMask(MASK mask, bool ext, uint ulData) + { + var mode = GetOperationMode(); + SetOperationMode(OperationMode.Configuration); + + SpanByte tbufdata = new SpanByte(new byte[4]); + PrepareId(tbufdata, ext, ulData); + + Address reg; + switch (mask) + { + case MASK.MASK0: reg = Address.RxM0Sidh; break; + case MASK.MASK1: reg = Address.RxM1Sidh; break; + default: + return false; + } + + _mcp25xxx.Write(reg, tbufdata); + + SetOperationMode(mode); + return true; + } + private OperationMode GetOperationMode() + { + byte value = _mcp25xxx.Read(Address.CanStat); + var canStat = new CanStat(value); + return canStat.OperationMode; + } + + /// + /// Sets the operation mode of the MCP25xxx device. + /// + /// The MCP25xxx device instance. + /// The desired operation mode. + private void SetOperationMode(OperationMode mode) + { + // Read the current value of the CanCtrl register + var canCtrlValue = new CanCtrl(_mcp25xxx.Read(Address.CanCtrl)); + + var newCanCtrlValue = new CanCtrl( + canCtrlValue.ClkOutPinPrescaler, + canCtrlValue.ClkOutPinEnable, + canCtrlValue.OneShotMode, + canCtrlValue.AbortAllPendingTransmissions, + mode); + + // Write the modified value back to the CanCtrl register + _mcp25xxx.WriteByte(newCanCtrlValue); + } + } +} diff --git a/devices/Mcp25xxx/Can/CanEnums.cs b/devices/Mcp25xxx/Can/CanEnums.cs new file mode 100644 index 0000000000..91a143b372 --- /dev/null +++ b/devices/Mcp25xxx/Can/CanEnums.cs @@ -0,0 +1,35 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Iot.Device.Mcp25xxx.Can +{ + public enum MASK + { + MASK0, + MASK1 + }; + + public enum RXF + { + RXF0 = 0, + RXF1 = 1, + RXF2 = 2, + RXF3 = 3, + RXF4 = 4, + RXF5 = 5 + }; + + public enum InterruptEnable : byte + { + DisableAll = 0, + RXB0 = 0x01, + RXB1 = 0x02, + TXB0 = 0x04, + TXB1 = 0x08, + TXB2 = 0x10, + ERR = 0x20, + WAKE = 0x40, + MSG_ERR = 0x80 + } + +} diff --git a/devices/Mcp25xxx/Can/CanMessage.cs b/devices/Mcp25xxx/Can/CanMessage.cs new file mode 100644 index 0000000000..4673c7778d --- /dev/null +++ b/devices/Mcp25xxx/Can/CanMessage.cs @@ -0,0 +1,73 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +namespace Iot.Device.Mcp25xxx.Can +{ + /// + /// CAN message. + /// + public class CanMessage + { + private uint _id; + + private CanMessageIdType _identifierType; + + private CanMessageFrameType _frameType; + + private byte[] _message; + + /// + /// Message ID (SID or EID format, depending on ). + /// + public uint Id + { + get { return _id; } + set { _id = value; } + } + + /// + /// Message identifier type. + /// + public CanMessageIdType IdentifierType + { + get { return _identifierType; } + set { _identifierType = value; } + } + + /// + /// Message frame type. + /// + public CanMessageFrameType FrameType + { + get { return _frameType; } + set { _frameType = value; } + } + + /// + /// Message data. + /// + /// + /// Maximum lenght of data buffer is 8. + /// + /// If the message buffer exceeds the maximum allowed lenght. + public byte[] Message + { + get { return _message; } + set { _message = value; } + } + + /// + /// Creates a CAN message. + /// + public CanMessage(uint id, CanMessageIdType identifierType, CanMessageFrameType frameType, byte[] message) + { + _id = id; + _identifierType = identifierType; + _frameType = frameType; + _message = message; + } + } + +} diff --git a/devices/Mcp25xxx/Can/CanMessageFrameType.cs b/devices/Mcp25xxx/Can/CanMessageFrameType.cs new file mode 100644 index 0000000000..f2f9917a84 --- /dev/null +++ b/devices/Mcp25xxx/Can/CanMessageFrameType.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Iot.Device.Mcp25xxx.Can +{ + /// + /// CAN message frame type. + /// + public enum CanMessageFrameType + { + /// + /// Data frame. + /// + Data = 0, + + /// + /// Remote request frame. + /// + RemoteRequest + } +} diff --git a/devices/Mcp25xxx/Can/CanMessageIdType.cs b/devices/Mcp25xxx/Can/CanMessageIdType.cs new file mode 100644 index 0000000000..cdb493baf2 --- /dev/null +++ b/devices/Mcp25xxx/Can/CanMessageIdType.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Iot.Device.Mcp25xxx.Can +{ + /// + /// CAN message identifier type. + /// + public enum CanMessageIdType + { + /// + /// Standard Identifier. + /// + SID, + + /// + /// Extended Identifier. + /// + EID + } +} diff --git a/devices/Mcp25xxx/Can/ICanController.cs b/devices/Mcp25xxx/Can/ICanController.cs new file mode 100644 index 0000000000..262fa8da20 --- /dev/null +++ b/devices/Mcp25xxx/Can/ICanController.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Iot.Device.Mcp25xxx.Can +{ + public interface ICanController + { + CanMessage GetMessage(); + void Initialize(Mcp25xxx mcp25xxx); + void Reset(); + void SetBitRate(int baudRate, int clockFrequency); + void WriteMessage(CanMessage message); + } +} \ No newline at end of file diff --git a/devices/Mcp25xxx/Mcp25xxx.cs b/devices/Mcp25xxx/Mcp25xxx.cs index 67582851d0..79eae7d59e 100644 --- a/devices/Mcp25xxx/Mcp25xxx.cs +++ b/devices/Mcp25xxx/Mcp25xxx.cs @@ -260,6 +260,23 @@ public byte Read(Address address) return readBuffer[2]; } + /// + /// Reads data of a specified lenght from the register beginning at the selected address. + /// + /// The address to start reading. + /// Number of bytes to read. This must be one or more to read. + /// The value of address read. + public byte[] Read(Address address, byte length = 1) + { + SpanByte writeBuffer = new byte[2 + length]; + writeBuffer[0] = (byte)InstructionFormat.Read; + writeBuffer[1] = (byte)address; + + SpanByte readBuffer = new byte[2 + length]; + _spiDevice.TransferFullDuplex(writeBuffer, readBuffer); + return readBuffer.Slice(2).ToArray(); + } + /// /// When reading a receive buffer, reduces the overhead of a normal READ /// command by placing the Address Pointer at one of four locations for the receive buffer. diff --git a/devices/Mcp25xxx/Mcp25xxx.nfproj b/devices/Mcp25xxx/Mcp25xxx.nfproj index dafbece8ef..699f6f92ef 100644 --- a/devices/Mcp25xxx/Mcp25xxx.nfproj +++ b/devices/Mcp25xxx/Mcp25xxx.nfproj @@ -30,21 +30,27 @@ - - packages\nanoFramework.CoreLibrary.1.15.5\lib\mscorlib.dll + + packages\nanoFramework.CoreLibrary.1.16.11\lib\mscorlib.dll - - packages\nanoFramework.Runtime.Events.1.11.18\lib\nanoFramework.Runtime.Events.dll + + packages\nanoFramework.Runtime.Events.1.11.29\lib\nanoFramework.Runtime.Events.dll - - packages\nanoFramework.System.Device.Gpio.1.1.41\lib\System.Device.Gpio.dll + + packages\nanoFramework.System.Device.Gpio.1.1.53\lib\System.Device.Gpio.dll - - packages\nanoFramework.System.Device.Spi.1.3.52\lib\System.Device.Spi.dll + + packages\nanoFramework.System.Device.Spi.1.3.73\lib\System.Device.Spi.dll + + + + + + diff --git a/devices/Mcp25xxx/Mcp25xxx.sln b/devices/Mcp25xxx/Mcp25xxx.sln index 8212ab1bb3..ee91da7f9b 100644 --- a/devices/Mcp25xxx/Mcp25xxx.sln +++ b/devices/Mcp25xxx/Mcp25xxx.sln @@ -1,7 +1,6 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30413.136 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35527.113 d17.12 MinimumVisualStudioVersion = 15.0.26124.0 Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "Mcp25xxx", "Mcp25xxx.nfproj", "{36CCC2BB-F206-44FD-A852-D9219E39C391}" EndProject @@ -25,12 +24,6 @@ Global {4BFDD29A-0A47-4798-B5A7-C05E39667013}.Release|Any CPU.ActiveCfg = Release|Any CPU {4BFDD29A-0A47-4798-B5A7-C05E39667013}.Release|Any CPU.Build.0 = Release|Any CPU {4BFDD29A-0A47-4798-B5A7-C05E39667013}.Release|Any CPU.Deploy.0 = Release|Any CPU - {EDF668AE-0CC6-47AF-AEB7-3B23EDA0EA1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EDF668AE-0CC6-47AF-AEB7-3B23EDA0EA1C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EDF668AE-0CC6-47AF-AEB7-3B23EDA0EA1C}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {EDF668AE-0CC6-47AF-AEB7-3B23EDA0EA1C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EDF668AE-0CC6-47AF-AEB7-3B23EDA0EA1C}.Release|Any CPU.Build.0 = Release|Any CPU - {EDF668AE-0CC6-47AF-AEB7-3B23EDA0EA1C}.Release|Any CPU.Deploy.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/devices/Mcp25xxx/Register/Interrupt/CanIntF.cs b/devices/Mcp25xxx/Register/Interrupt/CanIntF.cs index 2700c4ec84..d129cc3944 100644 --- a/devices/Mcp25xxx/Register/Interrupt/CanIntF.cs +++ b/devices/Mcp25xxx/Register/Interrupt/CanIntF.cs @@ -92,14 +92,14 @@ public CanIntF(byte value) /// True = Interrupt pending (must be cleared by MCU to reset interrupt condition). /// False = No interrupt pending. /// - public bool ReceiveBuffer0FullInterruptFlag { get; } + public bool ReceiveBuffer0FullInterruptFlag { get; set; } /// /// RX1IF: Receive Buffer 1 Full Interrupt Flag bit. /// True = Interrupt pending (must be cleared by MCU to reset interrupt condition). /// False = No interrupt pending. /// - public bool ReceiveBuffer1FullInterruptFlag { get; } + public bool ReceiveBuffer1FullInterruptFlag { get; set; } /// /// TX0IF: Transmit Buffer 0 Empty Interrupt Flag bit. diff --git a/devices/Mcp25xxx/packages.config b/devices/Mcp25xxx/packages.config index 115c650cd4..d13a0b8705 100644 --- a/devices/Mcp25xxx/packages.config +++ b/devices/Mcp25xxx/packages.config @@ -1,8 +1,8 @@  - - - - + + + + \ No newline at end of file diff --git a/devices/Mcp25xxx/packages.lock.json b/devices/Mcp25xxx/packages.lock.json index 403df704ef..30139681f6 100644 --- a/devices/Mcp25xxx/packages.lock.json +++ b/devices/Mcp25xxx/packages.lock.json @@ -4,27 +4,27 @@ ".NETnanoFramework,Version=v1.0": { "nanoFramework.CoreLibrary": { "type": "Direct", - "requested": "[1.15.5, 1.15.5]", - "resolved": "1.15.5", - "contentHash": "u2+GvAp1uxLrGdILACAZy+EVKOs28EQ52j8Lz7599egXZ3GBGejjnR2ofhjMQwzrJLlgtyrsx8nSLngDfJNsAg==" + "requested": "[1.16.11, 1.16.11]", + "resolved": "1.16.11", + "contentHash": "2XW+Zn0lQ+lOcxDbB1l2ga2rNoj9Jv2IeJwXE4ka1r+swmxn5N/otlMJVEXJgK8trUeD/E8T7+J7dXjU8UReHw==" }, "nanoFramework.Runtime.Events": { "type": "Direct", - "requested": "[1.11.18, 1.11.18]", - "resolved": "1.11.18", - "contentHash": "t0XpUkdyBBBv/0S4oGx3yUJG1iPYWc38odvZW8mVoioSxZOJrRkRHpNfwYxTxtP4LIEyyesOPEH42d05FHfHzA==" + "requested": "[1.11.29, 1.11.29]", + "resolved": "1.11.29", + "contentHash": "y3Y0SNfr1afMor4xrsiB1ETldjKvmnzBTcEH5gizFFXw3RNBB/N8npWqkCJn4HZS0TEENlH2vVrib3bWYMx5+Q==" }, "nanoFramework.System.Device.Gpio": { "type": "Direct", - "requested": "[1.1.41, 1.1.41]", - "resolved": "1.1.41", - "contentHash": "5QnpdfvjxOvka2S5IHSdKudWmkH+CDQ3TFFuXOGuNlgZJFsAx0/k5zuwgJYkxIyGbL8kdcjBWLyDNdihjA1pUg==" + "requested": "[1.1.53, 1.1.53]", + "resolved": "1.1.53", + "contentHash": "7Pd5iAeWPGdtKUB+OJ0vPjL+d9tQAK0s0JxV1dfjh6PZcU38wykdK64oMqNmCbDFA0aiZl0UyFmz3zXchn39nQ==" }, "nanoFramework.System.Device.Spi": { "type": "Direct", - "requested": "[1.3.52, 1.3.52]", - "resolved": "1.3.52", - "contentHash": "chtkrJp424LMitA6Fw/QzzhIrYL9PdEaln+A7o5QR99VijDoOILdMvgeeVBnIpkicUH7aY9Vj+3F2TlIGQH/+g==" + "requested": "[1.3.73, 1.3.73]", + "resolved": "1.3.73", + "contentHash": "bHh4MYqJcOfWnWjWBzYWZ+BiZdnUWXdJQKn7saGAaJTdQNVmYOF4QLL0P0bzetgAsEgeQ/ULs69ITBK64/jbyw==" }, "Nerdbank.GitVersioning": { "type": "Direct", diff --git a/devices/Mcp25xxx/samples/Mcp25xxx.Samples.nfproj b/devices/Mcp25xxx/samples/Mcp25xxx.Samples.nfproj index b25fd6cfed..b60a00af3b 100644 --- a/devices/Mcp25xxx/samples/Mcp25xxx.Samples.nfproj +++ b/devices/Mcp25xxx/samples/Mcp25xxx.Samples.nfproj @@ -20,17 +20,17 @@ - - ..\packages\nanoFramework.CoreLibrary.1.15.5\lib\mscorlib.dll + + ..\packages\nanoFramework.CoreLibrary.1.16.11\lib\mscorlib.dll - - ..\packages\nanoFramework.Runtime.Events.1.11.18\lib\nanoFramework.Runtime.Events.dll + + ..\packages\nanoFramework.Runtime.Events.1.11.29\lib\nanoFramework.Runtime.Events.dll - - ..\packages\nanoFramework.System.Device.Gpio.1.1.41\lib\System.Device.Gpio.dll + + ..\packages\nanoFramework.System.Device.Gpio.1.1.53\lib\System.Device.Gpio.dll - - ..\packages\nanoFramework.System.Device.Spi.1.3.52\lib\System.Device.Spi.dll + + ..\packages\nanoFramework.System.Device.Spi.1.3.73\lib\System.Device.Spi.dll diff --git a/devices/Mcp25xxx/samples/packages.config b/devices/Mcp25xxx/samples/packages.config index 4fbd05f8de..d5809c7dd0 100644 --- a/devices/Mcp25xxx/samples/packages.config +++ b/devices/Mcp25xxx/samples/packages.config @@ -1,7 +1,7 @@  - - - - + + + + \ No newline at end of file diff --git a/devices/Mcp25xxx/samples/packages.lock.json b/devices/Mcp25xxx/samples/packages.lock.json index 22094432d5..6004e9f425 100644 --- a/devices/Mcp25xxx/samples/packages.lock.json +++ b/devices/Mcp25xxx/samples/packages.lock.json @@ -4,27 +4,27 @@ ".NETnanoFramework,Version=v1.0": { "nanoFramework.CoreLibrary": { "type": "Direct", - "requested": "[1.15.5, 1.15.5]", - "resolved": "1.15.5", - "contentHash": "u2+GvAp1uxLrGdILACAZy+EVKOs28EQ52j8Lz7599egXZ3GBGejjnR2ofhjMQwzrJLlgtyrsx8nSLngDfJNsAg==" + "requested": "[1.16.11, 1.16.11]", + "resolved": "1.16.11", + "contentHash": "2XW+Zn0lQ+lOcxDbB1l2ga2rNoj9Jv2IeJwXE4ka1r+swmxn5N/otlMJVEXJgK8trUeD/E8T7+J7dXjU8UReHw==" }, "nanoFramework.Runtime.Events": { "type": "Direct", - "requested": "[1.11.18, 1.11.18]", - "resolved": "1.11.18", - "contentHash": "t0XpUkdyBBBv/0S4oGx3yUJG1iPYWc38odvZW8mVoioSxZOJrRkRHpNfwYxTxtP4LIEyyesOPEH42d05FHfHzA==" + "requested": "[1.11.29, 1.11.29]", + "resolved": "1.11.29", + "contentHash": "y3Y0SNfr1afMor4xrsiB1ETldjKvmnzBTcEH5gizFFXw3RNBB/N8npWqkCJn4HZS0TEENlH2vVrib3bWYMx5+Q==" }, "nanoFramework.System.Device.Gpio": { "type": "Direct", - "requested": "[1.1.41, 1.1.41]", - "resolved": "1.1.41", - "contentHash": "5QnpdfvjxOvka2S5IHSdKudWmkH+CDQ3TFFuXOGuNlgZJFsAx0/k5zuwgJYkxIyGbL8kdcjBWLyDNdihjA1pUg==" + "requested": "[1.1.53, 1.1.53]", + "resolved": "1.1.53", + "contentHash": "7Pd5iAeWPGdtKUB+OJ0vPjL+d9tQAK0s0JxV1dfjh6PZcU38wykdK64oMqNmCbDFA0aiZl0UyFmz3zXchn39nQ==" }, "nanoFramework.System.Device.Spi": { "type": "Direct", - "requested": "[1.3.52, 1.3.52]", - "resolved": "1.3.52", - "contentHash": "chtkrJp424LMitA6Fw/QzzhIrYL9PdEaln+A7o5QR99VijDoOILdMvgeeVBnIpkicUH7aY9Vj+3F2TlIGQH/+g==" + "requested": "[1.3.73, 1.3.73]", + "resolved": "1.3.73", + "contentHash": "bHh4MYqJcOfWnWjWBzYWZ+BiZdnUWXdJQKn7saGAaJTdQNVmYOF4QLL0P0bzetgAsEgeQ/ULs69ITBK64/jbyw==" } } }