text stringlengths 1 9.98k | __index_level_0__ int64 0 4.17k |
|---|---|
/*
*/
#ifndef PHY_INIT_DATA_H
#define PHY_INIT_DATA_H /* don't use #pragma once here, we compile this file sometimes */
#include "esp_phy_init.h"
#include "sdkconfig.h"
#ifdef __cplusplus
extern "C" {
#endif
// There is no init data for ESP32H2 right now, could be added when necessary.
#ifdef __cplusplus
}
#endif
... | 56 |
/*
*/
#ifndef PHY_INIT_DATA_H
#define PHY_INIT_DATA_H /* don't use #pragma once here, we compile this file sometimes */
#include "esp_phy_init.h"
#include "sdkconfig.h"
#ifdef __cplusplus
extern "C" {
#endif
// constrain a value between 'low' and 'high', inclusive
#define LIMIT(val, low, high) ((val high) ? high :... | 57 |
< 4-byte control infomation checksum */
uint8_t multiple_bin_checksum[4]; /*!< 4-byte multiple bin checksum */
uint8_t check_algorithm; /*!< check algorithm */
uint8_t version; /*!< PHY init data bin version */
uint8_t number; /*!< PHY init dat... | 57 |
/*
*/
#ifndef PHY_INIT_DATA_H
#define PHY_INIT_DATA_H /* don't use #pragma once here, we compile this file sometimes */
#include "esp_phy_init.h"
#include "sdkconfig.h"
#ifdef __cplusplus
extern "C" {
#endif
// constrain a value between 'low' and 'high', inclusive
#define LIMIT(val, low, high) ((val high) ? high :... | 58 |
< 4-byte control infomation checksum */
uint8_t multiple_bin_checksum[4]; /*!< 4-byte multiple bin checksum */
uint8_t check_algorithm; /*!< check algorithm */
uint8_t version; /*!< PHY init data bin version */
uint8_t number; /*!< PHY init dat... | 58 |
/*
*/
#ifndef _crc32_H_
#define _crc32_H_
/**
class crc32
{
public:
static unsigned int crc32_le(unsigned int crc, unsigned char const *buf, unsigned int len);
};
#endif // _crc32_H_
| 59 |
/*
*/
#ifndef _WL_State_H_
#define _WL_State_H_
#include "esp_err.h"
/**
#if defined(_MSC_VER)
#define ALIGNED_(x) __declspec(align(x))
#else
#if defined(__GNUC__)
#define ALIGNED_(x) __attribute__ ((aligned(x)))
#endif
#endif
typedef struct ALIGNED_(32) WL_State_s {
public:
uint32_t wl_dummy_sec_pos; ... | 60 |
< WL partition block size*/
uint32_t version; /*!< State id used to identify the version of current library implementation*/
uint32_t wl_device_id; /*!< ID of current WL instance. Generated randomly when the state is first initialized*/
uint32_t reserved[7]; ... | 60 |
/*
*/
#ifndef _WL_Ext_Safe_H_
#define _WL_Ext_Safe_H_
#include "Partition.h"
#include "WL_Flash.h"
#include "WL_Ext_Cfg.h"
#include "WL_Ext_Perf.h"
class WL_Ext_Safe : public WL_Ext_Perf
{
public:
WL_Ext_Safe();
~WL_Ext_Safe() override;
esp_err_t config(WL_Config_s *cfg, Partition *partition) override;
... | 61 |
/*
*/
#ifndef _WL_Ext_Perf_H_
#define _WL_Ext_Perf_H_
#include "Partition.h"
#include "WL_Flash.h"
#include "WL_Ext_Cfg.h"
class WL_Ext_Perf : public WL_Flash
{
public:
WL_Ext_Perf();
~WL_Ext_Perf() override;
esp_err_t config(WL_Config_s *cfg, Partition *partition) override;
esp_err_t init() overrid... | 62 |
/*
*/
#ifndef _Flash_Access_H_
#define _Flash_Access_H_
#include "esp_err.h"
/**
class Flash_Access
{
public:
virtual size_t get_flash_size() = 0;
virtual esp_err_t erase_sector(size_t sector) = 0;
virtual esp_err_t erase_range(size_t start_address, size_t size) = 0;
virtual esp_err_t write(size_t ... | 63 |
/*
*/
#ifndef _SPI_Flash_H_
#define _SPI_Flash_H_
#include "esp_err.h"
#include "Flash_Access.h"
/**
class SPI_Flash : public Flash_Access
{
public:
SPI_Flash();
size_t get_flash_size() override;
esp_err_t erase_sector(size_t sector) override;
esp_err_t erase_range(size_t start_address, size_t siz... | 64 |
/*
*/
#ifndef _WL_Flash_H_
#define _WL_Flash_H_
#include "esp_err.h"
#include "Flash_Access.h"
#include "Partition.h"
#include "WL_Config.h"
#include "WL_State.h"
/**
class WL_Flash : public Flash_Access
{
public :
WL_Flash();
~WL_Flash() override;
virtual esp_err_t config(wl_config_t *cfg, Partition *p... | 65 |
/*
*/
#ifndef _WL_Config_H_
#define _WL_Config_H_
#include "Flash_Access.h"
/**
#if defined(_MSC_VER)
#define ALIGNED_(x) __declspec(align(x))
#else
#if defined(__GNUC__)
#define ALIGNED_(x) __attribute__ ((aligned(x)))
#endif
#endif
typedef struct ALIGNED_(16) WL_Config_s {/*!= N*flash_sector_size, where N > 0.*/... | 66 |
The best way, if this value will be equal to sector size.*/
uint32_t crc32; /*!< CRC for this config*/
} wl_config_t;
#ifndef _MSC_VER // MSVS has different format for this define
static_assert(sizeof(wl_config_t) % 16 == 0, "Size of wl_config_t structure should be compatible with flash encry... | 66 |
/*
*/
#ifndef _Partition_H_
#define _Partition_H_
#include "esp_err.h"
#include "Flash_Access.h"
#include "esp_partition.h"
#include "spi_flash_mmap.h" // for SPI_FLASH_SEC_SIZE
/**
class Partition : public Flash_Access
{
public:
Partition(const esp_partition_t *partition);
virtual size_t get_flash_size... | 67 |
/*
*/
#ifndef _WL_Ext_Cfg_H_
#define _WL_Ext_Cfg_H_
#include "WL_Config.h"
typedef struct WL_Ext_Cfg_s : public WL_Config_s {
uint32_t fat_sector_size; /*!< virtual sector size*/
} wl_ext_cfg_t;
#endif // _WL_Ext_Cfg_H_
| 68 |
/*
*/
#ifndef _wear_levelling_H_
#define _wear_levelling_H_
#include "esp_log.h"
#include "esp_partition.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
typedef int32_t wl_handle_t;
#define WL_INVALID_HANDLE -1
/**
*/
esp_err_t wl_mount(const esp_partition_t *partition, wl_handle_t *out_handle);
/**
*/
esp_err... | 69 |
/*
*/
#pragma once
#include
#include "esp_err.h"
#include "sd_protocol_types.h"
#include "driver/sdspi_host.h"
#include "ff.h"
#include "wear_levelling.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
typedef struct {
const char* base_path; /*!slot` have been initialized by
*/
esp_err_t esp_vfs_fat_sdspi_mou... | 70 |
/*
*/
#pragma once
#include "esp_vfs_fat.h"
#include "diskio_impl.h"
#include "esp_partition.h"
#include "sdmmc_cmd.h"
#include
#include
typedef enum {
FORMATTED_DURING_LAST_MOUNT = 1 << 0, // The FATFS partition was formatted during the last mount
} vfs_fat_x_ctx_flags_t;
typedef struct vfs_fat_spiflash_ctx... | 71 |
// Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by a... | 72 |
< sector read function */
DRESULT (*write) (unsigned char pdrv, const unsigned char* buff, uint32_t sector, unsigned count); /*!< sector write function */
DRESULT (*ioctl) (unsigned char pdrv, unsigned char cmd, void* buff); /*!< function to get info about disk and do some misc operations */
} ff_diskio_impl_... | 72 |
/*
*/
#pragma once
#include "sdmmc_cmd.h"
#include "sd_protocol_defs.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
void ff_sdmmc_set_disk_status_check(BYTE pdrv, bool enable);
/**
*/
void ff_diskio_register_sdmmc(unsigned char pdrv, sdmmc_card_t* card);
/**
*/
BYTE ff_diskio_get_pdrv_card(const sdmmc_card_... | 73 |
// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by app... | 74 |
// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by app... | 75 |
/*
*/
#pragma once
/**
*/
#define HEAP_SIZE_CAPTURE(heap_size) \
heap_size = esp_get_free_heap_size();
#define HEAP_SIZE_CHECK(heap_size, tolerance) \
do {\
size_t final_heap_size = esp_get_free_heap_size(); \
if (final_heap_size < heap_size - tolerance) { \
printf("Initial h... | 76 |
/*/
/ Low level disk interface modlue include file (C)ChaN, 2019 /
/*/
#ifndef _DISKIO_DEFINED
#define _DISKIO_DEFINED
#ifdef __cplusplus
extern "C" {
#endif
#include "ff.h"
/* Status of Disk Functions */
typedef BYTE DSTATUS;
/* Results of Disk Functions */
typedef enum {
RES_OK = 0, /* 0: Successfu... | 77 |
= FF_MIN_SS) */
#define GET_BLOCK_SIZE 3 /* Get erase block size (needed at FF_USE_MKFS == 1) */
#define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at FF_USE_TRIM == 1) */
/* Generic command (Not used by FatFs) */
#define CTRL_POWER 5 /* Get/Set power status */
#d... | 77 |
/*/
/ FatFs - Generic FAT Filesystem module R0.15 /
//
/
/ Copyright (C) 2022, ChaN, all right reserved.
/
/ FatFs module is an open source software. Redistribution and use of FatFs in
/ source and binary forms, with or without modification, are permitted provided
/ that the following co... | 78 |
_finite(v))
#elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__cplusplus) /* C99 or later */
#define FF_INTDEF 2
#include
typedef unsigned int UINT; /* int must be 16-bit or 32-bit */
typedef unsigned char BYTE; /* char must be 8-bit */
typedef uint16_t WORD; /* 16-bit unsigned integer */
... | 78 |
= FF_MIN_SS
WORD ssize; /* Sector size (512, 1024, 2048 or 4096) */
#endif
#if FF_USE_LFN
WCHAR* lfnbuf; /* LFN working buffer */
#endif
#if FF_FS_EXFAT
BYTE* dirbuf; /* Directory entry block scratchpad buffer for exFAT */
#endif
#if !FF_FS_READONLY
DWORD last_clst; /* Last allocated cluster */
DWORD free_c... | 78 |
= 0) */
#if FF_FS_EXFAT
DWORD n_cont; /* Size of first fragment - 1 (valid when stat == 3) */
DWORD n_frag; /* Size of last fragment needs to be written to FAT (valid when not zero) */
DWORD c_scl; /* Containing directory start cluster (valid when sclust != 0) */
DWORD c_size; /* b31-b8:Size of containing d... | 78 |
FF_FS_READONLY
LBA_t dir_sect; /* Sector number containing the directory entry (not used at exFAT) */
BYTE* dir_ptr; /* Pointer to the directory entry in the win[] (not used at exFAT) */
#endif
#if FF_USE_FASTSEEK
DWORD* cltbl; /* Pointer to the cluster link map table (nulled on open, set by application) */
#end... | 78 |
..); /* Put a formatted string to the file */
TCHAR* f_gets (TCHAR* buff, int len, FIL* fp); /* Get a string from the file */
/* Some API fucntions are implemented as macro */
#define f_eof(fp) ((int)((fp)->fptr == (fp)->obj.objsize))
#define f_error(fp) ((fp)->err)
#define f_tell(fp) ((fp)->fptr)
#define f... | 78 |
c) */
#if FF_USE_LFN == 3 /* Dynamic memory allocation */
void* ff_memalloc (UINT msize); /* Allocate memory block */
void ff_memfree (void* mblock); /* Free memory block */
#endif
#if FF_FS_REENTRANT /* Sync functions */
int ff_mutex_create (int vol); /* Create a sync object */
void ff_mutex_delete (int vol); /*... | 78 |
fs_type) */
#define FS_FAT12 1
#define FS_FAT16 2
#define FS_FAT32 3
#define FS_EXFAT 4
/* File attribute bits for directory entry (FILINFO.fattrib) */
#define AM_RDO 0x01 /* Read only */
#define AM_HID 0x02 /* Hidden */
#define AM_SYS 0x04 /* System */
#define AM_DIR 0x10 /* Directory */
#define AM_ARC 0x20 /* Archiv... | 78 |
#include "sdkconfig.h"
/*/
/ Configurations of FatFs Module
/*/
#define FFCONF_DEF 80286 /* Revision ID */
/*/
/ Function Configurations
/*/
#define FF_FS_READONLY 0
/* This option switches read-only configuration. (0:Read/Write or 1:Read-only)
/ Read-only configuration removes writing API functions, f_write(), f... | 79 |
(0:Disable or 1:Enable) */
#define FF_USE_FASTSEEK CONFIG_FATFS_USE_FASTSEEK
/* This option switches fast seek function. (0:Disable or 1:Enable) */
#define FF_USE_EXPAND 1
/* This option switches f_expand function. (0:Disable or 1:Enable) */
#define FF_USE_CHMOD 1
/* This option switches attribute manipulation f... | 79 |
/ 2: Enable with LF-CRLF conversion.
/
/ FF_PRINT_LLI = 1 makes f_printf() support long long argument and FF_PRINT_FLOAT = 1/2
/ makes f_printf() support floating point argument. These features want C99 or later.
/ When FF_LFN_UNICODE >= 1 with LFN enabled, string functions convert the character
/ encoding in it... | 79 |
/
/ 0: Disable LFN. FF_MAX_LFN has no effect.
/ 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe.
/ 2: Enable LFN with dynamic working buffer on the STACK.
/ 3: Enable LFN with dynamic working buffer on the HEAP.
/
/ To enable the LFN, ffunicode.c needs to be added to the project. ... | 79 |
/
/ 0: ANSI/OEM in current CP (TCHAR = char)
/ 1: Unicode in UTF-16 (TCHAR = WCHAR)
/ 2: Unicode in UTF-8 (TCHAR = char)
/ 3: Unicode in UTF-32 (TCHAR = DWORD)
/
/ Also behavior of string I/O functions will be affected by this option.
/ When LFN is not enabled, this option has no effect. */
#define FF_LFN_... | 79 |
(1-10) */
#define FF_STR_VOLUME_ID 0
#define FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3"
/* FF_STR_VOLUME_ID switches support for volume ID in arbitrary strings.
/ When FF_STR_VOLUME_ID is set to 1 or 2, arbitrary strings can be used as drive
/ number in the path name. FF_VOLUME_STRS defines t... | 79 |
Also f_fdisk()
/ function will be available. */
/* SD card sector size */
#define FF_SS_SDCARD 512
/* wear_levelling library sector size */
#define FF_SS_WL CONFIG_WL_SECTOR_SIZE
#define FF_MIN_SS MIN(FF_SS_SDCARD, FF_SS_WL)
#define FF_MAX_SS MAX(FF_SS_SDCARD, FF_SS_WL)
/* This set of options ... | 79 |
0x100000000 max. This option has no effect when FF_LBA64 == 0. */
#define FF_USE_TRIM 1
/* This option switches support for ATA-TRIM. (0:Disable or 1:Enable)
/ To enable Trim function, also CTRL_TRIM command should be implemented to the
/ disk_ioctl() function. */
/*/
/ System Configurations
/*/
#define FF_FS... | 79 |
If the system does not have
/ an RTC or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable the
/ timestamp feature. Every object modified by FatFs will have a fixed timestamp
/ defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR in local time.
/ To enable timestamp function (FF_FS_NORTC = 0), get_f... | 79 |
/ bit1=1: Do not trust last allocated cluster number in the FSINFO.
*/
#define FF_FS_LOCK CONFIG_FATFS_FS_LOCK
/* The option FF_FS_LOCK switches file lock function to control duplicated file open
/ and illegal operation to open objects. This option must be 0 when FF_FS_READONLY
/ is 1.
/
/ 0: Disable file lock... | 79 |
Only file/directory access
/ to the same volume is under control of this featuer.
/
/ 0: Disable re-entrancy. FF_FS_TIMEOUT have no effect.
/ 1: Enable re-entrancy. Also user provided synchronization handlers,
/ ff_mutex_create(), ff_mutex_delete(), ff_mutex_take() and ff_mutex_give()
/ function, must b... | 79 |
/*
*/
#pragma once
#include
#include
#ifdef __XTENSA__
#include "xtensa/semihosting.h"
#elif __riscv
#include "riscv/semihosting.h"
#else
#error Unsupported architecture
#endif
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
#define SEMIHOSTING_SYS_OPEN 0x01
#define SEMIHOSTING_SYS_CLOSE 0x... | 80 |
..0x104 used by RiscV for custom semihosting calls */
/* Other Espressif extension sys calls */
#define ESP_SEMIHOSTING_SYS_SEEK 0x105 /* custom lseek with whence */
/* not implemented yet */
#define ESP_SEMIHOSTING_SYS_MKDIR 0x106
#define ESP_SEMIHOSTING_SYS_OPENDIR ... | 80 |
Changelog;
1 - Memory based approach with 2 registers implemented as defined in the ARM standard.
2 - User defined syscall numbers located between 0x100-0x1FF
3 - The break instruction operands updated to (1, 14)
4 - Absolute path support is dropped
*/
#define SEMIHOSTING_DRV_VERSION 2
/**
*/
static ... | 80 |
/*
*/
#include "sdkconfig.h"
#include "esp_vfs.h"
#include "esp_vfs_common.h"
#ifdef __cplusplus
extern "C" {
#endif
#if CONFIG_VFS_SELECT_IN_RAM
#define VFS_MALLOC_FLAGS (MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)
#else
#define VFS_MALLOC_FLAGS MALLOC_CAP_DEFAULT
#endif
typedef struct vfs_entry_ {
esp_vfs_t vfs; ... | 81 |
/*
*/
#pragma once
#include "esp_vfs.h"
#include "esp_vfs_common.h"
#ifdef __cplusplus
extern "C" {
#endif
void esp_vfs_dev_uart_register(void) __attribute__((deprecated("Please use uart_vfs_dev_register() instead")));
void esp_vfs_dev_uart_use_nonblocking(int uart_num) __attribute__((deprecated("Please use uart_... | 82 |
/*
*/
#pragma once
#include "esp_vfs.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
esp_err_t esp_vfs_semihost_register(const char* base_path);
/**
*/
esp_err_t esp_vfs_semihost_unregister(const char* base_path);
#ifdef __cplusplus
}
#endif
| 83 |
// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by a... | 84 |
/*
*/
#pragma once
#include "esp_err.h"
#include "esp_vfs.h"
#include "esp_vfs_common.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
esp_err_t esp_vfs_dev_cdcacm_register(void);
/**
*/
void esp_vfs_dev_cdcacm_set_rx_line_endings(esp_line_endings_t mode);
/**
*/
void esp_vfs_dev_cdcacm_set_tx_line_endings(es... | 85 |
/*
*/
#pragma once
#include "esp_err.h"
#ifdef __cplusplus
extern "C" {
#endif
#define ESP_VFS_DEV_CONSOLE "/dev/console"
/**
*/
esp_err_t esp_vfs_console_register(void);
#ifdef __cplusplus
}
#endif
| 86 |
/*
*/
#pragma once
#include "esp_err.h"
#include "esp_vfs.h"
#include "esp_vfs_common.h"
#ifdef __cplusplus
extern "C" {
#endif
esp_err_t esp_vfs_dev_usb_serial_jtag_register(void) __attribute__((deprecated("Please use usb_serial_jtag_vfs_register instead")));
void esp_vfs_dev_usb_serial_jtag_set_rx_line_endings(... | 87 |
/*
*/
#ifndef __ESP_VFS_H__
#define __ESP_VFS_H__
#include
#include
#include
#include
#include
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#include "esp_err.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include "sdkconfig.h"
#ifdef __cplusplus
extern "C" {
... | 88 |
// Copyright 2021 Espressif Systems (Shanghai) CO LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicabl... | 89 |
/*
*/
#pragma once
#include "sdkconfig.h"
#include "esp_vfs.h"
#ifdef __cplusplus
extern "C" {
#endif
#if CONFIG_VFS_SUPPORT_IO
/**
*/
void esp_vfs_set_primary_dev_vfs_def_struct(const esp_vfs_t *vfs);
#if CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG
/**
*/
void esp_vfs_set_secondary_dev_vfs_def_struct(const e... | 90 |
/*
*/
#ifndef _xtensa_perfmon_masks_H_
#define _xtensa_perfmon_masks_H_
#include
#include "xtensa/xt_perf_consts.h"
#ifdef __cplusplus
extern "C"
{
#endif
/**
*/
typedef struct xtensa_perfmon_select {
int select; /*!< Selected counter */
const char *description; /*!< Description for selected counter */... | 91 |
/*
*/
#ifndef _PERF_MON_ACCESS_H_
#define _PERF_MON_ACCESS_H_
#include
#include
#include "esp_err.h"
#include "esp_log.h"
#ifdef __cplusplus
extern "C"
{
#endif
/**@{*/
/**
*/
esp_err_t xtensa_perfmon_init(int id, uint16_t select, uint16_t mask, int kernelcnt, int tracelevel);
/**@}*/
/**@{*/
/**
*/
esp_err_... | 92 |
/*
*/
#ifndef _xtensa_perfmon_apis_H_
#define _xtensa_perfmon_apis_H_
#include "xtensa_perfmon_access.h"
#include "xtensa_perfmon_masks.h"
#ifdef __cplusplus
extern "C"
{
#endif
/**
*/
typedef struct xtensa_perfmon_config {
int repeat_count; /*!=0, then the perfmon will count only when interrupt level >... | 93 |
/*
*/
#ifndef _PERF_MON_H_
#define _PERF_MON_H_
#include
#include
#include "esp_err.h"
#include "esp_log.h"
#include "xtensa_perfmon_access.h"
#include "xtensa_perfmon_masks.h"
#include "xtensa_perfmon_apis.h"
#include "xtensa/xt_perf_consts.h"
#endif // _PERF_MON_H_
| 94 |
/*
*/
#pragma once
#include
#include
#include
#include "sdkconfig.h"
#include "soc/soc_caps.h"
#include "hal/cache_types.h"
#include "hal/mmu_types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
uint32_t start; //laddr start
uint32_t end; //laddr end
size_t size; ... | 95 |
/*
*/
#pragma once
#include
#include
#include "esp_err.h"
#include "esp_bit_defs.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
/**
*/
#define ESP_CACHE_MSYNC_FLAG_INVALIDATE BIT(0)
/**
*/
#define ESP_CACHE_MSYNC_FLAG_UNALIGNED BIT(1)
/**
*/
#define ESP_CACHE_MSYNC_FLAG_DIR_C2M BIT(2)
/**
*/
#... | 96 |
/*
*/
#pragma once
#include
#include
#include "esp_err.h"
#include "esp_bit_defs.h"
#include "hal/mmu_types.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
/**
*/
/**
*/
#define ESP_MMU_MMAP_FLAG_PADDR_SHARED BIT(0)
/**
*/
typedef uint32_t esp_paddr_t;
/**
esp_err_t esp_mmu_map(esp_paddr_t paddr_start,... | 97 |
/*
*/
#pragma once
#include
#include
#include "esp_err.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
typedef struct cache_driver_s cache_driver_t;
/**
*/
struct cache_driver_s {
/**
*/
void (*cache_flush)(int cpu_no);
/**
*/
void (*cache_writeback_psram)(void);
};
/**
*/
void c... | 98 |
/*
*/
#pragma once
#include
#include
#include "esp_err.h"
#include "hal/mmu_types.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
/**
*/
void esp_mmu_map_init(void);
/**
*/
esp_err_t esp_mmu_map_reserve_block_with_caps(size_t size, mmu_mem_caps_t caps, mmu_target_t target, const void **out_ptr);
/*
*/
esp... | 99 |
/*
*/
#pragma once
#include
#include
#include "esp_err.h"
#include "esp_bit_defs.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
/**
*/
#define ESP_CACHE_MALLOC_FLAG_PSRAM BIT(0)
/**
*/
#define ESP_CACHE_MALLOC_FLAG_DMA BIT(1)
/**
*/
esp_err_t esp_cache_aligned_malloc(size_t size, uint32_t ... | 100 |
/*
*/
#pragma once
#include
#include "esp_err.h"
#include "esp_log.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
*/
esp_err_t test_set_buffer_dirty(intptr_t vaddr_start, size_t size);
#ifdef __cplusplus
}
#endif
| 101 |
/*
*/
#pragma once
#include
#include
#include
#include "esp_err.h"
#include "esp_assert.h"
#include "esp_attr.h"
#ifdef __cplusplus
extern "C"
{
#endif
#define ESP_APP_DESC_MAGIC_WORD (0xABCD5432) /*!< The magic word for the esp_app_desc structure that is in DROM. */
/**
*/
typedef struct {
uint32_t magi... | 102 |
/*
*/
/* File adapted to use on IDF FreeRTOS component, extracted
*/
#ifndef __XT_ASM_UTILS_H
#define __XT_ASM_UTILS_H
/*
*/
.macro SPILL_ALL_WINDOWS
#if XCHAL_NUM_AREGS == 64
and a12, a12, a12
rotw 3
and a12, a12, a12
rotw 3
and a12, a12, a12
rotw 3
and a12, a12, a12
rotw 3
and a12, a12, a12
rotw 4
#e... | 103 |
L_spinlock_loop:
movi \reg_B, 0 /* Load spinlock free value (0) into SCOMPARE1 */
wsr \reg_B, SCOMPARE1
rsync /* Ensure that SCOMPARE1 is set before s32c1i executes */
rsr \reg_B, PRID /* Load the current core's ID int... | 103 |
endm
#endif /* portNUM_PROCESSORS > 1 */
#endif /* __XT_ASM_UTILS_H */
| 103 |
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by a... | 104 |
/*
*/
/*
*/
/*
*/
#ifndef XTENSA_CONTEXT_H
#define XTENSA_CONTEXT_H
#ifdef __ASSEMBLER__
#include
#endif
#include
#include
#include
#include
/* Align a value up to nearest n-byte boundary, where n is a power of 2. */
#define ALIGNUP(n, val) (((val) + (n)-1) & -(n))
/*
*/
/*
We need to undef... | 105 |
set sname##Size, XT_STRUCT_OFFSET;
#else // __clang__
#define STRUCT_BEGIN .pushsection .text; .struct 0
#define STRUCT_FIELD(ctype,size,asname,name) asname: .space size
#define STRUCT_AFIELD(ctype,size,asname,name,n) asname: .space (size)*(n)
#define STRUCT_END(sname) sname##Size:; .popsection
#e... | 105 |
The frame size is minimized by omitting regs not applicable to user's config.
For Windowed ABI, this stack frame includes the interruptee's base save area,
another base save area to manage gcc nested functions, and a little temporary
space to help manage the spilling of the register windows.
*/
STRUCT_BEGIN... | 105 |
= 0
#if XCHAL_EXTRA_SA_ALIGN 0
/* Offsets of each coprocessor save area within the 'aligned save area': */
#define XT_CP0_SA 0
#define XT_CP1_SA ALIGNUP(XCHAL_CP1_SA_ALIGN, XT_CP0_SA + XCHAL_CP0_SA_SIZE)
#define XT_CP2_SA ALIGNUP(XCHAL_CP2_SA_ALIGN, XT_CP1_SA + XCHAL_CP1_SA_SIZE)
#define XT_CP3_SA ALIGNUP(... | 105 |
Only uses the reg given as an argument.
Reading PRID on the ESP32 gives us 0xCDCD on the PRO processor (0)
and 0xABAB on the APP CPU (1). We can distinguish between the two by checking
bit 13: it's 1 on the APP and 0 on the PRO processor.
*/
#ifdef __ASSEMBLER__
.macro getcoreid reg
rsr.prid \reg
extui \reg,\reg... | 105 |
ENTRY0, RET0 are for frameless functions (no locals, no calls).
where size = size of stack frame in bytes (must be >0 and aligned to 16).
For framed functions the frame is created and the return address saved at
base of frame (Call0 ABI) or as determined by hardware (Windowed ABI).
For frameless fun... | 105 |
/*
*/
/
Copyright (c) 2006-2015 Cadence Design Systems Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merg... | 106 |
/
/
Xtensa-specific API for RTOS ports.
/
#ifndef __XTENSA_API_H__
#define __XTENSA_API_H__
#include
#include
#include "xtensa_context.h"
/* Typedef for C-callable interrupt handler function */
typedef void (*xt_handler)(void *);
/* Typedef for C-callable exception handler function */
typedef void (*xt_exc_h... | 106 |
h.
*/
extern xt_exc_handler xt_set_exception_handler(int n, xt_exc_handler f);
/*
Call this function to set a handler for the specified interrupt. The handler
will be installed on the core that calls this function.
n - Interrupt number.
f - Handler function address, NULL to uninstall hand... | 106 |
*/
static inline void xt_set_intclear(unsigned int arg)
{
xthal_set_intclear(arg);
}
/*
Call this function to get handler's argument for the specified interrupt.
n - Interrupt number.
*/
extern void * xt_get_interrupt_handler_arg(int n);
/*
Call this function to check if the specified interru... | 106 |
/*
*/
/*
*/
/*
*/
#ifndef XTENSA_TIMER_H
#define XTENSA_TIMER_H
#ifdef __ASSEMBLER__
#include
#endif
#include
#include
#include "xtensa_rtos.h" /* in case this wasn't included directly */
/*
Select timer to use for periodic tick, and determine its interrupt number
and priority. User may spe... | 107 |
User should BE SURE TO ADJUST THIS for the Xtensa platform being used.
If using a supported board via the board-independent API defined in xtbsp.h,
this may be left undefined and frequency and tick divisor will be computed
and cached during run-time initialization.
NOTE ON SIMULATOR:
Under the Xtensa instruction set ... | 107 |
defined(XT_BOARD)
#error "XT_CLOCK_FREQ must be defined for the target platform."
#endif
/*
Default number of timer "ticks" per second (default 100 for 10ms tick).
RTOS may define this in its own way (if applicable) in xtensa_rtos.h.
User may redefine this to an optimal value for the application, either by
editing t... | 107 |
/*
*/
#ifndef _ESP_CPU_UTILS_H
#define _ESP_CPU_UTILS_H
#ifdef __cplusplus
extern "C" {
#endif
/**
static inline uint32_t esp_cpu_process_stack_pc(uint32_t pc)
{
if (pc & 0x80000000) {
//Top two bits of a0 (return address) specify window increment. Overwrite to map to address space.
pc = (pc & 0... | 108 |
/*
*/
#pragma once
#include "xtensa/xtruntime.h"
#define RSR(reg, at) asm volatile ("rsr %0, %1" : "=r" (at) : "i" (reg))
#define WSR(reg, at) asm volatile ("wsr %0, %1" : : "r" (at), "i" (reg))
#define XSR(reg, at) asm volatile ("xsr %0, %1" : "+r" (at) : "i" (reg))
#define RER(reg, at) ... | 109 |
ps \tmp1
movi \tmp2, ~(PS_WOE_MASK | PS_OWB_MASK | PS_CALLINC_MASK)
and \tmp1, \tmp1, \tmp2
wsr.ps \tmp1
rsync
rsr.windowbase \tmp1
ssl \tmp1
movi \tmp1, 1
sll \tmp1, \tmp1
wsr.windowstart \tmp1
rsync
mov sp, \new_sp
rsr.ps \tmp1
movi \tmp2, (PS_WOE)
or \tmp1, ... | 109 |
ps %1 \n"\
" \n"\
"movi %2, " XTSTR( PS_WOE_MASK ) "\n"\
" \n"\
"or %1, %1, %2 \n"\
"wsr.ps %1 \n"\
"rsync \n"\
: "+r"(sp), "+r"(tmp1), "+r"(tmp2) : "r"(mask)); \
} while (0);
#endif // __ASSEMBLER__
| 109 |
#ifndef ERI_H
#define ERI_H
#include
/*
The ERI is a bus internal to each Xtensa core. It connects, amongst others, to the debug interface, where it
allows reading/writing the same registers as available over JTAG.
*/
/**
*/
uint32_t eri_read(int addr);
/**
*/
void eri_write(int addr, uint32_t data);
#endi... | 110 |
#ifndef XTENSA_DEBUG_MODULE_H
#define XTENSA_DEBUG_MODULE_H
#include
/*
ERI registers / OCD offsets and field definitions
*/
#define ERI_DEBUG_OFFSET 0x100000
#define ERI_TRAX_OFFSET (ERI_DEBUG_OFFSET+0)
#define ERI_PERFMON_OFFSET (ERI_DEBUG_OFFSET+0x1000)
#define ERI_OCDREG_OFFSET (ERI_DEBUG_OF... | 111 |
Usable trace ram is 2^MEMSZ bytes.
#define TRAXSTAT_MEMSZ_MASK 0x1F
#define TRAXSTAT_PTO (1
// TRACELEVEL (i.e. If this bit is set, this counter
// counts only when CINTLEVEL >TRACELEVEL;
// if this bit is cleared, this counter counts only when
// CINTLEVEL ≤ TRACELEVEL)
#define PMCTRL_KRNLCNT_SHIFT ... | 111 |
#define PGM_PMEN (1<<0) // Overall enable for all performance counting
#endif
| 111 |
/*
*/
#pragma once
#include
#include
#include "soc/soc_caps.h"
#include "xtensa/config/core-isa.h"
#include "xtensa/config/core.h"
#include "xtensa/config/extreg.h"
#include "xtensa/config/specreg.h"
#include "xtensa/xtruntime.h"
#include "xt_instr_macros.h"
#include "esp_bit_defs.h"
#include "esp_attr.h"
#ifdef _... | 112 |
prid %0\n"
:"=r"(id));
return id;
#else
return 0;
#endif // XCHAL_HAVE_PRID
}
FORCE_INLINE_ATTR void *xt_utils_get_sp(void)
{
void *sp;
asm volatile ("mov %0, sp;" : "=r" (sp));
return sp;
}
FORCE_INLINE_ATTR uint32_t xt_utils_get_cycle_count(void)
{
uint32_t ccount;
RSR(CCOUNT, cc... | 112 |
pdf)
uint32_t dbreakc_reg = 0x3F;
dbreakc_reg = dbreakc_reg << (__builtin_ffsll(size) - 1);
dbreakc_reg = dbreakc_reg & 0x3F;
if (on_read) {
dbreakc_reg |= BIT(30);
}
if (on_write) {
dbreakc_reg |= BIT(31);
}
// Enable break address and break control register
if (wp_n... | 112 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.