-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPWM_tail.h
51 lines (43 loc) · 1.26 KB
/
PWM_tail.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* @file PWM_tail.h
* @author Gus Ellerm, Andrew Limmer-Wood, Adam Ross
* @date 25/05/2018
* @brief Heade file for tail rotor motor PWM
*/
#ifndef PWM_TAIL_H_
#define PWM_TAIL_H_
/**********************************************************
* Defined constants
**********************************************************/
// PWM Hardware Details M0PWM5
// ---Tail Rotor PWM: PF5, J3-10
#define PWM_TAIL_BASE PWM1_BASE
#define PWM_TAIL_GEN PWM_GEN_2
#define PWM_TAIL_OUTNUM PWM_OUT_5
#define PWM_TAIL_OUTBIT PWM_OUT_5_BIT
#define PWM_TAIL_PERIPH_PWM SYSCTL_PERIPH_PWM1
#define PWM_TAIL_PERIPH_GPIO SYSCTL_PERIPH_GPIOF
#define PWM_TAIL_GPIO_BASE GPIO_PORTF_BASE
#define PWM_TAIL_GPIO_CONFIG GPIO_PF1_M1PWM5
#define PWM_TAIL_GPIO_PIN GPIO_PIN_1
/**
* Sets the PWM to a percentage (%) for the tail rotor motor
* @param pwm: The PWM value
*/
void
setPWMtail ( int pwm );
/**
* Returns the PWM duty cycle as a percentage (%) for the tail rotor motor
*/
int
getPWMtail ( void );
/**
* Update to LED display the PWM duty cycle as a percentage (%) for tail rotor
*/
void
updateDisplayPWMtail ( void );
/**
* Initializes the PWM for the tail rotor motor
*/
void
initPWMtail ( void );
#endif /* PWM_TAIL_H_ */