AVR based brushless motor controller
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

29 lines
570 B

#ifndef _MAIN_H_
#define _MAIN_H_
#include <avr/io.h>
#define F_CPU 8000000
#include <util/delay.h>
#define LED_RT (1<<PORTB4)
#define LED_GN (1<<PORTB5)
#define PHASE_A_H (1<<PORTB1)
#define PHASE_B_H (1<<PORTB2)
#define PHASE_C_H (1<<PORTB3)
#define PHASE_H_MASK (PHASE_A_H | PHASE_B_H | PHASE_C_H)
#define PHASE_A_L (1<<PORTD4)
#define PHASE_B_L (1<<PORTD3)
#define PHASE_C_L (1<<PORTD2)
#define PHASE_L_MASK (PHASE_A_L | PHASE_B_L | PHASE_C_L)
#define SENSE_A 0
#define SENSE_B 1
#define SENSE_C 2
#define SENSE_VOLTAGE 3
#define SENSE_CURRENT 6
#endif