-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from OrangeFox86/29-expose-raw-maple-bus-commu…
…nication-to-usb-cdc-serial-device 29 expose raw maple bus communication to usb cdc serial device
- Loading branch information
Showing
22 changed files
with
575 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#pragma once | ||
|
||
#include <stdint.h> | ||
#include <vector> | ||
#include <memory> | ||
|
||
#include "hal/System/MutexInterface.hpp" | ||
|
||
// Command structure: [whitespace]<command-char>[command]<\n> | ||
|
||
//! Command parser for processing commands from a TTY stream | ||
class CommandParser | ||
{ | ||
public: | ||
virtual ~CommandParser() {} | ||
|
||
//! @returns the string of command characters this parser handles | ||
virtual const char* getCommandChars() = 0; | ||
|
||
//! Called when newline reached; submit command and reset | ||
virtual void submit(const char* chars, uint32_t len) = 0; | ||
|
||
//! Prints help message for this command | ||
virtual void printHelp() = 0; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
#include <stdint.h> | ||
#include "hal/Usb/CommandParser.hpp" | ||
#include "hal/System/MutexInterface.hpp" | ||
|
||
//! Command parser for processing commands from a TTY stream | ||
class TtyParser | ||
{ | ||
public: | ||
//! Virtual destructor | ||
virtual ~TtyParser() {} | ||
//! Adds a command parser to my list of parsers - must be done before any other function called | ||
virtual void addCommandParser(std::shared_ptr<CommandParser> parser) = 0; | ||
//! Called from the process handling maple bus execution | ||
virtual void process() = 0; | ||
}; | ||
|
||
TtyParser* usb_cdc_create_parser(MutexInterface* m, char helpChar); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.