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
| |
| void | brake_release (void) |
Releases the electromagnetic brake
| |
| 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
| |
| 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
| |
| void | pwm_off (void) |
Turns the PWM off
| |
| void | motor_initialize (unsigned long base, float voltage, float freq) |
| Initializes the motor driver. | |
| void | motor_finalize (void) |
Finalizes the motor driver
| |
| void | motor_on (void) |
Turns the motor driver on
| |
| void | motor_off (void) |
Turns the motor driver off
| |
| 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
| |
| void | encoder_initialize (unsigned long base, long pulses) |
| Initializes Encoder, clears the counter on the quadrature decoder chip. | |
| void | encoder_finalize (void) |
Finalizes Encoder
| |
| 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
| |
| void | aic_off (void) |
Turns an AIC off
| |
| void | aic_initialize (unsigned long base, float vm, float freq, long np) |
| Initializes an AIC. | |
| void | aic_finalize (void) |
Finalizes an AIC
| |
|
||||||||||||||||||||
|
Initializes an AIC.
|
|
|
Initializes brake.
|
|
|
Gets the count on the quadrature decoder chip.
|
|
|
Gets the count and clears the counter on the quadrature decoder chip.
|
|
||||||||||||
|
Initializes Encoder, clears the counter on the quadrature decoder chip.
|
|
|
Reads the counter on the quadrature decoder chip and converts the motion to radians.
|
|
|
Reads the counter on the quadrature decoder chip, converts the motion to radians and clears the counter.
|
|
|
Initializes Index.
|
|
|
Reads the sync-switch.
|
|
||||||||||||||||
|
Initializes the motor driver.
|
|
|
Sets the voltage to be applied by the motor driver.
|
|
|
Returns the frequency of PWM.
|
|
||||||||||||||||
|
PWM initialization.
|
|
|
Sets the frequency of PWM in cycles of 10MHz.
|
|
|
Sets the duty-cycle of PWM.
|
|
|
Sets the duty-cycle of PWM.
|
|
|
Sets the frequency of PWM.
|
1.3.6