Usb serial (#1648)

* enabled usb clock
* added usb stack to application
* fixed pll0usb clock setup
* implemented serial usb handshake
* implemented serial communication
* integrated chibios shell
* implemented device reset
* implemented enter dfu mode
* implemented hackrf mode command
* implemented flash command
* implemented memory manipulation
* implemented button control
* fixed mode change
* improved reset behavior
* implemented directory commands
* implemented file commands
* improved data communication
* refactorings
This commit is contained in:
Bernd Herzog
2023-12-17 17:20:35 +01:00
committed by GitHub
parent 2ccda5aebd
commit 6069145b68
30 changed files with 1894 additions and 8 deletions

View File

@@ -22,6 +22,9 @@
#include "scsi.h"
#include "diskio.h"
#include <libopencm3/lpc43xx/scu.h>
#include <libopencm3/lpc43xx/rgu.h>
#include <libopencm3/lpc43xx/wwdt.h>
volatile bool usb_bulk_block_done = false;
@@ -281,6 +284,17 @@ void scsi_command(msd_cbw_t* msd_cbw_data) {
case SCSI_CMD_VERIFY_10:
status = 0;
break;
case SCSI_CMD_START_STOP_UNIT:
SCU_SFSP2_8 = (SCU_SFSP2_8 & ~(7)) | 4;
struct gpio_t dfu = GPIO(5, 7);
gpio_output(&dfu);
gpio_clear(&dfu);
delay(50 * 40800);
RESET_CTRL0 = (1 << 0);
break;
}
usb_send_csw(msd_cbw_data, status);

View File

@@ -36,7 +36,7 @@ usb_request_status_t report_max_lun(
1,
NULL,
NULL);
} else if (stage == USB_TRANSFER_STAGE_DATA) {
usb_transfer_schedule_ack(endpoint->out);
scsi_running = true;