| /**************************************************************************** |
| * boards/arm/stm32f7/stm32f746g-disco/src/stm32_lcd.c |
| * |
| * 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. |
| * |
| ****************************************************************************/ |
| |
| /**************************************************************************** |
| * Included Files |
| ****************************************************************************/ |
| |
| #include <nuttx/config.h> |
| |
| #include <errno.h> |
| #include <debug.h> |
| |
| #include <nuttx/arch.h> |
| #include <nuttx/board.h> |
| #include <nuttx/video/fb.h> |
| |
| #include <arch/board/board.h> |
| |
| #include "arm_internal.h" |
| #include "stm32f746g-disco.h" |
| #include "stm32_gpio.h" |
| #include "stm32_ltdc.h" |
| |
| #ifdef CONFIG_STM32F7_LTDC |
| /**************************************************************************** |
| * Public Functions |
| ****************************************************************************/ |
| |
| /**************************************************************************** |
| * Name: up_fbinitialize |
| * |
| * Description: |
| * Initialize the framebuffer video hardware associated with the display. |
| * |
| * Input Parameters: |
| * display - In the case of hardware with multiple displays, this |
| * specifies the display. Normally this is zero. |
| * |
| * Returned Value: |
| * Zero is returned on success; a negated errno value is returned on any |
| * failure. |
| * |
| ****************************************************************************/ |
| |
| int up_fbinitialize(int display) |
| { |
| /* Custom LCD display with RGB interface */ |
| |
| stm32_configgpio(GPIO_LCD_DISP); |
| stm32_configgpio(GPIO_LCD_BL); |
| |
| stm32_gpiowrite(GPIO_LCD_DISP, true); |
| stm32_gpiowrite(GPIO_LCD_BL, true); |
| |
| return stm32_ltdcinitialize(); |
| } |
| |
| /**************************************************************************** |
| * Name: up_fbgetvplane |
| * |
| * Description: |
| * Return a a reference to the framebuffer object for the specified video |
| * plane of the specified plane. |
| * Many OSDs support multiple planes of video. |
| * |
| * Input Parameters: |
| * display - In the case of hardware with multiple displays, this |
| * specifies the display. Normally this is zero. |
| * vplane - Identifies the plane being queried. |
| * |
| * Returned Value: |
| * A non-NULL pointer to the frame buffer access structure is returned on |
| * success; NULL is returned on any failure. |
| * |
| ****************************************************************************/ |
| |
| struct fb_vtable_s *up_fbgetvplane(int display, int vplane) |
| { |
| return stm32_ltdcgetvplane(vplane); |
| } |
| |
| /**************************************************************************** |
| * Name: up_fbuninitialize |
| * |
| * Description: |
| * Uninitialize the framebuffer support for the specified display. |
| * |
| * Input Parameters: |
| * display - In the case of hardware with multiple displays, this |
| * specifies the display. Normally this is zero. |
| * |
| * Returned Value: |
| * None |
| * |
| ****************************************************************************/ |
| |
| void up_fbuninitialize(int display) |
| { |
| stm32_gpiowrite(GPIO_LCD_DISP, false); |
| stm32_gpiowrite(GPIO_LCD_BL, false); |
| |
| stm32_ltdcuninitialize(); |
| } |
| #endif /* CONFIG_STM32_LTDC */ |