mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-09 13:33:39 +00:00
2ab7ee6a8a
Signed-off-by: deadprogram <ron@hybridgroup.com>
50 lines
795 B
Go
50 lines
795 B
Go
package descriptor
|
|
|
|
const (
|
|
interfaceTypeLen = 9
|
|
)
|
|
|
|
type InterfaceType struct {
|
|
data []byte
|
|
}
|
|
|
|
func (d InterfaceType) Bytes() []byte {
|
|
return d.data
|
|
}
|
|
|
|
func (d InterfaceType) Length(v uint8) {
|
|
d.data[0] = byte(v)
|
|
}
|
|
|
|
func (d InterfaceType) Type(v uint8) {
|
|
d.data[1] = byte(v)
|
|
}
|
|
|
|
func (d InterfaceType) InterfaceNumber(v uint8) {
|
|
d.data[2] = byte(v)
|
|
}
|
|
|
|
func (d InterfaceType) AlternateSetting(v uint8) {
|
|
d.data[3] = byte(v)
|
|
}
|
|
|
|
func (d InterfaceType) NumEndpoints(v uint8) {
|
|
d.data[4] = byte(v)
|
|
}
|
|
|
|
func (d InterfaceType) InterfaceClass(v uint8) {
|
|
d.data[5] = byte(v)
|
|
}
|
|
|
|
func (d InterfaceType) InterfaceSubClass(v uint8) {
|
|
d.data[6] = byte(v)
|
|
}
|
|
|
|
func (d InterfaceType) InterfaceProtocol(v uint8) {
|
|
d.data[7] = byte(v)
|
|
}
|
|
|
|
func (d InterfaceType) Interface(v uint8) {
|
|
d.data[8] = byte(v)
|
|
}
|