github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/machine/usb/descriptor/interface.go (about) 1 package descriptor 2 3 const ( 4 interfaceTypeLen = 9 5 ) 6 7 type InterfaceType struct { 8 data []byte 9 } 10 11 func (d InterfaceType) Bytes() []byte { 12 return d.data 13 } 14 15 func (d InterfaceType) Length(v uint8) { 16 d.data[0] = byte(v) 17 } 18 19 func (d InterfaceType) Type(v uint8) { 20 d.data[1] = byte(v) 21 } 22 23 func (d InterfaceType) InterfaceNumber(v uint8) { 24 d.data[2] = byte(v) 25 } 26 27 func (d InterfaceType) AlternateSetting(v uint8) { 28 d.data[3] = byte(v) 29 } 30 31 func (d InterfaceType) NumEndpoints(v uint8) { 32 d.data[4] = byte(v) 33 } 34 35 func (d InterfaceType) InterfaceClass(v uint8) { 36 d.data[5] = byte(v) 37 } 38 39 func (d InterfaceType) InterfaceSubClass(v uint8) { 40 d.data[6] = byte(v) 41 } 42 43 func (d InterfaceType) InterfaceProtocol(v uint8) { 44 d.data[7] = byte(v) 45 } 46 47 func (d InterfaceType) Interface(v uint8) { 48 d.data[8] = byte(v) 49 }