Enable the FET to drive LED_PWM at full blast.

This commit is contained in:
László Monda
2017-01-09 18:57:20 +01:00
parent 24cdab4be2
commit f6a8c56f61
2 changed files with 13 additions and 1 deletions

View File

@@ -11,9 +11,16 @@ void LedDriver_InitAllLeds(char isEnabled)
{
CLOCK_EnableClock(LED_DRIVER_SDB_CLOCK);
PORT_SetPinMux(LED_DRIVER_SDB_PORT, LED_DRIVER_SDB_PIN, kPORT_MuxAsGpio);
GPIO_PinInit(GPIOA, LED_DRIVER_SDB_PIN, &(gpio_pin_config_t){kGPIO_DigitalOutput, 0});
GPIO_PinInit(LED_DRIVER_SDB_GPIO, LED_DRIVER_SDB_PIN, &(gpio_pin_config_t){kGPIO_DigitalOutput, 0});
GPIO_WritePinOutput(LED_DRIVER_SDB_GPIO, LED_DRIVER_SDB_PIN, 1);
#if UHK_PCB_MAJOR_VERSION == 7
CLOCK_EnableClock(LED_DRIVER_PWM_CLOCK);
PORT_SetPinMux(LED_DRIVER_PWM_PORT, LED_DRIVER_PWM_PIN, kPORT_MuxAsGpio);
GPIO_PinInit(LED_DRIVER_PWM_GPIO, LED_DRIVER_PWM_PIN, &(gpio_pin_config_t){kGPIO_DigitalOutput, 0});
GPIO_WritePinOutput(LED_DRIVER_PWM_GPIO, LED_DRIVER_PWM_PIN, 1);
#endif
LedDriver_SetAllLedsTo(isEnabled ? 0xFF : 0x00);
}

View File

@@ -16,6 +16,11 @@
#define LED_DRIVER_SDB_CLOCK kCLOCK_PortA
#define LED_DRIVER_SDB_PIN 2
#define LED_DRIVER_PWM_PORT PORTD
#define LED_DRIVER_PWM_GPIO GPIOD
#define LED_DRIVER_PWM_CLOCK kCLOCK_PortD
#define LED_DRIVER_PWM_PIN 6
#define LED_DRIVER_REGISTER_SHUTDOWN 0x0A
#define LED_DRIVER_REGISTER_FRAME 0xFD