io_null

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

io_null

495 Views
razed11
Contributor V

Hi Everyone,

Last night I wrote a simple C++ class that wraps the file I/O for my debug output. When activated it selects SWO for output and when deactivated it selects the null driver.

The IO calls seem to robust to pass NULL. For example if I try to write something using NULL it test the file pointer before performing the write. If this is true for the other routines why would one use the null driver?

Thanks,

Kenny

Tags (2)
0 Kudos
4 Replies

344 Views
soledad
NXP Employee
NXP Employee

Hello Kenny,

In the past I used the null driver in order to create my own driver, please check the document attached (page 18) and let me know if this helps.


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

344 Views
razed11
Contributor V

Thanks. Have any idea on the question about pass NULL versus just using the default driver? That was the real question.

Curious why you implemented your own /dev/null? What did it do?

Not thrilled with this "assumed answered" business. Maybe give it some time. I understand that not everyone circles back to approve of an answer but I suspect it will no longer get read and my fundamental question was not addressed.

Kenny

0 Kudos

344 Views
soledad
NXP Employee
NXP Employee

Hi,

The null device driver is an I/O device that functions as a device driver but doesn’t perform any work.

It can be used to understand and test basic communication with the I/O subsystem.

I created a motor control driver for a step motor, I used as reference the below application note,

http://cache.freescale.com/files/32bit/doc/app_note/AN3902.pdf

This appnote may helps you!


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

344 Views
razed11
Contributor V

I appreciate the links to the app notes my question isn't related to writing my own driver. Please give my question another read.

Please mark it unanswered. I'm not how that happens or why I can't unmark it!!! Good forum overall though.

0 Kudos