Contiki-NG

Header file for the CC2538 PWM driver. More...

#include "contiki.h"
#include "dev/ioc.h"
#include "dev/gpio.h"
#include "dev/sys-ctrl.h"

Go to the source code of this file.

Macros

PWM return values
#define PWM_SUCCESS   0
 
#define PWM_ERROR   (-1)
 
PWM recommended values respect to peripheral clock frequency
#define PWM_SYS_16MHZ_NO_PRES_MIN   0xFFFF
 
#define PWM_SYS_16MHZ_NO_PRES_MIN_FREQ   244
 
#define PWM_SYS_16MHZ_PRES_MIN   0x00F42400
 
#define PWM_SYS_16MHZ_PRES_MIN_FREQ   1
 
#define PWM_SYS_16MHZ_NO_PRES_MAX   100
 
#define PWM_SYS_16MHZ_NO_PRES_MAX_FREQ   160000
 
PWM driver definitions and configuration values
#define PWM_TIMER_A   0
 
#define PWM_TIMER_B   1
 
#define PWM_TIMER_0   0
 
#define PWM_TIMER_1   1
 
#define PWM_TIMER_2   2
 
#define PWM_TIMER_3   3
 
#define PWM_TIMER_MIN   PWM_TIMER_0
 
#define PWM_TIMER_MAX   PWM_TIMER_3
 
#define PWM_SIGNAL_STRAIGHT   1
 
#define PWM_SIGNAL_INVERTED   0
 
#define PWM_OFF_WHEN_STOP   0
 
#define PWM_ON_WHEN_STOP   1
 
#define PWM_GPTIMER_CFG_SPLIT_MODE   0x04
 
#define PWM_DUTY_MAX   100
 
#define PWM_DUTY_MIN   0
 
#define PWM_FREQ_MIN   PWM_SYS_16MHZ_PRES_MIN_FREQ
 
#define PWM_FREQ_MAX   PWM_SYS_16MHZ_NO_PRES_MAX_FREQ
 

Functions

PWM functions
int8_t pwm_enable (uint32_t freq, uint8_t duty, uint32_t count, uint8_t timer, uint8_t ab)
 Configures the general purpose timer in PWM mode. More...
 
int8_t pwm_disable (uint8_t timer, uint8_t ab, uint8_t port, uint8_t pin)
 Disables a previously PWM configured GPTn. More...
 
int8_t pwm_start (uint8_t timer, uint8_t ab, uint8_t port, uint8_t pin)
 Once configured, starts the PWM. More...
 
int8_t pwm_stop (uint8_t timer, uint8_t ab, uint8_t port, uint8_t pin, uint8_t state)
 Halts the PWM in a given GPT/timer. More...
 
int8_t pwm_set_direction (uint8_t timer, uint8_t ab, uint8_t dir)
 Sets the PWM duty cycle signal direction (high/low) More...
 
int8_t pwm_toggle_direction (uint8_t timer, uint8_t ab)
 Toggle the PWM signal direction (inverts the current duty cycle) More...
 

Detailed Description

Header file for the CC2538 PWM driver.

Author
Javier Sanchez jsanc.nosp@m.hez@.nosp@m.zoler.nosp@m.tia..nosp@m.com Antonio Lignan alina.nosp@m.n@zo.nosp@m.lerti.nosp@m.a.co.nosp@m.m

Definition in file pwm.h.