Add DAC initialization

This commit is contained in:
Jeremy Soller 2020-01-28 14:59:54 -07:00
parent d52683fcb4
commit 5cd6f77e2a
No known key found for this signature in database
GPG Key ID: E988B49EE78A7FB1
4 changed files with 24 additions and 5 deletions

View File

@ -0,0 +1,8 @@
#include <board/dac.h>
void dac_init(void) {
// Enable DAC5, used for KBLIGHT_ADJ
DACPDREG &= ~(1 << 5);
// Set DAC5 to 0V
DACDAT5 = 0;
}

View File

@ -210,7 +210,7 @@ void gpio_init() {
// WLAN_PWR_EN
GPCRJ4 = GPIO_OUT | GPIO_UP;
// KBLIGHT_ADJ
GPCRJ5 = GPIO_OUT;
GPCRJ5 = GPIO_ALT;
// 3G_PWR_EN
GPCRJ6 = GPIO_OUT | GPIO_UP;
// NC

View File

@ -0,0 +1,8 @@
#ifndef _BOARD_DAC_H
#define _BOARD_DAC_H
#include <ec/dac.h>
void dac_init(void);
#endif // _BOARD_DAC_H

View File

@ -4,6 +4,7 @@
#include <arch/delay.h>
#include <board/battery.h>
#include <board/dac.h>
#include <board/gpio.h>
#include <board/gctrl.h>
#include <board/kbc.h>
@ -46,12 +47,14 @@ void timer_2(void) __interrupt(5) {
void init(void) {
gpio_init();
gctrl_init();
kbc_init();
pmc_init();
kbscan_init();
dac_init();
pwm_init();
smbus_init();
kbc_init();
kbscan_init();
pmc_init();
peci_init();
smbus_init();
//TODO: INTC
}