1 // Copyright 2018 The Fuchsia Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #pragma once
6 
7 #include <zircon/types.h>
8 
9 __BEGIN_CDECLS
10 
11 // clang-format off
12 #define AMBIENT_LIGHT_RPT_ID_INPUT       0x01
13 #define AMBIENT_LIGHT_RPT_ID_FEATURE     0x02
14 // clang-format on
15 
16 typedef struct ambient_light_input_rpt {
17     uint8_t rpt_id;
18     uint8_t state;
19     uint8_t event;
20     uint16_t illuminance;
21     uint16_t red;
22     uint16_t green;
23     uint16_t blue;
24 } __PACKED ambient_light_input_rpt_t;
25 
26 typedef struct ambient_light_feature_rpt {
27     uint8_t rpt_id;
28     uint8_t state;
29     uint32_t interval_ms; // default (0) means no polling
30     uint16_t threshold_low;
31     uint16_t threshold_high;
32 } __PACKED ambient_light_feature_rpt_t;
33 
34 size_t get_ambient_light_report_desc(const uint8_t** buf);
35 
36 __END_CDECLS
37