Drive the LED_PWM line of the left half via TPM which doesn't work yet for some reason. Add protocol command for setting the LED_PWM brightness of the left half. Expose UpdateUsbReports()

This commit is contained in:
László Monda
2017-01-13 21:43:47 +01:00
parent 0ded50b43a
commit 9ef9e5f734
10 changed files with 89 additions and 8 deletions
+27
View File
@@ -0,0 +1,27 @@
#ifndef __LED_PWM_H__
#define __LED_PWM_H__
// Includes:
#include "fsl_tpm.h"
// Macros:
#define LED_PWM_PORT PORTB
#define LED_PWM_CLOCK kCLOCK_PortB
#define LED_PWM_PIN 5
#define LED_PWM_TPM_BASEADDR TPM1
#define LED_PWM_TPM_CHANNEL kTPM_Chnl_1
#define TPM_SOURCE_CLOCK CLOCK_GetFreq(kCLOCK_BusClk)
#define TPM_PWM_FREQUENCY 24000U
#define INITIAL_DUTY_CYCLE_PERCENT 100U
// Functions:
extern void LedPwm_Init();
void LedPwm_SetBrightness(uint8_t brightnessPercent);
#endif