<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: Replacement for deprecated SPI method send()?</title>
		<link>http://forums.leaflabs.com/topic.php?id=2387</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:20:02 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=2387" rel="self" type="application/rss+xml" />

		<item>
			<title>pico on "Replacement for deprecated SPI method send()?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2387#post-12314</link>
			<pubDate>Sat, 11 Aug 2012 08:41:08 +0000</pubDate>
			<dc:creator>pico</dc:creator>
			<guid isPermaLink="false">12314@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;OK, thanks -- that's good to know. It was just the wording of the documentation for the transfer() method I found a bit misleading:&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;
&#60;strong&#62;uint8 transfer(uint8 data)&#60;/strong&#62;&#60;/p&#62;
&#60;p&#62;    Transmit a byte, then return the next unread byte.&#60;/p&#62;
&#60;p&#62;    This function transmits before receiving.
&#60;/p&#62;&#60;/blockquote&#62;
&#60;p&#62;It seemed to indicate a half-duplex rather than full-duplex sequence of events.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>crenn on "Replacement for deprecated SPI method send()?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2387#post-12311</link>
			<pubDate>Sat, 11 Aug 2012 06:30:20 +0000</pubDate>
			<dc:creator>crenn</dc:creator>
			<guid isPermaLink="false">12311@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Actually send(uint8_t b) does the same thing as transfer().&#60;/p&#62;
&#60;p&#62;You'll also be happy to know the neither is half duplex. When a byte is written out to a slave device, a byte is also clocked in at the same time. However this byte has to be read from the SPI device register, which both functions do. So while you'd assume that the read function reads a byte in, it's actually reading a byte from the register which has been put there by a previous write call. There is one last thing, the read function has to have a byte in the receive register, or it will block until it does, if your SPI device is in master, it will cause the microcontroller to hang until a reset.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>pico on "Replacement for deprecated SPI method send()?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=2387#post-12306</link>
			<pubDate>Sat, 11 Aug 2012 03:38:52 +0000</pubDate>
			<dc:creator>pico</dc:creator>
			<guid isPermaLink="false">12306@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I was looking for a HardwareSPI method that does exactly what the deprecated method send(uint8_t data) does -- namely shifts a byte out on MOSI while simultanelously reading the input on MISO.&#60;/p&#62;
&#60;p&#62;The documentation suggests there should be a non-deprecated replacement for this method, but none seem to fit the bill -- unless I am misreading their descriptions. In particular, they seem to be half duplex methods -- write a byte, then read a byte (e.g., uint8_t transfer(uint8_t b)) -- rather than full duplex (like uint8_t send(uint8_t b)) -- write a byte *while* reading a byte.&#60;/p&#62;
&#60;p&#62;Any help or insights appreciated. From the docs:&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;
&#60;strong&#62;Deprecated Functions&#60;/strong&#62;&#60;/p&#62;
&#60;p&#62;The following functions are defined for now, but they have been deprecated, and will be removed in a future Maple IDE release. You shouldn’t use them in new programs, and you should change any of your programs which do use them to the up-to-date functions discussed above.&#60;/p&#62;
&#60;p&#62;&#60;strong&#62;uint8 HardwareSPI::send(uint8 data)&#60;/strong&#62;&#60;/p&#62;
&#60;p&#62;    Writes the single byte data into the port buffer to be transmitted as soon as possible. Returns the data byte shifted back from the slave.&#60;/p&#62;
&#60;/blockquote&#62;</description>
		</item>

	</channel>
</rss>
