<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.mediawiki.compulab.com/w/index.php?action=history&amp;feed=atom&amp;title=CM-X300%3A_WinCE%3A_SPI_Driver_API</id>
	<title>CM-X300: WinCE: SPI Driver API - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.mediawiki.compulab.com/w/index.php?action=history&amp;feed=atom&amp;title=CM-X300%3A_WinCE%3A_SPI_Driver_API"/>
	<link rel="alternate" type="text/html" href="https://www.mediawiki.compulab.com/w/index.php?title=CM-X300:_WinCE:_SPI_Driver_API&amp;action=history"/>
	<updated>2026-04-17T10:54:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://www.mediawiki.compulab.com/w/index.php?title=CM-X300:_WinCE:_SPI_Driver_API&amp;diff=964&amp;oldid=prev</id>
		<title>Shai: added ssp1 referenece</title>
		<link rel="alternate" type="text/html" href="https://www.mediawiki.compulab.com/w/index.php?title=CM-X300:_WinCE:_SPI_Driver_API&amp;diff=964&amp;oldid=prev"/>
		<updated>2010-04-15T06:46:12Z</updated>

		<summary type="html">&lt;p&gt;added ssp1 referenece&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 06:46, 15 April 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot; &gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This sample application demonstrates the SPI communication between CM-X300 and Maxim Semiconductor DS1722 thermometer. The DS1722 manual is available at: [http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2766/t/al DS1722 manual].&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This sample application demonstrates the SPI communication between CM-X300 and Maxim Semiconductor DS1722 thermometer. The DS1722 manual is available at: [http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2766/t/al DS1722 manual].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The Windows CE demo image includes the SPI driver, which allows direct access to SSP3 functionality. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The Windows CE demo image includes the SPI driver, which allows direct access to SSP3 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;and SSP1 &lt;/ins&gt;functionality. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= SPI Sample =&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= SPI Sample =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Connecting the device to CM-X300 ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Connecting the device to CM-X300 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l19&quot; &gt;Line 19:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Connect pin 6 (SERMODE) of DS1722 to VDD.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Connect pin 6 (SERMODE) of DS1722 to VDD.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Connect all remaining DS1722 pins to VDD and GND according to the device datasheet. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Connect all remaining DS1722 pins to VDD and GND according to the device datasheet. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* Refer to [http://compulab.co.il/x300/download/x300-cm-man.pdf CM-X300-Man] for gpio mapping of SSP1.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== SPI Sample ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== SPI Sample ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Shai</name></author>
		
	</entry>
	<entry>
		<id>https://www.mediawiki.compulab.com/w/index.php?title=CM-X300:_WinCE:_SPI_Driver_API&amp;diff=922&amp;oldid=prev</id>
		<title>Shai at 07:18, 15 March 2010</title>
		<link rel="alternate" type="text/html" href="https://www.mediawiki.compulab.com/w/index.php?title=CM-X300:_WinCE:_SPI_Driver_API&amp;diff=922&amp;oldid=prev"/>
		<updated>2010-03-15T07:18:04Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Introduction = &lt;br /&gt;
This sample application demonstrates the SPI communication between CM-X300 and Maxim Semiconductor DS1722 thermometer. The DS1722 manual is available at: [http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2766/t/al DS1722 manual].&lt;br /&gt;
&lt;br /&gt;
The Windows CE demo image includes the SPI driver, which allows direct access to SSP3 functionality. &lt;br /&gt;
= SPI Sample =&lt;br /&gt;
== Connecting the device to CM-X300 ==&lt;br /&gt;
* The SPI device can be connected to the SSP3 port available on connector P6 on SB-X300. The following table describes the connector pin-out:&lt;br /&gt;
{|cellpadding=&amp;quot;3&amp;quot; border=&amp;quot;1&amp;quot; style=&amp;quot;border: 1px solid rgb(85, 85, 85); border-collapse: collapse;&amp;quot;&lt;br /&gt;
|  '''Signal Name'''  || '''Pin Number'''&lt;br /&gt;
|-&lt;br /&gt;
| SSP3_TXD || 5&lt;br /&gt;
|-&lt;br /&gt;
| SSP3_RXD || 7&lt;br /&gt;
|-&lt;br /&gt;
| SSP3_CLK || 3&lt;br /&gt;
|-&lt;br /&gt;
| SSP3_SFRM || 1&lt;br /&gt;
|}&lt;br /&gt;
* Connect pin 6 (SERMODE) of DS1722 to VDD.&lt;br /&gt;
* Connect all remaining DS1722 pins to VDD and GND according to the device datasheet. &lt;br /&gt;
&lt;br /&gt;
== SPI Sample ==&lt;br /&gt;
&lt;br /&gt;
The SPI Sample performs the following actions:&lt;br /&gt;
* Configure the SPI clock frequency (5KHz) and SFRM signal polarity.&lt;br /&gt;
* Read the temperature measurement.&lt;br /&gt;
* Write to the DS1722 configuration register.&lt;br /&gt;
* Read back from the configuration register.&lt;br /&gt;
&lt;br /&gt;
= SPI Driver =&lt;br /&gt;
== Overview ==&lt;br /&gt;
The CM-X300 SPI driver is a stream driver that may be accessed using the &amp;quot;SPI&amp;quot; prefix.&lt;br /&gt;
&lt;br /&gt;
== SPI Driver API ==&lt;br /&gt;
=== Data Types ===&lt;br /&gt;
{{Struct | HeadLevel = ==== | Structname = SPI_SLAVE_CONFIG |&lt;br /&gt;
Description = Device configuration structure|&lt;br /&gt;
Field1 = DWORD	dwDataSize |&lt;br /&gt;
Fieldexp1 = Size of each data frame in bits, allowed values: [4,32] |&lt;br /&gt;
Field2 = DWORD	dwClockRate|&lt;br /&gt;
Fieldexp2 = Frequency in KHz. Allowed values: [4,13*1024] |&lt;br /&gt;
Field3 = [[#POLARITY|POLARITY]]	ClockPol|&lt;br /&gt;
Fieldexp3 = Clock polarity |&lt;br /&gt;
Field4 = [[#POLARITY|POLARITY]]	ChipSelectPol |&lt;br /&gt;
Fieldexp4 = SFRM polarity |&lt;br /&gt;
Field5 = BOOL	bTxTristate |&lt;br /&gt;
Fieldexp5 = Tristate TX line when SFRM is de-asserted |&lt;br /&gt;
Field6 = BOOL	ClkPhaseHalfCycle|&lt;br /&gt;
Fieldexp6 = TRUE - CLK remains in its inactive/idle state until one-half clock cycle after the SFRM signal is asserted at the beginning of a frame.&amp;lt;br&amp;gt;&lt;br /&gt;
FALSE - CLK remains in its inactive/idle state until one full clock cycle after the SFRM signal is asserted at the beginning of a frame.&amp;lt;br&amp;gt;&lt;br /&gt;
Meaningless when bCSExternal = TRUE |&lt;br /&gt;
Field7 = BOOL	bCSExternal|&lt;br /&gt;
Fieldexp7 = SFRM is a GPIO |&lt;br /&gt;
Field8 = DWORD	dwGpioNum|&lt;br /&gt;
Fieldexp8 = GPIO number for SFRM |&lt;br /&gt;
Remarks = bCSExternal is not supported in CM-X300|&lt;br /&gt;
}}&lt;br /&gt;
{{Struct | HeadLevel = ==== | Structname = SPITRANS|&lt;br /&gt;
Description = Transaction data|&lt;br /&gt;
Field1 = DWORD mTransactions |&lt;br /&gt;
Fieldexp1 = Number of data frames in the transaction|&lt;br /&gt;
Field2 = DWORD *mWriteBuffer |&lt;br /&gt;
Fieldexp2 = Data to be written to the port|&lt;br /&gt;
Field3 = DWORD *mReadBuffer |&lt;br /&gt;
Fieldexp3 = Data that was read from the port|&lt;br /&gt;
Field4 = | Field5 = | Field6 = | Field7 = | Field8 = |&lt;br /&gt;
Remarks = |&lt;br /&gt;
}}&lt;br /&gt;
{{Enum| HeadLevel = ==== | Enumname = POLARITY |&lt;br /&gt;
Description = Signals polarity enumeration|  &lt;br /&gt;
Field1 = LOW_INACTIVE |&lt;br /&gt;
Field2 = HIGH_INACTIVE |&lt;br /&gt;
Field3 = |&lt;br /&gt;
Field4 = |&lt;br /&gt;
Remarks = |&lt;br /&gt;
}}&lt;br /&gt;
=== Functions ===&lt;br /&gt;
{{APIEx | HeadLevel = ==== | Signature = HANDLE SPIUserOpen() | &lt;br /&gt;
Description = Opens an instance of the SPI Bus Driver.  |  &lt;br /&gt;
Return =  Returns a handle that should be used to access the driver. Nonzero indicates success. |&lt;br /&gt;
Param1 = |&lt;br /&gt;
Param2 = |&lt;br /&gt;
Param3 = |&lt;br /&gt;
Param4 = |&lt;br /&gt;
Remarks = }}&lt;br /&gt;
&lt;br /&gt;
{{APIEx | HeadLevel = ==== | Signature = VOID SPIUserClose (HANDLE hDevice) | &lt;br /&gt;
Description = Closes the driver handle |  &lt;br /&gt;
Return = |&lt;br /&gt;
Param1 = *hDevice - Handle to an open SPI bus instance|&lt;br /&gt;
Param2 = |&lt;br /&gt;
Param3 = |&lt;br /&gt;
Param4 = |&lt;br /&gt;
Remarks = }}&lt;br /&gt;
&lt;br /&gt;
{{APIEx | HeadLevel = ==== | Signature = BOOL SPIUserSetConfiguration(HANDLE hDevice, [[#SPI_SLAVE_CONFIG|SPI_SLAVE_CONFIG]]* Settings) | &lt;br /&gt;
Description = Registers the configuration of the device.|  &lt;br /&gt;
Return = TRUE - indicates success.|&lt;br /&gt;
Param1 = *hDevice - Handle to an open SPI bus instance|&lt;br /&gt;
Param2 = *Settings - The SPI device configuration|&lt;br /&gt;
Param3 = |&lt;br /&gt;
Param4 = |&lt;br /&gt;
Remarks = The device specific configuration is passed to the SPI controller immediately before the transaction starts. The driver keeps the configuration between calls to this function or until the SPI bus handle is closed}}&lt;br /&gt;
&lt;br /&gt;
{{APIEx | HeadLevel = ==== | Signature = BOOL SPIUserTransact (HANDLE hDevice, [[#SPITRANS|SPITRANS]]* pTrans) | &lt;br /&gt;
Description = Submits SPI data transaction to the target device |  &lt;br /&gt;
Return = TRUE - indicates success.|&lt;br /&gt;
Param1 = *hDevice - Handle to an open SPI bus instance|&lt;br /&gt;
Param2 = *pTrans - pointer to data structures containing data buffers for the transaction&lt;br /&gt;
|&lt;br /&gt;
Param3 = |&lt;br /&gt;
Param4 = |&lt;br /&gt;
Remarks = The SPI transaction data buffers must be allocated and released by the user&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Windows CE|SPI Sample ]]&lt;br /&gt;
[[Category:CM-X300|WinCE: SPI Sample ]]&lt;/div&gt;</summary>
		<author><name>Shai</name></author>
		
	</entry>
</feed>