<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>open-nandra &#187; Coding</title>
	<atom:link href="http://open-nandra.com/category/linux/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://open-nandra.com</link>
	<description>open source</description>
	<lastBuildDate>Sun, 01 Jan 2012 13:10:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>New projects</title>
		<link>http://open-nandra.com/2011/06/new-projects-2/</link>
		<comments>http://open-nandra.com/2011/06/new-projects-2/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 19:24:00 +0000</pubDate>
		<dc:creator>Marek Belisko</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[pandaboard]]></category>

		<guid isPermaLink="false">http://open-nandra.com/?p=608</guid>
		<description><![CDATA[It was long time I wrote some post so forgive me . It was little bit busy months. Anyway I&#8217;m still working on some opensource projects. One of them will be based on Panda board so any new findings and fixes will be reported here. Stay tuned marek &#160;]]></description>
			<content:encoded><![CDATA[<p>It was long time I wrote some post so forgive me <img src='http://open-nandra.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . It was little bit busy months. Anyway I&#8217;m still working on some opensource projects. One of them will be based on Panda board so any new findings and fixes will be reported here. Stay tuned <img src='http://open-nandra.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>marek</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://open-nandra.com/2011/06/new-projects-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Friendly arm 2440 and sca3000 accelerometer</title>
		<link>http://open-nandra.com/2010/09/friendly-arm-2440-and-sca3000-accelerometer/</link>
		<comments>http://open-nandra.com/2010/09/friendly-arm-2440-and-sca3000-accelerometer/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 11:28:36 +0000</pubDate>
		<dc:creator>Marek Belisko</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[friendlyarm]]></category>
		<category><![CDATA[mini2440]]></category>
		<category><![CDATA[sca3000]]></category>

		<guid isPermaLink="false">http://open-nandra.com/?p=421</guid>
		<description><![CDATA[﻿﻿﻿﻿David Lewin ask me on theFriendly arm forum to check driver and setup for SPI on mini2440 board. SPI master driver is prepared so just add some platform data and board info for sca3000 and it must work . If you would like to connect some SPI device on your mini2440 board you need to: 1. update [...]]]></description>
			<content:encoded><![CDATA[<p>﻿﻿﻿﻿David Lewin ask me on theFriendly arm forum to check driver and setup for SPI on mini2440 board.</p>
<div id="_mcePaste">SPI master driver is prepared so just add some platform data and board info for sca3000 and it must work <img src='http://open-nandra.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</div>
<p><span id="more-421"></span><br />
If you would like to connect some SPI device on your mini2440 board you need to:</p>
<p>1. update mach-mini2440.c file in arch/arm/mach-s3c2440/ following:</p>
<p>Add s3c2410_spi_info structure with filled entries<br />
(we use standars SPI pins for spi.0 on CON4):</p>
<pre>static struct s3c2410_spi_info mini2440_spi0_pdata = {
         .pin_cs = S3C2410_GPG(2),
         .num_cs = 1,
         .bus_num = 0,
         .gpio_setup = &amp;s3c24xx_spi_gpiocfg_bus0_gpe11_12_13,
};</pre>
<p>2. add platform data for device:</p>
<pre>static struct spi_board_info mini2440_spi_devs[] __initdata = {
         {       /* sca3000 accel */
                 .modalias       = "sca3000_d01",
                 .chip_select    = 0,
                 .max_speed_hz   = 1 * 1000 * 1000,
                 .bus_num        = 0,
         }
};</pre>
<p>3. Add &amp;s3c_device_spi0 line to array of structures mini2440_devices[].</p>
<p>4. In function  mini2440_init add lines:</p>
<pre>s3c_device_spi0.dev.platform_data = &amp;mini2440_spi0_pdata;

spi_register_board_info(mini2440_spi_devs,
                                 ARRAY_SIZE(mini2440_spi_devs));</pre>
<p>You have now prepared kernel code for working with SPI accelerometer.<br />
Just enable all drivers you need (SPI, SCA3000, &#8230;) and recompile kernel.</p>
<p>If this is little bit hard to understand you can download a <a href="http://open-nandra.com/wp-content/uploads/patch">::patch::</a> for it.</p>
]]></content:encoded>
			<wfw:commentRss>http://open-nandra.com/2010/09/friendly-arm-2440-and-sca3000-accelerometer/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>T-mobile Leadtek USB modem LR7F04 Flash-OFDM Flarion kernel driver</title>
		<link>http://open-nandra.com/2010/02/t-mobile-leadtek-usb-modem-lr7f04-flash-ofdm-flarion-kernel-driver/</link>
		<comments>http://open-nandra.com/2010/02/t-mobile-leadtek-usb-modem-lr7f04-flash-ofdm-flarion-kernel-driver/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 21:54:23 +0000</pubDate>
		<dc:creator>Marek Belisko</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Flarion]]></category>
		<category><![CDATA[LR7F04]]></category>
		<category><![CDATA[T-mobile]]></category>
		<category><![CDATA[USB modem]]></category>

		<guid isPermaLink="false">http://open-nandra.com/?p=342</guid>
		<description><![CDATA[Friend of mine just want to use Flarion device on Ubuntu 9.10 but driver was compilable only for older kernels (2.6.26, 2.6.27). I try to fix it and provide driver functionality for newest kernels.Hacking takes me maybe 1/2 a day and result was very good. Device is properly loaded to kernel (tested on openSuse 11.2 [...]]]></description>
			<content:encoded><![CDATA[<p>Friend of mine just want to use Flarion device on Ubuntu 9.10 but driver was compilable only for older kernels (2.6.26, 2.6.27).</p>
<p>I try to fix it and provide driver functionality for newest kernels.<span id="more-342"></span>Hacking takes me maybe 1/2 a day and result was very good.</p>
<p>Device is properly loaded to kernel (tested on openSuse 11.2 on 2.6.31-12).</p>
<p>Also new eth interface is correctly created and fully working.</p>
<p>I observed that loading of DSP firmware sometimes fails (need to fix this)<br />
and also removing device makes a troubles.I try to fix if asap.</p>
<p>You can download code at:</p>
<pre>git://github.com/nandra/ft1000.git</pre>
<p>Then just follow instructions in README file and if something is wrong please let me know.</p>
<p>Marek</p>
]]></content:encoded>
			<wfw:commentRss>http://open-nandra.com/2010/02/t-mobile-leadtek-usb-modem-lr7f04-flash-ofdm-flarion-kernel-driver/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>container_of macro or how it works</title>
		<link>http://open-nandra.com/2009/08/container_of-macro-or-how-it-works/</link>
		<comments>http://open-nandra.com/2009/08/container_of-macro-or-how-it-works/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 10:56:44 +0000</pubDate>
		<dc:creator>Marek Belisko</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[HOW-TOs]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://open-nandra.com/?p=257</guid>
		<description><![CDATA[Some time when I start with kernel development I couln&#8217;t understand how container_of macro from kerne lworks. Some days ago there were and post on kernelnewbies list about using this. This gives me a signal to finally understand what&#8217;s going on. I try to write simple user space application with container_of macro using. Code: #include [...]]]></description>
			<content:encoded><![CDATA[<p>Some time when I start with kernel development I couln&#8217;t understand how container_of macro from kerne lworks.<br />
Some days ago there were and post on kernelnewbies list about using this. This gives me a signal to finally understand what&#8217;s going on. I try to write simple user space application with container_of macro using.<span id="more-257"></span></p>
<p>Code:</p>
<pre>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

#define offsetof(TYPE, MEMBER) ((size_t) &amp;((TYPE *)0)-&gt;MEMBER)

#define container_of(ptr, type, member) ({            \
 const typeof( ((type *)0)-&gt;member ) *__mptr = (ptr);    \
 (type *)( (char *)__mptr - offsetof(type,member) );})

#define CONT(prt, type, mem) container_of((prt), type, mem)

struct test {
 int a;
};

struct m {
 int b;
 struct test t;
 int c;
};

int main(int argc, char *argv[])
{
 /* existing structure */
 struct m *ma;
 ma = malloc(sizeof(struct m));
 ma-&gt;t.a = 5;
 ma-&gt;b = 3;
 /* pointer to existing entry */    
 struct test *te = &amp;ma-&gt;t;

 struct m *m = CONT(te, struct m, t);

 printf("m-&gt;b = %d\n", m-&gt;b);

 return EXIT_SUCCESS;
}</pre>
<p>At the beginnig is defined offsetof and container_of macros taken from kernel source.</p>
<p>We will use structure m which encapsulate structure test.</p>
<p>Container of macro is used to get a pointer to beginning of structure which contain element by type.</p>
<p>In our case we have a element t (in struct main) and would like to get pointer to main structure.</p>
<p>Input arguments will be : prt &#8211; pointer to element, type &#8211; type of element, elemet.</p>
<p>Note: this code is just for understanding how it works, don&#8217;t comment it <img src='http://open-nandra.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>You can find very good description at : <a href="http://www.kroah.com/log/linux/container_of.html" target="_blank">http://www.kroah.com/log/linux/container_of.html</a></p>
<p>Marek</p>
]]></content:encoded>
			<wfw:commentRss>http://open-nandra.com/2009/08/container_of-macro-or-how-it-works/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to control console application in Qt.</title>
		<link>http://open-nandra.com/2009/06/how-to-control-console-application-in-qt/</link>
		<comments>http://open-nandra.com/2009/06/how-to-control-console-application-in-qt/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 13:38:16 +0000</pubDate>
		<dc:creator>Marek Belisko</dc:creator>
				<category><![CDATA[HOW-TOs]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[QProcess]]></category>

		<guid isPermaLink="false">http://open-nandra.com/?p=251</guid>
		<description><![CDATA[For liqrf project we would like to add some gui so I start thinking about possibility to have controlled existing liqrf console appliaction via some nice gui (be honest not all users like command line ). In this how to I&#8217;ll try to show how easily use Qprocess class for this purpose. For Qt development [...]]]></description>
			<content:encoded><![CDATA[<p>For liqrf project we would like to add some gui so I start thinking about possibility to have controlled existing liqrf console appliaction via some nice gui (be honest not all users like command line <img src='http://open-nandra.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ). In this how to I&#8217;ll try to show how easily use Qprocess class for this purpose.</p>
<p><span id="more-251"></span></p>
<p>For Qt development I&#8217;m using Qt Creator which is freely available and combine designer and editor to one complex program.</p>
<p>First simple program which print some data to standard output.</p>
<pre>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;unistd.h&gt;

int main(void)
{
    unsigned i = 0;

    for ( ; ; ) {
        fprintf(stdout,"Value = %X\n", i++);
        fflush(stdout);
        sleep(2);
    }
    return 0;
}</pre>
<p>For compiling use :</p>
<pre>gcc -o test test.c</pre>
<p>For reading stdout we use Qt signal <strong>readyStandardOutput()</strong> which is triggered when something is written to stdout.</p>
<p>In Qt Creator just create default Qt4 application.</p>
<p>Add to mainwindow.h:</p>
<pre>private:
    Ui::MainWindowClass *ui;
    QProcess *process;</pre>
<p>Methods and slot in mainwindow.cpp:</p>
<pre>#include "mainwindow.h"
#include "ui_mainwindow.h"
#include &lt;QProcess&gt;

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent), ui(new Ui::MainWindowClass)
{
    ui-&gt;setupUi(this);
    process = new QProcess(this);
    process-&gt;setReadChannel(QProcess::StandardOutput);
    connect(process, SIGNAL(readyReadStandardOutput()), this, SLOT(updateOutput()));
    process-&gt;start("./test");

}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow :: updateOutput(void)
{
    QByteArray bytes = process-&gt;readAllStandardOutput();
    ui-&gt;textEdit-&gt;insertPlainText(bytes);
}</pre>
<p>That&#8217;s all. When you run Qt application you should see all stdout in textEdit.<br />
Complete project here:  <a href="http://open-nandra.com/wp-content/uploads/ext_process.tar.gz">ext_process.tar</a></p>
<p>Marek</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 14px; width: 1px; height: 1px;"><!-- p, li { white-space: pre-wrap; } --></div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 14px; width: 1px; height: 1px;"><!-- p, li { white-space: pre-wrap; } --></div>
]]></content:encoded>
			<wfw:commentRss>http://open-nandra.com/2009/06/how-to-control-console-application-in-qt/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Bug tracking system</title>
		<link>http://open-nandra.com/2009/05/bug-tracking-system/</link>
		<comments>http://open-nandra.com/2009/05/bug-tracking-system/#comments</comments>
		<pubDate>Thu, 07 May 2009 19:52:51 +0000</pubDate>
		<dc:creator>Marek Belisko</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[bug tracking]]></category>
		<category><![CDATA[buggenie]]></category>

		<guid isPermaLink="false">http://open-nandra.com/?p=219</guid>
		<description><![CDATA[I was thinking about possibility to track errors  new requirements during development cycle and then after project or release is finished check what cost a time resources and so on. Browsing and installing bug trackers on localhost takes me half a day and I think I choose the best one . I choose buggenie because [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="buggenie" src="http://www.thebuggenie.com/logo.png" alt="" width="292" height="64" />I was thinking about possibility to track errors  new requirements during development cycle and then after project or release is finished check what cost a time resources and so on. Browsing and installing bug trackers on localhost takes me half a day and I think I choose the best one <img src='http://open-nandra.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . I choose <a href="http://www.thebuggenie.net/" target="_blank">buggenie</a> because it has very nice and user friendly administration and other advantages. But the biggest advantage : it&#8217;s free <img src='http://open-nandra.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p>You can check it here <a href="http://open-nandra.com/bugtracking/index.php" target="_blank">::bug tracker::</a></p>
]]></content:encoded>
			<wfw:commentRss>http://open-nandra.com/2009/05/bug-tracking-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New projects</title>
		<link>http://open-nandra.com/2009/02/new-projects/</link>
		<comments>http://open-nandra.com/2009/02/new-projects/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 10:19:10 +0000</pubDate>
		<dc:creator>Marek Belisko</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[iqrf]]></category>
		<category><![CDATA[nw8xx]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://open-nandra.com/?p=103</guid>
		<description><![CDATA[Development of linux on HTC Oxygen is still not finished but I would like to start some new projects which help open-source community. First should be create an application for debugging and programming IQRF modules in linux environment (company support only windows). First steps was already done (spying usb interface) to reverse engineer it.  We [...]]]></description>
			<content:encoded><![CDATA[<p>Development of linux on HTC Oxygen is still not finished but I would like to start some new projects which help open-source community. <span id="more-103"></span></p>
<p>First should be create an application for debugging and programming IQRF modules in linux environment (company support only windows). First steps was already done (spying usb interface) to reverse engineer it.  We try to use libusb library to create an application which can communicate with device. More infos about modules at <a href="http://www.iqrf.com" target="_blank">www.iqrf.com</a>.</p>
<p>Next project should be focused on driver development. I participate on <a href="http://linuxdriverproject.org" target="_blank">linuxdriver</a> project. I choose driver for webcams based on NW8xx chip from out-of-tree drivers to adapt and get it to mainline. I will continue on previous work. Updating was stopped in 2007 and no other updates are available. This driver should support to 8 webcams which use mentioned chip. So thats the plans <img src='http://open-nandra.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<p>Marek</p>
]]></content:encoded>
			<wfw:commentRss>http://open-nandra.com/2009/02/new-projects/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ctimer pushed to github.com</title>
		<link>http://open-nandra.com/2009/01/ctimer-pushed-to-githubcom/</link>
		<comments>http://open-nandra.com/2009/01/ctimer-pushed-to-githubcom/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 12:51:26 +0000</pubDate>
		<dc:creator>Marek Belisko</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[high resolution timer]]></category>
		<category><![CDATA[timer]]></category>

		<guid isPermaLink="false">http://open-nandra.com/?p=60</guid>
		<description><![CDATA[More about project can be found at Projects page. Source can be browsed here and downloaded from github.com: git clone git://github.com/nandra/ctimer.git ctimer]]></description>
			<content:encoded><![CDATA[<p>More about project can be found at Projects page.</p>
<p>Source can be browsed <a href="https://github.com/nandra/ctimer/tree" target="_blank">here</a> and downloaded from github.com:</p>
<pre>git clone <span class="git_url_facebox">git://github.com/nandra/ctimer.git</span> ctimer</pre>
]]></content:encoded>
			<wfw:commentRss>http://open-nandra.com/2009/01/ctimer-pushed-to-githubcom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

