예제 #1
0
 /// <summary>
 /// Use this constructor when target device is already known and Bsl430NetDevice object is present from previous scan.
 /// </summary>
 public BSL430NET(Bsl430NetDevice DefaultDevice)
 {
     if (DefaultDevice == null)
     {
         throw new Bsl430NetException(462);
     }
     Bsl430NetInit(DefaultDevice.Mode, (DefaultDevice.Name.Trim() == "") ? null : DefaultDevice);
 }
예제 #2
0
 /// <summary>
 /// Bsl430NetDevice copy constructor
 /// </summary>
 public Bsl430NetDevice(Bsl430NetDevice Dev)
 {
     Name                 = Dev.Name;
     Description          = Dev.Description;
     Kind                 = Dev.Kind;
     FormattedDescription = Dev.FormattedDescription;
     Mode                 = Dev.Mode;
 }
예제 #3
0
        private void Bsl430NetInit(Mode Mode, Bsl430NetDevice Device = null)
        {
            try
            {
                switch (Mode)
                {
                case Mode.UART_FTD2XX: dev = new CommFTD2XX(this, Device); break;

                case Mode.UART_libftdi: dev = new CommLibftdi(this, Device); break;

                case Mode.UART_Serial: dev = new CommSerial(this, Device); break;

                case Mode.USB_HID: dev = new CommUSB(this, Device); break;
                }
                this.mode          = Mode;
                this.DefaultDevice = Device;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
예제 #4
0
 /// <summary>
 /// Downloads bytes from target MCU starting from address AddrStart to AddrStart + DataSize.
 /// If wrong password is entered, mass erase is auto executed as a safety measure, erasing entire flash.
 /// Password is last 16-byte (F543x-non-A only) or 32-byte (others) of IVT (FFE0-FFFF), if newer 5xx/6xx MCU is
 /// used. If MCU from older series is used (1xx/2xx/4xx), password is exactly 20-byte long. Mostly it is 32-byte.
 /// </summary>
 public StatusEx Download(byte[] Password, int AddrStart, int DataSize, out List <byte> Data, Bsl430NetDevice Device = null)
 {
     return(dev.Download(Device, Password, AddrStart, DataSize, out Data) ?? Utils.StatusCreateEx(466));
 }
예제 #5
0
 /// <summary>
 /// Uploads data from firmware_path to target MCU. Supported file formats are TI-TXT, Intel-HEX and ELF.
 /// If none, null or invalid password is entered, mass erase is executed first.
 /// Password is last 16-byte (F543x-non-A only) or 32-byte (others) of IVT (FFE0-FFFF), if newer 5xx/6xx MCU is
 /// used. If MCU from older series is used (1xx/2xx/4xx), password is exactly 20-byte long. Mostly it is 32-byte.
 /// </summary>
 public StatusEx Upload(string FirmwarePath, Bsl430NetDevice Device = null, byte[] Password = null)
 {
     return(dev.Upload(Device, FirmwarePath, Password) ?? Utils.StatusCreateEx(466));
 }
예제 #6
0
 /// <summary>
 /// Erase deletes the entire flash memory area except Information Memory if protocol 5xx6xx is used.
 /// Please see MCU datasheet for detailed information, or TI BSL doc (slau319t.pdf).
 /// </summary>
 public StatusEx Erase(Bsl430NetDevice Device = null)
 {
     return(dev.Erase(Device) ?? Utils.StatusCreateEx(466));
 }