You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/04/12 17:52:25 UTC

[GitHub] vrahane commented on a change in pull request #1012: LIS2DW12 add bitfields

vrahane commented on a change in pull request #1012: LIS2DW12 add bitfields
URL: https://github.com/apache/mynewt-core/pull/1012#discussion_r181168418
 
 

 ##########
 File path: hw/drivers/sensors/lis2dw12/include/lis2dw12/lis2dw12.h
 ##########
 @@ -182,19 +182,23 @@ struct lis2dw12_cfg {
     uint8_t high_pass;
 
     struct lis2dw12_tap_settings tap_cfg;
-    uint8_t double_tap_event_enable;
 
     uint8_t freefall_dur;
     uint8_t freefall_ths;
     
     uint8_t int1_pin_cfg;
     uint8_t int2_pin_cfg;
     bool map_int2_to_int1;
-    uint8_t int_enable;
+    
+    uint8_t int_enable : 1;
+    uint8_t int_pp_od : 1;
+    uint8_t int_latched : 1;
+    uint8_t int_active : 1;
+    uint8_t inactivity_sleep_enable : 1;
+    uint8_t low_noise_enable : 1;
+    uint8_t stationary_detection_enable : 1;
+    uint8_t double_tap_event_enable : 1;
 
-    uint8_t int_pp_od;
-    uint8_t int_latched;
-    uint8_t int_active;
     uint8_t slp_mode;
     uint8_t self_test_mode;
 
 Review comment:
   Since you are doing bit fields for config, making sure these get converted to bitfields as well LIS2DW12_PM_LP_MODEX could be 5 bits and LIS2DW12_HPF_M_XXX could be 3 bits. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services