pihwm
A lightweight C library for Raspberry Pi hardware modules.
|
Pulse width modulation library function implementation. More...
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
#include <fcntl.h>
#include <assert.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h>
#include "pihwm.h"
#include "pi_pwm.h"
Go to the source code of this file.
Functions | |
int | pwm_init () |
Initialise the PWM peripheral. | |
void | pwm_mode (unsigned int mode) |
Set mode for the PWM peripheral. | |
void | pwm_value (unsigned int value) |
Set PWM value. | |
void | pwm_release () |
Releases the PWM peripheral and unmaps the memory. | |
Variables | |
volatile unsigned int * | gpio |
volatile unsigned int * | pwm |
volatile unsigned int * | clk |
Pulse width modulation library function implementation.
Copyright (C) 2013 Omer Kilic omerk - Erlang Solutions Copyright (C) 2013 Jeremy Bennett ilic @gmai l.co mjerem - Embecosm Limited y.be nnett @emb ecosm .com
This file is part of pihwm http://omerk.github.io/pihwm
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file pi_pwm.c.