Repository navigation
Standard Library
Note
Generated by python3 tools/gen_stdlib_doc.py from the native registration tables in
src/ and modules/ — this is exactly what a script can call. · = one argument,
… = variable argument count (overloads are resolved at run time).
Behaviour follows .NET wherever the member exists there. Deliberate differences are listed
in LANGUAGE.md. Library groups can
be removed per VM with cfg.stdlib and at build time with the MCS_ENABLE_* flags of
include/mcs_config.h (set them in your mcs_user_config.h, see CONFIGURATION.md).
Contents: Core · Strings · Collections · Filesystem (modules/fs) · Hardware (modules/hal) · Drivers (modules/drivers) · Displays (modules/drivers, optional U8g2) · Network (modules/net) · Bluetooth (modules/ble) · Threads (modules/threads) · Scheduler (modules/sched)
| Type | Kind | Properties | Methods | Notes |
|---|---|---|---|---|
| Console | static | — |
WriteLine(…) Write(…) ReadLine() Clear()
|
|
| Convert | static | — |
ToInt32(…) ToInt64(…) ToUInt32(…) ToByte(…) ToSByte(…) ToInt16(…) ToUInt16(…) ToDouble(·) ToSingle(·) ToBoolean(·) ToChar(·) ToString(…) ToBase64String(…) FromBase64String(·) ToHexString(…) ToHexStringLower(…) FromHexString(·)
|
|
| Math | static | — |
Abs(·) Max(·, ·) Min(·, ·) Sign(·) Clamp(·, ·, ·) DivRem(·, ·) Sqrt(·) Sin(·) Cos(·) Tan(·) Asin(·) Acos(·) Atan(·) Atan2(·, ·) Sinh(·) Cosh(·) Tanh(·) Exp(·) Log(…) Log10(·) Log2(·) Pow(·, ·) Cbrt(·) Hypot(·, ·) Floor(·) Ceiling(·) Truncate(·) Round(…) FusedMultiplyAdd(·, ·, ·) IEEERemainder(·, ·)
|
MCS_STDLIB_MATH |
| Environment | static |
TickCount TickCount64
|
— |
Environment.NewLine is a constant |
| Thread | static |
Cores CurrentCore Os Count Id
|
Start(…) Run(…) RunOn(…) Every(…) StopAll() Sleep(·)
|
|
| GC | static | — |
Collect(…) GetTotalMemory(…) CollectionCount(…)
|
|
| Debug | static | — |
Assert(…) WriteLine(…) Write(…)
|
|
| object | instance | — |
ToString() ToString(·) Equals(·) GetHashCode() GetType()
|
every value |
| object | static | — |
ReferenceEquals(·, ·) Equals(·, ·)
|
|
| Type | instance | — |
ToString() Equals(·)
|
x.GetType(), typeof(T)
|
| Type | static | — | — | |
| Exception | instance | — | ToString() |
all exception classes |
| int / double / bool / char | instance |
HasValue Value
|
CompareTo(·) GetValueOrDefault(…)
|
|
| int (and long, byte, short, uint ...) | static | — |
Parse(…) TryParse(·, ·)
|
|
| double / float | static | — |
Parse(…) TryParse(·, ·) IsNaN(·) IsInfinity(·) IsPositiveInfinity(·) IsNegativeInfinity(·) IsFinite(·)
|
MCS_ENABLE_FLOAT |
| bool | static | — |
Parse(·) TryParse(·, ·)
|
|
| Encoding | static |
UTF8 ASCII
|
— | using System.Text; |
| Encoding.UTF8 / Encoding.ASCII | instance | — |
GetBytes(·) GetString(…) GetByteCount(·)
|
|
| BitConverter | static | IsLittleEndian |
ToInt16(…) ToUInt16(…) ToInt32(…) ToUInt32(…) ToInt64(…) ToBoolean(…) ToSingle(…) ToDouble(…) GetBytes(·) ToString(…)
|
little-endian; ToString gives 01-AB-FF
|
| BinaryPrimitives | static | — |
ReadInt16BigEndian(…) ReadInt16LittleEndian(…) ReadUInt16BigEndian(…) ReadUInt16LittleEndian(…) ReadInt32BigEndian(…) ReadInt32LittleEndian(…) ReadUInt32BigEndian(…) ReadUInt32LittleEndian(…) ReadInt64BigEndian(…) ReadInt64LittleEndian(…) WriteInt16BigEndian(…) WriteInt16LittleEndian(…) WriteUInt16BigEndian(…) WriteUInt16LittleEndian(…) WriteInt32BigEndian(…) WriteInt32LittleEndian(…) WriteUInt32BigEndian(…) WriteUInt32LittleEndian(…) WriteInt64BigEndian(…) WriteInt64LittleEndian(…)
|
using System.Buffers.Binary; optional last offset argument (MicroCS extension) |
| char | static | — |
IsDigit(…) IsLetter(…) IsLetterOrDigit(…) IsWhiteSpace(…) IsUpper(…) IsLower(…) IsPunctuation(…) IsControl(…) IsNumber(…) IsSymbol(…) ToUpper(…) ToLower(…) ToUpperInvariant(…) ToLowerInvariant(…) GetNumericValue(…) Parse(·)
|
|
| Random | instance | — |
Next(…) NextDouble() NextSingle() NextBytes(·)
|
xorshift PRNG, seedable |
| Stopwatch | instance |
ElapsedMilliseconds ElapsedTicks IsRunning
|
Start() Stop() Reset() Restart()
|
uses cfg.ticks_fn
|
| Stopwatch | static | — | StartNew() |
|
| Delegate / Action / Func | instance | — |
Invoke(…) DynamicInvoke(…)
|
|
| ValueTuple | instance | — | ToString() |
Item1..Item7 and element names are fields |
| Json | static | — |
Parse(·) Deserialize(·) Stringify(…) Serialize(…) Escape(·)
|
Parse → Dictionary<string, object> / List<object> / values; Stringify(value[, indent]); also as JsonSerializer.Serialize / Deserialize (NETWORK.md) |
| Type | Kind | Properties | Methods | Notes |
|---|---|---|---|---|
| string | instance | Length |
Substring(…) IndexOf(…) Contains(…) StartsWith(…) EndsWith(…) Trim(…) TrimStart(…) TrimEnd(…) ToUpper() ToLower() ToUpperInvariant() ToLowerInvariant() LastIndexOf(…) IndexOfAny(·) Replace(…) PadLeft(…) PadRight(…) Split(…) ToCharArray() Insert(·, ·) Remove(…) CompareTo(·) Equals(·) Equals(·, ·) GetEnumerator() Clone()
|
UTF-8, byte-indexed |
| string | static | — |
IsNullOrEmpty(·) IsNullOrWhiteSpace(·) Join(…) Concat(…) Format(…) Compare(…) CompareOrdinal(·, ·) Equals(…)
|
|
| StringBuilder | instance |
Length Capacity
|
Append(…) AppendLine(…) AppendFormat(…) ToString() ToString(·, ·) Clear() Insert(·, ·) Remove(·, ·) Replace(·, ·)
|
MCS_ENABLE_STRINGBUILDER |
| Type | Kind | Properties | Methods | Notes |
|---|---|---|---|---|
| KeyValuePair<K,V> | instance | — | ToString() |
Key, Value fields; deconstructible |
| T[] (arrays) | instance |
Length LongLength Rank
|
GetEnumerator() Contains(·) IndexOf(…) ToList() ToArray() ForEach(·) Cast() AsEnumerable() LastIndexOf(·) Find(·) FindLast(·) FindIndex(·) FindLastIndex(·) FindAll(·) Exists(·) TrueForAll(·) ConvertAll(·) CopyTo(…) BinarySearch(…) Where(·) Select(·) SelectMany(·) Any(…) All(·) Count(…) Sum(…) Min(…) Max(…) MinBy(·) MaxBy(·) First(…) FirstOrDefault(…) Last(…) LastOrDefault(…) Single(…) ElementAt(·) ElementAtOrDefault(·) OrderBy(…) OrderByDescending(…) Order() ThenBy(·) ThenByDescending(·) OrderDescending() Skip(·) Take(·) SkipWhile(·) TakeWhile(·) Distinct() DistinctBy(·) Aggregate(…) SequenceEqual(·) Concat(·) Append(·) Zip(…) Chunk(·) ToDictionary(…) GroupBy(·) Average(…) Clone() GetLength(·) Reverse()
|
plus every LINQ operator below |
| Array | static | — |
Sort(…) Reverse(…) IndexOf(…) LastIndexOf(·, ·) Fill(…) Copy(…) Clear(…) Exists(·, ·) TrueForAll(·, ·) Find(·, ·) FindLast(·, ·) FindIndex(·, ·) FindLastIndex(·, ·) FindAll(·, ·) ForEach(·, ·) BinarySearch(…) ConvertAll(·, ·) Empty()
|
|
| List | instance |
Count Capacity
|
GetEnumerator() Contains(·) IndexOf(…) ToList() ToArray() ForEach(·) Cast() AsEnumerable() LastIndexOf(·) Find(·) FindLast(·) FindIndex(·) FindLastIndex(·) FindAll(·) Exists(·) TrueForAll(·) ConvertAll(·) CopyTo(…) BinarySearch(…) Where(·) Select(·) SelectMany(·) Any(…) All(·) Count(…) Sum(…) Min(…) Max(…) MinBy(·) MaxBy(·) First(…) FirstOrDefault(…) Last(…) LastOrDefault(…) Single(…) ElementAt(·) ElementAtOrDefault(·) OrderBy(…) OrderByDescending(…) Order() ThenBy(·) ThenByDescending(·) OrderDescending() Skip(·) Take(·) SkipWhile(·) TakeWhile(·) Distinct() DistinctBy(·) Aggregate(…) SequenceEqual(·) Concat(·) Append(·) Zip(…) Chunk(·) ToDictionary(…) GroupBy(·) Average(…) Add(·) Insert(·, ·) Remove(·) RemoveAt(·) Clear() AddRange(·) InsertRange(·, ·) RemoveRange(·, ·) RemoveAll(·) Sort(…) Reverse(…) GetRange(·, ·) TrimExcess() AsReadOnly()
|
plus every LINQ operator below |
| Enumerable | static | — |
Range(·, ·) Repeat(·, ·) Empty()
|
|
| Dictionary<K,V> | instance |
Count Keys Values
|
Add(·, ·) TryAdd(·, ·) ContainsKey(·) TryGetValue(·, ·) ContainsValue(·) Remove(·) Clear() GetValueOrDefault(…) GetEnumerator() ToList() ToArray() ForEach(·)
|
MCS_ENABLE_DICT; insertion-ordered; plus the LINQ operators below |
| HashSet | instance | Count |
Add(·) Remove(·) Contains(·) Clear() UnionWith(·) IntersectWith(·) ExceptWith(·) IsSubsetOf(·) Overlaps(·) IsSupersetOf(·) SetEquals(·) SymmetricExceptWith(·) ToList() ToArray() GetEnumerator()
|
plus the LINQ operators below |
| Stack | instance | Count |
Push(·) Pop() Peek() TryPop(·) TryPeek(·) Clear() Contains(·) ToArray() GetEnumerator()
|
|
| Queue | instance | Count |
Enqueue(·) Dequeue() Peek() TryDequeue(·) TryPeek(·) Clear() Contains(·) ToArray() GetEnumerator()
|
|
| Dictionary / HashSet / Stack / Queue | instance | — |
Where(·) Select(·) SelectMany(·) Any(…) All(·) Count(…) Sum(…) Min(…) Max(…) MinBy(·) MaxBy(·) First(…) FirstOrDefault(…) Last(…) LastOrDefault(…) Single(…) ElementAt(·) ElementAtOrDefault(·) OrderBy(…) OrderByDescending(…) Order() OrderDescending() Skip(·) Take(·) SkipWhile(·) TakeWhile(·) Distinct() DistinctBy(·) Aggregate(…) SequenceEqual(·) Concat(·) Append(·) Zip(…) Chunk(·) ToDictionary(…) GroupBy(·) Average(…)
|
LINQ operators, run on a snapshot (dictionaries yield KeyValuePairs); MCS_ENABLE_LINQ
|
LINQ operators are eager: each returns a new List<T> (or a scalar) immediately.
They are available directly on arrays, List<T>, Dictionary, HashSet, Stack, Queue and
the results of other operators. Building with MCS_ENABLE_LINQ=0 removes them (and Enumerable)
to save ~12 KB of flash; List<T> methods such as Find, ForEach, Exists, ConvertAll stay.
| Type | Kind | Properties | Methods | Notes |
|---|---|---|---|---|
| File | static | — |
ReadAllText(·) WriteAllText(·, ·) AppendAllText(·, ·) ReadAllLines(·) WriteAllLines(·, ·) AppendAllLines(·, ·) ReadAllBytes(·) WriteAllBytes(·, ·) Exists(·) Delete(·) Copy(…) Move(·, ·) GetLength(·)
|
mcs_fs_open_lib |
| Directory | static | — |
Exists(·) CreateDirectory(·) GetFiles(·) GetDirectories(·) GetFileSystemEntries(·) Delete(…) GetCurrentDirectory()
|
|
| Path | static | — |
Combine(…) GetFileName(·) GetExtension(·) GetFileNameWithoutExtension(·) GetDirectoryName(·) GetFullPath(·)
|
|
| DriveInfo | instance |
Name TotalSize TotalFreeSpace AvailableFreeSpace DriveFormat IsReady
|
ToString() |
new DriveInfo(path); size of the mount holding path
|
| DriveInfo | static | — | GetDrives() |
| Type | Kind | Properties | Methods | Notes |
|---|---|---|---|---|
| Hal | static |
Board Micros UniqueId CpuHz DroppedEvents
|
Has(·) Poll() Run(…) DelayMicroseconds(·) Reset() OnEvent(·, ·) Post(…) Options(…)
|
consts Board, ApiVersion
|
| GPIO | static | — |
Configure(·, ·) Mode(·, ·) Write(·, ·) Read(·) Toggle(·) Pin(·) OnChange(·, ·, ·) Off(·) PulseIn(…)
|
consts Input Output InputPullUp InputPullDown OpenDrain Analog Rising Falling Both, PullDefault PullNone PullUp PullDown PullBoth, SpeedDefault SpeedLow SpeedMedium SpeedHigh SpeedVeryHigh; Configure(pin, GpioConfig) (settings) |
| Pin | instance |
Value Number
|
Write(·) Read() Toggle() High() Low() SetMode(·) OnChange(·, ·) Configure(·)
|
new Pin(pin[, mode or GpioConfig]); pin = number or name ("PA5", "GPIO21", "LED") |
| UART | static | — |
Open(…) Close(·) Write(·, ·) WriteLine(…) Read(…) ReadString(…) ReadLine(…) Available(·) OnReceive(·, ·) WriteAsync(·, ·) ReadAsync(·, ·)
|
consts ParityNone ParityOdd ParityEven
|
| I2C | static | — |
Open(…) Write(·, ·, ·) Read(·, ·, ·) WriteRead(·, ·, ·, ·) ReadRegister(·, ·, ·) ReadRegisters(·, ·, ·, ·) WriteRegister(·, ·, ·, ·) Scan(·) WriteAsync(·, ·, ·) ReadAsync(·, ·, ·) WriteReadAsync(·, ·, ·, ·)
|
|
| I2cDevice | instance |
Address Bus
|
Write(·) Read(·) WriteRead(·, ·) ReadRegister(·) ReadRegisters(·, ·) WriteRegister(·, ·) WriteAsync(·) ReadAsync(·) WriteReadAsync(·, ·)
|
new I2cDevice(bus, address) |
| SPI | static | — |
Open(…) Transfer(…) Write(…) Read(…) TransferAsync(…) WriteAsync(…) ReadAsync(…)
|
|
| SpiDevice | instance |
Bus ChipSelect
|
Transfer(…) Write(·) Read(·) WriteRead(·, ·) TransferAsync(·, ·) WriteAsync(·) ReadAsync(·)
|
new SpiDevice(bus, csPin, hz, mode) or (bus, csPin, SpiConfig) — drives CS for you |
| ADC | static |
Resolution ReferenceMillivolts
|
Configure(·, ·) Read(·) ReadMillivolts(·) ReadVoltage(·) ReadAverage(…)
|
consts Resolution, ReferenceMillivolts, AttenDefault Atten0dB Atten2_5dB Atten6dB Atten12dB
|
| DAC | static | Resolution |
Write(·, ·) WriteMillivolts(·, ·)
|
const Resolution
|
| PWM | static | — |
Configure(·, ·) Set(·, ·, ·) SetPermille(·, ·, ·) SetPulse(·, ·, ·) Servo(…) Tone(·, ·) Stop(·)
|
duty for Set is 0.0–1.0 |
| Timer | static | — |
Start(·, ·, ·) Once(·, ·, ·) Stop(·)
|
periods in microseconds |
| I2S | static | — |
Open(…) Write(…) Read(…) WriteSamples(…) ReadSamples(…) Close(·)
|
consts Tx Rx Duplex
|
| QSPI | static | — |
Open(…) Command(…) Read(…) Write(…) Transfer(·, ·, ·, ·, ·, ·, ·, ·, ·) ReadAsync(…) WriteAsync(…)
|
address -1 = no address phase |
| CAN | static | — |
Open(…) Send(…) Receive(…) OnReceive(·, ·)
|
|
| CanFrame | instance |
Id Extended Remote Length Data
|
ToString() |
new CanFrame(id, data[, extended]) |
| Watchdog | static | — |
Start(·) Feed()
|
|
| RTC | static | Now |
Set(·) |
Unix seconds |
| DmaBuffer | instance |
Length Busy
|
Fill(…) CopyFrom(…) ToArray(…) GetString(…) ToString()
|
new DmaBuffer(size or bytes) — DMA-capable memory, indexer buf[i] (DMA) |
| DmaTransfer | instance |
IsCompleted Succeeded Error Result Id
|
Wait(…) OnComplete(·) Cancel()
|
returned by every …Async call |
| Dma | static |
Pending Available Channels Alignment MaxTransfers
|
Copy(…) CopyAsync(…) Fill(…) FillAsync(…) WaitAll(…)
|
memory-to-memory DMA, transfers in flight |
| Type | Kind | Properties | Methods | Notes |
|---|---|---|---|---|
| Drivers | static | List |
Has(·) |
registered device drivers (mcs_driver.h); List = names |
| LedStrip | instance |
Count Pin Brightness
|
GetPixel(·) SetPixel(…) Fill(…) Clear() Show() Dispose()
|
ws2812 driver: new LedStrip(pin, count[, order]) — WS2812/SK6812 on any pin; indexer strip[i]
|
| LedStrip | static | — |
Rgb(…) Hsv(…)
|
consts GRB RGB GRBW; colours 0xRRGGBB
|
| Servo | instance |
Angle Pulse Attached MinPulse MaxPulse MaxAngle Channel
|
Write(·) Read() WritePulse(·) MoveTo(·, ·) Attach() Detach() Stop() Dispose()
|
servo driver: new Servo(channel[, minUs, maxUs[, maxAngle]]) — hobby servo on a PWM channel; MoveTo(angle, ms) eases |
| Type | Kind | Properties | Methods | Notes |
|---|---|---|---|---|
| U8g2 | instance |
BusClock I2CAddress Display Bus Rows Cols Font CursorX CursorY LogRedrawOnNewline LogLineHeightOffset BufferTileWidth BufferTileHeight BufferCurrTileRow BufferSize FullBuffer Ascent Descent MaxCharHeight MaxCharWidth DrawColor Width Height
|
Begin(…) InitDisplay() ClearDisplay() Clear() SetPowerSave(·) Sleep() Wake() SetContrast(·) SetFlipMode(·) RefreshDisplay() SetBusClock(·) SetI2CAddress(·) SetFont(·) SetCursor(·, ·) Home() Print(·) Println(…) UserInterfaceSelectionList(·, ·, ·) UserInterfaceMessage(·, ·, ·, ·) UserInterfaceInputValue(·, ·, ·, ·, ·, ·, ·) GetMenuEvent() SetMenuInput(·) LogBegin(…) Log(·) LogLine(…) DrawLog(·, ·) Dispose() ClearBuffer() SendBuffer() FirstPage() NextPage() Draw(·) UpdateDisplay() UpdateDisplayArea(·, ·, ·, ·) SetAutoPageClear(·) SetDisplayRotation(·) GetBuffer() SetBuffer(·) GetPixel(·, ·) Dump() WriteBufferPBM() WriteBufferXBM() DrawPixel(·, ·) DrawHLine(·, ·, ·) DrawVLine(·, ·, ·) DrawHVLine(·, ·, ·, ·) DrawLine(·, ·, ·, ·) DrawBox(·, ·, ·, ·) DrawFrame(·, ·, ·, ·) DrawRBox(·, ·, ·, ·, ·) DrawRFrame(·, ·, ·, ·, ·) DrawCircle(·, ·, ·) DrawCircle(·, ·, ·, ·) DrawDisc(·, ·, ·) DrawDisc(·, ·, ·, ·) DrawEllipse(·, ·, ·, ·) DrawEllipse(·, ·, ·, ·, ·) DrawFilledEllipse(·, ·, ·, ·) DrawFilledEllipse(·, ·, ·, ·, ·) DrawArc(·, ·, ·, ·, ·) DrawTriangle(·, ·, ·, ·, ·, ·) DrawPolygon(·) DrawXBM(·, ·, ·, ·, ·) DrawXBMP(·, ·, ·, ·, ·) DrawBitmap(·, ·, ·, ·, ·) DrawGlyph(·, ·, ·) DrawGlyphX2(·, ·, ·) DrawStr(·, ·, ·) DrawStrX2(·, ·, ·) DrawUTF8(·, ·, ·) DrawUTF8X2(·, ·, ·) DrawUTF8Lines(·, ·, ·, ·, ·) DrawUTF8Line(·, ·, ·, ·, ·, ·) DrawButtonUTF8(·, ·, ·, ·, ·, ·, ·) DrawButtonFrame(·, ·, ·, ·, ·, ·) GetStrWidth(·) GetUTF8Width(·) GetXOffsetUTF8(·) GetXOffsetGlyph(·) IsGlyph(·) GetGlyphWidth(·) SetFontMode(·) SetFontDirection(·) SetFontPosBaseline() SetFontPosBottom() SetFontPosTop() SetFontPosCenter() SetFontRefHeightAll() SetFontRefHeightExtendedText() SetFontRefHeightText() SetDrawColor(·) SetBitmapMode(·) SetClipWindow(·, ·, ·, ·) SetMaxClipWindow() IsIntersection(·, ·, ·, ·)
|
new U8g2(display[, bus/pins]) — frame-buffer graphics (U8G2.md) |
| U8g2 | static |
Displays Fonts
|
I2C(…) SoftI2C(…) SPI(…) SoftSPI(…) Soft3WireSPI(…) Parallel8080(…) Parallel6800(…) KS0108(…)
|
|
| U8x8 | instance |
BusClock I2CAddress Display Bus Rows Cols Font CursorX CursorY LogRedrawOnNewline LogLineHeightOffset FontWidth FontHeight
|
Begin(…) InitDisplay() ClearDisplay() Clear() SetPowerSave(·) Sleep() Wake() SetContrast(·) SetFlipMode(·) RefreshDisplay() SetBusClock(·) SetI2CAddress(·) SetFont(·) SetCursor(·, ·) Home() Print(·) Println(…) UserInterfaceSelectionList(·, ·, ·) UserInterfaceMessage(·, ·, ·, ·) UserInterfaceInputValue(·, ·, ·, ·, ·, ·, ·) GetMenuEvent() SetMenuInput(·) LogBegin(…) Log(·) LogLine(…) DrawLog(·, ·) Dispose() ClearLine(·) FillDisplay() DrawGlyph(·, ·, ·) Draw1x2Glyph(·, ·, ·) Draw2x2Glyph(·, ·, ·) DrawString(·, ·, ·) DrawUTF8(·, ·, ·) Draw1x2String(·, ·, ·) Draw1x2UTF8(·, ·, ·) Draw2x2String(·, ·, ·) Draw2x2UTF8(·, ·, ·) DrawTile(·, ·, ·, ·) SetInverseFont(·) GetUTF8Len(·)
|
new U8x8(display) — 8×8 text without a frame buffer |
| U8x8 | static |
Displays Fonts
|
I2C(…) SoftI2C(…) SPI(…) SoftSPI(…) Soft3WireSPI(…) Parallel8080(…) Parallel6800(…) KS0108(…)
|
| Type | Kind | Properties | Methods | Notes |
|---|---|---|---|---|
| Net | static | Backend |
Has(·) |
const ApiVersion; Has(feature): Wifi, EspNow, Tls, HttpServer, … (NETWORK.md) |
| Wifi | static |
Mode Status StatusName IsConnected DisconnectReason Ssid Bssid Rssi Auth Channel Ip Netmask Gateway Dns Dns2 Ipv6 Dhcp Mac ApMac Hostname Country AutoReconnect Persistent PowerSave TxPower Protocol ApProtocol Bandwidth MinAuth ListenInterval Band Antenna ApIp ApClientCount SavedSsid
|
Connect(…) Begin(…) ConnectEnterprise(…) Reconnect() WaitConnected(…) Disconnect() Off() ReasonName(…) EventName(·) AuthName(·) SetStaticIp(…) UseDhcp() Scan(…) StartAp(…) StopAp() SetApIp(…) ApClients() Save(…) Forget() Wps(…) SmartConfig(…) OnEvent(·)
|
consts ModeOff ModeStation ModeAccessPoint ModeStationAp, statuses Idle Connecting Connected NoSsid WrongPassword ConnectFailed ConnectionLost Disconnected Stopped, Auth*, Power*, Proto*, Band*, Event*, Reason*
|
| WifiNetwork | instance |
Ssid Bssid Rssi Channel Auth AuthName Secure Hidden Protocols Quality
|
ToString() |
returned by Wifi.Scan()
|
| WifiClient | instance |
Mac Rssi Ip
|
ToString() |
returned by Wifi.ApClients()
|
| EspNow | static | Peers |
Start() Stop() AddPeer(…) RemovePeer(·) SetPmk(·) Send(…) Broadcast(·) Receive(…) OnReceive(·)
|
const MaxData; MACs as "24:0A:C4:12:34:56"
|
| EspNowMessage | instance |
Mac Data Text Rssi Length
|
ToString() |
returned by EspNow.Receive()
|
| Ntp | static |
Synced Time LocalTime UtcTime Timezone UtcOffset
|
Start(…) Sync(…)
|
SNTP; Timezone = POSIX TZ string |
| Mdns | static | — |
Start(…) Stop() AddService(…) RemoveService(·, ·) Resolve(…)
|
ESP32 with the espressif/mdns component |
| Ping | static | — | Send(…) |
round trip in ms, -1 = no answer |
| TcpClient | instance |
Available Connected Timeout NoDelay KeepAlive RemoteAddress RemotePort LocalAddress LocalPort IsTls
|
Connect(…) ConnectTls(…) Write(·) WriteLine(…) Flush() Read(…) ReadString(…) ReadByte() ReadLine() ReadToEnd() Close() Dispose()
|
new TcpClient() or (host, port[, timeoutMs])
|
| TcpListener | instance |
LocalPort Active
|
Start(…) Stop() Pending() AcceptTcpClient(…) Accept(…) Dispose()
|
new TcpListener(port) or (address, port)
|
| UdpClient | instance |
RemoteAddress RemotePort LocalPort Available EnableBroadcast Timeout
|
Connect(·, ·) Send(…) Receive(…) ReceiveString(…) JoinMulticastGroup(·) DropMulticastGroup(·) Close() Dispose()
|
new UdpClient([port]) |
| Dns | static | HostName |
Resolve(·) GetHostAddresses(·)
|
|
| Http | static |
Timeout UserAgent FollowRedirects
|
Get(…) Head(…) Delete(…) Post(…) Put(…) Patch(…) Request(…) GetString(…) Download(…) UrlEncode(·)
|
headers: Dictionary<string, string>, "Name: value" lines or string[]
|
| HttpResponse | instance |
StatusCode Reason IsSuccess Body Bytes ContentLength ContentType Url Headers
|
Header(·) EnsureSuccess() ToString()
|
returned by every Http request |
| HttpServer | instance |
WebSockets Port Running Requests Cors
|
On(…) Get(·, ·) Post(·, ·) Put(·, ·) Delete(·, ·) Patch(·, ·) NotFound(·) WebSocket(…) ServeFiles(·, ·) Start() Stop() Dispose() Poll(…) Run() Broadcast(·)
|
new HttpServer([port]) or (address, port); handlers return a string (HTML), byte[] or an object (JSON) |
| HttpRequest | instance |
Method Path Query Url Body Bytes Json ContentType ContentLength Headers Host RemoteAddress Sent Status
|
Header(·) Param(…) HasParam(·) Send(…) SendJson(…) SendStatus(·) SendFile(…) Redirect(…) SetHeader(·, ·) Authenticate(…) ToString()
|
passed to every HttpServer route |
| WebSocket | instance |
IsOpen State CloseStatus CloseReason Id Path Url RemoteAddress Timeout IsTls
|
Connect(…) Send(·) SendText(·) SendBinary(·) Ping(…) Receive(…) Close(…) Dispose() OnMessage(·) Poll(…) ToString()
|
new WebSocket([url[, timeoutMs]]) client, or a server-side connection from HttpServer.WebSocket
|
| DnsServer | instance |
Running Queries Ttl Domain Address Port
|
Start(…) Stop() Dispose() Poll()
|
new DnsServer([address]) — captive portals |
| Type | Kind | Properties | Methods | Notes |
|---|---|---|---|---|
| Ble | static |
Enabled OptionNames ScanInterval ScanWindow Backend Name Address AddressType TxPower Mtu Appearance IoCapability Bonding Mitm SecureConnections Phy Passkey MaxConnections Timeout AutoAdvertise DroppedEvents Advertising Scanning Services Connections Connected Bonds
|
Enable() Disable() Reset() CanReadOption(·) CanSetOption(·) Has(·) StartAdvertising(…) StopAdvertising() Scan(…) StartScan(…) StopScan() AddService(·) ClearServices() Connect(…) OnConnect(·) OnDisconnect(·) OnEvent(·) OnPasskey(·) Poll() EventName(·) RemoveBond(·) ClearBonds()
|
opt-in (MCS_ENABLE_BLE); Has(feature), Event*, Io*, Passkey*, Phy* consts (BLE.md) |
| BleAdvertisement | instance |
Name Connectable Interval Duration IncludeTxPower Appearance Flags Raw ScanResponse
|
AddServiceUuid(·) SetManufacturerData(·, ·) AddServiceData(·, ·) Build() BuildScanResponse()
|
new BleAdvertisement([name]) — advertising data |
| BleAdvertisement | static | — |
IBeacon(…) EddystoneUrl(…) EddystoneUid(…)
|
beacon presets |
| BleDevice | instance |
Address AddressType Name Rssi Connectable TxPower Appearance Flags ServiceUuids ManufacturerData CompanyId Data ScanResponse IsIBeacon BeaconUuid BeaconMajor BeaconMinor BeaconPower EddystoneUrl
|
HasService(·) ServiceData(·) Connect(…) ToString()
|
returned by Ble.Scan / Ble.StartScan
|
| BleService | instance |
Uuid Primary Handle Characteristics
|
AddCharacteristic(…) ToString()
|
new BleService(uuid[, primary]) — local GATT service |
| BleCharacteristic | instance |
Uuid Properties Handle MaxLength Value StringValue Subscribers Description
|
SetValue(·) Notify(…) Indicate(…) OnWrite(·) OnSubscribe(·) AddDescriptor(…) ToString()
|
returned by BleService.AddCharacteristic; BleProperty.* flags |
| BleDescriptor | instance |
Uuid Handle Value StringValue
|
OnWrite(·) |
returned by BleCharacteristic.AddDescriptor
|
| BleConnection | instance |
Handle Address AddressType Role Connected Mtu Rssi Encrypted Authenticated Bonded Interval Latency SupervisionTimeout
|
Disconnect() Pair() RequestMtu() UpdateParameters(·, ·, ·, ·) Services() Service(·) Characteristic(·, ·) ToString()
|
a link in either role (Ble.Connect, Ble.OnConnect) |
| BleRemoteService | instance |
Uuid Name Handle EndHandle
|
Characteristics() Characteristic(·) ToString()
|
GATT client: BleConnection.Services()
|
| BleRemoteCharacteristic | instance |
Uuid Name Handle Properties CanRead CanWrite CanNotify CanIndicate
|
Read() ReadString() Write(…) Subscribe(…) Unsubscribe() Descriptors() ToString()
|
GATT client |
| BleRemoteDescriptor | instance |
Uuid Name Handle
|
Read() Write(·) ToString()
|
GATT client |
| BleUart | instance |
Available Connected
|
Write(·) WriteLine(…) Read() ReadString() ReadLine() OnReceive(·) Start(…)
|
new BleUart([name]) — Nordic UART Service |
| BleUuid | static | — |
Normalize(·) ToLong(·) Equals(·, ·) IsValid(·) Name(·)
|
UUID helpers |
| Type | Kind | Properties | Methods | Notes |
|---|---|---|---|---|
| Worker | instance |
IsAlive Id Core Runs State Error Result
|
Join(…) Stop()
|
returned by Thread.Run / RunOn / Every (THREADS.md) |
| Channel | instance |
Count Capacity Name
|
Send(…) TrySend(·) Receive(…) TryReceive()
|
new Channel(name[, capacity]) — messages between threads |
| Type | Kind | Properties | Methods | Notes |
|---|---|---|---|---|
| Scheduler | static | Count |
Every(…) After(…) Cancel(·) CancelAll()
|
mcs_sched_open_lib |
Exception classes (members Message, InnerException, ToString(); user classes can derive
from any of them; deep recursion raises a catchable StackOverflowException):
ArgumentException ArgumentNullException ArgumentOutOfRangeException ArithmeticException DirectoryNotFoundException DivideByZeroException Exception FileNotFoundException FormatException HttpRequestException IOException IndexOutOfRangeException InvalidCastException InvalidOperationException KeyNotFoundException MissingMemberException NotImplementedException NotSupportedException NullReferenceException ObjectDisposedException OutOfMemoryException OverflowException SocketException StackOverflowException SystemException TimeoutException UnauthorizedAccessException WebSocketException
Enums: StringSplitOptions (None, RemoveEmptyEntries, TrimEntries), StringComparison
(Ordinal, OrdinalIgnoreCase, CurrentCulture, CurrentCultureIgnoreCase, InvariantCulture,
InvariantCultureIgnoreCase; culture variants compare ordinally). A trailing StringComparison is honored by
IndexOf LastIndexOf Contains StartsWith EndsWith Replace Equals and string.Equals / string.Compare;
its values are tagged ints, so IndexOf(s, StringComparison.Ordinal) is never taken for a start index.
1319 members in 109 tables.
Generated from the MicroCS repository - edit the files there, not in the wiki.
Start here
Step-by-step guides
- Guides
- Guide PC Simulator
- Guide ESP32
- Guide ESP32 C3 OLED
- Guide Raspberry Pi Pico
- Guide STM32
- Guide Arduino
- Guide Zephyr
- Guide Peripheral Settings
- Guide DMA
Hardware
- Hardware API
- Peripheral Configuration
- DMA
- Device Drivers
- Wi Fi and Networking
- U8g2 Displays
- Filesystem
- Threads
- Scheduler
Ports
- Porting and Build Systems
- Port ESP32
- Port RP2040 RP2350
- Port STM32
- Port STM32 Firmware
- Port Zephyr
- Port Arduino
C# and the runtime
Embedding and tuning
Internals
Project