saramonteiro commented on a change in pull request #2628:
URL: https://github.com/apache/incubator-nuttx/pull/2628#discussion_r557345542



##########
File path: include/nuttx/efuse/efuse.h
##########
@@ -0,0 +1,155 @@
+/****************************************************************************
+ * include/nuttx/efuse/efuse.h
+ *
+ * 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 __INCLUDE_NUTTX_EFUSE_EFUSE_H
+#define __INCLUDE_NUTTX_EFUSE_EFUSE_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <nuttx/fs/ioctl.h>
+
+#include <signal.h>
+#include <stdint.h>
+
+#ifdef CONFIG_EFUSE
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Command:     EFUSEIOC_READ_FIELD
+ * Description: Read a blob of bits from an efuse field.
+ * Arguments:   A structure containing the field[], a dst pointer, and size
+ *              of bits to be read from efuses.
+ * Return:      Zero (OK) on success.  Minus one will be returned on failure
+ *              with the errno value set appropriately.
+ */
+
+#define EFUSEIOC_READ_FIELD      _EFUSEIOC(0x0001)
+
+/* Command:     EFUSEIOC_WRITE_FIELD
+ * Description: Write a blob of bits to an efuse's field
+ * Arguments:   A structure containing the field[], the src memory and the
+ *              amount of bits to write.
+ * Return:      Zero (OK) on success.  Minus one will be returned on failure
+ *              with the errno value set appropriately.
+ */
+
+#define EFUSEIOC_WRITE_FIELD     _EFUSEIOC(0x0002)
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+/* Structure eFuse field */
+
+struct efuse_desc_s
+{
+  uint16_t   bit_offset; /* Bit offset related to beginning of efuse */
+  uint16_t   bit_count;  /* Length of bit field */
+};
+
+/* Type definition for an eFuse field */
+
+typedef struct efuse_desc_s efuse_desc_t;
+
+/* Structs with the parameters passed to the IOCTLs */
+
+struct efuse_param
+{
+  FAR const efuse_desc_t **field;
+  size_t  size;
+  FAR uint8_t *data;

Review comment:
       @acassis in this example, shouldn't `param.size` be equal to 1 since it 
is the sum of the sizes of each element in the array?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


Reply via email to