Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

PIO Kernel module

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?

;)

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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().