Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. #ifndef MAIN_H_
  2. #define MAIN_H_
  3.  
  4. #include "driverlib/driverlib.h"
  5.  
  6. #define TIMER_A_PERIOD 1000 //T = 1/f = (TIMER_A_PERIOD * 1 us)
  7. #define HIGH_COUNT 500 //Number of cycles signal is high (Duty Cycle = HIGH_COUNT / TIMER_A_PERIOD)
  8.  
  9. //Output pin to buzzer
  10. #define PWM_PORT GPIO_PORT_P1
  11. #define PWM_PIN GPIO_PIN7
  12. //LaunchPad LED1 - note unavailable if UART is used
  13. #define LED1_PORT GPIO_PORT_P1
  14. #define LED1_PIN GPIO_PIN0
  15. //LaunchPad LED2
  16. #define LED2_PORT GPIO_PORT_P4
  17. #define LED2_PIN GPIO_PIN0
  18. //LaunchPad Pushbutton Switch 1
  19. #define SW1_PORT GPIO_PORT_P1
  20. #define SW1_PIN GPIO_PIN2
  21. //LaunchPad Pushbutton Switch 2
  22. #define SW2_PORT GPIO_PORT_P2
  23. #define SW2_PIN GPIO_PIN6
  24. //Input to ADC - in this case input A9 maps to pin P8.1
  25. #define ADC_IN_PORT GPIO_PORT_P8
  26. #define ADC_IN_PIN GPIO_PIN1
  27. #define ADC_IN_CHANNEL ADC_INPUT_A9
  28.  
  29. void Init_GPIO(void);
  30. void Init_Clock(void);
  31. void Init_UART(void);
  32. void Init_PWM(void);
  33. void Init_ADC(void);
  34.  
  35. Timer_A_outputPWMParam param; //Timer configuration data structure for PWM
  36.  
  37. #endif /* MAIN_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement