<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forums.obdev.at/app.php/feed/topic/4511" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2010-06-29T21:40:48+02:00</updated>

	<author><name><![CDATA[Objective Development Forums]]></name></author>
	<id>https://forums.obdev.at/app.php/feed/topic/4511</id>

		<entry>
		<author><name><![CDATA[frank26080115]]></name></author>
		<updated>2010-06-29T21:40:48+02:00</updated>

		<published>2010-06-29T21:40:48+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=4511&amp;p=14957#p14957</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=4511&amp;p=14957#p14957"/>
		<title type="html"><![CDATA[Re: USB transmitter]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=4511&amp;p=14957#p14957"><![CDATA[
<!-- m --><a class="postlink" href="http://vusb.wikidot.com/driver-api">http://vusb.wikidot.com/driver-api</a><!-- m --><br /><br /><div class="codebox"><p>Code: </p><pre><code>static uchar buffer&#91;64&#93;;<br />static uchar currentPosition, bytesRemaining;<br /> <br />usbMsgLen_t usbFunctionSetup(uchar setupData&#91;8&#93;)<br />{<br />    usbRequest_t *rq = (void *)setupData;   // cast to structured data for parsing<br />    switch(rq-&gt;bRequest){<br />    case VENDOR_RQ_WRITE_BUFFER:<br />        currentPosition = 0;                // initialize position index<br />        bytesRemaining = rq-&gt;wLength.word;  // store the amount of data requested<br />        if(bytesRemaining &gt; sizeof(buffer)) // limit to buffer size<br />            bytesRemaining = sizeof(buffer);<br />        return USB_NO_MSG;        // tell driver to use usbFunctionWrite()<br />    }<br />    return 0;                               // ignore all unknown requests<br />}<br /> <br />uchar usbFunctionWrite(uchar *data, uchar len)<br />{<br />    uchar i;<br />    if(len &gt; bytesRemaining)                // if this is the last incomplete chunk<br />        len = bytesRemaining;               // limit to the amount we can store<br />    bytesRemaining -= len;<br />    for(i = 0; i &lt; len; i++)<br />        buffer&#91;currentPosition++&#93; = data&#91;i&#93;;<br />    return bytesRemaining == 0;             // return 1 if we have all data<br />}</code></pre></div><br /><br />it shows how to get the data into a buffer<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=2426">frank26080115</a> — Tue Jun 29, 2010 9:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[gates2231]]></name></author>
		<updated>2010-06-29T14:14:17+02:00</updated>

		<published>2010-06-29T14:14:17+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=4511&amp;p=14954#p14954</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=4511&amp;p=14954#p14954"/>
		<title type="html"><![CDATA[USB transmitter]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=4511&amp;p=14954#p14954"><![CDATA[
hello friends<br />I am trying to make an USB transmitter which transmits data from the PC via USB cable<br /><br />I programmed atmega32 with hid-data and it is working fine storing data in the eeprom and reading data<br /><br />but i want this data to be moved into transmit buffer and transmitted<br /><br />I am not able to understand how data is being sent from PC to the uC<br /><br />I read all the firmware but there is nothing in main function and the hidtool is also vague<br /><br />Please enlighten me<br />Thanking you<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=4056">gates2231</a> — Tue Jun 29, 2010 2:14 pm</p><hr />
]]></content>
	</entry>
	</feed>
