libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
usb.h
Go to the documentation of this file.
1#pragma once
2#ifndef DSY_HID_USB_H
3#define DSY_HID_USB_H
4#include <stdint.h>
5#include <stdlib.h>
6
7namespace daisy
12{
19{
20 public:
22 enum class Result
23 {
24 OK,
25 ERR,
26 };
27
35
36
38 typedef void (*ReceiveCallback)(uint8_t* buff, uint32_t* len);
39
41
43
47 void Init(UsbPeriph dev);
48
52 void DeInit(UsbPeriph dev);
53
58 Result TransmitInternal(uint8_t* buff, size_t size);
64 Result TransmitExternal(uint8_t* buff, size_t size);
65
70 void SetReceiveCallback(ReceiveCallback cb, UsbPeriph dev);
71
72 private:
73};
74
75} // namespace daisy
76#endif
77
78/* - Add support for other USB classes (currently only CDC is supported)
79- DMA setup
80*/
Interface for initializing and using the USB Peripherals on the daisy.
Definition usb.h:19
UsbHandle()
Definition usb.h:40
void Init(UsbPeriph dev)
Result TransmitExternal(uint8_t *buff, size_t size)
void SetReceiveCallback(ReceiveCallback cb, UsbPeriph dev)
Result
Definition usb.h:23
~UsbHandle()
Definition usb.h:42
UsbPeriph
Definition usb.h:30
@ FS_EXTERNAL
Definition usb.h:32
@ FS_BOTH
Definition usb.h:33
@ FS_INTERNAL
Definition usb.h:31
Result TransmitInternal(uint8_t *buff, size_t size)
void DeInit(UsbPeriph dev)
Hardware defines and helpers for daisy field platform.
Definition index.h:2