Nordic Thingy:52
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
sx150x_led_drv_regs.h
1 /*
2  Copyright (c) 2010 - 2017, Nordic Semiconductor ASA
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without modification,
6  are permitted provided that the following conditions are met:
7 
8  1. Redistributions of source code must retain the above copyright notice, this
9  list of conditions and the following disclaimer.
10 
11  2. Redistributions in binary form, except as embedded into a Nordic
12  Semiconductor ASA integrated circuit in a product or a software update for
13  such product, must reproduce the above copyright notice, this list of
14  conditions and the following disclaimer in the documentation and/or other
15  materials provided with the distribution.
16 
17  3. Neither the name of Nordic Semiconductor ASA nor the names of its
18  contributors may be used to endorse or promote products derived from this
19  software without specific prior written permission.
20 
21  4. This software, with or without modification, must only be used with a
22  Nordic Semiconductor ASA integrated circuit.
23 
24  5. Any software provided in binary form under this license must not be reverse
25  engineered, decompiled, modified and/or disassembled.
26 
27  THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
28  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
29  OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
30  DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
31  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
33  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
36  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37  */
38 
39 #ifndef __SX150X_LED_DRV_REGS_H__
40 #define __SX150X_LED_DRV_REGS_H__
41 
42 #include <stdint.h>
43 
55 typedef struct
56 {
57  uint32_t on_time_ms;
58  uint8_t on_intensity;
59  uint32_t off_time_ms;
60  uint8_t off_intensity;
61  uint32_t fade_in_time_ms;
62  uint32_t fade_out_time_ms;
63 }drv_ext_light_sequence_t;
64 
67 typedef struct
68 {
69  uint8_t on_time;
70  uint8_t on_intensity;
71  uint8_t off_time;
72  uint8_t off_intensity;
73  uint8_t fade_in_time;
74  uint8_t fade_out_time;
76 
77 #define SX150X_LED_DRIVER_SEQUENCE_ON_TIME_DEFAULT (0)
78 #define SX150X_LED_DRIVER_SEQUENCE_ON_INTENSITY_DEFAULT (0xFF)
79 #define SX150X_LED_DRIVER_SEQUENCE_OFF_TIME_DEFAULT (0)
80 #define SX150X_LED_DRIVER_SEQUENCE_OFF_INTENSITY_DEFAULT (0)
81 #define SX150X_LED_DRIVER_SEQUENCE_FADE_IN_TIME_DEFAULT (0)
82 #define SX150X_LED_DRIVER_SEQUENCE_FADE_OUT_TIME_DEFAULT (0)
83 
84 #define SEQUENCE_DEFAULT_VAL (drv_ext_light_sequence_t) \
85 { .on_time_ms = SX150X_LED_DRIVER_SEQUENCE_ON_TIME_DEFAULT, \
86  .on_intensity = SX150X_LED_DRIVER_SEQUENCE_ON_INTENSITY_DEFAULT, \
87  .off_time_ms = SX150X_LED_DRIVER_SEQUENCE_OFF_TIME_DEFAULT, \
88  .off_intensity = SX150X_LED_DRIVER_SEQUENCE_OFF_INTENSITY_DEFAULT, \
89  .fade_in_time_ms = SX150X_LED_DRIVER_SEQUENCE_FADE_IN_TIME_DEFAULT, \
90  .fade_out_time_ms = SX150X_LED_DRIVER_SEQUENCE_FADE_OUT_TIME_DEFAULT, \
91 }
92 
93 #define SEQUENCE_REG_DEFAULT_VAL (sx150x_led_drv_regs_vals_t) \
94 { .on_time = SX150X_LED_DRIVER_SEQUENCE_ON_TIME_DEFAULT, \
95  .on_intensity = SX150X_LED_DRIVER_SEQUENCE_ON_INTENSITY_DEFAULT, \
96  .off_time = SX150X_LED_DRIVER_SEQUENCE_OFF_TIME_DEFAULT, \
97  .off_intensity = SX150X_LED_DRIVER_SEQUENCE_OFF_INTENSITY_DEFAULT, \
98  .fade_in_time = SX150X_LED_DRIVER_SEQUENCE_FADE_IN_TIME_DEFAULT, \
99  .fade_out_time = SX150X_LED_DRIVER_SEQUENCE_FADE_OUT_TIME_DEFAULT, \
100 }
101 
102 
103 #endif
104