boardio.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef _ILOTOPONTV2_IO_
  2. #define _ILOTOPONTV2_IO_
  3. #define MOT_A LATCbits.LATC1
  4. #define MOT_B LATCbits.LATC0
  5. #define MOT_C LATAbits.LATA6
  6. #define MOT_D LATAbits.LATA7
  7. #define MOT_DIS LATAbits.LATA5
  8. #define SETPORT_MOTOR do{ TRISCbits.TRISC1=TRISCbits.TRISC0=TRISAbits.TRISA6=TRISAbits.TRISA7=TRISAbits.TRISA5=0;\
  9. \
  10. } while(0)
  11. #define MOT_PWM 2 // motor pwm number
  12. #define LAMP1 LATBbits.LATB0
  13. #define LAMP2 LATBbits.LATB4
  14. #define LAMP3 LATBbits.LATB5
  15. #define LAMP4 LATAbits.LATA4
  16. #define SETPORT_LAMPS do{ TRISBbits.TRISB0=TRISBbits.TRISB4=TRISBbits.TRISB5=TRISAbits.TRISA4=0;\
  17. PSTR1CON=0; PSTR1CONbits.STR1D=1; } while(0)
  18. #define LAMP1_PWM 4
  19. #define LAMP2_PWM 1
  20. #define LAMP3_PWM 3
  21. #define LAMP4_PWM 5
  22. #define K1PORT B
  23. #define K1BIT 1
  24. #define K2PORT B
  25. #define K2BIT 3
  26. #define K3PORT B
  27. #define K3BIT 2
  28. #define CURRENT_AN 0 // current measure
  29. #define TEMP_AN 1 // temperature analog channel
  30. #define VBATT_AN 2 // battery voltage analog channel
  31. #define SERIAL_DRV LATCbits.LATC5 // aux serial port
  32. #define SETPORT_SERIAL do { TRISCbits.TRISC5=TRISCbits.TRISC6=0; } while(0)
  33. #endif