Example #1
0
        static void Main()
        {
#if TINYCLR_V2_SC20100DEV_MIKROBUS_1
            Rfm9XDevice rfm9XDevice = new Rfm9XDevice(SC20100.SpiBus.Spi3, SC20100.GpioPin.PD3);
#endif
#if TINYCLR_V2_SC20100DEV_MIKROBUS_2
            Rfm9XDevice rfm9XDevice = new Rfm9XDevice(SC20100.SpiBus.Spi3, SC20100.GpioPin.PD14);
#endif
#if TINYCLR_V2_FEZDUINO
            Rfm9XDevice rfm9XDevice = new Rfm9XDevice(SC20100.SpiBus.Spi6, SC20100.GpioPin.PB1);
#endif
#if TINYCLR_V2_FEZPORTAL
            Rfm9XDevice rfm9XDevice = new Rfm9XDevice(SC20100.SpiBus.Spi3, SC20100.GpioPin.PC13);
#endif

            while (true)
            {
                for (byte registerIndex = 0; registerIndex <= 0x42; registerIndex++)
                {
                    byte registerValue = rfm9XDevice.RegisterReadByte(registerIndex);

                    Debug.WriteLine($"Register 0x{registerIndex:x2} - Value 0X{registerValue:x2}");
                }
                Debug.WriteLine("");

                Thread.Sleep(10000);
            }
        }
Example #2
0
        static void Main()
        {
            Rfm9XDevice rfm9XDevice = new Rfm9XDevice(FEZ.GpioPin.D10);

            while (true)
            {
                for (byte registerIndex = 0; registerIndex <= 0x42; registerIndex++)
                {
                    byte registerValue = rfm9XDevice.RegisterReadByte(registerIndex);

                    Debug.WriteLine($"Register 0x{registerIndex:x2} - Value 0X{registerValue:x2}");
                }
                Debug.WriteLine("");

                Thread.Sleep(10000);
            }
        }
Example #3
0
        public static void Main()
        {
#if ST_STM32F429I_DISCOVERY
            int chipSelectPinNumber = PinNumber('C', 2);
#endif
#if ESP32_WROOM_32_LORA_1_CHANNEL
            int chipSelectPinNumber = Gpio.IO16;
#endif
#if NETDUINO3_WIFI
            int chipSelectPinNumber = PinNumber('B', 10);
#endif
#if ST_NUCLEO144_F746ZG
            int chipSelectPinNumber = PinNumber('D', 14);
#endif

            try
            {
#if ESP32_WROOM_32_LORA_1_CHANNEL
                Configuration.SetPinFunction(nanoFramework.Hardware.Esp32.Gpio.IO12, DeviceFunction.SPI1_MISO);
                Configuration.SetPinFunction(nanoFramework.Hardware.Esp32.Gpio.IO13, DeviceFunction.SPI1_MOSI);
                Configuration.SetPinFunction(nanoFramework.Hardware.Esp32.Gpio.IO14, DeviceFunction.SPI1_CLOCK);
#endif
                Rfm9XDevice rfm9XDevice = new Rfm9XDevice(SpiBusId, chipSelectPinNumber);

                Thread.Sleep(500);

                while (true)
                {
                    for (byte registerIndex = 0; registerIndex <= 0x42; registerIndex++)
                    {
                        byte registerValue = rfm9XDevice.RegisterReadByte(registerIndex);

                        Debug.WriteLine($"Register 0x{registerIndex:x2} - Value 0X{registerValue:x2}");
                    }
                    Debug.WriteLine("");

                    Thread.Sleep(10000);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }