kasjer commented on a change in pull request #1105: hw/drivers: Add TLC5971 
driver
URL: https://github.com/apache/mynewt-core/pull/1105#discussion_r189093124
 
 

 ##########
 File path: hw/drivers/tlc5971/include/tlc5971/tlc5971.h
 ##########
 @@ -0,0 +1,205 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#ifndef __TLC5971_H__
+#define __TLC5971_H__
+
+#include "os/mynewt.h"
+
+#define TLC5971_NUM_LED_CHANNELS            4
+
+#define TLC5971_GRAYSCALE_MIN               0
+#define TLC5971_GRAYSCALE_MAX               0xFFFFU
+
+#define TLC5971_GLOBAL_BRIGHTNESS_MIN       0
+#define TLC5971_GLOBAL_BRIGHTNESS_MAX       0x7FU
+
+#define TLC5971_PACKET_LENGTH               28
+
+#define TLC5971_WRITE_COMMAND               0x25
+
+#define TLC5971_DATA_BYTE27(ctrl)           (TLC5971_WRITE_COMMAND << 2 | \
+    (ctrl & (TLC5971_CTRL_MASK_LOW)))
+
+#define TLC5971_DATA_BYTE26(ctrl, bc_blu)   ((ctrl & TLC5971_CTRL_MASK_HIGH) \
+    | (bc_blu >> 2 & TLC5971_BC_BLU_BYTE_26_MASK))
 
 Review comment:
   inconsistent placement of |

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to