Skip to content

Commit 0cdab7c

Browse files
committed
add als w1160 driver.
1 parent cfac38b commit 0cdab7c

6 files changed

Lines changed: 564 additions & 2 deletions

File tree

src/fw/drivers/als/als.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
#pragma once
17+
18+
#include <stdbool.h>
19+
#include <stdint.h>
20+
21+
// @brief initialization
22+
void als_init(void);
23+
// @brief deinit
24+
void als_deinit(void);
25+
// @brief print register value
26+
void als_register_dump(void);
27+
// @brief read ambient light
28+
float als_ambient_light_lux_get(void);

src/fw/drivers/als/als_null.c

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
#include "drivers/als/als.h"
17+
#include "drivers/gpio.h"
18+
#include "drivers/pmic.h"
19+
#include "system/logging.h"
20+
#include "system/passert.h"
21+
#include "drivers/i2c.h"
22+
#include "kernel/util/delay.h"
23+
24+
25+
26+
//////////////////////////////////////////////////////////////////////
27+
// @brief initialization
28+
void als_init(void) {
29+
}
30+
31+
// @brief deinit
32+
void als_deinit(void) {
33+
}
34+
35+
// @brief print register value
36+
void als_register_dump(void) {
37+
}
38+
39+
// @brief read ambient light
40+
float als_ambient_light_lux_get(void) {
41+
return 0;
42+
}
43+
44+

0 commit comments

Comments
 (0)