rcsim commented on code in PR #12839:
URL: https://github.com/apache/nuttx/pull/12839#discussion_r1703425688


##########
boards/arm/stm32/common/src/stm32_mfrc522.c:
##########
@@ -0,0 +1,86 @@
+/****************************************************************************
+ * boards/arm/stm32/common/src/stm32_mfrc522.c
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <errno.h>
+#include <debug.h>
+
+#include <nuttx/board.h>
+#include <nuttx/spi/spi.h>
+#include <nuttx/contactless/mfrc522.h>
+
+#include "stm32.h"
+#include "stm32_spi.h"
+
+#if defined(CONFIG_SPI) && defined(CONFIG_STM32_SPI1) && 
defined(CONFIG_CL_MFRC522)
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define MFRC522_SPI_PORTNO 1   /* On SPI1 */
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32_mfrc522initialize
+ *
+ * Description:
+ *   Initialize and register the MFRC522 RFID driver.
+ *
+ * Input Parameters:
+ *   devpath - The full path to the driver to register. E.g., "/dev/rfid0"
+ *
+ * Returned Value:
+ *   Zero (OK) on success; a negated errno value on failure.
+ *
+ ****************************************************************************/
+
+int stm32_mfrc522initialize(const char *devpath)
+{
+  struct spi_dev_s *spi;
+  int ret;
+
+  spi = stm32_spibus_initialize(MFRC522_SPI_PORTNO);
+

Review Comment:
   Done, thanks!



-- 
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]

Reply via email to