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.

30 lines
570 B

  1. #ifndef _MAIN_H_
  2. #define _MAIN_H_
  3. #include <avr/io.h>
  4. #define F_CPU 8000000
  5. #include <util/delay.h>
  6. #define LED_RT (1<<PORTB4)
  7. #define LED_GN (1<<PORTB5)
  8. #define PHASE_A_H (1<<PORTB1)
  9. #define PHASE_B_H (1<<PORTB2)
  10. #define PHASE_C_H (1<<PORTB3)
  11. #define PHASE_H_MASK (PHASE_A_H | PHASE_B_H | PHASE_C_H)
  12. #define PHASE_A_L (1<<PORTD4)
  13. #define PHASE_B_L (1<<PORTD3)
  14. #define PHASE_C_L (1<<PORTD2)
  15. #define PHASE_L_MASK (PHASE_A_L | PHASE_B_L | PHASE_C_L)
  16. #define SENSE_A 0
  17. #define SENSE_B 1
  18. #define SENSE_C 2
  19. #define SENSE_VOLTAGE 3
  20. #define SENSE_CURRENT 6
  21. #endif