Skip to content

Instantly share code, notes, and snippets.

View joperezr's full-sized avatar
🏠
Working from home

Jose Perez Rodriguez joperezr

🏠
Working from home
  • Microsoft
  • Seattle, WA.
  • 14:57 (UTC -08:00)
View GitHub Profile
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeFrameworkVersion>$(_RuntimeFrameworkVersion)</RuntimeFrameworkVersion>
<CoreFxPackageVersion>4.4.0-$(CoreFxExpectedPrerelease)</CoreFxPackageVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<OutputType>Exe</OutputType>
</PropertyGroup>
@joperezr
joperezr / System.Device.Gpio.Proposal.md
Last active October 2, 2018 16:36
System.Device.Gpio API Proposal

System.Device.Gpio Proposal

The goal of this API is to allow .Net Core developers to access General Purpose IO (GPIO) pins of IoT devices like Raspberry Pi, Hummingboard, or Odroid. This will allow applications to read and write data from/to sensors, leds and other kind of peripherals connected to those pins. This API should also support most commonly used serial communication protocols like SPI and I2C.

Rationale and Usage

API Design Goals

  • Extensible to many different kinds of IoT devices
  • Multiplatform (Linux and Windows OS)
@joperezr
joperezr / System.Device.Gpio.cs
Last active October 2, 2018 17:35
Full System.Device.Gpio proposal
using System.Collections.Generic;
namespace System.Device.Gpio
{
public enum PinNumberingScheme
{
/// <summary>
/// Board numbering based on the physical location of the board.
/// </summary>
Board = 0,
@joperezr
joperezr / System.Device.Gpio.Proposal2.md
Last active October 19, 2018 16:55
Api Proposal for System.Device.Gpio Round 2

System.Device.Gpio Proposal

The goal of this API is to allow .Net Core developers to access General Purpose IO (GPIO) pins of IoT devices like Raspberry Pi, Hummingboard, or Odroid. This will allow applications to read and write data from/to sensors, leds and other kind of peripherals connected to those pins. This API should also support most commonly used serial communication protocols like SPI and I2C.

Namespaces

  • System.Device.Gpio: Will contain the types that allow access to the GPIO pins in order to opening and closing pins, reading and writing values to them, and subscribing for event notifications.
  • System.Device.Pwm : Will contain the types that allow access to PWM (Pulse Width Modulation). This will allow developers to send square waves over a pin in order to simulate analog values from digital outputs.
  • System.Device.I2c : Will contain the types that allow developers to communicate with devices that use the I2C protocol to transfer data.
  • System.Device.Spi : Will contain the type
using System.Collections.Generic;
using System.Device.Gpio;
using System.Threading;
using System.Threading.Tasks;
namespace System.Device.Gpio
{
#region Enums And Structs
public enum PinNumberingScheme
{
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Buffers.Binary;
using System.Device.Gpio;
using System.Device.I2c;
using System.Device.I2c.Drivers;
using System.Device.Spi;
@joperezr
joperezr / Notes.md
Last active July 8, 2019 17:41
Katarzyna's Notes on Json

Some reflections & questions

  • Why in MetadataDb there's a byte array instead od Memory / Span?

    • overhead? --> Memory is supposed to be more efficient
    • limited space on stack? --> it's Memory not Span
  • What does the new API have from what Json.NET API has?

    • Json Schema Validation - it is paid in Json.NET?
  • other important features:

@joperezr
joperezr / DotNetLinks.md
Created November 1, 2019 20:02 — forked from karelz/DotNetLinks.md
Links about .NET for conferences and customer discussions
@joperezr
joperezr / EventHub.cs
Created November 11, 2019 17:21
Structured Streaming from Azure EventHub using .NET for Apache Spark
using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Sample
{
public class EventHubPosition
{
public string Offset { get; set; }
@joperezr
joperezr / RegexBackground.md
Last active February 9, 2022 21:06
Small Background about Regex

Brief Background on the inners of Regex

Contrary to the obvious, Regex type itself doesn't know how to match a pattern with a given input. But it does have a factory which aids in producing objects which do know how to do this.

namespace System.Text.RegularExpressions
{
  public class Regex
  {
 protected internal RegexRunnerFactory factory;