Add PWM control

This commit is contained in:
Jeremy Soller
2019-09-30 09:02:53 -06:00
parent 35a869bb49
commit 3fb1ecd84b
5 changed files with 55 additions and 3 deletions

View File

@ -0,0 +1,8 @@
#ifndef _BOARD_PWM_H
#define _BOARD_PWM_H
#include <ec/pwm.h>
void pwm_init(void);
#endif // _BOARD_PWM_H

View File

@ -9,6 +9,7 @@
#include <board/kbscan.h>
#include <board/pmc.h>
#include <board/ps2.h>
#include <board/pwm.h>
void external_0(void) __interrupt(0) {
printf("external_0\n");
@ -40,8 +41,9 @@ void init(void) {
kbc_init();
pmc_init();
kbscan_init();
pwm_init();
//TODO: INTC, PECI, PWM, SMBUS
//TODO: INTC, PECI, SMBUS
// PECI information can be found here: https://www.intel.com/content/dam/www/public/us/en/documents/design-guides/core-i7-lga-2011-guide.pdf
}

View File

@ -0,0 +1,8 @@
#include <board/pwm.h>
void pwm_init(void) {
// Set T0CHSEL to TACH0A and T1CHSEL to TACH1A
TSWCTLR = 0;
// Turn on the CPU fan at full blast (temperature control TODO)
DCR2 = 0xFF;
}