Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
CTCaer
GitHub Repository: CTCaer/hekate
Path: blob/master/bdk/power/bm92t36.h
1476 views
1
/*
2
* USB-PD driver for Nintendo Switch's TI BM92T36
3
*
4
* Copyright (c) 2020 CTCaer
5
*
6
* This program is free software; you can redistribute it and/or modify it
7
* under the terms and conditions of the GNU General Public License,
8
* version 2, as published by the Free Software Foundation.
9
*
10
* This program is distributed in the hope it will be useful, but WITHOUT
11
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13
* more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
#ifndef __BM92T36_H_
20
#define __BM92T36_H_
21
22
#include <utils/types.h>
23
24
#define BM92T36_I2C_ADDR 0x18
25
26
typedef struct _usb_pd_object_t
27
{
28
u32 amperage;
29
u32 voltage;
30
} usb_pd_object_t;
31
32
typedef struct _usb_pd_objects_t
33
{
34
u32 pdo_no;
35
usb_pd_object_t pdos[7];
36
usb_pd_object_t selected_pdo;
37
} usb_pd_objects_t;
38
39
void bm92t36_get_sink_info(bool *inserted, usb_pd_objects_t *usb_pd);
40
41
#endif
42
43