aicio.h File Reference


Detailed Description

I/O Interface Library.

Author:
Walter Fetter Lages <w.fetter@ieee.org>
Since:
AIC-1.4.2

#include "../lib/aicio/motor.c"
#include "../lib/aicio/encoder.c"
#include "../lib/aicio/aic.c"

Include dependency graph for aicio.h:

Include dependency graph

Defines

#define REF_FREQ   10e6
 Reference frequency = 10MHz.

#define SW_FREQ   20e3
 Default Switching Frequency = 20KHz.

#define TURNOFF_DELAY   600e-9
 H-bridge turn-off delay.

#define MIN_COUNT   (unsigned int)(2*TURNOFF_DELAY*REF_FREQ)
 PWM minimal count value.

#define MAX_COUNT   (unsigned int)(REF_FREQ/SW_FREQ)
 PWM maximal count value.


Functions

void brake_initialize (unsigned long base)
 Initializes brake.

void brake_apply (void)
 Applies the electromagnetic brake
Since:
AIC-1.4.2.


void brake_release (void)
 Releases the electromagnetic brake
Since:
AIC-1.4.2.


void index_initialize (unsigned long base)
 Initializes Index.

unsigned long index_read (void)
 Reads the sync-switch.

void pwm_set_count (unsigned int count)
 Sets the frequency of PWM in cycles of 10MHz.

void pwm_set_freq (float frequency)
 Sets the frequency of PWM.

float pwm_get_freq (void)
 Returns the frequency of PWM.

void pwm_initialize (unsigned long base, unsigned int min_count, unsigned int count)
 PWM initialization.

void pwm_finalize (void)
 Finalizes the PWM
Since:
AIC-1.4.2.


unsigned long pwm_set_duty_float (float dutycycle)
 Sets the duty-cycle of PWM.

unsigned long pwm_set_duty (unsigned long dutycycle)
 Sets the duty-cycle of PWM.

void pwm_on (void)
 Turns the PWM on
Since:
AIC-1.4.2.


void pwm_off (void)
 Turns the PWM off
Since:
AIC-1.4.2.


void motor_initialize (unsigned long base, float voltage, float freq)
 Initializes the motor driver.

void motor_finalize (void)
 Finalizes the motor driver
Since:
AIC-1.5.0.


void motor_on (void)
 Turns the motor driver on
Since:
AIC-1.5.0.


void motor_off (void)
 Turns the motor driver off
Since:
AIC-1.5.0.


float motor_set (float voltage)
 Sets the voltage to be applied by the motor driver.

 encoder_clear (void)
 Clears the counter on the quadrature decoder chip
Since:
AIC-1.5.0.


void encoder_initialize (unsigned long base, long pulses)
 Initializes Encoder, clears the counter on the quadrature decoder chip.

void encoder_finalize (void)
 Finalizes Encoder
Since:
AIC-1.5.0.


long encoder_get_count (void)
 Gets the count on the quadrature decoder chip.

long encoder_get_count_and_clear (void)
 Gets the count and clears the counter on the quadrature decoder chip.

float encoder_read (void)
 Reads the counter on the quadrature decoder chip and converts the motion to radians.

float encoder_read_and_clear (void)
 Reads the counter on the quadrature decoder chip, converts the motion to radians and clears the counter.

void aic_on (void)
 Turns an AIC on
Since:
AIC-1.5.0.


void aic_off (void)
 Turns an AIC off
Since:
AIC-1.5.0.


void aic_initialize (unsigned long base, float vm, float freq, long np)
 Initializes an AIC.

void aic_finalize (void)
 Finalizes an AIC
Since:
AIC-1.5.0.



Generated on Thu Mar 27 15:33:33 2008 for Actuator Interface Card by doxygen 1.3.6