Welcome to the Meadow Core library GitHub repository! This library is the foundation of the Meadow platform and provides a powerful set of tools for creating connected devices. The Meadow Core library includes APIs for common protocols such as SPI, I2C, and UART, as well as APIs for networking, storage, and more. The library is written in C# and is designed to work with the Meadow F7 Microcontroller. With Meadow Core, you can quickly and easily build connected devices that are powerful, reliable, and secure. Join our community and start building with Meadow Core today!
If this repo is cloned, it will only build if the following repositories are cloned and stored at the same folder level:
- Meadow.Units contains a strong unitization into the entire stack of Meadow.
- Meadow.Logging a lightweight logging library for embedded hardware.
- Meadow.Contracts contains the interfaces used by the entire Meadow stack.
- Meadow.Modbus is a .NET assembly that provides Modbus RTU and TCP as well as Modbus TCP server capabilities.
- MQTTnet is a high performance .NET library for MQTT based communication.
Additionally, you might want to check out our repos with tons of samples with different levels of complexity and hardware requirements:
- Meadow.Core.Samples has all our sample projects that cover every feature Meadow has to offer with no extra peripherals required.
- Meadow.Project.Samples has en extensive collection of Meadow Projects using Meadow.Foundation, our peripheral driver and hardware control libraries to make .NET IoT development plug-and-play.
- Meadow.ProjectLab.Samples contains project samples for the breadboardless rapid prototyping board Project Lab.
- Meadow.Desktop.Samples contains project samples for Meadow.Windows and Meadow.Linux.
All peripherals must be able to be constructed with an IPin
along with a device with the capabilities to configure a proper port (digital IO, analog, PWM, etc.) and a specific type of port such as IDigitalOutputPort
, IPwmPort
, IAnalogInputPort
, etc.
public class AnalogSensor
{
protected IAnalogInputPort AnalogInputPort { get; set; }
public AnalogSensor (IAnalogInputController device, IPin pin)
: this (device.CreateAnalogInputPort(pin)) { }
public AnalogSensor (IAnalogInputPort analogInputPort)
{
AnalogInputPort = analogInputPort;
}
}
public class Led
{
protected IDigitalOutputPort DigitalOutputPort { get; set; }
public Led (IDigitalOutputController device, IPin pin)
: this(device.CreateDigitalOutputPort(pin)) { }
public Led (IDigitalPort digitalOutputPort)
{
DigitalOutputPort = digitalOutputPort;
}
}
public class PwmLed
{
protected IPwmPort PwmPort { get; set; }
public PwmLed (IPwmOutputController device, IPin pin)
: this (device.CreatePwmPort(pin)) { }
public PwmLed (IPwmPort pwmPort)
{
PwmPort = pwmPort;
}
}