Merge branch 'arpruss-master'
This commit is contained in:
commit
ffce10ce29
|
@ -23,7 +23,7 @@
|
|||
#include <string.h>
|
||||
#include <libmaple/iwdg.h>
|
||||
|
||||
#include "usb_serial.h"
|
||||
#include "usb_composite_serial.h"
|
||||
|
||||
#define USB_TIMEOUT 50
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define _COMPOSITE_SERIAL_H_
|
||||
|
||||
#include "USBComposite.h"
|
||||
#include "usb_serial.h"
|
||||
#include "usb_composite_serial.h"
|
||||
|
||||
class USBCompositeSerial : public Stream {
|
||||
private:
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include <stdint.h>
|
||||
#include <libmaple/nvic.h>
|
||||
#include "usb_hid.h"
|
||||
#include "usb_serial.h"
|
||||
#include "usb_composite_serial.h"
|
||||
#include "usb_generic.h"
|
||||
#include <libmaple/usb.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "USBMassStorage.h"
|
||||
#include "usb_mass.h"
|
||||
#include "usb_mass_mal.h"
|
||||
#include "usb_serial.h"
|
||||
#include "usb_composite_serial.h"
|
||||
#include <string.h>
|
||||
|
||||
void USBMassStorageDevice::begin() {
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
#include <USBHID.h>
|
||||
|
||||
#define LED PB12
|
||||
|
||||
void setup(){
|
||||
pinMode(LED,OUTPUT);
|
||||
digitalWrite(LED,1);
|
||||
USBHID_begin_with_serial(HID_MOUSE);
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
void loop(){
|
||||
digitalWrite(LED,0);
|
||||
Mouse.move(4,0);
|
||||
delay(500);
|
||||
digitalWrite(LED,1);
|
||||
delay(30000);
|
||||
digitalWrite(LED,0);
|
||||
Mouse.move(-4,0);
|
||||
delay(500);
|
||||
digitalWrite(LED,1);
|
||||
delay(30000);
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
#include <USBComposite.h>
|
||||
|
||||
#define PRODUCT_ID 0x29
|
||||
|
||||
#include "image.h"
|
||||
|
||||
bool write(uint32_t memoryOffset, const uint8_t *writebuff, uint16_t transferLength) {
|
||||
|
@ -49,6 +51,7 @@ void dumpDrive() {
|
|||
}
|
||||
|
||||
void setup() {
|
||||
USBComposite.setProductId(PRODUCT_ID);
|
||||
MassStorage.setDrive(0, sizeof(image), read, write);
|
||||
MassStorage.registerComponent();
|
||||
CompositeSerial.registerComponent();
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "SdFat.h"
|
||||
|
||||
#define LED_PIN PB12
|
||||
#define PRODUCT_ID 0x29
|
||||
|
||||
SdFatEX sd;
|
||||
const uint32_t speed = SPI_CLOCK_DIV2 ;
|
||||
|
@ -22,6 +23,7 @@ bool read(uint32_t memoryOffset, uint8_t *readbuff, uint16_t transferLength) {
|
|||
}
|
||||
|
||||
void setup() {
|
||||
USBComposite.setProductId(PRODUCT_ID);
|
||||
pinMode(LED_PIN,OUTPUT);
|
||||
digitalWrite(LED_PIN,1);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name=USBComposite for STM32F1
|
||||
version=0.64
|
||||
version=0.66
|
||||
author=Various
|
||||
email=arpruss@gmail.com
|
||||
sentence=USB HID / MIDI / mass storage library for STM32F1
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
* the result made cleaner.
|
||||
*/
|
||||
|
||||
#include "usb_serial.h"
|
||||
#include "usb_composite_serial.h"
|
||||
#include "usb_generic.h"
|
||||
#include <string.h>
|
||||
#include <libmaple/usb.h>
|
|
@ -264,6 +264,7 @@ static void getMIDIPartDescriptor(uint8* out) {
|
|||
// patch to reflect where the part goes in the descriptor
|
||||
OUT_BYTE(usbMIDIDescriptor_Config, AC_Interface.bInterfaceNumber) += usbMIDIPart.startInterface;
|
||||
OUT_BYTE(usbMIDIDescriptor_Config, MS_Interface.bInterfaceNumber) += usbMIDIPart.startInterface;
|
||||
OUT_BYTE(usbMIDIDescriptor_Config, AC_CS_Interface.baInterfaceNr) += usbMIDIPart.startInterface;
|
||||
OUT_BYTE(usbMIDIDescriptor_Config, DataOutEndpoint.bEndpointAddress) += usbMIDIPart.startEndpoint;
|
||||
OUT_BYTE(usbMIDIDescriptor_Config, DataInEndpoint.bEndpointAddress) += usbMIDIPart.startEndpoint;
|
||||
}
|
||||
|
|
|
@ -35,18 +35,15 @@
|
|||
*/
|
||||
|
||||
#include "boards_private.h"
|
||||
#include "USBHID.h"
|
||||
#include <libmaple/gpio.h>
|
||||
#include <libmaple/timer.h>
|
||||
|
||||
#include <boards.h>
|
||||
#include <usb_serial.h>
|
||||
|
||||
namespace wirish {
|
||||
namespace priv {
|
||||
|
||||
void board_setup_usb(void) {
|
||||
//Serial = CompositeSerial;
|
||||
#ifdef GENERIC_BOOTLOADER
|
||||
//Reset the USB interface on generic boards - developed by Victor PV
|
||||
gpio_set_mode(PIN_MAP[PA12].gpio_device, PIN_MAP[PA12].gpio_bit, GPIO_OUTPUT_PP);
|
||||
|
|
Loading…
Reference in New Issue