<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de-AT">
	<id>https://becomwiki.live.md-websolutions.com/index.php?action=history&amp;feed=atom&amp;title=BLACKSheep%C2%AE_Examples_page</id>
	<title>BLACKSheep® Examples page - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://becomwiki.live.md-websolutions.com/index.php?action=history&amp;feed=atom&amp;title=BLACKSheep%C2%AE_Examples_page"/>
	<link rel="alternate" type="text/html" href="https://becomwiki.live.md-websolutions.com/index.php?title=BLACKSheep%C2%AE_Examples_page&amp;action=history"/>
	<updated>2026-05-13T12:46:49Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in BECOM Systems Support</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://becomwiki.live.md-websolutions.com/index.php?title=BLACKSheep%C2%AE_Examples_page&amp;diff=30&amp;oldid=prev</id>
		<title>Peter: 1 Version importiert</title>
		<link rel="alternate" type="text/html" href="https://becomwiki.live.md-websolutions.com/index.php?title=BLACKSheep%C2%AE_Examples_page&amp;diff=30&amp;oldid=prev"/>
		<updated>2023-10-31T08:03:05Z</updated>

		<summary type="html">&lt;p&gt;1 Version importiert&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de-AT&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 31. Oktober 2023, 10:03 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;de-AT&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(kein Unterschied)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://becomwiki.live.md-websolutions.com/index.php?title=BLACKSheep%C2%AE_Examples_page&amp;diff=29&amp;oldid=prev</id>
		<title>en&gt;Peter: 1 Version importiert</title>
		<link rel="alternate" type="text/html" href="https://becomwiki.live.md-websolutions.com/index.php?title=BLACKSheep%C2%AE_Examples_page&amp;diff=29&amp;oldid=prev"/>
		<updated>2023-08-22T19:35:45Z</updated>

		<summary type="html">&lt;p&gt;1 Version importiert&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Scope ==&lt;br /&gt;
[This page shows some c-Code examples for using the BLACKSheep(c) drivers.&lt;br /&gt;
&lt;br /&gt;
== Serial Interface Driver ==&lt;br /&gt;
===SPI===&lt;br /&gt;
First the SPI bus must be initialized. Than a call of SPIopen for each slave is necessary.&amp;lt;br&amp;gt;&lt;br /&gt;
Currently only the master mode is supported.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
        /*************************************************************/&lt;br /&gt;
        /*               Initialize the spi bus first                */&lt;br /&gt;
        /*************************************************************/&lt;br /&gt;
&lt;br /&gt;
        unsigned long nSCLK = 125000000;  // current system clock in [Hz]&lt;br /&gt;
        unsigned long nCCLK = 500000000;  // current core clock in [Hz]&lt;br /&gt;
&lt;br /&gt;
    #ifdef SPI_INIT_BUS_0&lt;br /&gt;
        nPrintWidth=printf (&amp;quot;Initialize SPI interface 0...&amp;quot;);&lt;br /&gt;
        tErrorCode = SPIsetup(0, nSCLK, nCCLK, true); &lt;br /&gt;
        if(tErrorCode) {&lt;br /&gt;
            BS_PRINTF_FAILED(nPrintWidth);&lt;br /&gt;
        }&lt;br /&gt;
        else {&lt;br /&gt;
            BS_PRINTF_OK(nPrintWidth);&lt;br /&gt;
        }&lt;br /&gt;
    #endif&lt;br /&gt;
    #ifdef SPI_INIT_BUS_1&lt;br /&gt;
        nPrintWidth=printf (&amp;quot;Initialize SPI interface 1...&amp;quot;);&lt;br /&gt;
        tErrorCode = SPIsetup(1, nSCLK, nCCLK, true); &lt;br /&gt;
        if(tErrorCode) {&lt;br /&gt;
            BS_PRINTF_FAILED(nPrintWidth);&lt;br /&gt;
        }&lt;br /&gt;
        else {&lt;br /&gt;
            BS_PRINTF_OK(nPrintWidth);&lt;br /&gt;
        }&lt;br /&gt;
    #endif&lt;br /&gt;
    #ifdef SPI_INIT_BUS_2&lt;br /&gt;
        nPrintWidth=printf (&amp;quot;Initialize SPI interface 2...&amp;quot;);&lt;br /&gt;
        tErrorCode = SPIsetup(2, nSCLK, nCCLK, true); &lt;br /&gt;
        if(tErrorCode) {&lt;br /&gt;
            BS_PRINTF_FAILED(nPrintWidth);&lt;br /&gt;
        }&lt;br /&gt;
        else {&lt;br /&gt;
            BS_PRINTF_OK(nPrintWidth);&lt;br /&gt;
        }&lt;br /&gt;
    #endif        &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        /*************************************************************/&lt;br /&gt;
        /*                     Open an SPI slave                     */&lt;br /&gt;
        /*************************************************************/&lt;br /&gt;
	T_SPI_CONFIG 	SPICfg;&lt;br /&gt;
        unsigned char cSPI = 0;                           //SPI bus number&lt;br /&gt;
	unsigned long ulCSEL = 0x80000800;                //Use PF11 as CS&lt;br /&gt;
//	unsigned long ulCSEL = 0x80001000;                //Use PF12 as CS&lt;br /&gt;
//	unsigned long ulCSEL = 0x80002000;                //Use PF13 as CS&lt;br /&gt;
//	unsigned long ulCSEL = 0x80004000;                //Use PF14 as CS&lt;br /&gt;
&lt;br /&gt;
	SPICfg.mbMaSl 			= true;           //Currently only master mode is supported, so set it to true.&lt;br /&gt;
	SPICfg.mtCSEL 			= ulCSEL;&lt;br /&gt;
	SPICfg.mnBaudrate		= 20000000;       //Baudrate in [Hz]&lt;br /&gt;
	SPICfg.mnTransferSize		= SPI_8BIT;&lt;br /&gt;
	SPICfg.mnClockPolarity		= SPI_CPOL_HIGH;&lt;br /&gt;
	SPICfg.mnClockPhase		= SPI_CPHA_HIGH;&lt;br /&gt;
	SPICfg.mnMsbLsbFirst		= SPI_MSB_FIRST; //MSB first or LSB first&lt;br /&gt;
	SPICfg.mnMasterErrorFlag	= SPI_NONE;      //Dont change this&lt;br /&gt;
	SPICfg.msDefaultWord		= 0;             //Bitpattern which should be clocked out during an SPIread.&lt;br /&gt;
	&lt;br /&gt;
	T_SPI_HANDLE hSPI = SPIopen(cSPI, &amp;amp;SPICfg, NULL);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        /*************************************************************/&lt;br /&gt;
        /*          Device should be ready for data transfer         */&lt;br /&gt;
        /*************************************************************/&lt;br /&gt;
        unsigned short ausData[50];&lt;br /&gt;
        SPIread(hSPI, ausData, 50, NULL);                //Read out 50 bytes of data.&lt;br /&gt;
        SPIwrite(hSPI, ausData, 50, NULL);               //Write 50 bytes of data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>en&gt;Peter</name></author>
	</entry>
</feed>