Download E-books USB Mass Storage: Designing and Programming Devices and Embedded Hosts PDF

By Jan Axelson

This developer's consultant for designers and programmers of mass-storage units that use the common Serial Bus (USB) interface offers builders with details on tips on how to select garage media, interface the media to a microcontroller or different CPU, and write gadget firmware to entry the media and practice USB communications. Comparisons of well known storage-media concepts to assist clients opt for a media style for a venture are incorporated, and the categories described cover difficult drives and flash-memory playing cards akin to the MultiMediaCard (MMC), safe electronic (SD) card, and CompactFlash card. Helpful pointers on constructing an embedded host that could entry USB mass-storage units also are covered.

Show description

Read Online or Download USB Mass Storage: Designing and Programming Devices and Embedded Hosts PDF

Best Nonfiction books

Signals and Systems (2nd Edition)

This authoritative e-book, very popular for its highbrow caliber and contributions presents an excellent starting place and life-long reference for a person learning an important equipment of contemporary sign and procedure research. the key alterations of the revision are reorganization of bankruptcy fabric and the addition of a much broader variety of problems.

Letters from Mexico

Written over a seven-year interval to Charles V of Spain, Hernan Cortes' letters offer a story account of the conquest of Mexico from the founding of the coastal city of Veracruz till Cortes's trip to Honduras in 1525.

How to Get People to Do Stuff: Master the art and science of persuasion and motivation

All of us wish humans to do stuff. no matter if you will have your clients to shop for from you, proprietors to provide you a great deal, your staff to take extra initiative, or your wife to make dinner—a great amount of daily is ready getting the folks round you to do stuff. rather than utilizing your ordinary strategies that usually paintings and infrequently do not, what when you may possibly harness the facility of psychology and mind technology to encourage humans to do the things you wish them to do - even getting humans to want to do the things you wish them to do.

Monster of God: The Man-Eating Predator in the Jungles of History and the Mind

"Rich element and bright anecdotes of experience. .. .A treasure trove of unique truth and difficult pondering. "―The big apple instances ebook evaluation, entrance web page For millennia, lions, tigers, and their man-eating family members have stored our darkish, frightening forests darkish and frightening, and their predatory majesty has been the stuff of folklore.

Extra resources for USB Mass Storage: Designing and Programming Devices and Embedded Hosts

Show sample text content

BCSWStatus ! = 0x0) { // bCSWStatus shows an errors. // Set measurement to the decrease of the endpoint measurement or dCBWDataTransferLength. dimension = mMin (MSD_IN_EP_SIZE, gblCBW. dCBWDataTransferLength); // Reset msd_buffer’s contents to zeroes to ship pad facts. for (i = zero; i < dimension; i++) msd_buffer[i] = zero; if (gblCBW. dCBWDataTransferLength > MSD_IN_EP_SIZE) { // there has been an blunders (bCSWStatus ! = 0x0) // and dCBWDataTransferLength is larger than the endpoint measurement. // ship MSD_IN_EP_SIZE bytes from msd_buffer. SendData((byte*)&msd_buffer[0], MSD_IN_EP_SIZE); // Subtract the despatched bytes from dCBWDataTransferLength within the CBW. gblCBW. dCBWDataTransferLength -= MSD_IN_EP_SIZE; // Subtract the despatched bytes from dCSWDataResidue within the CSW. msd_csw. dCSWDataResidue -= MSD_IN_EP_SIZE; sixty five Chapter three } else { // there has been an blunders (bCSWStatus ! = 0x0) // and dCBWDataTransferLength is <= the endpoint measurement. // ship dCBWDataTransferLength bytes from msd_buffer. SendData((byte*)&msd_buffer[0], gblCBW. dCBWDataTransferLength); // Set dCBWDataTransferLength = zero to reason the CSW to be despatched. gblCBW. dCBWDataTransferLength = zero; // Decrement dCSWDataResidue by way of the variety of bytes despatched. msd_csw. dCSWDataResidue -= gblCBW. dCBWDataTransferLength; } } else { // there isn't any errors and the knowledge to be despatched is <= the endpoint measurement. // ship dCSWDataResidue bytes starting at ptrNextData. SendData(ptrNextData, msd_csw. dCSWDataResidue); // Subtract the despatched bytes from dCBWDataTransferLength. gblCBW. dCBWDataTransferLength -= msd_csw. dCSWDataResidue ; // Set dCSWDataResidue equivalent to dCBWDataTransferLength. msd_csw. dCSWDataResidue = gblCBW. dCBWDataTransferLength; // If the host anticipated extra bytes than have been despatched, // dCBWDataTransferLength is bigger than 0. // Set dCBWDataTransferLength = zero to reason the CSW to be despatched. gblCBW. dCBWDataTransferLength = zero; } } } } sixty six The USB Mass garage category Receiving info from the USB Host If the data-transport part is host-to-device, firmware calls the MSDDataOut functionality to get information bought from the host. void MSDDataOut(void) { // To permit receiving facts, provide possession of the endpoint’s buffer to the SIE. mUSBBufferReady(MSD_BD_OUT); // carrier USB interrupts. (See Microchip’s Framework firmware for info. ) USBDriverService(); // Wait till the SIE has lower back possession of the endpoint buffer to the CPU, // indicating that info used to be acquired. whereas (mMSDRxIsBusy()) { USBDriverService(); } // Subtract the variety of acquired bytes from dCBWDataTransferLength within the CBW. gblCBW. dCBWDataTransferLength -= MSD_BD_OUT. Cnt; // Subtract the variety of bought bytes from dCSWDataResidue within the CSW. msd_csw. dCSWDataResidue -= MSD_BD_OUT. Cnt; // For the subsequent transaction, set the OUT endpoint’s count number to the endpoint dimension. MSD_BD_OUT. Cnt = MSD_OUT_EP_SIZE; // Increment the OUT endpoint’s handle via endpoint-size bytes // in case there's extra information to obtain. MSD_BD_OUT. ADR += MSD_OUT_EP_SIZE; } Sending the CSW Firmware calls the SendCSW functionality after finishing the command-transport and data-transport (if required) stages of a command.

Rated 4.50 of 5 – based on 41 votes