BlueSCSI_console.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * Copyright (C) 2024 Eric Helgeson
  3. *
  4. * This file is part of BlueSCSI
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  18. **/
  19. #ifndef BLUESCSI_CONSOLE_H
  20. #define BLUESCSI_CONSOLE_H
  21. #include <cctype>
  22. #include "BlueSCSI_console.h"
  23. #include "hardware/watchdog.h"
  24. #include "pico/bootrom.h"
  25. #include "BlueSCSI_log.h"
  26. #include "BlueSCSI.h"
  27. #include "BlueSCSI_initiator.h"
  28. #include "stdint.h"
  29. #include <assert.h>
  30. #ifndef __MBED__
  31. # include <Adafruit_TinyUSB.h>
  32. # include <class/cdc/cdc_device.h>
  33. #endif
  34. #define PICO_REBOOT_MAGIC 0x5eeded
  35. #define MAX_CBD_LEN 10
  36. #define NULL_CHAR_LEN 1
  37. #define DISABLE_CHAR '#'
  38. #define MAX_SERIAL_INPUT_CHARS ((MAX_CBD_LEN * 2) + NULL_CHAR_LEN)
  39. #define RESPONSE_BUFFER_LEN 4096
  40. void handleUsbInputTargetMode(int32_t data);
  41. void handleUsbInputInitiatorMode();
  42. void initiatorConsoleLoop();
  43. void serialPoll();
  44. int hexToBytes(const char *hex_string, uint8_t *bytes_array, size_t max_length);
  45. #endif //BLUESCSI_CONSOLE_H