Skip to content

Commit

Permalink
ci stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
tore-espressif committed Nov 12, 2024
1 parent 11b69c3 commit 7adb8ec
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 35 deletions.
15 changes: 14 additions & 1 deletion .build-test-rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,28 @@ host/class:
enable:
- if: SOC_USB_OTG_SUPPORTED == 1

host/class/uvc/usb_host_uvc_2/examples/camera_display:
enable:
- if: (IDF_VERSION_MAJOR >= 5 and IDF_VERSION_MINOR >= 3)
reason: This example uses esp_lcd API introduced in v5.3

# Host tests
host/class/cdc/usb_host_cdc_acm/host_test:
enable:
- if: IDF_TARGET in ["linux"] and (IDF_VERSION_MAJOR >= 5 and IDF_VERSION_MINOR >= 4)


host/class/hid/usb_host_hid/host_test:
enable:
- if: IDF_TARGET in ["linux"] and (IDF_VERSION_MAJOR >= 5 and IDF_VERSION_MINOR >= 4)
reason: USB mock was added in v5.4

host/class/uvc/usb_host_uvc/host_test:
enable:
- if: IDF_TARGET in ["linux"] and (IDF_VERSION_MAJOR >= 5 and IDF_VERSION_MINOR >= 4)
- if: IDF_TARGET in ["linux"] and (IDF_VERSION_MAJOR >= 5 and IDF_VERSION_MINOR >= 4)
reason: USB mock was added in v5.4

host/class/uvc/usb_host_uvc_2/host_test:
enable:
- if: IDF_TARGET in ["linux"] and (IDF_VERSION_MAJOR >= 5 and IDF_VERSION_MINOR >= 4)
reason: USB mock was added in v5.4
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "freertos/queue.h"

#include "display.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## IDF Component Manager Manifest File
dependencies:
idf: ">=5.0"
idf: ">=5.3"
espressif/esp_lcd_ra8875: "*"
espressif/esp_jpeg: "~1.2"
usb_host_uvc_2:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,32 @@
#include "esp_lcd_panel_ops.h"
#include "esp_lcd_ra8875.h"
#include "display.h"
#include "driver/gpio.h"

/* Display */
#define BSP_LCD_DB0 (GPIO_NUM_13)
#define BSP_LCD_DB1 (GPIO_NUM_12)
#define BSP_LCD_DB2 (GPIO_NUM_11)
#define BSP_LCD_DB3 (GPIO_NUM_10)
#define BSP_LCD_DB4 (GPIO_NUM_9)
#define BSP_LCD_DB5 (GPIO_NUM_46)
#define BSP_LCD_DB6 (GPIO_NUM_3)
#define BSP_LCD_DB7 (GPIO_NUM_8)
#define BSP_LCD_DB8 (GPIO_NUM_18)
#define BSP_LCD_DB9 (GPIO_NUM_17)
#define BSP_LCD_DB10 (GPIO_NUM_16)
#define BSP_LCD_DB11 (GPIO_NUM_15)
#define BSP_LCD_DB12 (GPIO_NUM_7)
#define BSP_LCD_DB13 (GPIO_NUM_6)
#define BSP_LCD_DB14 (GPIO_NUM_5)
#define BSP_LCD_DB15 (GPIO_NUM_4)
#define BSP_LCD_CS (GPIO_NUM_NC)
#define BSP_LCD_DC (GPIO_NUM_37)
#define BSP_LCD_WR (GPIO_NUM_38)
#define BSP_LCD_RD (GPIO_NUM_NC)
#define BSP_LCD_RST (GPIO_NUM_39)
#define BSP_LCD_WAIT (GPIO_NUM_1)
#define BSP_LCD_BL (GPIO_NUM_NC)
#define BSP_LCD_TP_INT (GPIO_NUM_2)
#define BSP_LCD_DB0 (13)
#define BSP_LCD_DB1 (12)
#define BSP_LCD_DB2 (11)
#define BSP_LCD_DB3 (10)
#define BSP_LCD_DB4 (9)
#define BSP_LCD_DB5 (46)
#define BSP_LCD_DB6 (3)
#define BSP_LCD_DB7 (8)
#define BSP_LCD_DB8 (18)
#define BSP_LCD_DB9 (17)
#define BSP_LCD_DB10 (16)
#define BSP_LCD_DB11 (15)
#define BSP_LCD_DB12 (7)
#define BSP_LCD_DB13 (6)
#define BSP_LCD_DB14 (5)
#define BSP_LCD_DB15 (4)
#define BSP_LCD_CS (-1)
#define BSP_LCD_DC (37)
#define BSP_LCD_WR (38)
#define BSP_LCD_RD (-1)
#define BSP_LCD_RST (39)
#define BSP_LCD_WAIT (1)
#define BSP_LCD_BL (-1)
#define BSP_LCD_TP_INT (2)

// Bit number used to represent command and parameter
#define LCD_CMD_BITS 16
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once

#include "sdkconfig.h"
#include "esp_idf_version.h"

// @todo fix the hard-coded number here: Should be taken from HAL FIFO config in future versions of esp-idf
#if (CONFIG_IDF_TARGET_ESP32P4)
#define MAX_MPS_IN 4096
#else
#define MAX_MPS_IN 600
#endif

// Definition of USB_EP_DESC_GET_MULT for IDF versions that don't have it.
// It was introduced in IDF v5.3 and backported to v5.2.1 and v5.1.4
#if !(ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 1, 4) && ESP_IDF_VERSION != ESP_IDF_VERSION_VAL(5, 2, 0))
#define USB_EP_DESC_GET_MULT(desc_ptr) (((desc_ptr)->wMaxPacketSize & 0x1800) >> 11)
#endif
9 changes: 1 addition & 8 deletions host/class/uvc/usb_host_uvc_2/uvc_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "uvc_descriptors_priv.h"
#include "uvc_check_priv.h"
#include "uvc_critical_priv.h"
#include "uvc_idf_version_priv.h"

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
Expand Down Expand Up @@ -343,14 +344,6 @@ static esp_err_t uvc_claim_interface(uvc_stream_t *uvc_stream, const usb_ep_desc
const usb_config_desc_t *cfg_desc;
ESP_ERROR_CHECK(usb_host_get_active_config_descriptor(uvc_stream->dev_hdl, &cfg_desc));

// @todo fix the hard-coded number here: Should be taken from HAL FIFO config?
#include "sdkconfig.h"
#if (CONFIG_IDF_TARGET_ESP32P4)
#define MAX_MPS_IN 4096
#else
#define MAX_MPS_IN 600
#endif

ESP_RETURN_ON_ERROR(
uvc_desc_get_streaming_intf_and_ep(cfg_desc, uvc_stream->bInterfaceNumber, MAX_MPS_IN, &intf_desc, &ep_desc),
TAG, "Could not find Streaming interface %d", uvc_stream->bInterfaceNumber);
Expand Down

0 comments on commit 7adb8ec

Please sign in to comment.