]> gitweb.factorcode.org Git - factor.git/blob - libs/usb/usb.facts
72f159b93a1300b09a9257e2c49c9e84e417d01a
[factor.git] / libs / usb / usb.facts
1 ! Copyright (C) 2006 Chris Double.
2 ! See http://factorcode.org/license.txt for BSD license.
3
4 USING: help usb ;
5
6 HELP: bus-each 
7 { $values { "usb_bus" "an alien pointing to a usb_bus structure" } { "quot" "A quotation with stack effect " { $snippet "( usb_bus -- )" } } }
8 { $description "Starting with the given usb_bus, traverse the linked list of busses calling the quotation on each one." } 
9 { $examples
10   { $example "usb_get_busses [ display-devices ]" }
11 }
12 { $see-also device-each find-devices } ;
13
14 HELP: device-each 
15 { $values { "usb_device" "an alien pointing to a usb_device structure" } { "quot" "A quotation with stack effect " { $snippet "( usb_device -- )" } } }
16 { $description "Starting with the given usb_device, traverse the linked list of devices calling the quotation on each one." } 
17 { $examples
18   { $example "usb_get_busses [\n  usb_bus-devices [ display-device ]\n] bus-each" }
19 }
20 { $see-also bus-each find-devices } ;
21
22 HELP: vendor-id-matches?
23 { $values { "id" "the integer vendor id" } { "usb_device" "an alien pointing to a usb_device structure" } { "bool" "a boolean" } }
24 { $description "Return true if the device has the given vendor id." } 
25 { $see-also product-id-matches? is-device? } ;
26
27 HELP: product-id-matches?
28 { $values { "id" "the integer product id" } { "usb_device" "an alien pointing to a usb_device structure" } { "bool" "a boolean" } }
29 { $description "Return true if the device has the given product id." } 
30 { $see-also vendor-id-matches? is-device? } ;
31
32 HELP: is-device?
33 { $values { "vendor-id" "the integer vendor id" } { "product-id" "the integer product-id" } { "usb_device" "an alien pointing to a usb_device structure" } { "bool" "a boolean" } }
34 { $description "Return true if the device has the given vendor and product id." } 
35 { $see-also vendor-id-matches? product-id-matches? } ;
36
37 HELP: find-devices 
38 { $values { "vendor-id" "the integer vendor id for the device to find" } { "product-id" "the integer product id for the device to find" } { "seq" "a sequence containing the usb_devices found" } }
39 { $description "Traverse the devices on all USB busses looking for a device with the given vendor and product id's. Return a sequence containing all the usb_device structures found matcing the vendor and product id's." } 
40 { $examples
41   { $example "HEX: 10D6 HEX: 1100 find-devices" }
42 }
43 { $see-also bus-each device-each } ;
44