// @generated by protoc-gen-es v2.12.0 with parameter "target=ts"
// @generated from file meshtastic/serial_hal.proto (package meshtastic, syntax proto3)
/* eslint-disable */

import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
import type { Message } from "@bufbuild/protobuf";

/**
 * Describes the file meshtastic/serial_hal.proto.
 */
export const file_meshtastic_serial_hal: GenFile = /*@__PURE__*/
  fileDesc("ChttZXNodGFzdGljL3NlcmlhbF9oYWwucHJvdG8SCm1lc2h0YXN0aWMiogIKEFNlcmlhbEhhbENvbW1hbmQSFgoOdHJhbnNhY3Rpb25faWQYASABKA0SLwoEdHlwZRgCIAEoDjIhLm1lc2h0YXN0aWMuU2VyaWFsSGFsQ29tbWFuZC5UeXBlEgsKA3BpbhgDIAEoDRINCgV2YWx1ZRgEIAEoDRIMCgRtb2RlGAUgASgNEgwKBGRhdGEYBiABKAwijAEKBFR5cGUSCQoFVU5TRVQQABIMCghQSU5fTU9ERRABEhEKDURJR0lUQUxfV1JJVEUQAhIQCgxESUdJVEFMX1JFQUQQAxIUChBBVFRBQ0hfSU5URVJSVVBUEAQSFAoQREVUQUNIX0lOVEVSUlVQVBAFEhAKDFNQSV9UUkFOU0ZFUhAGEggKBE5PT1AQByLMAQoRU2VyaWFsSGFsUmVzcG9uc2USFgoOdHJhbnNhY3Rpb25faWQYASABKA0SNAoGcmVzdWx0GAIgASgOMiQubWVzaHRhc3RpYy5TZXJpYWxIYWxSZXNwb25zZS5SZXN1bHQSDQoFdmFsdWUYAyABKA0SDAoEZGF0YRgEIAEoDBINCgVlcnJvchgFIAEoCSI9CgZSZXN1bHQSBgoCT0sQABIJCgVFUlJPUhABEg8KC0JBRF9SRVFVRVNUEAISDwoLVU5TVVBQT1JURUQQA0JfChRvcmcubWVzaHRhc3RpYy5wcm90b0IJU2VyaWFsSGFsWiJnaXRodWIuY29tL21lc2h0YXN0aWMvZ28vZ2VuZXJhdGVkqgIUTWVzaHRhc3RpYy5Qcm90b2J1ZnO6AgBiBnByb3RvMw");

/**
 * @generated from message meshtastic.SerialHalCommand
 */
export type SerialHalCommand = Message<"meshtastic.SerialHalCommand"> & {
  /**
   * Host-assigned request id. Replies echo this id back in
   * SerialHalResponse.transaction_id.
   *
   * @generated from field: uint32 transaction_id = 1;
   */
  transactionId: number;

  /**
   * @generated from field: meshtastic.SerialHalCommand.Type type = 2;
   */
  type: SerialHalCommand_Type;

  /**
   * @generated from field: uint32 pin = 3;
   */
  pin: number;

  /**
   * @generated from field: uint32 value = 4;
   */
  value: number;

  /**
   * @generated from field: uint32 mode = 5;
   */
  mode: number;

  /**
   * @generated from field: bytes data = 6;
   */
  data: Uint8Array;
};

/**
 * Describes the message meshtastic.SerialHalCommand.
 * Use `create(SerialHalCommandSchema)` to create a new message.
 */
export const SerialHalCommandSchema: GenMessage<SerialHalCommand> = /*@__PURE__*/
  messageDesc(file_meshtastic_serial_hal, 0);

/**
 * @generated from enum meshtastic.SerialHalCommand.Type
 */
export enum SerialHalCommand_Type {
  /**
   * @generated from enum value: UNSET = 0;
   */
  UNSET = 0,

  /**
   * @generated from enum value: PIN_MODE = 1;
   */
  PIN_MODE = 1,

  /**
   * @generated from enum value: DIGITAL_WRITE = 2;
   */
  DIGITAL_WRITE = 2,

  /**
   * @generated from enum value: DIGITAL_READ = 3;
   */
  DIGITAL_READ = 3,

  /**
   * @generated from enum value: ATTACH_INTERRUPT = 4;
   */
  ATTACH_INTERRUPT = 4,

  /**
   * @generated from enum value: DETACH_INTERRUPT = 5;
   */
  DETACH_INTERRUPT = 5,

  /**
   * @generated from enum value: SPI_TRANSFER = 6;
   */
  SPI_TRANSFER = 6,

  /**
   * @generated from enum value: NOOP = 7;
   */
  NOOP = 7,
}

/**
 * Describes the enum meshtastic.SerialHalCommand.Type.
 */
export const SerialHalCommand_TypeSchema: GenEnum<SerialHalCommand_Type> = /*@__PURE__*/
  enumDesc(file_meshtastic_serial_hal, 0, 0);

/**
 * @generated from message meshtastic.SerialHalResponse
 */
export type SerialHalResponse = Message<"meshtastic.SerialHalResponse"> & {
  /**
   * Matches the originating SerialHalCommand.transaction_id for normal
   * request/response traffic.
   *
   * A value of 0 indicates an unsolicited interrupt notification generated by
   * the device. In that case, the host should interpret value as the GPIO pin
   * that triggered.
   *
   * @generated from field: uint32 transaction_id = 1;
   */
  transactionId: number;

  /**
   * @generated from field: meshtastic.SerialHalResponse.Result result = 2;
   */
  result: SerialHalResponse_Result;

  /**
   * Used by DIGITAL_READ replies and interrupt notifications. For interrupt
   * notifications (transaction_id == 0), this carries the pin number.
   *
   * @generated from field: uint32 value = 3;
   */
  value: number;

  /**
   * @generated from field: bytes data = 4;
   */
  data: Uint8Array;

  /**
   * @generated from field: string error = 5;
   */
  error: string;
};

/**
 * Describes the message meshtastic.SerialHalResponse.
 * Use `create(SerialHalResponseSchema)` to create a new message.
 */
export const SerialHalResponseSchema: GenMessage<SerialHalResponse> = /*@__PURE__*/
  messageDesc(file_meshtastic_serial_hal, 1);

/**
 * @generated from enum meshtastic.SerialHalResponse.Result
 */
export enum SerialHalResponse_Result {
  /**
   * @generated from enum value: OK = 0;
   */
  OK = 0,

  /**
   * @generated from enum value: ERROR = 1;
   */
  ERROR = 1,

  /**
   * @generated from enum value: BAD_REQUEST = 2;
   */
  BAD_REQUEST = 2,

  /**
   * @generated from enum value: UNSUPPORTED = 3;
   */
  UNSUPPORTED = 3,
}

/**
 * Describes the enum meshtastic.SerialHalResponse.Result.
 */
export const SerialHalResponse_ResultSchema: GenEnum<SerialHalResponse_Result> = /*@__PURE__*/
  enumDesc(file_meshtastic_serial_hal, 1, 0);

