Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

PIO Kernel module

Altera_Forum
Honored Contributor II
1,074 Views

Hello, 

I'm currently using a Kernel module for LED PIO as a character device. I control it with fopen, fprintf, fread in my application. But I would like to write integer and use 32 bit registers. I know i could use fwrite but i'm not sure the module can handle it. 

What can i do in order to send integers instead of bytes to the kernel module? 

;)
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
295 Views

Unix file io is all character/byte based, the stdio functions are best used for text! 

 

You probably ought to use open/read/write/close rather than the stdio forms, at least they'll generate one system call per function call... 

 

For device control look at ioctl().
0 Kudos
Reply