vrmay23 commented on code in PR #18301:
URL: https://github.com/apache/nuttx/pull/18301#discussion_r2809636902


##########
include/nuttx/lcd/st7796.h:
##########
@@ -0,0 +1,188 @@
+/****************************************************************************
+ * include/nuttx/lcd/st7796.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_LCD_ST7796_H
+#define __INCLUDE_NUTTX_LCD_ST7796_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <stdint.h>
+#include <stdbool.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Display raw dimensions (before orientation transform)
+ *
+ * These must be in the public header because board code needs them to
+ * calculate the effective xres/yres based on Kconfig orientation settings
+ * at compile-time. Without these, boards would need to hardcode dimensions.
+ */
+
+#define ST7796_XRES_RAW         320
+#define ST7796_YRES_RAW         480
+
+/* Default SPI frequency
+ *
+ * Must be in the public header because board code uses this as a safe
+ * default when the user hasn't specified a custom frequency via Kconfig.
+ * Centralizes the datasheet specification to prevent duplication.
+ */
+
+#define ST7796_SPI_MAXFREQUENCY 40000000
+
+/* Pre-defined MADCTL values for common orientations
+ *
+ * These must be in the public header because board code selects the
+ * appropriate MADCTL value based on hardware orientation and RGB/BGR
+ * panel type configured via Kconfig. This abstracts the internal MADCTL
+ * bit manipulation from board code. Values are absolute to eliminate
+ * dependency on internal bit definitions.
+ */
+
+#define ST7796_MADCTL_PORTRAIT           0x40
+#define ST7796_MADCTL_PORTRAIT_BGR       0x48
+#define ST7796_MADCTL_RPORTRAIT          0x80
+#define ST7796_MADCTL_RPORTRAIT_BGR      0x88
+#define ST7796_MADCTL_LANDSCAPE          0x20
+#define ST7796_MADCTL_LANDSCAPE_BGR      0x28
+#define ST7796_MADCTL_RLANDSCAPE         0xe0
+#define ST7796_MADCTL_RLANDSCAPE_BGR     0xe8
+
+/* Rotation ioctl commands (if not defined in fb.h) */
+
+#ifndef FBIOSET_ROTATION
+#  define FBIOSET_ROTATION      _FBIOC(0x0100)

Review Comment:
   @linguini1 it is done!



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