Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: low-speed usb reference designs with macos drivers?



At 11:04 PM -0500 2/6/05, Stephen Bannasch wrote:

Basic emulation of a serial port is all I need.

If you actually want it to look like a serial port, ie have a /dev/??? entry associated with it, that's a bit tricky. If you just want to send data to and from the device, then looking at the examples is probably a good start. I like the "Deva Example" as a place to start (probably because I wrote it), in a few minutes I can modify it to be able to talk to a new device (I suspect it might take you a little longer), the theory is it takes care of the nasty OS specific bits and just lets you get at the device functions you're interested in.


I would like to be able to power the device and charge a battery while it is plugged in but I assume this has no relationship to the driver.

Power management has a lot to do with the driver, but it may not need to be your driver. The power available to the device is controlled by the driver through negotiation with the system, a driver has to send a SET_CONFIGURATION request to a device before it can start to do anything, when that happens the device is allowed to use the amount of power specified in the configuration descriptor.


There is a system supplied driver which will do this for you, it is the composite driver, which matches to devices with bDeviceClass == 0 in their device descriptors. It will configure the device and then go looking for interfaces to match drivers against. Presumably the interfaces in your device would be vendor specific (bInterfaceClass==0xff).

As of 10.3.6, it will try to match the highest power configuration to the available power on the port (100mA or 500mA). (Just in time for the iPod shuffle which implements multiple power configurations.)

If anybody knows of a better list to ask this questions on please let me know.

This is the place for questions which relate to the Mac specifically. For questions on the basic nature of USB and devices, and/or programming under other OSs, the USB-if's developer web board is a good place to start. Start at <http://developers.usb.org>
--
Barry Twycross
email@hidden
---
USB, it's not a Dyslexic BUS. (Thanks to TC.)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden


This email sent to email@hidden
References: 
 >low-speed usb reference designs with macos drivers? (From: Stephen Bannasch <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.