-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Currently suports device mode only, not host - Adds example CDC app for samg55_xplained_pro board
- Loading branch information
Showing
11 changed files
with
180 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include <modm/board.hpp> | ||
#include <modm/platform.hpp> | ||
|
||
using namespace modm::platform; | ||
|
||
int main() { | ||
Board::initialize(); | ||
|
||
// Pull DP low briefly on reset to make sure USB host disconnects/reconnects | ||
MATRIX->CCFG_SYSIO |= (CCFG_SYSIO_SYSIO11 | CCFG_SYSIO_SYSIO10); | ||
GpioA22::setOutput(false); | ||
modm::delay_ms(5); | ||
GpioA22::setInput(); | ||
|
||
Board::initializeUsbFs(); | ||
|
||
tusb_init(); | ||
|
||
while (true) | ||
{ | ||
// Read any received data and echo it back | ||
uint8_t buf[64]; | ||
uint32_t read_count; | ||
tud_task(); | ||
read_count = UsbUart0::read(buf, sizeof(buf)); | ||
UsbUart0::write(buf, read_count); | ||
Board::Led::toggle(); | ||
} | ||
} |
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,13 @@ | ||
<library> | ||
<extends>modm:samg55-xplained-pro</extends> | ||
<options> | ||
<option name="modm:build:project.name">samg-demo</option> | ||
<option name="modm:tinyusb:config">device.cdc</option> | ||
<option name="modm:build:build.path">../../../build/samg55_xplained_pro/usbserial</option> | ||
</options> | ||
<modules> | ||
|
||
<module>modm:tinyusb</module> | ||
<module>modm:build:scons</module> | ||
</modules> | ||
</library> |
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
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