mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 12:33:27 +08:00
Merged nuttx/nuttx into master
This commit is contained in:
@@ -98,6 +98,7 @@ config AM335X_LCDC
|
||||
bool "LCD controller"
|
||||
default n
|
||||
depends on VIDEO && EXPERIMENTAL
|
||||
select LCD
|
||||
select VIDEO_EDID
|
||||
|
||||
config AM335X_TSC
|
||||
@@ -274,21 +275,6 @@ config AM335X_LCDC_FB_SIZE
|
||||
---help---
|
||||
Size of the video RAM frame buffer. Default: 1Mb.
|
||||
|
||||
config AM335X_LCDC_USE_CLKIN
|
||||
bool "Use optional input clock"
|
||||
default n
|
||||
|
||||
config AM335X_LCDC_CLKIN_FREQUENCY
|
||||
int "Input clock frequency"
|
||||
default 0
|
||||
depends on AM335X_LCDC_USE_CLKIN
|
||||
|
||||
config AM335X_LCDC_REFRESH_FREQ
|
||||
int "LCD refesh rate (Hz)"
|
||||
default 50
|
||||
---help---
|
||||
LCD refesh rate (Hz)
|
||||
|
||||
choice
|
||||
prompt "Bits per pixel"
|
||||
default AM335X_LCDC_BPP16_565
|
||||
@@ -319,13 +305,6 @@ config AM335X_LCDC_BPP32
|
||||
|
||||
endchoice
|
||||
|
||||
config AM335X_LCDC_BGR
|
||||
bool "Blue-Green-Red color order"
|
||||
default n
|
||||
depends on !AM335X_LCDC_MONOCHROME
|
||||
---help---
|
||||
This option selects BGR color order vs. default RGB
|
||||
|
||||
config AM335X_LCDC_BACKCOLOR
|
||||
hex "Initial background color"
|
||||
default 0x0
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "hardware/am335x_cm.h"
|
||||
#include "hardware/am335x_prcm.h"
|
||||
#include "am335x_config.h"
|
||||
#include "am335x_clockconfig.h"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/am335x/am335x_wdog.c
|
||||
* arch/arm/src/am335x/am335x_edid.c
|
||||
*
|
||||
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@@ -82,7 +82,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
static uint32_t
|
||||
am335x_videomode_vrefresh(FAR const struct edid_videomode_s *videomode)
|
||||
am335x_videomode_vrefresh(FAR const struct videomode_s *videomode)
|
||||
{
|
||||
uint32_t refresh;
|
||||
|
||||
@@ -113,7 +113,7 @@ static uint32_t
|
||||
****************************************************************************/
|
||||
|
||||
static bool
|
||||
am335x_videomode_valid(FAR const struct edid_videomode_s *videomode)
|
||||
am335x_videomode_valid(FAR const struct videomode_s *videomode)
|
||||
{
|
||||
size_t fbstride;
|
||||
size_t fbsize;
|
||||
@@ -216,10 +216,10 @@ static bool
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
static const struct edid_videomode_s *
|
||||
static const struct videomode_s *
|
||||
am335x_lcd_pickmode(FAR struct edid_info_s *ei)
|
||||
{
|
||||
FAR const struct edid_videomode_s *videomode;
|
||||
FAR const struct videomode_s *videomode;
|
||||
int n;
|
||||
|
||||
/* Get standard VGA as default */
|
||||
@@ -242,7 +242,7 @@ static const struct edid_videomode_s *
|
||||
* are sorted on closest match to that mode.
|
||||
*/
|
||||
|
||||
edid_sort_modes(ei->edid_modes, &ei->edid_preferred_mode, ei->edid_nmodes);
|
||||
sort_videomodes(ei->edid_modes, &ei->edid_preferred_mode, ei->edid_nmodes);
|
||||
|
||||
/* Pick the first valid mode in the list */
|
||||
|
||||
@@ -280,7 +280,7 @@ static const struct edid_videomode_s *
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void am335x_lcd_videomode(FAR const struct edid_videomode_s *videomode,
|
||||
void am335x_lcd_videomode(FAR const struct videomode_s *videomode,
|
||||
FAR struct am335x_panel_info_s *panel)
|
||||
{
|
||||
lcdinfo("Detected videomode: %dx%d @ %dKHz\n",
|
||||
@@ -355,9 +355,9 @@ void am335x_lcd_videomode(FAR const struct edid_videomode_s *videomode,
|
||||
|
||||
void am335x_lcd_edid(FAR const uint8_t *edid, size_t edid_len,
|
||||
FAR struct am335x_panel_info_s *panel,
|
||||
FAR struct edid_videomode_s *selected)
|
||||
FAR const struct videomode_s **selected)
|
||||
{
|
||||
FAR const struct edid_videomode_s *videomode = NULL;
|
||||
FAR const struct videomode_s *videomode = NULL;
|
||||
struct edid_info_s ei;
|
||||
|
||||
/* Do we have EDID data? */
|
||||
@@ -380,7 +380,7 @@ void am335x_lcd_edid(FAR const uint8_t *edid, size_t edid_len,
|
||||
|
||||
if (videomode == NULL)
|
||||
{
|
||||
videomode = edid_mode_lookup("640x480x60");
|
||||
videomode = videomode_lookup_by_name("640x480x60");
|
||||
DEBUGASSERT(videomode != NULL);
|
||||
}
|
||||
|
||||
@@ -392,6 +392,6 @@ void am335x_lcd_edid(FAR const uint8_t *edid, size_t edid_len,
|
||||
|
||||
if (selected != NULL)
|
||||
{
|
||||
memcpy(selected, videomode, sizeof(struct edid_videomode_s));
|
||||
*selected = videomode;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "hardware/am335x_control.h"
|
||||
#include "hardware/am335x_scm.h"
|
||||
#include "hardware/am335x_gpio.h"
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/am225x/am335x_lcd.c
|
||||
* arch/arm/src/am225x/am335x_lcdc.c
|
||||
*
|
||||
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@@ -56,7 +56,7 @@
|
||||
#include <nuttx/video/fb.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "hardware/am335x_cm.h"
|
||||
#include "hardware/am335x_prcm.h"
|
||||
#include "am335x_pinmux.h"
|
||||
#include "am335x_config.h"
|
||||
#include "am335x_gpio.h"
|
||||
|
||||
@@ -251,9 +251,9 @@ void am335x_lcdclear(nxgl_mxpixel_t color);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
struct edid_videomode_s; /* Forward reference */
|
||||
struct videomode_s; /* Forward reference */
|
||||
|
||||
void am335x_lcd_videomode(FAR const struct edid_videomode_s *videomode,
|
||||
void am335x_lcd_videomode(FAR const struct videomode_s *videomode,
|
||||
FAR struct am335x_panel_info_s *panel);
|
||||
|
||||
/****************************************************************************
|
||||
@@ -281,7 +281,7 @@ void am335x_lcd_videomode(FAR const struct edid_videomode_s *videomode,
|
||||
|
||||
void am335x_lcd_edid(FAR const uint8_t *edid, size_t edid_len,
|
||||
FAR struct am335x_panel_info_s *panel,
|
||||
FAR struct edid_videomode_s *selected);
|
||||
FAR const struct videomode_s **selected);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: am335x_backlight
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "hardware/am335x_control.h"
|
||||
#include "hardware/am335x_scm.h"
|
||||
#include "hardware/am335x_pinmux.h"
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -43,24 +43,13 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "hardware/am335x_memorymap.h"
|
||||
#include "hardware/am335x_scm.h"
|
||||
#include "am335x_sysclk.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* REVISIT: These belong in a control module register header file */
|
||||
|
||||
#define AM335X_SCM_CTRL_STATUS_OFFSET 0x40
|
||||
#define AM335X_SCM_CTRL_STATUS (AM335X_CONTROL_MODULE_VADDR + AM335X_SCM_CTRL_STATUS_OFFSET)
|
||||
#define SCM_CTRL_STATUS_SYSBOOT1_SHIFT (22) /* Bits 22-23: Crystal clock frequency selection */
|
||||
#define SCM_CTRL_STATUS_SYSBOOT1_MASK (3 << SCM_CTRL_STATUS_SYSBOOT1_SHIFT)
|
||||
# define SCM_CTRL_STATUS_SYSBOOT1_19p2MHZ (0 << SCM_CTRL_STATUS_SYSBOOT1_SHIFT)
|
||||
# define SCM_CTRL_STATUS_SYSBOOT1_24MHZ (1 << SCM_CTRL_STATUS_SYSBOOT1_SHIFT)
|
||||
# define SCM_CTRL_STATUS_SYSBOOT1_25MHZ (2 << SCM_CTRL_STATUS_SYSBOOT1_SHIFT)
|
||||
# define SCM_CTRL_STATUS_SYSBOOT1_26MHZ (3 << SCM_CTRL_STATUS_SYSBOOT1_SHIFT)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/********************************************************************************************
|
||||
* arch/arm/src/am335x/hardware/am335x_cm.h
|
||||
* arch/arm/src/am335x/hardware/am335x_dcan.h
|
||||
*
|
||||
* Copyright (C) 2019 Petro Karashchenko. All rights reserved.
|
||||
* Author: Petro Karashchenko <petro.karashchenko@gmail.com>
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
/********************************************************************************************
|
||||
* arch/arm/src/am335x/hardware/am335x_cm.h
|
||||
* arch/arm/src/am335x/hardware/am335x_prcm.h
|
||||
*
|
||||
* Copyright (C) 2019 Petro Karashchenko. All rights reserved.
|
||||
* Author: Petro Karashchenko <petro.karashchenko@gmail.com>
|
||||
@@ -33,8 +33,8 @@
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_AM335X_HARDWARE_AM335X_CM_H
|
||||
#define __ARCH_ARM_SRC_AM335X_HARDWARE_AM335X_CM_H
|
||||
#ifndef __ARCH_ARM_SRC_AM335X_HARDWARE_AM335X_PRCM_H
|
||||
#define __ARCH_ARM_SRC_AM335X_HARDWARE_AM335X_PRCM_H
|
||||
|
||||
/********************************************************************************************
|
||||
* Included Files
|
||||
@@ -365,4 +365,4 @@
|
||||
# define CM_DPLL_DMTIMER1_CLKSEL_CLK_RC32K (3 << CM_DPLL_DMTIMER1MS_CLKSEL_SHIFT) /* Select CLK_RC32K clock */
|
||||
# define CM_DPLL_DMTIMER1_CLKSEL_CLK_32768 (4 << CM_DPLL_DMTIMER1MS_CLKSEL_SHIFT) /* Selects the CLK_32768 from 32KHz Crystal Osc */
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_AM335X_HARDWARE_AM335X_CM_H */
|
||||
#endif /* __ARCH_ARM_SRC_AM335X_HARDWARE_AM335X_PRCM_H */
|
||||
+254
-245
File diff suppressed because it is too large
Load Diff
@@ -4,4 +4,14 @@
|
||||
#
|
||||
|
||||
if ARCH_BOARD_BEAGLEBONE_BLACK
|
||||
|
||||
config BEAGLEBONE_VIDEOMODE
|
||||
string "LCD Video Mode"
|
||||
default "640x480x60"
|
||||
depends on !CONFIG_LCD_TDA19988 || !CONFIG_AM335X_I2C2
|
||||
---help---
|
||||
If we are not using HDMI (via the TDA19988) then we must select a
|
||||
fixed LCD resolution. The default, "640x480x60" is standard VGA
|
||||
which should be supported by all LCDs.
|
||||
|
||||
endif # ARCH_BOARD_BEAGLEBONE_BLACK
|
||||
|
||||
@@ -51,7 +51,7 @@ CSRCS += am335x_buttons.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_AM335X_LCDC),y)
|
||||
CSRCS += am335x_lcdc.c
|
||||
CSRCS += am335x_lcd.c
|
||||
endif
|
||||
|
||||
include $(TOPDIR)/configs/Board.mk
|
||||
|
||||
@@ -42,11 +42,14 @@
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/lcd/tda19988.h>
|
||||
#include <nuttx/video/fb.h>
|
||||
#include <nuttx/video/edid.h>
|
||||
#include <nuttx/video/videomode.h>
|
||||
|
||||
#include "am335x_lcd.h"
|
||||
#include "am335x_lcdc.h"
|
||||
#include "beaglebone-black.h"
|
||||
|
||||
#ifdef HAVE_LCD
|
||||
@@ -55,15 +58,19 @@
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef HAVE_TDA19988
|
||||
static int am335x_attach(const struct tda19988_lower_s *lower,
|
||||
xcpt_t handler, void *arg);
|
||||
static int am335x_enable(const struct tda19988_lower_s *lower, bool enable);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef HAVE_TDA19988
|
||||
static const strurct tda19988_lower_s g_lower;
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
@@ -77,10 +84,14 @@ static const strurct tda19988_lower_s g_lower;
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef HAVE_TDA19988
|
||||
static int am335x_attach(const struct tda19988_lower_s *lower,
|
||||
xcpt_t handler, void *arg)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: am335x_enable
|
||||
@@ -90,9 +101,13 @@ static int am335x_attach(const struct tda19988_lower_s *lower,
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef HAVE_TDA19988
|
||||
static int am335x_enable(const struct tda19988_lower_s *lower, bool enable)
|
||||
{
|
||||
#warning Missing logic
|
||||
return -ENOSYS;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@@ -102,7 +117,8 @@ static int am335x_enable(const struct tda19988_lower_s *lower, bool enable)
|
||||
* Name: up_fbinitialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the LCD. This involves:
|
||||
* Initialize the LCD. If support for the TDA19988 HDMI controller is
|
||||
* enabled, then this involves:
|
||||
*
|
||||
* 1. Initializing the TDA19988 HDMI controller driver
|
||||
* 2. Reading EDID data from the connected monitor
|
||||
@@ -110,10 +126,20 @@ static int am335x_enable(const struct tda19988_lower_s *lower, bool enable)
|
||||
* 4. Initializing the LCD controller using this video mode
|
||||
* 5. Initializing the HDMI controller using the video mode
|
||||
*
|
||||
* Otherwise, a default video mode is used to initialize the LCD
|
||||
* controller.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_fbinitialize(int display)
|
||||
int up_fbinitialize(int display)
|
||||
{
|
||||
FAR const struct videomode_s *videomode;
|
||||
struct am335x_panel_info_s panel;
|
||||
int ret;
|
||||
|
||||
#ifdef HAVE_TDA19988
|
||||
TDA19988_HANDLE handle;
|
||||
|
||||
/* Initialize the TDA19988 GPIO interrupt input */
|
||||
/* Initialize the TDA19988 lower half state instance */
|
||||
/* Initialize the TDA19988 HDMI controller driver */
|
||||
@@ -121,10 +147,45 @@ void up_fbinitialize(int display)
|
||||
/* Read raw EDID data from the connected monitor */
|
||||
/* Select a compatible video mode from the EDID data */
|
||||
/* Free the allocated EDID buffer */
|
||||
/* Convert the video mode to a AM335X LCD panel configuration */
|
||||
/* Initialize the LCD controller using this video mode */
|
||||
/* Convert the EDID video mode to a TDA19988 video mode */
|
||||
/* Initialize the HDMI controller using the TDA19988 video mode */
|
||||
|
||||
#warning Missing logic
|
||||
#else
|
||||
/* Lookup the video mode corresponding to the default video mode */
|
||||
|
||||
videomode = videomode_lookup_by_name(CONFIG_BEAGLEBONE_VIDEOMODE);
|
||||
if (videomode == NULL)
|
||||
{
|
||||
lcderr("ERROR: Videomode \"%s\" is not supported.\n",
|
||||
CONFIG_BEAGLEBONE_VIDEOMODE);
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
#endif
|
||||
/* Convert the selected video mode to a AM335X LCD panel configuration */
|
||||
|
||||
am335x_lcd_videomode(videomode, &panel);
|
||||
|
||||
/* Initialize the LCD controller using this panel configuration */
|
||||
|
||||
ret = am335x_lcd_initialize(&panel);
|
||||
if (ret < 0)
|
||||
{
|
||||
lcderr("ERROR: am335x_lcd_initialize() failed: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef HAVE_TDA19988
|
||||
/* Initialize the HDMI controller using the selected video mode */
|
||||
|
||||
ret = tda19988_videomode(handle, videomode);
|
||||
if (ret < 0)
|
||||
{
|
||||
lcderr("ERROR: tda19988_videomode() failed: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
#endif /* HAVE_LCD */
|
||||
|
||||
@@ -56,16 +56,25 @@
|
||||
|
||||
/* LCD ******************************************************************************/
|
||||
|
||||
#define HAVE_LCD 1
|
||||
#if !defined(CONFIG_AM335X_LCDC) || !defined(CONFIG_VIDEO_EDID) || \
|
||||
!defined(CONFIG_LCD_TDA19988) || !defined(CONFIG_AM335X_I2C2)
|
||||
#define HAVE_LCD 1
|
||||
#define HAVE_TDA19988 1
|
||||
|
||||
#if !defined(CONFIG_AM335X_LCDC) || !defined(CONFIG_VIDEO_EDID)
|
||||
# undef HAVE_LCD
|
||||
# undef HAVE_TDA19988
|
||||
#elif !defined(CONFIG_LCD_TDA19988) || !defined(CONFIG_AM335X_I2C2)
|
||||
# undef HAVE_TDA19988
|
||||
# if !defined(CONFIG_BEAGLEBONE_VIDEOMODE)
|
||||
# define CONFIG_BEAGLEBONE_VIDEOMODE "640x480x60"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define TDA19988_I2CBUS 2
|
||||
#define TDA19988_HDMI_I2CADDR 0x70
|
||||
#define TDA19988_CEC_I2CADDR 0x34
|
||||
#define TDA19988_I2CFREQUENCY 400000
|
||||
#if defined(HAVE_LCD)
|
||||
# define TDA19988_I2CBUS 2
|
||||
# define TDA19988_HDMI_I2CADDR 0x70
|
||||
# define TDA19988_CEC_I2CADDR 0x34
|
||||
# define TDA19988_I2CFREQUENCY 400000
|
||||
#endif
|
||||
|
||||
/* LEDs *****************************************************************************/
|
||||
|
||||
|
||||
@@ -384,10 +384,11 @@ Configuration Subdirectories
|
||||
You can debug the all RAM version using ZDS-II as follows:
|
||||
|
||||
a. Connect to the debugger,
|
||||
b. Load the nuttx.lod file
|
||||
b. Reset, Go, and Break. This will initialize the external RAM
|
||||
c. Break and Load the nuttx.lod file
|
||||
c. Set the PC to 0x040000
|
||||
d. Single step a few times to make sure things look good, then
|
||||
e. "GO"
|
||||
e. Go
|
||||
|
||||
5. Optimizations:
|
||||
|
||||
@@ -415,7 +416,7 @@ Configuration Subdirectories
|
||||
configuration. Not yet verified.
|
||||
|
||||
2019-07-09: The RAM version does not run! I can single step through
|
||||
the initialization and all looks well, but when I "GO", the system
|
||||
the initialization and all looks well, but when I "Go", the system
|
||||
crashes. The PC is sitting at a crazy address when I break in. I
|
||||
have not yet debugged this.
|
||||
|
||||
|
||||
@@ -2,5 +2,75 @@ README
|
||||
======
|
||||
The Olimex STM32-E407 configuration is based on the configuration olimex-stm32-h407 and stm32f4discovery.
|
||||
|
||||
nsh - Basic shell run on USART2.
|
||||
usbnsh - Basic shell run on the virtual serial port.
|
||||
Configurations
|
||||
==============
|
||||
|
||||
Instantiating Configurations
|
||||
----------------------------
|
||||
Each Olimex-STM32-E407 configuration is maintained in a sub-directory and
|
||||
can be selected as follow:
|
||||
|
||||
tools/configure.sh olimex-stm32-e407/<subdir>
|
||||
|
||||
Where <subdir> is one of the following:
|
||||
|
||||
Compile Firmware
|
||||
----------------
|
||||
Once you've set the proper configuration, you just need to execute the next
|
||||
command:
|
||||
|
||||
make
|
||||
|
||||
If everything goes find, it should return the next two files:
|
||||
|
||||
nuttx.hex
|
||||
nuttx.bin
|
||||
|
||||
You can return more kind of files by setting on menuconfig.
|
||||
|
||||
|
||||
Flashing the Board
|
||||
-----------------
|
||||
You can flash this board in different ways, but the easiest way is using
|
||||
ARM-USB-TINY-H JTAG flasher device.
|
||||
Connect this device to the JTAG connector and type the next command:
|
||||
|
||||
openocd -f interface/ftdi/olimex-arm-usb-tiny-h.cfg -f target/stm32f4x.cfg -c init -c "reset halt" -c "flash write_image erase nuttx.bin 0x08000000"
|
||||
|
||||
Configuration Directories
|
||||
-------------------------
|
||||
nsh:
|
||||
---
|
||||
Configures the NuttShell (nsh) located at apps/examples/nsh. This
|
||||
configuration enables a console on UART2. Support for
|
||||
builtin applications is enabled, but in the base configuration no
|
||||
builtin applications are selected.
|
||||
|
||||
usbnsh:
|
||||
------
|
||||
Configures the NuttShell (nsh) located at apps/examples/nsh. This
|
||||
configuration enables a console on USB_OTG1. Support for
|
||||
builtin applications is enabled, but in the base configuration no
|
||||
builtin applications are selected.
|
||||
|
||||
netnsh:
|
||||
------
|
||||
Configures the NuttShell (nsh) located at examples/nsh. This
|
||||
configuration is focused on network testing.
|
||||
|
||||
BMP180:
|
||||
------
|
||||
This a configuration example for the BMP180 barometer sensor. This
|
||||
sensor works with I2C, you need to do the next connections:
|
||||
|
||||
BMP180 VIN -> Board 3.3V
|
||||
BMP180 GND -> Board GND
|
||||
BMP180 SCL -> Board PB6 (Arduino header D1)
|
||||
BMP180 SDA -> Board PB7 (Arduino header D0)
|
||||
|
||||
This example is configured to work with the USBNSH instead of UART NSH, so
|
||||
the console will be shown over the USB_OTG1 connector.
|
||||
|
||||
On the console, type "ls /dev " and if the registration process goes fine,
|
||||
you should see a device called "press0". Now execute the app
|
||||
BMP180 to see the ambient pressure value.
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_ARCH_FPU is not set
|
||||
# CONFIG_NSH_ARGCAT is not set
|
||||
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
||||
# CONFIG_NSH_CMDPARMS is not set
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="olimex-stm32-e407"
|
||||
CONFIG_ARCH_BOARD_OLIMEX_STM32E407=y
|
||||
CONFIG_ARCH_BUTTONS=y
|
||||
CONFIG_ARCH_CHIP_STM32=y
|
||||
CONFIG_ARCH_CHIP_STM32F407ZG=y
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_BOARDCTL_USBDEVCTRL=y
|
||||
CONFIG_BOARD_LATE_INITIALIZE=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=16717
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_CDCACM=y
|
||||
CONFIG_CDCACM_CONSOLE=y
|
||||
CONFIG_EXAMPLES_BMP180=y
|
||||
CONFIG_EXAMPLES_HELLO=y
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_INTELHEX_BINARY=y
|
||||
CONFIG_LIB_BOARDCTL=y
|
||||
CONFIG_MAX_TASKS=16
|
||||
CONFIG_MAX_WDOGPARMS=2
|
||||
CONFIG_MM_REGIONS=2
|
||||
CONFIG_NFILE_DESCRIPTORS=8
|
||||
CONFIG_NFILE_STREAMS=8
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_NSH_FILEIOSIZE=512
|
||||
CONFIG_NSH_LINELEN=64
|
||||
CONFIG_NSH_READLINE=y
|
||||
CONFIG_PREALLOC_MQ_MSGS=4
|
||||
CONFIG_PREALLOC_TIMERS=4
|
||||
CONFIG_PREALLOC_WDOGS=16
|
||||
CONFIG_RAM_SIZE=114688
|
||||
CONFIG_RAM_START=0x20000000
|
||||
CONFIG_RAW_BINARY=y
|
||||
CONFIG_RR_INTERVAL=200
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SDCLONE_DISABLE=y
|
||||
CONFIG_SENSORS=y
|
||||
CONFIG_SENSORS_BMP180=y
|
||||
CONFIG_START_DAY=6
|
||||
CONFIG_START_MONTH=12
|
||||
CONFIG_START_YEAR=2011
|
||||
CONFIG_STM32_I2C1=y
|
||||
CONFIG_STM32_JTAG_SW_ENABLE=y
|
||||
CONFIG_STM32_OTGFS=y
|
||||
CONFIG_STM32_PWR=y
|
||||
CONFIG_STM32_USART2=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_SYSTEM_NSH_CXXINITIALIZE=y
|
||||
CONFIG_USART2_RXBUFSIZE=128
|
||||
CONFIG_USART2_TXBUFSIZE=128
|
||||
CONFIG_USBDEV=y
|
||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||
@@ -212,24 +212,35 @@
|
||||
/* Alternate function pin selections ************************************************/
|
||||
|
||||
/* USART1 */
|
||||
|
||||
#define GPIO_USART1_RX GPIO_USART1_RX_2 /* PB7 */
|
||||
#define GPIO_USART1_TX GPIO_USART1_TX_2 /* PB6 */
|
||||
|
||||
/* USART2 */
|
||||
|
||||
#define GPIO_USART2_RX GPIO_USART2_RX_2 /* PD6 */
|
||||
#define GPIO_USART2_TX GPIO_USART2_TX_2 /* PD5 */
|
||||
|
||||
/* USART3 */
|
||||
|
||||
#define GPIO_USART3_RX GPIO_USART3_RX_1 /* PB11 */
|
||||
#define GPIO_USART3_TX GPIO_USART3_TX_1 /* PB10 */
|
||||
|
||||
/* CAN */
|
||||
#define GPIO_CAN1_RX GPIO_CAN1_RX_2 /* PB8 */
|
||||
#define GPIO_CAN1_TX GPIO_CAN1_TX_2 /* PB9 */
|
||||
|
||||
#define GPIO_CAN1_RX GPIO_CAN1_RX_2 /* PB8 */
|
||||
#define GPIO_CAN1_TX GPIO_CAN1_TX_2 /* PB9 */
|
||||
|
||||
/* I2C */
|
||||
#define GPIO_I2C1_SCL GPIO_I2C1_SCL_1 /* PB6 */
|
||||
#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 /* PB7 */
|
||||
|
||||
#define GPIO_I2C1_SCL GPIO_I2C1_SCL_1 /* PB6 */
|
||||
#define GPIO_I2C1_SDA GPIO_I2C1_SDA_1 /* PB7 */
|
||||
|
||||
/* SPI1 */
|
||||
|
||||
#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 /* PA5 */
|
||||
#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_2 /* PB5 */
|
||||
#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */
|
||||
|
||||
/* Ethernet *************************************************************************/
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
-include $(TOPDIR)/Make.defs
|
||||
|
||||
ASRCS =
|
||||
CSRCS = stm32_boot.c stm32_bringup.c
|
||||
CSRCS = stm32_boot.c stm32_bringup.c stm32_spi.c
|
||||
|
||||
ifeq ($(CONFIG_ARCH_LEDS),y)
|
||||
CSRCS += stm32_autoleds.c
|
||||
@@ -80,5 +80,9 @@ ifeq ($(CONFIG_ARCH_FPU),y)
|
||||
CSRCS += stm32_ostest.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_BMP180),y)
|
||||
CSRCS += stm32_bmp180.c
|
||||
endif
|
||||
|
||||
include $(TOPDIR)/configs/Board.mk
|
||||
|
||||
|
||||
@@ -269,5 +269,23 @@ int stm32_sdio_initialize(void);
|
||||
int stm32_can_setup(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: stm32_bmp180initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize and register the BMP180 Pressure Sensor driver.
|
||||
*
|
||||
* Input parameters:
|
||||
* devpath - The full path to the driver to register. E.g., "/dev/press0"
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_BMP180)
|
||||
int stm32_bmp180initialize(FAR const char *devpath);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIGS_OLIMEX_STM32_E407_SRC_INTERNAL_H */
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
/************************************************************************************
|
||||
* configs/olimex-stm32-e407/src/stm32_bmp180.c
|
||||
*
|
||||
* Copyright (C) 2019 Acutronics Robotics. All rights reserved.
|
||||
* Author: Acutronics Robotics (Juan Flores) <juan@erlerobotics.com>
|
||||
* Base on the implementation of: Alan Carvalho de Assis <acassis@gmail.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/spi/spi.h>
|
||||
#include <nuttx/sensors/bmp180.h>
|
||||
|
||||
#include "stm32.h"
|
||||
#include "stm32_i2c.h"
|
||||
#include "olimex-stm32-e407.h"
|
||||
|
||||
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_BMP180)
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
|
||||
#define BMP180_I2C_PORTNO 1 /* On I2C1 */
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Name: stm32_bmp180initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize and register the BMP180 Pressure Sensor driver.
|
||||
*
|
||||
* Input parameters:
|
||||
* devpath - The full path to the driver to register. E.g., "/dev/press0"
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
int stm32_bmp180initialize(FAR const char *devpath)
|
||||
{
|
||||
FAR struct i2c_master_s *i2c;
|
||||
int ret;
|
||||
|
||||
sninfo("Initializing BMP180!\n");
|
||||
|
||||
/* Initialize I2C */
|
||||
|
||||
i2c = stm32_i2cbus_initialize(BMP180_I2C_PORTNO);
|
||||
|
||||
if (!i2c)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Then register the barometer sensor */
|
||||
|
||||
ret = bmp180_register(devpath, i2c);
|
||||
if (ret < 0)
|
||||
{
|
||||
snerr("ERROR: Error registering BMP180\n");
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_I2C && CONFIG_SENSORS_BMP180 && CONFIG_STM32_I2C1 */
|
||||
@@ -218,6 +218,17 @@ int stm32_bringup(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SENSORS_BMP180
|
||||
/* Initialize the BMP180 pressure sensor. */
|
||||
|
||||
ret = stm32_bmp180initialize("/dev/press0");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "Failed to initialize BMP180, error %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
UNUSED(ret);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,318 @@
|
||||
/****************************************************************************
|
||||
* configs/olimex-stm32-e407/src/stm32_spi.c
|
||||
*
|
||||
* Copyright (C) 2016, 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Laurent Latil <laurent@latil.nom.fr>
|
||||
* Modify by: Acutronics Robotics (Juan Flores) <juan@erlerobotics.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/spi/spi.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "chip.h"
|
||||
#include "stm32.h"
|
||||
#include "olimex-stm32-e407.h"
|
||||
|
||||
#if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_spidev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the Olimex-STM32-E407
|
||||
* board.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void stm32_spidev_initialize(void)
|
||||
{
|
||||
/* NOTE: Clocking for SPI1 and/or SPI2 was already provided in stm32_rcc.c.
|
||||
* Configurations of SPI pins is performed in stm32_spi.c.
|
||||
* Here, we only initialize chip select pins unique to the board
|
||||
* architecture.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_MTD_W25
|
||||
(void)stm32_configgpio(FLASH_SPI1_CS); /* FLASH chip select */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CAN_MCP2515
|
||||
(void)stm32_configgpio(GPIO_MCP2515_CS); /* MCP2515 chip select */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CL_MFRC522
|
||||
(void)stm32_configgpio(GPIO_CS_MFRC522); /* MFRC522 chip select */
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SENSORS_MAX6675)
|
||||
(void)stm32_configgpio(GPIO_MAX6675_CS); /* MAX6675 chip select */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LCD_MAX7219
|
||||
(void)stm32_configgpio(STM32_LCD_CS); /* MAX7219 chip select */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LCD_ST7567
|
||||
(void)stm32_configgpio(STM32_LCD_CS); /* ST7567 chip select */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LCD_PCD8544
|
||||
(void)stm32_configgpio(STM32_LCD_CS); /* ST7567 chip select */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_WL_NRF24L01
|
||||
stm32_configgpio(GPIO_NRF24L01_CS); /* nRF24L01 chip select */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MMCSD_SPI
|
||||
stm32_configgpio(GPIO_SDCARD_CS); /* SD/MMC Card chip select */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IEEE802154_MRF24J40
|
||||
stm32_configgpio(GPIO_MRF24J40_CS);
|
||||
#endif
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_spi1/2select and stm32_spi1/2status
|
||||
*
|
||||
* Description:
|
||||
* The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status
|
||||
* must be provided by board-specific logic. They are implementations of
|
||||
* the select and status methods of the SPI interface defined by struct
|
||||
* spi_ops_s (see include/nuttx/spi/spi.h). All other methods (including
|
||||
* stm32_spibus_initialize()) are provided by common STM32 logic. To use
|
||||
* this common SPI logic on your board:
|
||||
*
|
||||
* 1. Provide logic in stm32_boardinitialize() to configure SPI chip select
|
||||
* pins.
|
||||
* 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() functions
|
||||
* in your board-specific logic. These functions will perform chip
|
||||
* selection and status operations using GPIOs in the way your board is
|
||||
* configured.
|
||||
* 3. Add a calls to stm32_spibus_initialize() in your low level application
|
||||
* initialization logic
|
||||
* 4. The handle returned by stm32_spibus_initialize() may then be used to
|
||||
* bind the SPI driver to higher level logic (e.g., calling
|
||||
* mmcsd_spislotinitialize(), for example, will bind the SPI driver to
|
||||
* the SPI MMC/SD driver).
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STM32_SPI1
|
||||
void stm32_spi1select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
#if defined(CONFIG_CAN_MCP2515)
|
||||
if (devid == SPIDEV_CANBUS(0))
|
||||
{
|
||||
stm32_gpiowrite(GPIO_MCP2515_CS, !selected);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CL_MFRC522)
|
||||
if (devid == SPIDEV_CONTACTLESS(0))
|
||||
{
|
||||
stm32_gpiowrite(GPIO_CS_MFRC522, !selected);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IEEE802154_MRF24J40
|
||||
if (devid == SPIDEV_IEEE802154(0))
|
||||
{
|
||||
stm32_gpiowrite(GPIO_MRF24J40_CS, !selected);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_IEEE802154_XBEE)
|
||||
if (devid == SPIDEV_IEEE802154(0))
|
||||
{
|
||||
stm32_gpiowrite(GPIO_XBEE_CS, !selected);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SENSORS_MAX6675)
|
||||
if (devid == SPIDEV_TEMPERATURE(0))
|
||||
{
|
||||
stm32_gpiowrite(GPIO_MAX6675_CS, !selected);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LCD_MAX7219
|
||||
if (devid == SPIDEV_DISPLAY(0))
|
||||
{
|
||||
stm32_gpiowrite(STM32_LCD_CS, !selected);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LCD_PCD8544
|
||||
if (devid == SPIDEV_DISPLAY(0))
|
||||
{
|
||||
stm32_gpiowrite(STM32_LCD_CS, !selected);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LCD_ST7567
|
||||
if (devid == SPIDEV_DISPLAY(0))
|
||||
{
|
||||
stm32_gpiowrite(STM32_LCD_CS, !selected);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_WL_NRF24L01
|
||||
if (devid == SPIDEV_WIRELESS(0))
|
||||
{
|
||||
stm32_gpiowrite(GPIO_NRF24L01_CS, !selected);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MMCSD_SPI
|
||||
if (devid == SPIDEV_MMCSD(0))
|
||||
{
|
||||
stm32_gpiowrite(GPIO_SDCARD_CS, !selected);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MTD_W25
|
||||
stm32_gpiowrite(FLASH_SPI1_CS, !selected);
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
uint8_t status = 0;
|
||||
|
||||
#ifdef CONFIG_WL_NRF24L01
|
||||
if (devid == SPIDEV_WIRELESS(0))
|
||||
{
|
||||
status |= SPI_STATUS_PRESENT;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MMCSD_SPI
|
||||
if (devid == SPIDEV_MMCSD(0))
|
||||
{
|
||||
status |= SPI_STATUS_PRESENT;
|
||||
}
|
||||
#endif
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32_SPI2
|
||||
void stm32_spi2select(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
bool selected)
|
||||
{
|
||||
}
|
||||
|
||||
uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_spi1cmddata
|
||||
*
|
||||
* Description:
|
||||
* Set or clear the SH1101A A0 or SD1306 D/C n bit to select data (true)
|
||||
* or command (false). This function must be provided by platform-specific
|
||||
* logic. This is an implementation of the cmddata method of the SPI
|
||||
* interface defined by struct spi_ops_s (see include/nuttx/spi/spi.h).
|
||||
*
|
||||
* Input Parameters:
|
||||
*
|
||||
* spi - SPI device that controls the bus the device that requires the CMD/
|
||||
* DATA selection.
|
||||
* devid - If there are multiple devices on the bus, this selects which one
|
||||
* to select cmd or data. NOTE: This design restricts, for example,
|
||||
* one one SPI display per SPI bus.
|
||||
* cmd - true: select command; false: select data
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
#ifdef CONFIG_STM32_SPI1
|
||||
int stm32_spi1cmddata(FAR struct spi_dev_s *dev, uint32_t devid,
|
||||
bool cmd)
|
||||
{
|
||||
#ifdef CONFIG_LCD_ST7567
|
||||
if (devid == SPIDEV_DISPLAY(0))
|
||||
{
|
||||
/* This is the Data/Command control pad which determines whether the
|
||||
* data bits are data or a command.
|
||||
*/
|
||||
|
||||
(void)stm32_gpiowrite(STM32_LCD_RS, !cmd);
|
||||
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LCD_PCD8544
|
||||
if (devid == SPIDEV_DISPLAY(0))
|
||||
{
|
||||
/* This is the Data/Command control pad which determines whether the
|
||||
* data bits are data or a command.
|
||||
*/
|
||||
|
||||
(void)stm32_gpiowrite(STM32_LCD_CD, !cmd);
|
||||
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
return -ENODEV;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_STM32_SPI1 || CONFIG_STM32_SPI2 */
|
||||
@@ -8,6 +8,7 @@
|
||||
# CONFIG_CXD56_I2C0_SCUSEQ is not set
|
||||
# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set
|
||||
# CONFIG_MMCSD_SPI is not set
|
||||
# CONFIG_MTD_SMART_WEAR_LEVEL is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="spresense"
|
||||
@@ -44,6 +45,7 @@ CONFIG_FAT_MAXFNAME=64
|
||||
CONFIG_FS_FAT=y
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_FS_PROCFS_REGISTER=y
|
||||
CONFIG_FS_SMARTFS=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_I2C=y
|
||||
@@ -54,6 +56,11 @@ CONFIG_MAX_TASKS=16
|
||||
CONFIG_MAX_WDOGPARMS=2
|
||||
CONFIG_MMCSD=y
|
||||
CONFIG_MMCSD_SDIO=y
|
||||
CONFIG_MTD_BYTE_WRITE=y
|
||||
CONFIG_MTD_PARTITION=y
|
||||
CONFIG_MTD_SMART=y
|
||||
CONFIG_MTD_SMART_ENABLE_CRC=y
|
||||
CONFIG_MTD_SMART_SECTOR_SIZE=4096
|
||||
CONFIG_NFILE_DESCRIPTORS=8
|
||||
CONFIG_NFILE_STREAMS=8
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
@@ -70,6 +77,9 @@ CONFIG_RTC=y
|
||||
CONFIG_RTC_DRIVER=y
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SDCLONE_DISABLE=y
|
||||
CONFIG_SMARTFS_ALIGNED_ACCESS=y
|
||||
CONFIG_SMARTFS_MAXNAMLEN=30
|
||||
CONFIG_SMARTFS_MULTI_ROOT_DIRS=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_START_DAY=6
|
||||
CONFIG_START_MONTH=12
|
||||
@@ -88,4 +98,4 @@ CONFIG_USBDEV_DUALSPEED=y
|
||||
CONFIG_USBMSC=y
|
||||
CONFIG_USBMSC_COMPOSITE=y
|
||||
CONFIG_USBMSC_REMOVABLE=y
|
||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||
CONFIG_USER_ENTRYPOINT="spresense_main"
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
# CONFIG_CXD56_I2C0_SCUSEQ is not set
|
||||
# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set
|
||||
# CONFIG_MMCSD_SPI is not set
|
||||
# CONFIG_MTD_SMART_WEAR_LEVEL is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="spresense"
|
||||
@@ -47,6 +48,7 @@ CONFIG_FAT_MAXFNAME=64
|
||||
CONFIG_FS_FAT=y
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_FS_PROCFS_REGISTER=y
|
||||
CONFIG_FS_SMARTFS=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_I2C=y
|
||||
@@ -54,6 +56,11 @@ CONFIG_MAX_TASKS=16
|
||||
CONFIG_MAX_WDOGPARMS=2
|
||||
CONFIG_MMCSD=y
|
||||
CONFIG_MMCSD_SDIO=y
|
||||
CONFIG_MTD_BYTE_WRITE=y
|
||||
CONFIG_MTD_PARTITION=y
|
||||
CONFIG_MTD_SMART=y
|
||||
CONFIG_MTD_SMART_ENABLE_CRC=y
|
||||
CONFIG_MTD_SMART_SECTOR_SIZE=4096
|
||||
CONFIG_NFILE_DESCRIPTORS=8
|
||||
CONFIG_NFILE_STREAMS=8
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
@@ -70,6 +77,9 @@ CONFIG_RTC=y
|
||||
CONFIG_RTC_DRIVER=y
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SDCLONE_DISABLE=y
|
||||
CONFIG_SMARTFS_ALIGNED_ACCESS=y
|
||||
CONFIG_SMARTFS_MAXNAMLEN=30
|
||||
CONFIG_SMARTFS_MULTI_ROOT_DIRS=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_START_DAY=6
|
||||
CONFIG_START_MONTH=12
|
||||
@@ -85,4 +95,4 @@ CONFIG_USBDEV_DUALSPEED=y
|
||||
CONFIG_USBMSC=y
|
||||
CONFIG_USBMSC_EPBULKIN=1
|
||||
CONFIG_USBMSC_REMOVABLE=y
|
||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||
CONFIG_USER_ENTRYPOINT="spresense_main"
|
||||
|
||||
@@ -56,4 +56,4 @@ CONFIG_SYSTEM_CLE=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_SYSTEM_NSH_CXXINITIALIZE=y
|
||||
CONFIG_UART1_SERIAL_CONSOLE=y
|
||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||
CONFIG_USER_ENTRYPOINT="spresense_main"
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#
|
||||
# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set
|
||||
# CONFIG_MMCSD_SPI is not set
|
||||
# CONFIG_MTD_SMART_WEAR_LEVEL is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="spresense"
|
||||
@@ -35,6 +36,7 @@ CONFIG_FS_FAT=y
|
||||
CONFIG_FS_FATTIME=y
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_FS_PROCFS_REGISTER=y
|
||||
CONFIG_FS_SMARTFS=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_I2C=y
|
||||
@@ -68,6 +70,11 @@ CONFIG_NET_STATISTICS=y
|
||||
CONFIG_NET_TCP=y
|
||||
CONFIG_NET_UDP=y
|
||||
CONFIG_NET_UDP_BINDTODEVICE=y
|
||||
CONFIG_MTD_BYTE_WRITE=y
|
||||
CONFIG_MTD_PARTITION=y
|
||||
CONFIG_MTD_SMART=y
|
||||
CONFIG_MTD_SMART_ENABLE_CRC=y
|
||||
CONFIG_MTD_SMART_SECTOR_SIZE=4096
|
||||
CONFIG_NFILE_DESCRIPTORS=8
|
||||
CONFIG_NFILE_STREAMS=8
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
@@ -88,6 +95,9 @@ CONFIG_RTC=y
|
||||
CONFIG_SCHED_LPWORK=y
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SDCLONE_DISABLE=y
|
||||
CONFIG_SMARTFS_ALIGNED_ACCESS=y
|
||||
CONFIG_SMARTFS_MAXNAMLEN=30
|
||||
CONFIG_SMARTFS_MULTI_ROOT_DIRS=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_STACK_COLORATION=y
|
||||
CONFIG_START_DAY=16
|
||||
@@ -102,4 +112,4 @@ CONFIG_UART1_SERIAL_CONSOLE=y
|
||||
CONFIG_USBDEV=y
|
||||
CONFIG_USBDEV_DMA=y
|
||||
CONFIG_USBDEV_DUALSPEED=y
|
||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||
CONFIG_USER_ENTRYPOINT="spresense_main"
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
# CONFIG_CXD56_I2C0_SCUSEQ is not set
|
||||
# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set
|
||||
# CONFIG_MMCSD_SPI is not set
|
||||
# CONFIG_MTD_SMART_WEAR_LEVEL is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="spresense"
|
||||
@@ -42,6 +43,7 @@ CONFIG_FAT_MAXFNAME=64
|
||||
CONFIG_FS_FAT=y
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_FS_PROCFS_REGISTER=y
|
||||
CONFIG_FS_SMARTFS=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_I2C=y
|
||||
@@ -49,6 +51,11 @@ CONFIG_MAX_TASKS=16
|
||||
CONFIG_MAX_WDOGPARMS=2
|
||||
CONFIG_MMCSD=y
|
||||
CONFIG_MMCSD_SDIO=y
|
||||
CONFIG_MTD_BYTE_WRITE=y
|
||||
CONFIG_MTD_PARTITION=y
|
||||
CONFIG_MTD_SMART=y
|
||||
CONFIG_MTD_SMART_ENABLE_CRC=y
|
||||
CONFIG_MTD_SMART_SECTOR_SIZE=4096
|
||||
CONFIG_NFILE_DESCRIPTORS=8
|
||||
CONFIG_NFILE_STREAMS=8
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
@@ -65,6 +72,9 @@ CONFIG_RTC=y
|
||||
CONFIG_RTC_DRIVER=y
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SDCLONE_DISABLE=y
|
||||
CONFIG_SMARTFS_ALIGNED_ACCESS=y
|
||||
CONFIG_SMARTFS_MAXNAMLEN=30
|
||||
CONFIG_SMARTFS_MULTI_ROOT_DIRS=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_START_DAY=6
|
||||
CONFIG_START_MONTH=12
|
||||
@@ -83,4 +93,4 @@ CONFIG_USBDEV_DUALSPEED=y
|
||||
CONFIG_USBMSC=y
|
||||
CONFIG_USBMSC_COMPOSITE=y
|
||||
CONFIG_USBMSC_REMOVABLE=y
|
||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||
CONFIG_USER_ENTRYPOINT="spresense_main"
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
# CONFIG_CXD56_I2C0_SCUSEQ is not set
|
||||
# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set
|
||||
# CONFIG_MMCSD_SPI is not set
|
||||
# CONFIG_MTD_SMART_WEAR_LEVEL is not set
|
||||
# CONFIG_STANDARD_SERIAL is not set
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="spresense"
|
||||
@@ -35,6 +36,7 @@ CONFIG_FAT_MAXFNAME=64
|
||||
CONFIG_FS_FAT=y
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_FS_PROCFS_REGISTER=y
|
||||
CONFIG_FS_SMARTFS=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_I2C=y
|
||||
@@ -42,6 +44,11 @@ CONFIG_MAX_TASKS=16
|
||||
CONFIG_MAX_WDOGPARMS=2
|
||||
CONFIG_MMCSD=y
|
||||
CONFIG_MMCSD_SDIO=y
|
||||
CONFIG_MTD_BYTE_WRITE=y
|
||||
CONFIG_MTD_PARTITION=y
|
||||
CONFIG_MTD_SMART=y
|
||||
CONFIG_MTD_SMART_ENABLE_CRC=y
|
||||
CONFIG_MTD_SMART_SECTOR_SIZE=4096
|
||||
CONFIG_NFILE_DESCRIPTORS=8
|
||||
CONFIG_NFILE_STREAMS=8
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
@@ -58,6 +65,9 @@ CONFIG_RTC=y
|
||||
CONFIG_RTC_DRIVER=y
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SDCLONE_DISABLE=y
|
||||
CONFIG_SMARTFS_ALIGNED_ACCESS=y
|
||||
CONFIG_SMARTFS_MAXNAMLEN=30
|
||||
CONFIG_SMARTFS_MULTI_ROOT_DIRS=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_START_DAY=6
|
||||
CONFIG_START_MONTH=12
|
||||
@@ -73,4 +83,4 @@ CONFIG_USBDEV_DUALSPEED=y
|
||||
CONFIG_USBMSC=y
|
||||
CONFIG_USBMSC_EPBULKIN=1
|
||||
CONFIG_USBMSC_REMOVABLE=y
|
||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||
CONFIG_USER_ENTRYPOINT="spresense_main"
|
||||
|
||||
@@ -85,6 +85,9 @@ CONFIG_SCHED_LPWORK=y
|
||||
CONFIG_SCHED_LPWORKPRIORITY=30
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SDCLONE_DISABLE=y
|
||||
CONFIG_SMARTFS_ALIGNED_ACCESS=y
|
||||
CONFIG_SMARTFS_MAXNAMLEN=30
|
||||
CONFIG_SMARTFS_MULTI_ROOT_DIRS=y
|
||||
CONFIG_STACK_COLORATION=y
|
||||
CONFIG_START_DAY=16
|
||||
CONFIG_START_MONTH=7
|
||||
@@ -100,7 +103,7 @@ CONFIG_USBDEV_DUALSPEED=y
|
||||
CONFIG_USBMSC=y
|
||||
CONFIG_USBMSC_EPBULKIN=1
|
||||
CONFIG_USBMSC_REMOVABLE=y
|
||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||
CONFIG_USER_ENTRYPOINT="spresense_main"
|
||||
CONFIG_WIRELESS_GS2200M=y
|
||||
CONFIG_WL_GS2200M=y
|
||||
CONFIG_WL_GS2200M_SPI_FREQUENCY=10000000
|
||||
|
||||
+12
-11
@@ -172,7 +172,7 @@ static int tda19988_unlink(FAR struct inode *inode);
|
||||
|
||||
static int tda19988_hwinitialize(FAR struct tda1988_dev_s *priv);
|
||||
static int tda19988_videomode_internal(FAR struct tda1988_dev_s *priv,
|
||||
FAR const struct tda19988_videomode_s *mode);
|
||||
FAR const struct videomode_s *mode);
|
||||
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
||||
static void tda19988_shutdown(FAR struct tda1988_dev_s *priv);
|
||||
#endif
|
||||
@@ -229,7 +229,8 @@ static int tda19988_getregs(FAR const struct tda19988_i2c_s *dev,
|
||||
return -1;
|
||||
}
|
||||
|
||||
lcdinfo("Read: %02x:%02x->%02x\n", page, regaddr, *regval);
|
||||
lcdinfo("Write: %02x<-%02x\n", regaddr, *regval);
|
||||
lcderrdumpbuffer("Read:", regval, nregs);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -263,7 +264,7 @@ static int tda19988_putreg(FAR const struct tda19988_i2c_s *dev,
|
||||
return ret;
|
||||
}
|
||||
|
||||
lcdinfo("Wrote: %02x:%02x<-%02x\n", page, regaddr, regval);
|
||||
lcdinfo("Wrote: %02x<-%02x\n", regaddr, regval);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -298,7 +299,7 @@ static int tda19988_putreg16(FAR const struct tda19988_i2c_s *dev,
|
||||
return ret;
|
||||
}
|
||||
|
||||
lcdinfo("Wrote: %02x:%02x<-%02x\n", page, regaddr, regval);
|
||||
lcdinfo("Wrote: 02x<-%04x\n", regaddr, regval);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -729,7 +730,7 @@ static int tda19988_fetch_edid(struct tda1988_dev_s *priv)
|
||||
goto done;
|
||||
}
|
||||
|
||||
blocks = priv->edid[EDID_TRAILER_NEXTENSIONS];
|
||||
blocks = priv->edid[EDID_TRAILER_NEXTENSIONS_OFFSET];
|
||||
if (blocks > 0)
|
||||
{
|
||||
FAR uint8_t *edid;
|
||||
@@ -1125,15 +1126,15 @@ static int tda19988_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
* of the initialization of the driver. This is
|
||||
* equivalent to calling tda18899_videomode() within
|
||||
* the OS.
|
||||
* Argument: A reference to a tda19988_videomode_s structure
|
||||
* Argument: A reference to a videomode_s structure
|
||||
* instance.
|
||||
* Returns: None
|
||||
*/
|
||||
|
||||
case TDA19988_IOC_VIDEOMODE:
|
||||
{
|
||||
FAR const struct tda19988_videomode_s *mode =
|
||||
(FAR const struct tda19988_videomode_s *)((uintptr_t)arg);
|
||||
FAR const struct videomode_s *mode =
|
||||
(FAR const struct videomode_s *)((uintptr_t)arg);
|
||||
|
||||
if (mode == NULL)
|
||||
{
|
||||
@@ -1385,7 +1386,7 @@ done:
|
||||
|
||||
static int
|
||||
tda19988_videomode_internal(FAR struct tda1988_dev_s *priv,
|
||||
FAR const struct tda19988_videomode_s *mode)
|
||||
FAR const struct videomode_s *mode)
|
||||
{
|
||||
uint16_t ref_pix;
|
||||
uint16_t ref_line;
|
||||
@@ -1462,7 +1463,7 @@ static int
|
||||
(mode->vsync_end - mode->vsync_start) / 2;
|
||||
}
|
||||
|
||||
div = 148500 / mode->dot_clock;
|
||||
div = 148500 / mode->dotclock;
|
||||
if (div != 0)
|
||||
{
|
||||
if (--div > 3)
|
||||
@@ -1732,7 +1733,7 @@ TDA19988_HANDLE tda19988_register(FAR const char *devpath,
|
||||
****************************************************************************/
|
||||
|
||||
int tda19988_videomode(TDA19988_HANDLE handle,
|
||||
FAR const struct tda19988_videomode_s *mode)
|
||||
FAR const struct videomode_s *mode)
|
||||
{
|
||||
FAR struct tda1988_dev_s *priv = (FAR struct tda1988_dev_s *)handle;
|
||||
int ret;
|
||||
|
||||
@@ -15,6 +15,13 @@ config APDS9960_I2C_FREQUENCY
|
||||
default 400000
|
||||
depends on SENSORS_APDS9960
|
||||
|
||||
config SENSORS_AK09912
|
||||
bool "Asahi AK09911/AK09912 Compass Sensor"
|
||||
default n
|
||||
select I2C
|
||||
---help---
|
||||
Enable driver for AK09911/AK09912 Compass sensor.
|
||||
|
||||
config SENSORS_AS5048B
|
||||
bool "AMS AS5048B Magnetic Rotary Encoder support"
|
||||
default n
|
||||
@@ -86,6 +93,13 @@ config SENSORS_BMP180
|
||||
---help---
|
||||
Enable driver support for the Bosch BMP180 barometer sensor.
|
||||
|
||||
config SENSORS_BMP280
|
||||
bool "Bosch BMP280 Barometic Pressure Sensor"
|
||||
default n
|
||||
select I2C
|
||||
---help---
|
||||
Enable driver for the Bosch BMP280 barometic pressure sensor.
|
||||
|
||||
config SENSORS_DHTXX
|
||||
bool "DHTxx humidity/temperature Sensor support"
|
||||
default n
|
||||
@@ -724,6 +738,13 @@ config VEML6070_I2C_FREQUENCY
|
||||
default 100000
|
||||
depends on SENSORS_VEML6070
|
||||
|
||||
config SENSORS_VL53L1X
|
||||
bool "ST VL53L1X TOF sensor"
|
||||
default n
|
||||
select I2C
|
||||
---help---
|
||||
Enable driver support for the VL53L1X Time Of Flight sensor.
|
||||
|
||||
config SENSORS_XEN1210
|
||||
bool "Sensixs XEN1210 Magnetometer"
|
||||
default n
|
||||
|
||||
@@ -57,6 +57,10 @@ ifeq ($(CONFIG_SENSORS_APDS9960),y)
|
||||
CSRCS += apds9960.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_AK09912),y)
|
||||
CSRCS += ak09912.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_AS5048B),y)
|
||||
CSRCS += as5048b.c
|
||||
endif
|
||||
@@ -113,6 +117,11 @@ ifeq ($(CONFIG_SENSORS_BMP180),y)
|
||||
CSRCS += bmp180.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_BMP280),y)
|
||||
CSRCS += bmp280.c
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_HTS221),y)
|
||||
CSRCS += hts221.c
|
||||
endif
|
||||
@@ -249,6 +258,12 @@ ifeq ($(CONFIG_SENSORS_VEML6070),y)
|
||||
CSRCS += veml6070.c
|
||||
endif
|
||||
|
||||
# ST VL53L1X
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_VL53L1X),y)
|
||||
CSRCS += vl53l1x.c
|
||||
endif
|
||||
|
||||
# Sensixs XEN1210
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_XEN1210),y)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -173,6 +173,7 @@ struct gs2200m_dev_s
|
||||
uint16_t aip_cid_bits;
|
||||
uint8_t tx_buff[MAX_PKT_LEN];
|
||||
struct net_driver_s net_dev;
|
||||
uint8_t op_mode;
|
||||
FAR const struct gs2200m_lower_s *lower;
|
||||
};
|
||||
|
||||
@@ -1369,10 +1370,18 @@ errout:
|
||||
static enum pkt_type_e gs2200m_set_opmode(FAR struct gs2200m_dev_s *dev,
|
||||
uint8_t mode)
|
||||
{
|
||||
enum pkt_type_e t;
|
||||
char cmd[20];
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "AT+WM=%d\r\n", mode);
|
||||
return gs2200m_send_cmd(dev, cmd, NULL);
|
||||
t = gs2200m_send_cmd(dev, cmd, NULL);
|
||||
|
||||
if (TYPE_OK == t)
|
||||
{
|
||||
dev->op_mode = mode;
|
||||
}
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -1471,7 +1480,7 @@ static enum pkt_type_e gs2200m_set_security(FAR struct gs2200m_dev_s *dev,
|
||||
****************************************************************************/
|
||||
|
||||
static enum pkt_type_e gs2200m_join_network(FAR struct gs2200m_dev_s *dev,
|
||||
FAR char *ssid)
|
||||
FAR char *ssid, uint8_t ch)
|
||||
{
|
||||
struct pkt_dat_s pkt_dat;
|
||||
enum pkt_type_e r;
|
||||
@@ -1482,7 +1491,18 @@ static enum pkt_type_e gs2200m_join_network(FAR struct gs2200m_dev_s *dev,
|
||||
/* Initialize pkt_dat and send command */
|
||||
|
||||
memset(&pkt_dat, 0, sizeof(pkt_dat));
|
||||
snprintf(cmd, sizeof(cmd), "AT+WA=%s\r\n", ssid);
|
||||
|
||||
if (0 == dev->op_mode)
|
||||
{
|
||||
snprintf(cmd, sizeof(cmd), "AT+WA=%s\r\n", ssid);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* In AP mode, we can specify chennel to use */
|
||||
|
||||
snprintf(cmd, sizeof(cmd), "AT+WA=%s,,%d\r\n", ssid, ch);
|
||||
}
|
||||
|
||||
r = gs2200m_send_cmd(dev, cmd, &pkt_dat);
|
||||
|
||||
if (r != TYPE_OK)
|
||||
@@ -2155,7 +2175,7 @@ static int gs2200m_ioctl_assoc_sta(FAR struct gs2200m_dev_s *dev,
|
||||
|
||||
/* Associate with AP */
|
||||
|
||||
if (TYPE_OK != gs2200m_join_network(dev, msg->ssid))
|
||||
if (TYPE_OK != gs2200m_join_network(dev, msg->ssid, 0))
|
||||
{
|
||||
wlerr("*** error: failed to join (ssid:%s) \n", msg->ssid);
|
||||
return -1;
|
||||
@@ -2222,9 +2242,10 @@ static int gs2200m_ioctl_assoc_ap(FAR struct gs2200m_dev_s *dev,
|
||||
|
||||
/* Enable the AP */
|
||||
|
||||
if (TYPE_OK != gs2200m_join_network(dev, msg->ssid))
|
||||
if (TYPE_OK != gs2200m_join_network(dev, msg->ssid, msg->ch))
|
||||
{
|
||||
wlerr("*** error: failed to join (ssid:%s) \n", msg->ssid);
|
||||
wlerr("*** error: failed to join (ssid:%s, ch:%d) \n",
|
||||
msg->ssid, msg->ch);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,9 @@ namespace std
|
||||
|
||||
using ::socklen_t;
|
||||
using ::sa_family_t;
|
||||
#if __cplusplus >= 201103L
|
||||
using nullptr_t = decltype(nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // __INCLUDE_CXX_CSTDDEF
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/i2c/i2c_master.h>
|
||||
#include <nuttx/lcd/lcd_ioctl.h>
|
||||
#include <nuttx/video/videomode.h>
|
||||
|
||||
#ifdef CONFIG_LCD_TDA19988
|
||||
|
||||
@@ -59,30 +60,13 @@
|
||||
* Description: Select the video mode. This must be done as part of the
|
||||
* initialization of the driver. This is equivalent to
|
||||
* calling tda18899_videomode() within the OS.
|
||||
* Argument: A reference to a tda19988_videomode_s structure instance.
|
||||
* See struct tda19988_videomode_s below.
|
||||
* Argument: A reference to a videomode_s structure instance.
|
||||
* See struct videomode_s below.
|
||||
* Returns: None
|
||||
*/
|
||||
|
||||
#define TDA19988_IOC_VIDEOMODE _LCDIOC(TDA19988_NIOCTL_BASE + 0)
|
||||
|
||||
/* Values for video mode flags */
|
||||
|
||||
#define VID_PHSYNC 0x0001
|
||||
#define VID_NHSYNC 0x0002
|
||||
#define VID_PVSYNC 0x0004
|
||||
#define VID_NVSYNC 0x0008
|
||||
#define VID_INTERLACE 0x0010
|
||||
#define VID_DBLSCAN 0x0020
|
||||
#define VID_CSYNC 0x0040
|
||||
#define VID_PCSYNC 0x0080
|
||||
#define VID_NCSYNC 0x0100
|
||||
#define VID_HSKEW 0x0200
|
||||
#define VID_BCAST 0x0400
|
||||
#define VID_PIXMUX 0x1000
|
||||
#define VID_DBLCLK 0x2000
|
||||
#define VID_CLKDIV2 0x4000
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
@@ -91,26 +75,6 @@
|
||||
|
||||
typedef FAR void *TDA19988_HANDLE;
|
||||
|
||||
/* Structure that provides the TDA19988 video mode */
|
||||
|
||||
struct tda19988_videomode_s
|
||||
{
|
||||
int dot_clock; /* Dot clock frequency in kHz. */
|
||||
|
||||
int hdisplay;
|
||||
int hsync_start;
|
||||
int hsync_end;
|
||||
int htotal;
|
||||
|
||||
int vdisplay;
|
||||
int vsync_start;
|
||||
int vsync_end;
|
||||
int vtotal;
|
||||
|
||||
int flags; /* Video mode flags; see above. */
|
||||
int hskew;
|
||||
};
|
||||
|
||||
/* This structure defines the I2C interface.
|
||||
* REVISIT: This could be simplified because the CEC and HDMI reside on
|
||||
* the same I2C bus (pins CSCL and CSCA).
|
||||
@@ -210,7 +174,7 @@ TDA19988_HANDLE tda19988_register(FAR const char *devpath,
|
||||
****************************************************************************/
|
||||
|
||||
int tda19988_videomode(TDA19988_HANDLE handle,
|
||||
FAR const struct tda19988_videomode_s *mode);
|
||||
FAR const struct videomode_s *mode);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: tda19988_read_edid
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/sensors/ak09912.h
|
||||
*
|
||||
* Copyright 2018 Sony Semiconductor Solutions Corporation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
|
||||
* the names of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific prior written
|
||||
* permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_SENSORS_AK09912_H
|
||||
#define __INCLUDE_NUTTX_SENSORS_AK09912_H
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_AK09912)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/* Prerequisites:
|
||||
*
|
||||
* CONFIG_AK09912
|
||||
* Enables support for the AK09912 driver
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
struct i2c_master_s;
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/* IOCTL Commands ***********************************************************/
|
||||
|
||||
/* Arg: 0: Disable compensated
|
||||
* 1: Enable compensated
|
||||
*/
|
||||
|
||||
#define ENABLE_COMPENSATED (1)
|
||||
#define DISABLE_COMPENSATED (0)
|
||||
#define SNIOC_ENABLE_COMPENSATED _SNIOC(0x0001)
|
||||
|
||||
#define SNIOC_GETADJ _SNIOC(0x0002)
|
||||
|
||||
struct mag_data_s
|
||||
{
|
||||
int16_t x; /* X raw data */
|
||||
int16_t y; /* Y raw data */
|
||||
int16_t z; /* Z raw data */
|
||||
};
|
||||
|
||||
struct ak09912_sensadj_s
|
||||
{
|
||||
uint8_t x;
|
||||
uint8_t y;
|
||||
uint8_t z;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Name: ak09912_register
|
||||
*
|
||||
* Description:
|
||||
* Register the AK09912 character device as 'devpath'
|
||||
*
|
||||
* Input Parameters:
|
||||
* devpath - The full path to the driver to register. E.g., "/dev/mag0"
|
||||
* i2c - An instance of the I2C interface to use to communicate with
|
||||
* AK09912
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
int ak09912_register(FAR const char *devpath, FAR struct i2c_master_s *i2c);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_I2C && CONFIG_AK09912 */
|
||||
#endif /* __DRIVERS_AK09912_H */
|
||||
@@ -0,0 +1,165 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/sensors/bmp280.h
|
||||
*
|
||||
* Copyright 2018 Sony Semiconductor Solutions Corporation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
|
||||
* the names of its contributors may be used to endorse or promote
|
||||
* products derived from this software without specific prior written
|
||||
* permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_SENSORS_BMP280_H
|
||||
#define __INCLUDE_NUTTX_SENSORS_BMP280_H
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_BMP280)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/* Prerequisites:
|
||||
*
|
||||
* CONFIG_BMP280
|
||||
* Enables support for the BMP280 driver
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
struct i2c_master_s;
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/* IOCTL Commands ***********************************************************/
|
||||
|
||||
/* Arg: 0: Disable compensated
|
||||
* 1: Enable compensated
|
||||
*/
|
||||
|
||||
#define ENABLE_COMPENSATED (1)
|
||||
#define DISABLE_COMPENSATED (0)
|
||||
|
||||
/* Standby duration */
|
||||
|
||||
#define BMP280_STANDBY_1_MS (0x00) /* 0.5 ms */
|
||||
#define BMP280_STANDBY_63_MS (0x01) /* 62.5 ms */
|
||||
#define BMP280_STANDBY_125_MS (0x02) /* 125 ms */
|
||||
#define BMP280_STANDBY_250_MS (0x03) /* 250 ms */
|
||||
#define BMP280_STANDBY_500_MS (0x04) /* 500 ms */
|
||||
#define BMP280_STANDBY_1000_MS (0x05) /* 1000 ms */
|
||||
#define BMP280_STANDBY_2000_MS (0x06) /* 2000 ms */
|
||||
#define BMP280_STANDBY_4000_MS (0x07) /* 4000 ms */
|
||||
|
||||
/* Enable compensate of sensing values (no SCU bus only)
|
||||
*
|
||||
* Arg: ENABLE_COMPENSATED or DISABLE_COMPENSATED
|
||||
*/
|
||||
|
||||
#define SNIOC_ENABLE_COMPENSATED _SNIOC(0x0001)
|
||||
|
||||
/* Get sensor predefined adjustment values (SCU bus only)
|
||||
*
|
||||
* Arg: Pointer of struct bmp280_press_adj_s (pressure)
|
||||
* Pointer of struct bmp280_temp_adj_s (temperature)
|
||||
*/
|
||||
|
||||
#define SNIOC_GETADJ _SNIOC(0x0002)
|
||||
|
||||
/* Set sensor standby duration
|
||||
*
|
||||
* Arg: BMP280_STANDBY_*_MS
|
||||
*/
|
||||
|
||||
#define SNIOC_SETSTB _SNIOC(0x0003)
|
||||
|
||||
struct bmp280_press_adj_s
|
||||
{
|
||||
uint16_t dig_p1; /** calibration P1 data */
|
||||
int16_t dig_p2; /** calibration P2 data */
|
||||
int16_t dig_p3; /** calibration P3 data */
|
||||
int16_t dig_p4; /** calibration P4 data */
|
||||
int16_t dig_p5; /** calibration P5 data */
|
||||
int16_t dig_p6; /** calibration P6 data */
|
||||
int16_t dig_p7; /** calibration P7 data */
|
||||
int16_t dig_p8; /** calibration P8 data */
|
||||
int16_t dig_p9; /** calibration P9 data */
|
||||
};
|
||||
|
||||
struct bmp280_temp_adj_s
|
||||
{
|
||||
uint16_t dig_t1; /** calibration T1 data */
|
||||
int16_t dig_t2; /** calibration T2 data */
|
||||
int16_t dig_t3; /** calibration T3 data */
|
||||
};
|
||||
|
||||
struct bmp280_meas_s
|
||||
{
|
||||
uint8_t msb; /** meas value MSB */
|
||||
uint8_t lsb; /** meas value LSB */
|
||||
uint8_t xlsb; /** meas value XLSB */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Name: bmp280_register
|
||||
*
|
||||
* Description:
|
||||
* Register the BMP280 character device as 'devpath'
|
||||
*
|
||||
* Input Parameters:
|
||||
* devpath - The full path to the driver to register. E.g., "/dev/press"
|
||||
* i2c - An instance of the I2C interface to use to communicate with
|
||||
* BMP280
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
int bmp280_register(FAR const char *devpath, FAR struct i2c_master_s *i2c);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_I2C && CONFIG_SENSORS_BMP280 */
|
||||
#endif /* __INCLUDE_NUTTX_BMP280_H */
|
||||
@@ -210,4 +210,11 @@
|
||||
#define SNIOC_SET_CLEAN_INTERVAL _SNIOC(0x005d) /* Arg: uint32_t value (seconds) */
|
||||
#define SNIOC_START_FAN_CLEANING _SNIOC(0x005e) /* Arg: None */
|
||||
|
||||
/* IOCTL commands unique to the VL53L1X */
|
||||
|
||||
#define SNIOC_DISTANCESHORT _SNIOC(0x0100) /* Arg: None */
|
||||
#define SNIOC_DISTANCELONG _SNIOC(0x0101) /* Arg: None */
|
||||
#define SNIOC_CALIBRATE _SNIOC(0x0102) /* Arg: b16_t value */
|
||||
#define SNIOC_TEMPUPDATE _SNIOC(0x0103) /* Arg: b16_t value */
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_SENSORS_IOCTL_H */
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
/****************************************************************************
|
||||
* drivers/sensors/vl53l1x.h
|
||||
*
|
||||
* Copyright (C) 2019 Acutronics Robotics. All rights reserved.
|
||||
* Author: Acutronics Robotics (Juan Flores Muñoz) <juan@erlerobotics.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_SENSORS_VL53L1X_H
|
||||
#define __INCLUDE_NUTTX_SENSORS_VL53L1X_H
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_VL53L1X)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define VL53L1X_I2C_PORTNO 1
|
||||
|
||||
#define SOFT_RESET 0x0000
|
||||
#define TIMEOUT_MACROP_LOOP_BOUND 0x0008
|
||||
#define RANGE_OFFSET_MM 0x001e
|
||||
#define INNER_OFFSET_MM 0x0020
|
||||
#define OUTER_OFFSET_MM 0x0022
|
||||
#define GPIO_MUX_CTRL 0x0030
|
||||
#define GPIO_STATUS 0x0031
|
||||
#define PHASECAL_TIMEOUT_MACRO 0x004b
|
||||
#define RANGE_CFG_TIMEOUT_MACRO_HI 0x005e
|
||||
#define RANGE_VCSEL_PERIOD_A 0x0060
|
||||
#define RANGE_VCSEL_PERIOD_B 0x0063
|
||||
#define RANGE_TIMEOUT_MACRO_HI 0x0061
|
||||
#define RANGE_CFG_VALID_PHASE 0x0069
|
||||
#define SYSTEM__THRESH_HIGH 0x0072
|
||||
#define SYSTEM__THRESH_LOW 0x0074
|
||||
#define SD_CFG_WOI_SD0 0x0078
|
||||
#define SD_CFG_INIT_PHASE 0x007a
|
||||
#define INTERRUPT_CLEAR 0x0086
|
||||
#define SYSTEM_MODE 0x0087
|
||||
#define EFFECTIVE_SPADS 0x008c
|
||||
#define VL53L1_GET_DISTANCE 0x0096
|
||||
#define SIGNAL_COUNT_RATE 0x0098
|
||||
#define VL53L1_SYSTEM_STATUS 0x00e5
|
||||
#define VL53L1_GET_ID 0x010f
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: vl53l1x_register
|
||||
*
|
||||
* Description:
|
||||
* Register the VL53L1X character device as 'devpath'
|
||||
*
|
||||
* Input Parameters:
|
||||
* devpath - The full path to the driver to register. E.g., "/dev/tof0"
|
||||
* i2c - An instance of the I2C interface to use to communicate with
|
||||
* VL53L1X
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int vl53l1x_register(FAR const char *devpath, FAR struct i2c_master_s *i2c);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_I2C && CONFIG_SENSORS_VL53L1X */
|
||||
#endif /* __INCLUDE_NUTTX_SENSORS_VL53L1X_H */
|
||||
+26
-68
@@ -5,10 +5,10 @@
|
||||
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Reference: Wikipedia
|
||||
* Reference: Wikipedia (initial version)
|
||||
*
|
||||
* Some of structures in this file derive from FreeBSD which has a
|
||||
* compatible 2-clause BSD license:
|
||||
* Updated and extended with definitions from FreeBSD which has a compatible 2-clause BSD
|
||||
* license:
|
||||
*
|
||||
* Copyright (c) 2006 Itronix Inc. All rights reserved.
|
||||
* Written by Garrett D'Amore for Itronix Inc.
|
||||
@@ -50,6 +50,7 @@
|
||||
********************************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <nuttx/video/videomode.h>
|
||||
|
||||
/********************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@@ -168,6 +169,8 @@
|
||||
|
||||
/* For digital input: */
|
||||
#define EDID_DISPLAY_INPUT_VIDIF_SHIFT (0) /* Bits 0-3: Video interface */
|
||||
#define EDID_DISPLAY_INPUT_VIDIF_MASK (15 << EDID_DISPLAY_INPUT_VIDIF_SHIFT)
|
||||
# define EDID_DISPLAY_INPUT_DFP1_COMPAT (1 << EDID_DISPLAY_INPUT_VIDIF_SHIFT)
|
||||
#define EDID_DISPLAY_INPUT_BITDEPTH_SHIFT (4) /* Bits 4-6: Bit depth */
|
||||
#define EDID_DISPLAY_INPUT_BITDEPTH_MASK (7 << EDID_DISPLAY_INPUT_BITDEPTH_SHIFT)
|
||||
|
||||
@@ -180,9 +183,13 @@
|
||||
* supported */
|
||||
#define EDID_DISPLAY_INPUT_SYNC (1 << 3) /* Bit 3: Separate sync supported */
|
||||
#define EDID_DISPLAY_INPUT_BLANK2BLACK (1 << 4) /* Bit 4: Blank to black setup */
|
||||
#define EDID_DISPLAY_INPUT_LEVELS_SHIFT (0) /* Bits 5-6: Video white and sync levels,
|
||||
#define EDID_DISPLAY_INPUT_LEVELS_SHIFT (5) /* Bits 5-6: Video white and sync levels,
|
||||
* relative to blank */
|
||||
#define EDID_DISPLAY_INPUT_LEVELS_MASK (3 << EDID_DISPLAY_INPUT_LEVELS_SHIFT)
|
||||
# define EDID_DISPLAY_INPUT_LEVEL_1 (0 << EDID_DISPLAY_INPUT_LEVELS_SHIFT) /* -0.7, 0.3V */
|
||||
# define EDID_DISPLAY_INPUT_LEVEL_2 (1 << EDID_DISPLAY_INPUT_LEVELS_SHIFT) /* -0.714, 0.286V */
|
||||
# define EDID_DISPLAY_INPUT_LEVEL_3 (2 << EDID_DISPLAY_INPUT_LEVELS_SHIFT) /* -1.0, 0.4V */
|
||||
# define EDID_DISPLAY_INPUT_LEVEL_4 (3 << EDID_DISPLAY_INPUT_LEVELS_SHIFT) /* -0.7, 0.0V */
|
||||
|
||||
/* Display Section: Supported Features */
|
||||
|
||||
@@ -204,6 +211,10 @@
|
||||
#define EDID_DISPLAY_FEATURE_ATYPE_MASK (3 << EDID_DISPLAY_FEATURE_ATYPE_SHIFT)
|
||||
#define EDID_DISPLAY_FEATURE_DTYPE_SHIFT (3) /* Bits 3-4: Display type (digital) */
|
||||
#define EDID_DISPLAY_FEATURE_DTYPE_MASK (3 << EDID_DISPLAY_FEATURE_DTYPE_SHIFT)
|
||||
# define EDID_ISPLAY_FEATURES_DTYPE_MONO (0 << EDID_DISPLAY_FEATURE_DTYPE_SHIFT)
|
||||
# define EDID_ISPLAY_FEATURES_DTYPE_RGB (1 << EDID_DISPLAY_FEATURE_DTYPE_SHIFT)
|
||||
# define EDID_ISPLAY_FEATURES_DTYPE_NON_RGB (2 << EDID_DISPLAY_FEATURE_DTYPE_SHIFT)
|
||||
# define EDID_ISPLAY_FEATURES_DTYPE_UNDEFINED (3 << EDID_DISPLAY_FEATURE_DTYPE_SHIFT)
|
||||
#define EDID_DISPLAY_FEATURE_DPMSOFF (1 << 5) /* Bit 5: DPMS active-off supported */
|
||||
#define EDID_DISPLAY_FEATURE_DPMSSUSP (1 << 6) /* Bit 6: DPMS suspend supported */
|
||||
#define EDID_DISPLAY_FEATURE_DPMSSTDBY (1 << 7) /* Bit 7: DPMS standby supported */
|
||||
@@ -479,46 +490,10 @@
|
||||
* from manufacturer. However, the value is
|
||||
* later used by DDDB. */
|
||||
|
||||
/* Video mode flags used in struct hdmi_videomode_s */
|
||||
|
||||
#define VID_PHSYNC (1 << 0)
|
||||
#define VID_NHSYNC (1 << 1)
|
||||
#define VID_PVSYNC (1 << 2)
|
||||
#define VID_NVSYNC (1 << 3)
|
||||
#define VID_INTERLACE (1 << 4)
|
||||
#define VID_DBLSCAN (1 << 5)
|
||||
#define VID_CSYNC (1 << 6)
|
||||
#define VID_PCSYNC (1 << 7)
|
||||
#define VID_NCSYNC (1 << 8)
|
||||
#define VID_HSKEW (1 << 9)
|
||||
#define VID_BCAST (1 << 10)
|
||||
#define VID_PIXMUX (1 << 11)
|
||||
#define VID_DBLCLK (1 << 12)
|
||||
#define VID_CLKDIV2 (1 << 13)
|
||||
|
||||
/********************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
********************************************************************************************/
|
||||
|
||||
/* This structure represents one video mode extracted from the EDID. CAREFUL: Fields
|
||||
* may not change without also modification to initializer in edid_videomode.c.
|
||||
*/
|
||||
|
||||
struct edid_videomode_s
|
||||
{
|
||||
uint32_t dotclock; /* Dot clock frequency in kHz. */
|
||||
uint16_t hdisplay;
|
||||
uint16_t hsync_start;
|
||||
uint16_t hsync_end;
|
||||
uint16_t htotal;
|
||||
uint16_t vdisplay;
|
||||
uint16_t vsync_start;
|
||||
uint16_t vsync_end;
|
||||
uint16_t vtotal;
|
||||
uint16_t flags; /* Video mode flags; see above. */
|
||||
FAR const char *name;
|
||||
};
|
||||
|
||||
/* These structures is a user-friendly digest of the EDID data. */
|
||||
|
||||
struct edid_chroma_s
|
||||
@@ -540,8 +515,9 @@ struct edid_range_s
|
||||
uint16_t er_min_hfreq; /* kHz */
|
||||
uint16_t er_max_hfreq; /* kHz */
|
||||
uint16_t er_max_clock; /* MHz */
|
||||
int er_have_gtf2;
|
||||
uint16_t er_gtf2_hfreq;
|
||||
|
||||
bool er_have_gtf2;
|
||||
uint16_t er_gtf2_c;
|
||||
uint16_t er_gtf2_m;
|
||||
uint16_t er_gtf2_k;
|
||||
@@ -561,18 +537,18 @@ struct edid_info_s
|
||||
uint8_t edid_ext_block_count;
|
||||
uint16_t edid_product;
|
||||
uint32_t edid_serial;
|
||||
int edid_year;
|
||||
int edid_week;
|
||||
int edid_have_range;
|
||||
uint16_t edid_year;
|
||||
uint8_t edid_week;
|
||||
bool edid_have_range;
|
||||
|
||||
struct edid_range_s edid_range;
|
||||
struct edid_chroma_s edid_chroma;
|
||||
|
||||
/* Parsed modes */
|
||||
|
||||
FAR struct edid_videomode_s *edid_preferred_mode;
|
||||
FAR struct videomode_s *edid_preferred_mode;
|
||||
int edid_nmodes;
|
||||
struct edid_videomode_s edid_modes[64];
|
||||
struct videomode_s edid_modes[64];
|
||||
};
|
||||
|
||||
/********************************************************************************************
|
||||
@@ -599,37 +575,19 @@ struct edid_info_s
|
||||
int edid_parse(FAR const uint8_t *data, FAR struct edid_info_s *edid);
|
||||
|
||||
/********************************************************************************************
|
||||
* Name: edid_sort_modes
|
||||
* Name: edid_dump
|
||||
*
|
||||
* Description:
|
||||
* Sort video modes by refresh rate, aspect ratio, then resolution.
|
||||
* Preferred mode or largest mode is first in the list and other modes
|
||||
* are sorted on closest match to that mode.
|
||||
*
|
||||
* Note that the aspect ratio calculation treats "close" aspect ratios
|
||||
* (within 12.5%) as the same for this purpose.
|
||||
* Dump the full content of the EDID
|
||||
*
|
||||
* Input Parameters:
|
||||
* modes - A reference to the first entry in a list of video modes
|
||||
* preferred - A pointer to the pointer to the preferred mode in the list
|
||||
* nmodes - The number of modes in the list
|
||||
* edid - The edid to be dumped
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
void edid_sort_modes(FAR struct edid_videomode_s *modes,
|
||||
FAR struct edid_videomode_s **preferred, unsigned int nmodes);
|
||||
|
||||
/********************************************************************************************
|
||||
* Name: edid_mode_lookup
|
||||
*
|
||||
* Description:
|
||||
* Find the video mode in a look-up table
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
FAR const struct edid_videomode_s *edid_mode_lookup(FAR const char *name);
|
||||
void edid_dump(FAR const struct edid_info_s *edid);
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_VIDEO_EDID_H */
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
/**************************************************************************7
|
||||
* include/nuttx/video/vesagtf.h
|
||||
* EDID (Extended Display Identification Data) Format
|
||||
*
|
||||
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Derives from logic in FreeBSD which has an equivalent 3-clause BSD
|
||||
* license:
|
||||
*
|
||||
* Copyright (c) 2006 Itronix Inc. All rights reserved.
|
||||
* Written by Garrett D'Amore for Itronix Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
********************************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_VIDEO_VESAGTF
|
||||
#define __INCLUDE_NUTTX_VIDEO_VESAGTF
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Default values to use for params. */
|
||||
|
||||
#define VESAGTF_MARGIN_PPT 18 /* 1.8% */
|
||||
#define VESAGTF_MIN_PORCH 1 /* minimum front porch */
|
||||
#define VESAGTF_VSYNC_RQD 3 /* vsync width in lines */
|
||||
#define VESAGTF_HSYNC_PCT 8 /* width of hsync % of total line */
|
||||
#define VESAGTF_MIN_VSBP 550 /* min vsync + back porch (usec) */
|
||||
#define VESAGTF_M 600 /* blanking formula gradient */
|
||||
#define VESAGTF_C 40 /* blanking formula offset */
|
||||
#define VESAGTF_K 128 /* blanking formula scaling factor */
|
||||
#define VESAGTF_J 20 /* blanking formula scaling factor */
|
||||
|
||||
#define VESAGTF_FLAG_ILACE 0x0001/* use interlace */
|
||||
#define VESAGTF_FLAG_MARGINS 0x0002/* use margins */
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Use VESA GTF formula to generate a monitor mode, given resolution and
|
||||
* refresh rates.
|
||||
*/
|
||||
|
||||
struct vesagtf_params
|
||||
{
|
||||
unsigned int margin_ppt; /* Bertical margin size, percent * 10 think
|
||||
* parts-per-thousand */
|
||||
unsigned int min_porch; /* Minimum front porch */
|
||||
unsigned int vsync_rqd; /* Width of vsync in lines */
|
||||
unsigned int hsync_pct; /* Hsync as % of total width */
|
||||
unsigned int min_vsbp; /* Minimum vsync + back porch (usec) */
|
||||
unsigned int m; /* Blanking formula gradient */
|
||||
unsigned int c; /* Blanking formula offset */
|
||||
unsigned int k; /* Blanking formula scaling factor */
|
||||
unsigned int j; /* Blanking formula scaling factor */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
struct videomode_s; /* Forward reference */
|
||||
|
||||
/****************************************************************************
|
||||
* Name: vesagtf_mode
|
||||
*
|
||||
* Description:
|
||||
* Use VESA GTF formula to generate monitor timings. Assumes default
|
||||
* GTF parameters, non-interlaced, and no margins.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void vesagtf_mode(unsigned int x, unsigned int y, unsigned int refresh,
|
||||
FAR struct videomode_s *videomode);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: vesagtf_mode_params
|
||||
*
|
||||
* Description:
|
||||
* vesagtf_mode_params() - as defined by the GTF Timing Standard, compute
|
||||
* the Stage 1 Parameters using the vertical refresh frequency. In other
|
||||
* words: input a desired resolution and desired refresh rate, and
|
||||
* output the GTF mode timings.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void vesagtf_mode_params(unsigned int x, unsigned int y, unsigned int refresh,
|
||||
FAR struct vesagtf_params *params,
|
||||
unsigned int flags,
|
||||
FAR struct videomode_s *videomode);
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_VIDEO_VESAGTF */
|
||||
@@ -0,0 +1,191 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/video/videomode.h
|
||||
* EDID (Extended Display Identification Data) Format
|
||||
*
|
||||
* Copyright (C) 2019 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Some of structures in this file derive from FreeBSD which has a
|
||||
* compatible 2-clause BSD license:
|
||||
*
|
||||
* Copyright (c) 2006 Itronix Inc. All rights reserved.
|
||||
* Written by Garrett D'Amore for Itronix Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_VIDEO_VIDEOMODE_H
|
||||
#define __INCLUDE_NUTTX_VIDEO_VIDEOMODE_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Video mode flags used in struct hdmi_videomode_s */
|
||||
|
||||
#define VID_PHSYNC (1 << 0)
|
||||
#define VID_NHSYNC (1 << 1)
|
||||
#define VID_PVSYNC (1 << 2)
|
||||
#define VID_NVSYNC (1 << 3)
|
||||
#define VID_INTERLACE (1 << 4)
|
||||
#define VID_DBLSCAN (1 << 5)
|
||||
#define VID_CSYNC (1 << 6)
|
||||
#define VID_PCSYNC (1 << 7)
|
||||
#define VID_NCSYNC (1 << 8)
|
||||
#define VID_HSKEW (1 << 9)
|
||||
#define VID_BCAST (1 << 10)
|
||||
#define VID_PIXMUX (1 << 12)
|
||||
#define VID_DBLCLK (1 << 13)
|
||||
#define VID_CLKDIV2 (1 << 14)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* This structure represents one video mode extracted from the EDID.
|
||||
* CAREFUL: Fields may not change without also modification to initializer
|
||||
* in videomode_lookup.c.
|
||||
*/
|
||||
|
||||
struct videomode_s
|
||||
{
|
||||
uint32_t dotclock; /* Dot clock frequency in kHz. */
|
||||
uint16_t hdisplay;
|
||||
uint16_t hsync_start;
|
||||
uint16_t hsync_end;
|
||||
uint16_t htotal;
|
||||
uint16_t vdisplay;
|
||||
uint16_t vsync_start;
|
||||
uint16_t vsync_end;
|
||||
uint16_t vtotal;
|
||||
uint16_t hskew;
|
||||
uint16_t flags; /* Video mode flags; see above. */
|
||||
FAR const char *name;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sort_videomodes
|
||||
*
|
||||
* Description:
|
||||
* Sort video modes by refresh rate, aspect ratio, then resolution.
|
||||
* Preferred mode or largest mode is first in the list and other modes
|
||||
* are sorted on closest match to that mode.
|
||||
*
|
||||
* Note that the aspect ratio calculation treats "close" aspect ratios
|
||||
* (within 12.5%) as the same for this purpose.
|
||||
*
|
||||
* Input Parameters:
|
||||
* modes - A reference to the first entry in a list of video modes
|
||||
* preferred - A pointer to the pointer to the preferred mode in the list
|
||||
* nmodes - The number of modes in the list
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void sort_videomodes(FAR struct videomode_s *modes,
|
||||
FAR struct videomode_s **preferred,
|
||||
unsigned int nmodes);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: videomode_lookup
|
||||
*
|
||||
* Description:
|
||||
* Find the video mode in a look-up table
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR const struct videomode_s *videomode_lookup_by_name(FAR const char *name);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: videomode_lookup_by_dotclock
|
||||
*
|
||||
* Description:
|
||||
* Find the video mode in a look-up table with the matching width and
|
||||
* height and the closest dot clock that does not exceed the requested
|
||||
* dot clock.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if 0 /* Not used */
|
||||
FAR const struct videomode_s *
|
||||
videomode_lookup_by_dotclock(uint16_t width, uint16_t height,
|
||||
uint32_t dotclock);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: videomode_lookup_by_refresh
|
||||
*
|
||||
* Description:
|
||||
* Find the video mode in a look-up table with the matching width and
|
||||
* height and the closest refresh rate that does not exceed the requested
|
||||
* rate.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if 0 /* Not used */
|
||||
FAR const struct videomode_s *
|
||||
videomode_lookup_by_refresh(uint16_t width, uint16_t height,
|
||||
uint16_t refresh);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: videomode_dump
|
||||
*
|
||||
* Description:
|
||||
* Dump the content of a video mode one one line to the SYSLOG.
|
||||
*
|
||||
* Input Parameters:
|
||||
* prefix - A string to print at the beginning of the line. May be
|
||||
* NULL
|
||||
* videomode - The videomode to be dumped
|
||||
* terse - True: Print only a minimal amount of data, sufficient to
|
||||
* identify the video mode.
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void videomode_dump(FAR const char *prefix,
|
||||
FAR const struct videomode_s *videomode, bool terse);
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_VIDEO_VIDEOMODE_H */
|
||||
@@ -118,6 +118,7 @@ struct gs2200m_assoc_msg
|
||||
FAR char *ssid;
|
||||
FAR char *key;
|
||||
uint8_t mode;
|
||||
uint8_t ch;
|
||||
};
|
||||
|
||||
struct gs2200m_lower_s
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
|
||||
/* The following can be individually enabled */
|
||||
|
||||
#ifdef CONFIG_ARCH_HAVE_VFORK
|
||||
#if defined(CONFIG_SCHED_WAITPID) && defined(CONFIG_ARCH_HAVE_VFORK)
|
||||
# define SYS_vfork __SYS_vfork
|
||||
# define __SYS_atexit (__SYS_vfork + 1)
|
||||
#else
|
||||
|
||||
+1
-1
@@ -177,7 +177,7 @@
|
||||
"unsetenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","int","const char*"
|
||||
"up_assert","assert.h","","void","FAR const uint8_t*","int"
|
||||
#"up_assert","assert.h","","void"
|
||||
"vfork","unistd.h","defined(CONFIG_ARCH_HAVE_VFORK)","pid_t"
|
||||
"vfork","unistd.h","defined(CONFIG_SCHED_WAITPID) && defined(CONFIG_ARCH_HAVE_VFORK)","pid_t"
|
||||
"wait","sys/wait.h","defined(CONFIG_SCHED_WAITPID) && defined(CONFIG_SCHED_HAVE_PARENT)","pid_t","int*"
|
||||
"waitid","sys/wait.h","defined(CONFIG_SCHED_WAITPID) && defined(CONFIG_SCHED_HAVE_PARENT)","int","idtype_t","id_t"," FAR siginfo_t *","int"
|
||||
"waitpid","sys/wait.h","defined(CONFIG_SCHED_WAITPID)","pid_t","pid_t","int*","int"
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 161 and column 2.
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user