forked from nanoframework/nanoFramework.IoT.Device
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BusAdapter.cs
34 lines (30 loc) · 1.13 KB
/
BusAdapter.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Device.Gpio;
namespace Iot.Device.Mcp23xxx
{
public abstract partial class Mcp23xxx
{
/// <summary>
/// Bus adapter
/// </summary>
protected abstract class BusAdapter : IDisposable
{
/// <summary>
/// Reads bytes from the device register
/// </summary>
/// <param name="registerAddress">Register address</param>
/// <param name="buffer">Bytes to be read from the register</param>
public abstract void Read(byte registerAddress, SpanByte buffer);
/// <summary>
/// Writes bytes to the device register
/// </summary>
/// <param name="registerAddress">Register address</param>
/// <param name="data">Bytes to be written to the register</param>
public abstract void Write(byte registerAddress, SpanByte data);
/// <inheritdoc/>
public abstract void Dispose();
}
}
}