blob: 9c4dfef498a4e178049db225dca87d92589963e4 (
plain)
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
|
/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* Switch module for Chrome EC */
#ifndef __CROS_EC_SWITCH_H
#define __CROS_EC_SWITCH_H
#include "common.h"
#include "gpio.h"
/**
* Interrupt handler for switch inputs.
*
* @param signal Signal which triggered the interrupt.
*/
void switch_interrupt(enum gpio_signal signal);
/**
* Switch task.
*/
void switch_task(void);
/**
* Return non-zero if AC power is present.
*/
int switch_get_ac_present(void);
/**
* Return non-zero if lid is open.
*
* Uses the debounced lid state, not the raw signal from the GPIO.
*/
int switch_get_lid_open(void);
/**
* Return non-zero if write protect signal is asserted.
*/
int switch_get_write_protect(void);
#endif /* __CROS_EC_SWITCH_H */
|