Initial commit: TXW82x FPV v2.7.0.7-42229 SDK + project sources

This commit is contained in:
2026-07-06 11:30:13 +08:00
commit e76462eeb7
3451 changed files with 1415300 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
#ifndef _HG_XSPI_H_
#define _HG_XSPI_H_
#ifdef __cplusplus
extern "C" {
#endif
enum hg_xspi_flags {
hg_xspi_flags_ready,
hg_xspi_flags_suspend,
hg_xspi_flags_suspend_ulp,
hg_xspi_flags_suspend_pd,
};
struct hg_xspi {
struct dev_obj dev;
void *hw;
uint32 irq_num;
//qspi_irq_hdl irq_hdl;
uint32 irq_data;
uint32 opened;
uint32 flags;
uint8_t rst_pin;
void *priv;
//#ifdef CONFIG_SLEEP
#if 1
uint32 sys_regs[6];
uint32 ospi_regs[256 / 4];
#endif
#if 1
int tx[2];
int rx[2][2];
#endif
};
struct hg_xspi_hw;
int32 hg_xspi_attach(uint32 dev_id, struct hg_xspi *p_spi);
void hg_xspi_sample_offset(uint32 ospi_base, int8 rx_offset, int8 tx_offset);
uint32 hg_xspi_get_div(struct hg_xspi_hw *p_qspi, uint8 cs);
int hg_xspi_set_div(struct hg_xspi_hw *p_qspi, uint32 div, uint8 cs_ex);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,88 @@
/**
******************************************************************************
* @file Libraries/Driver/include/LL/tx_peg_ll_qspi.h
* @author HUGE-IC Application Team
* @version V1.0.0
* @date 01-07-2019
* @brief This file contains all the QSPI LL firmware functions.
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT 2019 HUGE-IC</center></h2>
*
*
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef _HG_XSPI_PSRAM_H_
#define _HG_XSPI_PSRAM_H_
#include "dev/xspi/hg_xspi.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
/** @addtogroup TX_PEG_StdPeriph_Driver CanesVenatici Driver
* @{
*/
/** @addtogroup qspi_interface_gr QSPI Driver
* @ingroup TX_PEG_StdPeriph_Driver
* @{
*/
/** @addtogroup QSPI_LL_Driver QSPI LL Driver
* @ingroup qspi_interface_gr
* @brief Mainly the driver part of the QSPI module, which includes \b QSPI \b Register
* \b Constants, \b QSPI \b Exported \b Constants, \b QSPI \b Exported \b Struct, \b QSPI
* \b Data \b transfers \b functions, \b QSPI \b Initialization \b and \b QSPI \b Configuration
* \b And \b Interrupt \b Handle \b function.
* @{
*/
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/***** DRIVER API *****/
/***** LL API *****/
/***** LL API AND DRIVER API *****/
/*
* @usage:
clk_mhz == 0, use configuration makecode.ini
clk_mhz == other, use parameter clk_mhz
*
*/
int ll_xip_clock_init(int clk_mhz);
#ifdef __cplusplus
}
#endif
/**
* @}
*/
/**
* @}
*/
#endif
/*************************** (C) COPYRIGHT 2023 HUGE-IC ***** END OF FILE *****/

View File

@@ -0,0 +1,115 @@
/**
******************************************************************************
* @file Libraries/Driver/include/LL/tx_peg_ll_qspi.h
* @author HUGE-IC Application Team
* @version V1.0.0
* @date 01-07-2019
* @brief This file contains all the QSPI LL firmware functions.
******************************************************************************
* @attention
*
* <h2><center>&copy; COPYRIGHT 2019 HUGE-IC</center></h2>
*
*
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef _HG_XSPI_PSRAM_H_
#define _HG_XSPI_PSRAM_H_
#include "dev/xspi/hg_xspi.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
/** @addtogroup TX_PEG_StdPeriph_Driver CanesVenatici Driver
* @{
*/
/** @addtogroup qspi_interface_gr QSPI Driver
* @ingroup TX_PEG_StdPeriph_Driver
* @{
*/
/** @addtogroup QSPI_LL_Driver QSPI LL Driver
* @ingroup qspi_interface_gr
* @brief Mainly the driver part of the QSPI module, which includes \b QSPI \b Register
* \b Constants, \b QSPI \b Exported \b Constants, \b QSPI \b Exported \b Struct, \b QSPI
* \b Data \b transfers \b functions, \b QSPI \b Initialization \b and \b QSPI \b Configuration
* \b And \b Interrupt \b Handle \b function.
* @{
*/
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
enum psram_type {
PSRAM_NONE,
UPSRAM_4MB,
UPSRAM_4MBx2,
UPSRAM_8MBx2,
UPSRAM_16MB,
APSRAM_4MB,
UNDEFINE,
};
enum psram_clk_alt {
PSRAM_CLK_240M,
PSRAM_CLK_320M,
PSRAM_CLK_274M,
PSRAM_CLK_160M,
PSRAM_CLK_USER = 0xf0,
PSRAM_CLK_MIN = 0xf1,
PSRAM_CLK_MAX = 0xf2,
PSRAM_CLK_END,
};
struct psram_dcfg {
struct list_head list;
uint32_t pid;
void *cfg;
};
/***** DRIVER API *****/
/***** LL API *****/
/***** LL API AND DRIVER API *****/
struct __ctl_clk;
int psram_auto_init(int extern_pt, uint32_t clk);
int32_t psram_init(struct hg_xspi *xspi, void *vcfg);
void psram_deinit(struct hg_xspi *xspi);
void register_psram_dcfg(void *cfg, uint32_t pid);
void* find_psram_dcfg(uint32_t pid);
#ifdef __cplusplus
}
#endif
/**
* @}
*/
/**
* @}
*/
#endif
/*************************** (C) COPYRIGHT 2023 HUGE-IC ***** END OF FILE *****/