You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/06/29 09:14:49 UTC

[GitHub] [incubator-nuttx] adamkaliszan opened a new pull request, #6542: Nucleo Wl55JC board supports E-ink display

adamkaliszan opened a new pull request, #6542:
URL: https://github.com/apache/incubator-nuttx/pull/6542

   ## Summary
   Stm NucleoWl55 BSP for E-ink display
   
   BSP suooprt SPI driver. 
   Make menuconfig allow to chose pins that are conected to external e-ink display with ssd1680 driver.  
   
   ## Impact
   None
   
   ## Testing
   Tested on Stm Nucleo Wl55JC
   
   
   


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] mlyszczek commented on a diff in pull request #6542: Nucleo Wl55JC board supports E-ink display

Posted by GitBox <gi...@apache.org>.
mlyszczek commented on code in PR #6542:
URL: https://github.com/apache/incubator-nuttx/pull/6542#discussion_r909501788


##########
boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_spi.c:
##########
@@ -0,0 +1,257 @@
+/****************************************************************************
+ * boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_spi.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 <stdint.h>
+#include <stdbool.h>
+#include <debug.h>
+#include <errno.h>
+
+#include <arch/board/board.h>
+#include <nuttx/spi/spi.h>
+
+#include "arm_internal.h"
+#include "chip.h"
+
+#include "stm32wl5.h"
+#include "nucleo-wl55jc.h"
+
+#if defined(CONFIG_STM32WL5_SPI1) || defined(CONFIG_STM32WL5_SPI2S2)
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/* Global driver instances */
+
+#ifdef CONFIG_STM32WL5_SPI1
+struct spi_dev_s *g_spi1;
+#endif
+#ifdef CONFIG_STM32WL5_SPI2S2
+struct spi_dev_s *g_spi2;
+#endif
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32_spidev_initialize
+ *
+ * Description:
+ *   Called to configure SPI chip select GPIO pins for the Nucleo-wl55JC
+ *   boards.
+ *
+ ****************************************************************************/
+
+void weak_function stm32wl5_spidev_initialize(void)
+{
+#ifdef CONFIG_STM32WL5_SPI1
+  /* Configure SPI-based devices */
+
+  g_spi1 = stm32wl5_spibus_initialize(1);
+  if (!g_spi1)
+    {
+      spierr("ERROR: FAILED to initialize SPI port 1\n");
+    }
+
+  g_spi1 = stm32wl5_spibus_initialize(1);

Review Comment:
   Duplicated code? If not maybe add a comment that you try again to init?



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] adamkaliszan commented on a diff in pull request #6542: Nucleo Wl55JC board supports E-ink display

Posted by GitBox <gi...@apache.org>.
adamkaliszan commented on code in PR #6542:
URL: https://github.com/apache/incubator-nuttx/pull/6542#discussion_r909618157


##########
boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_ssd1680.c:
##########
@@ -0,0 +1,194 @@
+/****************************************************************************
+ * boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_ssd1680.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 <debug.h>
+
+#include <nuttx/board.h>
+#include <nuttx/lcd/lcd.h>
+#include <nuttx/lcd/ssd1680.h>
+#include <nuttx/spi/spi.h>
+
+#include "stm32wl5.h"
+#include "nucleo-wl55jc.h"
+#include "stm32wl5_gpio.h"
+#include "stm32wl5_ssd1680.h"
+
+#if defined(CONFIG_VIDEO_FB) && defined(CONFIG_LCD_FRAMEBUFFER)
+#  include <nuttx/video/fb.h>
+#endif
+
+#ifdef CONFIG_LCD_SSD1680
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+#if defined(GPIO_SSD1680_PWR)
+static bool ssd1680_set_vcc(bool state)
+{
+  esp32_gpiowrite(GPIO_SSD1680_PWR, state);
+  return true;
+}
+#endif
+
+#if defined(CONFIG_SSD1680_GPIO_PIN_RST)
+static bool ssd1680_set_rst(bool state)
+{
+  stm32wl5_gpiowrite(GPIO_SSD1680_RST, state);
+  return true;
+}
+#endif
+
+#if defined(CONFIG_SSD1680_GPIO_PIN_BUSY)
+static bool ssd1680_check_busy(void)
+{
+  return stm32wl5_gpioread(GPIO_SSD1680_BUSY);
+}
+#endif
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_dev_s    *g_lcddev;
+struct ssd1680_priv_s g_ssd1680_priv =
+{
+#if defined(CONFIG_SSD1680_GPIO_PIN_PWR) && (CONFIG_SSD1680_GPIO_PIN_PWR >= 0)
+  .set_vcc = ssd1680_set_vcc,
+#else
+  .set_vcc = NULL,
+#endif
+#if defined(CONFIG_SSD1680_GPIO_PIN_RST)  && (CONFIG_SSD1680_GPIO_PIN_RST >= 0)

Review Comment:
   Yes. Moreover there is no need to use #else in order to write NULL value.



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] adamkaliszan commented on a diff in pull request #6542: Nucleo Wl55JC board supports E-ink display

Posted by GitBox <gi...@apache.org>.
adamkaliszan commented on code in PR #6542:
URL: https://github.com/apache/incubator-nuttx/pull/6542#discussion_r909602868


##########
boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_spi.c:
##########
@@ -0,0 +1,257 @@
+/****************************************************************************
+ * boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_spi.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 <stdint.h>
+#include <stdbool.h>
+#include <debug.h>
+#include <errno.h>
+
+#include <arch/board/board.h>
+#include <nuttx/spi/spi.h>
+
+#include "arm_internal.h"
+#include "chip.h"
+
+#include "stm32wl5.h"
+#include "nucleo-wl55jc.h"
+
+#if defined(CONFIG_STM32WL5_SPI1) || defined(CONFIG_STM32WL5_SPI2S2)
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/* Global driver instances */
+
+#ifdef CONFIG_STM32WL5_SPI1
+struct spi_dev_s *g_spi1;
+#endif
+#ifdef CONFIG_STM32WL5_SPI2S2
+struct spi_dev_s *g_spi2;
+#endif
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32_spidev_initialize
+ *
+ * Description:
+ *   Called to configure SPI chip select GPIO pins for the Nucleo-wl55JC
+ *   boards.
+ *
+ ****************************************************************************/
+
+void weak_function stm32wl5_spidev_initialize(void)
+{
+#ifdef CONFIG_STM32WL5_SPI1
+  /* Configure SPI-based devices */
+
+  g_spi1 = stm32wl5_spibus_initialize(1);
+  if (!g_spi1)
+    {
+      spierr("ERROR: FAILED to initialize SPI port 1\n");
+    }
+
+  g_spi1 = stm32wl5_spibus_initialize(1);
+  if (!g_spi1)
+    {
+      spierr("ERROR: FAILED to initialize SPI port 1\n");

Review Comment:
   Initialization of additional lines for SPI devices is pointless. 



##########
boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_spi.c:
##########
@@ -0,0 +1,257 @@
+/****************************************************************************
+ * boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_spi.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 <stdint.h>
+#include <stdbool.h>
+#include <debug.h>
+#include <errno.h>
+
+#include <arch/board/board.h>
+#include <nuttx/spi/spi.h>
+
+#include "arm_internal.h"
+#include "chip.h"
+
+#include "stm32wl5.h"
+#include "nucleo-wl55jc.h"
+
+#if defined(CONFIG_STM32WL5_SPI1) || defined(CONFIG_STM32WL5_SPI2S2)
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/* Global driver instances */
+
+#ifdef CONFIG_STM32WL5_SPI1
+struct spi_dev_s *g_spi1;
+#endif
+#ifdef CONFIG_STM32WL5_SPI2S2
+struct spi_dev_s *g_spi2;
+#endif
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32_spidev_initialize
+ *
+ * Description:
+ *   Called to configure SPI chip select GPIO pins for the Nucleo-wl55JC
+ *   boards.
+ *
+ ****************************************************************************/
+
+void weak_function stm32wl5_spidev_initialize(void)
+{
+#ifdef CONFIG_STM32WL5_SPI1
+  /* Configure SPI-based devices */
+
+  g_spi1 = stm32wl5_spibus_initialize(1);
+  if (!g_spi1)
+    {
+      spierr("ERROR: FAILED to initialize SPI port 1\n");
+    }
+
+  g_spi1 = stm32wl5_spibus_initialize(1);

Review Comment:
   It is my fail. The code was duplicated. I will fix it.



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #6542: Nucleo Wl55JC board supports E-ink display

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #6542:
URL: https://github.com/apache/incubator-nuttx/pull/6542


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] mlyszczek commented on a diff in pull request #6542: Nucleo Wl55JC board supports E-ink display

Posted by GitBox <gi...@apache.org>.
mlyszczek commented on code in PR #6542:
URL: https://github.com/apache/incubator-nuttx/pull/6542#discussion_r909502611


##########
boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_spi.c:
##########
@@ -0,0 +1,257 @@
+/****************************************************************************
+ * boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_spi.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 <stdint.h>
+#include <stdbool.h>
+#include <debug.h>
+#include <errno.h>
+
+#include <arch/board/board.h>
+#include <nuttx/spi/spi.h>
+
+#include "arm_internal.h"
+#include "chip.h"
+
+#include "stm32wl5.h"
+#include "nucleo-wl55jc.h"
+
+#if defined(CONFIG_STM32WL5_SPI1) || defined(CONFIG_STM32WL5_SPI2S2)
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/* Global driver instances */
+
+#ifdef CONFIG_STM32WL5_SPI1
+struct spi_dev_s *g_spi1;
+#endif
+#ifdef CONFIG_STM32WL5_SPI2S2
+struct spi_dev_s *g_spi2;
+#endif
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32_spidev_initialize
+ *
+ * Description:
+ *   Called to configure SPI chip select GPIO pins for the Nucleo-wl55JC
+ *   boards.
+ *
+ ****************************************************************************/
+
+void weak_function stm32wl5_spidev_initialize(void)
+{
+#ifdef CONFIG_STM32WL5_SPI1
+  /* Configure SPI-based devices */
+
+  g_spi1 = stm32wl5_spibus_initialize(1);
+  if (!g_spi1)
+    {
+      spierr("ERROR: FAILED to initialize SPI port 1\n");
+    }
+
+  g_spi1 = stm32wl5_spibus_initialize(1);
+  if (!g_spi1)
+    {
+      spierr("ERROR: FAILED to initialize SPI port 1\n");

Review Comment:
   Does it even make sense to move on when spi fails to initialize?



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] mlyszczek commented on a diff in pull request #6542: Nucleo Wl55JC board supports E-ink display

Posted by GitBox <gi...@apache.org>.
mlyszczek commented on code in PR #6542:
URL: https://github.com/apache/incubator-nuttx/pull/6542#discussion_r909504747


##########
boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_ssd1680.c:
##########
@@ -0,0 +1,194 @@
+/****************************************************************************
+ * boards/arm/stm32wl5/nucleo-wl55jc/src/stm32_ssd1680.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 <debug.h>
+
+#include <nuttx/board.h>
+#include <nuttx/lcd/lcd.h>
+#include <nuttx/lcd/ssd1680.h>
+#include <nuttx/spi/spi.h>
+
+#include "stm32wl5.h"
+#include "nucleo-wl55jc.h"
+#include "stm32wl5_gpio.h"
+#include "stm32wl5_ssd1680.h"
+
+#if defined(CONFIG_VIDEO_FB) && defined(CONFIG_LCD_FRAMEBUFFER)
+#  include <nuttx/video/fb.h>
+#endif
+
+#ifdef CONFIG_LCD_SSD1680
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+#if defined(GPIO_SSD1680_PWR)
+static bool ssd1680_set_vcc(bool state)
+{
+  esp32_gpiowrite(GPIO_SSD1680_PWR, state);
+  return true;
+}
+#endif
+
+#if defined(CONFIG_SSD1680_GPIO_PIN_RST)
+static bool ssd1680_set_rst(bool state)
+{
+  stm32wl5_gpiowrite(GPIO_SSD1680_RST, state);
+  return true;
+}
+#endif
+
+#if defined(CONFIG_SSD1680_GPIO_PIN_BUSY)
+static bool ssd1680_check_busy(void)
+{
+  return stm32wl5_gpioread(GPIO_SSD1680_BUSY);
+}
+#endif
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct lcd_dev_s    *g_lcddev;
+struct ssd1680_priv_s g_ssd1680_priv =
+{
+#if defined(CONFIG_SSD1680_GPIO_PIN_PWR) && (CONFIG_SSD1680_GPIO_PIN_PWR >= 0)
+  .set_vcc = ssd1680_set_vcc,
+#else
+  .set_vcc = NULL,
+#endif
+#if defined(CONFIG_SSD1680_GPIO_PIN_RST)  && (CONFIG_SSD1680_GPIO_PIN_RST >= 0)

Review Comment:
   Wouldn't it be more readable with empty line between the lines?



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org