✨ Adds support for esp32 P4
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <sdkconfig.h>
|
||||
#include <wifi/wifi_idf.h>
|
||||
#include <esp_http_server.h>
|
||||
#include "platform_shared/message.pb.h"
|
||||
|
||||
@@ -23,16 +23,37 @@
|
||||
#ifndef ESP_PLATFORM_NAME
|
||||
#define ESP_PLATFORM_NAME "ESP32-S3"
|
||||
#endif
|
||||
#elif CONFIG_IDF_TARGET_ESP32C6
|
||||
#include "esp32c6/rom/rtc.h"
|
||||
#ifndef ESP_PLATFORM_NAME
|
||||
#define ESP_PLATFORM_NAME "ESP32-C6"
|
||||
#endif
|
||||
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||
#include "esp32p4/rom/rtc.h"
|
||||
#ifndef ESP_PLATFORM_NAME
|
||||
#define ESP_PLATFORM_NAME "ESP32-P4"
|
||||
#endif
|
||||
#define ESP32P4_USES_C6_COPROCESSOR 1
|
||||
#else
|
||||
#error Target CONFIG_IDF_TARGET is not supported
|
||||
#endif
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32P4
|
||||
#ifndef SDA_PIN
|
||||
#define SDA_PIN 7
|
||||
#endif
|
||||
#ifndef SCL_PIN
|
||||
#define SCL_PIN 8
|
||||
#endif
|
||||
#else
|
||||
#ifndef SDA_PIN
|
||||
#define SDA_PIN 21
|
||||
#endif
|
||||
#ifndef SCL_PIN
|
||||
#define SCL_PIN 22
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef I2C_FREQUENCY
|
||||
#define I2C_FREQUENCY 100000UL
|
||||
#endif
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <motion_states/state.h>
|
||||
#include <utils/math_utils.h>
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <functional>
|
||||
|
||||
|
||||
@@ -11,10 +11,16 @@
|
||||
|
||||
namespace Camera {
|
||||
|
||||
#if USE_CAMERA && !CONFIG_IDF_TARGET_ESP32P4
|
||||
#include <esp_camera.h>
|
||||
|
||||
#if USE_CAMERA
|
||||
#include <peripherals/camera_pins.h>
|
||||
#else
|
||||
typedef struct {
|
||||
uint8_t *buf;
|
||||
size_t len;
|
||||
} camera_fb_t;
|
||||
typedef struct {
|
||||
} sensor_t;
|
||||
#endif
|
||||
|
||||
#define PART_BOUNDARY "frame"
|
||||
@@ -23,7 +29,11 @@ camera_fb_t *safe_camera_fb_get();
|
||||
sensor_t *safe_sensor_get();
|
||||
void safe_sensor_return();
|
||||
|
||||
class CameraService : public StatefulService<CameraSettings> {
|
||||
class CameraService
|
||||
#if USE_CAMERA && !CONFIG_IDF_TARGET_ESP32P4
|
||||
: public StatefulService<CameraSettings>
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
CameraService();
|
||||
|
||||
@@ -32,10 +42,12 @@ class CameraService : public StatefulService<CameraSettings> {
|
||||
esp_err_t cameraStill(httpd_req_t *request);
|
||||
esp_err_t cameraStream(httpd_req_t *request);
|
||||
|
||||
#if USE_CAMERA && !CONFIG_IDF_TARGET_ESP32P4
|
||||
StatefulProtoEndpoint<CameraSettings, api_CameraSettings> protoEndpoint;
|
||||
|
||||
private:
|
||||
FSPersistencePB<CameraSettings> _persistence;
|
||||
void updateCamera();
|
||||
#endif
|
||||
};
|
||||
} // namespace Camera
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef LEDService_h
|
||||
#define LEDService_h
|
||||
|
||||
#include <sdkconfig.h>
|
||||
#include <driver/rmt_tx.h>
|
||||
#include <led_strip.h>
|
||||
#include <led_strip_rmt.h>
|
||||
@@ -9,8 +10,12 @@
|
||||
#include <esp_log.h>
|
||||
|
||||
#ifndef WS2812_PIN
|
||||
#if CONFIG_IDF_TARGET_ESP32P4
|
||||
#define WS2812_PIN 27
|
||||
#else
|
||||
#define WS2812_PIN 12
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef WS2812_NUM_LEDS
|
||||
#define WS2812_NUM_LEDS 13
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include <template/state_result.h>
|
||||
#include <sdkconfig.h>
|
||||
#include <platform_shared/api.pb.h>
|
||||
|
||||
#if !CONFIG_IDF_TARGET_ESP32P4
|
||||
#include <esp_camera.h>
|
||||
#else
|
||||
#define PIXFORMAT_JPEG 0
|
||||
#define FRAMESIZE_VGA 0
|
||||
#define GAINCEILING_2X 0
|
||||
#endif
|
||||
|
||||
namespace Camera {
|
||||
|
||||
// Use proto type directly as settings type
|
||||
using CameraSettings = api_CameraSettings;
|
||||
|
||||
// Default factory settings
|
||||
inline CameraSettings CameraSettings_defaults() {
|
||||
CameraSettings settings = api_CameraSettings_init_zero;
|
||||
settings.pixformat = PIXFORMAT_JPEG;
|
||||
|
||||
@@ -1,17 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <template/state_result.h>
|
||||
#include <sdkconfig.h>
|
||||
#include <platform_shared/api.pb.h>
|
||||
|
||||
/*
|
||||
* I2C software connection
|
||||
*/
|
||||
#if CONFIG_IDF_TARGET_ESP32P4
|
||||
#ifndef SDA_PIN
|
||||
#define SDA_PIN 7
|
||||
#endif
|
||||
#ifndef SCL_PIN
|
||||
#define SCL_PIN 8
|
||||
#endif
|
||||
#else
|
||||
#ifndef SDA_PIN
|
||||
#define SDA_PIN 21
|
||||
#endif
|
||||
#ifndef SCL_PIN
|
||||
#define SCL_PIN 22
|
||||
#endif
|
||||
#endif
|
||||
#ifndef I2C_FREQUENCY
|
||||
#define I2C_FREQUENCY 1000000UL
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user