Skip to content

dwilkins/pwm-sunxi

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

pwm-sunxi

Kernel Module to support pwm for the sun4i (and others???)

Creates a sysfs structure like the following:

   -- pwm-sunxi
      |
      +----pwmX
               |
               +---duty
               +---duty_percent
               +---period
               +---polarity
               +---pulse
               +---pin
               +---run

Period values can be a bit confusing - I have a google spreadsheet that you can use to explore what will happen with different period and duty values

Allwinner A10 Prescale explorer

  • period (r/w)

    period that makes up a cycle. Can be expressed as hz, khz, ms, or us. Whole numbers only.Examples:

    echo 10hz > /sys/class/pwm-sunxi/pwm0/period
    echo 1khz > /sys/class/pwm-sunxi/pwm0/period
    echo 100ms > /sys/class/pwm-sunxi/pwm0/period
    echo 100us > /sys/class/pwm-sunxi/pwm0/period
    echo 150khz > /sys/class/pwm-sunxi/pwm0/period
  • duty (r/w)

    portion of the period above that is "active" or on. Same units as above

  • duty_percent (r/w)

    duty expressed as a percentage. Whole numbers only

    echo 50 > /sys/class/pwm-sunxi/pwm0/duty_percent
  • polarity(r/w)

    polarity of the pin during the duty portion. 1 = high, 0 = low during

  • pulse (r/w)

    Output one pulse at the specified period and duty

  • pin (ro)

    Name of the A10 pin this pwm outputs on. This is hardwired and informational only. Example: PB2

  • run (r/w) Enable the PWM with the previously set parameters. Example:

    echo 1 > /sys/class/pwm-sunxi/pwm0/run
    echo 0 > /sys/class/pwm-sunxi/pwm0/run

About

Kernel Module to support pwm for the sun4i (and others???)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages