Simple USBHost library for STM32F746NG Discovery board. Only either the Fastspeed or the Highspeed port can be used( not both together)
Dependents: DISCO-F746NG_USB_Host
Fork of KL46Z-USBHost by
USBHost/USBEndpoint.h@5:10bfc10afcc8, 2014-01-27 (annotated)
- Committer:
- va009039
- Date:
- Mon Jan 27 11:00:28 2014 +0000
- Revision:
- 5:10bfc10afcc8
- Child:
- 8:6463cd1964c0
add isochronous transfer
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
va009039 | 5:10bfc10afcc8 | 1 | #pragma once |
va009039 | 5:10bfc10afcc8 | 2 | #include "USBHostTypes.h" |
va009039 | 5:10bfc10afcc8 | 3 | |
va009039 | 5:10bfc10afcc8 | 4 | class USBEndpoint { |
va009039 | 5:10bfc10afcc8 | 5 | public: |
va009039 | 5:10bfc10afcc8 | 6 | USBEndpoint() : data01_toggle(DATA0),address(0),MaxPacketSize(8) {} |
va009039 | 5:10bfc10afcc8 | 7 | void setState(uint8_t st){}; // dummy |
va009039 | 5:10bfc10afcc8 | 8 | void setSize(int size) { MaxPacketSize = size; } |
va009039 | 5:10bfc10afcc8 | 9 | void setAddress(uint8_t addr) { address = addr; } |
va009039 | 5:10bfc10afcc8 | 10 | void setData01(uint8_t data01) { data01_toggle = data01; } |
va009039 | 5:10bfc10afcc8 | 11 | uint8_t getAddress(){ return address; }; |
va009039 | 5:10bfc10afcc8 | 12 | int getSize() { return MaxPacketSize; } |
va009039 | 5:10bfc10afcc8 | 13 | uint8_t getData01() { return data01_toggle; } |
va009039 | 5:10bfc10afcc8 | 14 | void toggleData01() { |
va009039 | 5:10bfc10afcc8 | 15 | data01_toggle = (data01_toggle == DATA0) ? DATA1 : DATA0; |
va009039 | 5:10bfc10afcc8 | 16 | } |
va009039 | 5:10bfc10afcc8 | 17 | |
va009039 | 5:10bfc10afcc8 | 18 | private: |
va009039 | 5:10bfc10afcc8 | 19 | uint8_t data01_toggle; // DATA0,DATA1 |
va009039 | 5:10bfc10afcc8 | 20 | uint8_t address; |
va009039 | 5:10bfc10afcc8 | 21 | int MaxPacketSize; |
va009039 | 5:10bfc10afcc8 | 22 | }; |