Re: PWM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


> I plan to use 2 servos, but not at the same time. I'd love to see your
> code
> and test it. I'm using 2.6.26.8 currently.

I will send it on when I get back to work on Monday.


> How can I enable sysfs? Currently I'm not having any /sys on the system.

Serious? Just configure it in, and then mount it (early) when you boot up.

CONFIG_SYSFS=y

Type 'mount' on your development machine and see what it says for sysfs.

/sys on /sys type sysfs (rw,noexec,nosuid,nodev)


> The backlight driver's source is a great idea, will take a look at it.

Bill's PWM lib is probably the best solution if you want to try it. You
should give it a go and give him some feedback.


> Is it easier to control the TCs from userspace or just via kernel driver?

Depends how you define "easier". Writing kernel drivers isn't always
easier, but it's generally the better and safer solution.

Technically, it is easier to do direct memory read/writes (using /dev/mem)
to the microcontroller's registers ... but this is bad because you could
crash the whole system.

>From a kernel driver you allow access from userspace through your device
driver's API.

I'm not sure of the "official" word on this, but you can choose between
two different userspace APIs for your device driver:

* /dev
* /sys

With /dev you have your traditional read/write/ioctl commands (plus some
others). It's like a single data pipe into the device driver, and you have
to define a protocol and message types.

With /sys you can define any number of files and directories with
meaningful names that can be read/written-to. Each file is mapped to a
function in your driver which is called when you access it from userspace.

It's like a text based menu system and it's essentially self documenting.
I like sysfs, so I prefer to use it.

Have a look at hwmon on your development machine. You can simply 'cat' the
files to see the RPM fan speeds, CPU temperature, etc.

find /sys -name "hwmon*"

Aras


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

[Linux ARM]     [Linux ARM MSM]     [Linux ARM Kernel]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

Add to Google Follow linuxarm on Twitter