eren-terzioglu commented on code in PR #15079: URL: https://github.com/apache/nuttx/pull/15079#discussion_r1875549985
########## include/nuttx/pcnt/pcnt.h: ########## @@ -0,0 +1,96 @@ +/**************************************************************************** + * include/nuttx/pcnt/pcnt.h + * + * SPDX-License-Identifier: Apache-2.0 + * + * 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_PCNT_PCNT_H +#define __INCLUDE_NUTTX_PCNT_PCNT_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#include <sys/types.h> +#include <stdint.h> +#include <stdbool.h> +#include <nuttx/fs/ioctl.h> + +#ifdef CONFIG_PCNT + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +struct pcnt_dev_s; + +/* The pcnt peripheral vtable */ + +struct pcnt_ops_s +{ + CODE int (*open)(FAR struct pcnt_dev_s *dev); + CODE int (*close)(FAR struct pcnt_dev_s *dev); + CODE ssize_t (*read)(FAR struct pcnt_dev_s *dev, + FAR char *buffer, + size_t buflen); + CODE int (*ioctl)(FAR struct pcnt_dev_s *dev, + int cmd, unsigned long arg); +}; + +/* pcnt private data. This structure only defines the initial fields of the + * structure visible to the pcnt client. The specific implementation may + * add additional, device-specific fields. + */ + +struct pcnt_dev_s +{ + FAR const struct pcnt_ops_s *ops; + int minor; Review Comment: PCNT (esp_pcnt.c) driver automatically assigns a number to the interface and we use that minor number there for convenience. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
