// I/O Resources available from a BeaglePlay Remote I/O Server
// Copyright (C)2025, Philip Munts dba Munts Technologies.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
namespace IO.Objects.RemoteIO.Platforms
{
///
/// I/O resources (channel numbers) available on a BeaglePlay running
/// Remote I/O Protocol Server.
///
public static class BeaglePlay
{
///
/// GPIO channel number for the BeaglePlay user LED.
///
/// This GPIO pin cannot be configured as an input.
///
/// USERLED and LED_USER0 refer to the same LED.
///
///
public const int USERLED = 0;
///
/// GPIO channel number for the BeaglePlay LED USR0.
///
/// This GPIO pin cannot be configured as an input.
///
/// LED_USER0 and USERLED refer to the same LED.
///
///
public const int LED_USR0 = 0;
///
/// GPIO channel number for the BeaglePlay LED USR1.
///
/// This GPIO pin cannot be configured as an input.
///
///
public const int LED_USR1 = 1;
///
/// GPIO channel number for the BeaglePlay LED USR2.
///
/// This GPIO pin cannot be configured as an input.
///
///
public const int LED_USR2 = 2;
///
/// GPIO channel number for the BeaglePlay LED USR3.
///
/// This GPIO pin cannot be configured as an input.
///
///
public const int LED_USR3 = 3;
///
/// GPIO channel number for the BeaglePlay LED USR4.
///
/// This GPIO pin cannot be configured as an input.
///
///
public const int LED_USR4 = 4;
///
/// GPIO channel number for the BeaglePlay user button.
///
/// This GPIO pin cannot be configured as an output.
///
///
public const int USERBUTTON = 5;
///
/// GPIO channel number for the BeaglePlay mikroBUS socket
/// AN pin.
///
public const int AN = 6;
///
/// GPIO channel number for the BeaglePlay mikroBUS socket
/// RST pin.
///
public const int RST = 7;
///
/// GPIO channel number for the BeaglePlay mikroBUS socket
/// CS pin.
///
/// This GPIO pin cannot be configured unless the BeaglePlay
/// has had either the mikrobus-gpio.dtbo or the
/// mikrobus-spi-gpio.dtbo device tree overlay applied.
///
///
public const int CS = 8;
///
/// GPIO channel number for the BeaglePlay mikroBUS socket
/// SCK pin.
///
/// This GPIO pin cannot be configured unless the BeaglePlay
/// has had either the mikrobus-gpio.dtbo or the
/// mikrobus-spi-gpio.dtbo device tree overlay applied.
///
///
public const int SCK = 9;
///
/// GPIO channel number for the BeaglePlay mikroBUS socket
/// MISO pin.
///
/// This GPIO pin cannot be configured unless the BeaglePlay
/// has had either the mikrobus-gpio.dtbo or the
/// mikrobus-spi-gpio.dtbo device tree overlay applied.
///
///
public const int MISO = 10;
///
/// GPIO channel number for the BeaglePlay mikroBUS socket
/// MOSI pin.
///
/// This GPIO pin cannot be configured unless the BeaglePlay
/// has had either the mikrobus-gpio.dtbo or the
/// mikrobus-spi-gpio.dtbo device tree overlay applied.
///
///
public const int MOSI = 11;
///
/// GPIO channel number for the BeaglePlay mikroBUS socket
/// PWM pin.
///
/// This GPIO pin cannot be configured unless the BeaglePlay
/// has had either the mikrobus-gpio.dtbo or the
/// mikrobus-pwm-gpio.dtbo device tree overlay applied.
///
///
public const int PWM = 12;
///
/// GPIO channel number for the BeaglePlay mikroBUS socket
/// INT pin.
///
public const int INT = 13;
///
/// GPIO channel number for the BeaglePlay mikroBUS socket
/// RX pin.
///
/// This GPIO pin cannot be configured unless the BeaglePlay
/// has had either the mikrobus-gpio.dtbo or the
/// mikrobus-uart-gpio.dtbo device tree overlay applied.
///
///
public const int RX = 14;
///
/// GPIO channel number for the BeaglePlay mikroBUS socket
/// TX pin.
///
/// This GPIO pin cannot be configured unless the BeaglePlay
/// has had either the mikrobus-gpio.dtbo or the
/// mikrobus-uart-gpio.dtbo device tree overlay applied.
///
///
public const int TX = 15;
///
/// GPIO channel number for the BeaglePlay mikroBUS socket
/// SCL pin.
///
/// This GPIO pin cannot be configured unless the BeaglePlay
/// has had either the mikrobus-gpio.dtbo or the
/// mikrobus-i2c-gpio.dtbo device tree overlay applied.
///
///
public const int SCL = 16;
///
/// GPIO channel number for the BeaglePlay mikroBUS socket
/// SDA pin.
///
/// This GPIO pin cannot be configured unless the BeaglePlay
/// has had either the mikrobus-gpio.dtbo or the
/// mikrobus-i2c-gpio.dtbo device tree overlay applied.
///
///
public const int SDA = 17;
///
/// GPIO channel number for the BeaglePlay Grove socket
/// D0 pin.
///
/// This GPIO pin cannot be configured unless the BeaglePlay
/// has had either the grove-gpio.dtbo or the
/// grove-motor3.dtbo device tree overlay applied.
///
///
public const int D0 = 18;
///
/// GPIO channel number for the BeaglePlay mikroBUS socket
/// D1 pin.
///
/// This GPIO pin cannot be configured unless the BeaglePlay
/// has had either the grove-gpio.dtbo or the
/// grove-motor1.dtbo device tree overlay applied.
///
///
public const int D1 = 19;
///
/// I2C bus channel number for the Grove socket.
///
public const int I2C_GROVE = 0;
///
/// I2C bus channel number for the mikroBUS socket.
///
public const int I2C_MIKROBUS = 1;
///
/// I2C bus channel number for the QWIIC socket.
///
public const int I2C_QWIIC = 2;
///
/// PWM output channel number for the mikroBUS socket.
///
public const int PWM_MIKROBUS = 0;
///
/// PWM output channel number for the Grove socket pin D0.
///
/// This PWM output cannot be configured unless the BeaglePlay
/// has had either the grove-motor1.dtbo or the
/// grove-motor2.dtbo device tree overlay applied.
///
///
public const int PWM_GROVE_D0 = 1;
///
/// PWM output channel number for the Grove socket pin D1.
///
/// This PWM output cannot be configured unless the BeaglePlay
/// has had either the grove-motor2.dtbo or the
/// grove-motor3.dtbo device tree overlay applied.
///
///
public const int PWM_GROVE_D1 = 2;
///
/// SPI slave device channel number for the Grove socket.
///
public const int SPI_MIKROBUS = 0;
}
}