<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl-pl">
<link rel="self" type="application/atom+xml" href="https://forum.atnel.pl/feed.php?f=30&amp;t=6287&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2014-03-09T12:00:35+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=30&amp;t=6287&amp;mode</id>
<entry>
<author><name><![CDATA[Anonymous]]></name></author>
<updated>2014-03-09T12:00:35+01:00</updated>
<published>2014-03-09T12:00:35+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=6287&amp;p=73539#p73539</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=6287&amp;p=73539#p73539"/>
<title type="html"><![CDATA[Biblioteka do W5500 (wiz550io) pod AVR]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=6287&amp;p=73539#p73539"><![CDATA[
Witam, mam &quot;problem&quot; z wykonaniem sprzętowej obsługi wiznet W5500<br /><br />Tutaj część pod STMa<br />[syntax=c]void  wizchip_select(void)<br />{<br />   xGPIOPinWrite( xGPIO_PORTA_BASE, xGPIO_PIN_4, 0);<br />}<br /><br />void  wizchip_deselect(void)<br />{<br />   xGPIOPinWrite( xGPIO_PORTA_BASE, xGPIO_PIN_4, 1);<br />}<br /><br />void  wizchip_write(uint8_t wb)<br />{<br />   xSPISingleDataReadWrite(WIZCHIP_SPI_BASE,wb);<br />}<br /><br />uint8_t wizchip_read()<br />{<br />   return xSPISingleDataReadWrite(WIZCHIP_SPI_BASE,0xFF);<br />}[/syntax]<br /><br /><br />Kawałek kodu pod STM32F103x obsługującej wysyłanie danych po SPI<br /><br />[syntax=c]unsigned long<br />SPISingleDataReadWrite(unsigned long ulBase, unsigned long ulWData)<br />{<br />    unsigned long ulReadTemp;<br />    //<br />    // Check the arguments.<br />    //<br />    xASSERT((ulBase == SPI3_BASE) || (ulBase == SPI1_BASE)||<br />            (ulBase == SPI2_BASE));<br /><br />    //<br />    // Wait until there is space.<br />    //<br />    while(!(xHWREG(ulBase + SPI_SR) &amp; SPI_SR_TXE));<br />    xHWREG(ulBase + SPI_DR) = ulWData;<br /><br />    //<br />    // Wait until there is data to be read.<br />    //<br />    while(!(xHWREG(ulBase + SPI_SR) &amp; SPI_SR_RXNE));<br />    ulReadTemp = xHWREG(ulBase + SPI_DR);<br /><br />    return ulReadTemp;<br />}[/syntax]<br /><br />[syntax=c]#define xSPISingleDataReadWrite(ulBase, ulWData)                              \        SPISingleDataReadWrite(ulBase, ulWData)[/syntax]<br /><br />W załączniku wersja pod &quot;AVR&quot; tj. na eclipsa, oraz wersja do coocoxa pod STM32F103x<p>Statystyki: Napisane przez Gość — 9 mar 2014, o 12:00</p><hr />
]]></content>
</entry>
</feed>