mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-06-30 12:30:59 +02:00
Update IDF to version 3cad00f (#310)
This commit is contained in:
@ -1,21 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
|
||||
#ifndef __ESP_BROWNOUT_H
|
||||
#define __ESP_BROWNOUT_H
|
||||
|
||||
void esp_brownout_init();
|
||||
|
||||
#endif
|
@ -61,7 +61,10 @@ void _esp_error_check_failed(esp_err_t rc, const char *file, int line, const cha
|
||||
* Disabled if assertions are disabled.
|
||||
*/
|
||||
#ifdef NDEBUG
|
||||
#define ESP_ERROR_CHECK(x) do { (x); } while (0)
|
||||
#define ESP_ERROR_CHECK(x) do { \
|
||||
esp_err_t rc = (x); \
|
||||
(void) sizeof(rc); \
|
||||
} while(0);
|
||||
#else
|
||||
#define ESP_ERROR_CHECK(x) do { \
|
||||
esp_err_t rc = (x); \
|
||||
|
@ -61,6 +61,11 @@ esp_err_t esp_set_watchpoint(int no, void *adr, int size, int flags);
|
||||
void esp_clear_watchpoint(int no);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Stops panic WDT
|
||||
*/
|
||||
void esp_panic_wdt_stop(void);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
/* Bt contoller Task */
|
||||
/* controller */
|
||||
#define ESP_TASK_BT_CONTROLLER_PRIO (ESP_TASK_PRIO_MAX - 1)
|
||||
#define ESP_TASK_BT_CONTROLLER_PRIO (ESP_TASK_PRIO_MAX - 2)
|
||||
#ifdef CONFIG_NEWLIB_NANO_FORMAT
|
||||
#define BT_TASK_EXTRA_STACK_SIZE (0)
|
||||
#else
|
||||
|
@ -61,8 +61,11 @@ extern "C" {
|
||||
* RTC_CNTL_STORE7_REG FAST_RTC_MEMORY_CRC
|
||||
*************************************************************************************
|
||||
*/
|
||||
|
||||
#define RTC_BOOT_TIME_LOW_REG RTC_CNTL_STORE2_REG
|
||||
#define RTC_BOOT_TIME_HIGH_REG RTC_CNTL_STORE3_REG
|
||||
#define RTC_XTAL_FREQ_REG RTC_CNTL_STORE4_REG
|
||||
#define RTC_APB_FREQ_REG RTC_CNTL_STORE5_REG
|
||||
#define RTC_ENTRY_ADDR_REG RTC_CNTL_STORE6_REG
|
||||
#define RTC_MEMORY_CRC_REG RTC_CNTL_STORE7_REG
|
||||
|
||||
|
@ -65,81 +65,81 @@ extern "C" {
|
||||
*************************************************************
|
||||
*/
|
||||
|
||||
#define PERIPHS_SPI_FLASH_CMD SPI_CMD(1)
|
||||
#define PERIPHS_SPI_FLASH_ADDR SPI_ADDR(1)
|
||||
#define PERIPHS_SPI_FLASH_CTRL SPI_CTRL(1)
|
||||
#define PERIPHS_SPI_FLASH_CTRL1 SPI_CTRL1(1)
|
||||
#define PERIPHS_SPI_FLASH_STATUS SPI_RD_STATUS(1)
|
||||
#define PERIPHS_SPI_FLASH_USRREG SPI_USER(1)
|
||||
#define PERIPHS_SPI_FLASH_USRREG1 SPI_USER1(1)
|
||||
#define PERIPHS_SPI_FLASH_USRREG2 SPI_USER2(1)
|
||||
#define PERIPHS_SPI_FLASH_C0 SPI_W0(1)
|
||||
#define PERIPHS_SPI_FLASH_C1 SPI_W1(1)
|
||||
#define PERIPHS_SPI_FLASH_C2 SPI_W2(1)
|
||||
#define PERIPHS_SPI_FLASH_C3 SPI_W3(1)
|
||||
#define PERIPHS_SPI_FLASH_C4 SPI_W4(1)
|
||||
#define PERIPHS_SPI_FLASH_C5 SPI_W5(1)
|
||||
#define PERIPHS_SPI_FLASH_C6 SPI_W6(1)
|
||||
#define PERIPHS_SPI_FLASH_C7 SPI_W7(1)
|
||||
#define PERIPHS_SPI_FLASH_TX_CRC SPI_TX_CRC(1)
|
||||
#define PERIPHS_SPI_FLASH_CMD SPI_CMD_REG(1)
|
||||
#define PERIPHS_SPI_FLASH_ADDR SPI_ADDR_REG(1)
|
||||
#define PERIPHS_SPI_FLASH_CTRL SPI_CTRL_REG(1)
|
||||
#define PERIPHS_SPI_FLASH_CTRL1 SPI_CTRL1_REG(1)
|
||||
#define PERIPHS_SPI_FLASH_STATUS SPI_RD_STATUS_REG(1)
|
||||
#define PERIPHS_SPI_FLASH_USRREG SPI_USER_REG(1)
|
||||
#define PERIPHS_SPI_FLASH_USRREG1 SPI_USER1_REG(1)
|
||||
#define PERIPHS_SPI_FLASH_USRREG2 SPI_USER2_REG(1)
|
||||
#define PERIPHS_SPI_FLASH_C0 SPI_W0_REG(1)
|
||||
#define PERIPHS_SPI_FLASH_C1 SPI_W1_REG(1)
|
||||
#define PERIPHS_SPI_FLASH_C2 SPI_W2_REG(1)
|
||||
#define PERIPHS_SPI_FLASH_C3 SPI_W3_REG(1)
|
||||
#define PERIPHS_SPI_FLASH_C4 SPI_W4_REG(1)
|
||||
#define PERIPHS_SPI_FLASH_C5 SPI_W5_REG(1)
|
||||
#define PERIPHS_SPI_FLASH_C6 SPI_W6_REG(1)
|
||||
#define PERIPHS_SPI_FLASH_C7 SPI_W7_REG(1)
|
||||
#define PERIPHS_SPI_FLASH_TX_CRC SPI_TX_CRC_REG(1)
|
||||
|
||||
#define SPI0_R_QIO_DUMMY_CYCLELEN 3
|
||||
#define SPI0_R_QIO_ADDR_BITSLEN 31
|
||||
#define SPI0_R_FAST_DUMMY_CYCLELEN 7
|
||||
#define SPI0_R_DIO_DUMMY_CYCLELEN 3
|
||||
#define SPI0_R_FAST_ADDR_BITSLEN 23
|
||||
#define SPI0_R_SIO_ADDR_BITSLEN 23
|
||||
#define SPI0_R_QIO_DUMMY_CYCLELEN 3
|
||||
#define SPI0_R_QIO_ADDR_BITSLEN 31
|
||||
#define SPI0_R_FAST_DUMMY_CYCLELEN 7
|
||||
#define SPI0_R_DIO_DUMMY_CYCLELEN 3
|
||||
#define SPI0_R_FAST_ADDR_BITSLEN 23
|
||||
#define SPI0_R_SIO_ADDR_BITSLEN 23
|
||||
|
||||
#define SPI1_R_QIO_DUMMY_CYCLELEN 3
|
||||
#define SPI1_R_QIO_ADDR_BITSLEN 31
|
||||
#define SPI1_R_FAST_DUMMY_CYCLELEN 7
|
||||
#define SPI1_R_DIO_DUMMY_CYCLELEN 3
|
||||
#define SPI1_R_DIO_ADDR_BITSLEN 31
|
||||
#define SPI1_R_FAST_ADDR_BITSLEN 23
|
||||
#define SPI1_R_SIO_ADDR_BITSLEN 23
|
||||
#define SPI1_R_QIO_DUMMY_CYCLELEN 3
|
||||
#define SPI1_R_QIO_ADDR_BITSLEN 31
|
||||
#define SPI1_R_FAST_DUMMY_CYCLELEN 7
|
||||
#define SPI1_R_DIO_DUMMY_CYCLELEN 3
|
||||
#define SPI1_R_DIO_ADDR_BITSLEN 31
|
||||
#define SPI1_R_FAST_ADDR_BITSLEN 23
|
||||
#define SPI1_R_SIO_ADDR_BITSLEN 23
|
||||
|
||||
#define SPI_W_SIO_ADDR_BITSLEN 23
|
||||
#define ESP_ROM_SPIFLASH_W_SIO_ADDR_BITSLEN 23
|
||||
|
||||
#define TWO_BYTE_STATUS_EN SPI_WRSR_2B
|
||||
#define ESP_ROM_SPIFLASH_TWO_BYTE_STATUS_EN SPI_WRSR_2B
|
||||
|
||||
//SPI address register
|
||||
#define SPI_FLASH_BYTES_LEN 24
|
||||
#define SPI_BUFF_BYTE_WRITE_NUM 32
|
||||
#define SPI_BUFF_BYTE_READ_NUM 64
|
||||
#define SPI_BUFF_BYTE_READ_BITS 0x3f
|
||||
#define ESP_ROM_SPIFLASH_BYTES_LEN 24
|
||||
#define ESP_ROM_SPIFLASH_BUFF_BYTE_WRITE_NUM 32
|
||||
#define ESP_ROM_SPIFLASH_BUFF_BYTE_READ_NUM 64
|
||||
#define ESP_ROM_SPIFLASH_BUFF_BYTE_READ_BITS 0x3f
|
||||
|
||||
//SPI status register
|
||||
#define SPI_FLASH_BUSY_FLAG BIT0
|
||||
#define SPI_FLASH_WRENABLE_FLAG BIT1
|
||||
#define SPI_FLASH_BP0 BIT2
|
||||
#define SPI_FLASH_BP1 BIT3
|
||||
#define SPI_FLASH_BP2 BIT4
|
||||
#define FLASH_WR_PROTECT (SPI_FLASH_BP0|SPI_FLASH_BP1|SPI_FLASH_BP2)
|
||||
#define SPI_FLASH_QE BIT9
|
||||
#define ESP_ROM_SPIFLASH_BUSY_FLAG BIT0
|
||||
#define ESP_ROM_SPIFLASH_WRENABLE_FLAG BIT1
|
||||
#define ESP_ROM_SPIFLASH_BP0 BIT2
|
||||
#define ESP_ROM_SPIFLASH_BP1 BIT3
|
||||
#define ESP_ROM_SPIFLASH_BP2 BIT4
|
||||
#define ESP_ROM_SPIFLASH_WR_PROTECT (ESP_ROM_SPIFLASH_BP0|ESP_ROM_SPIFLASH_BP1|ESP_ROM_SPIFLASH_BP2)
|
||||
#define ESP_ROM_SPIFLASH_QE BIT9
|
||||
|
||||
typedef enum {
|
||||
SPI_FLASH_QIO_MODE = 0,
|
||||
SPI_FLASH_QOUT_MODE,
|
||||
SPI_FLASH_DIO_MODE,
|
||||
SPI_FLASH_DOUT_MODE,
|
||||
SPI_FLASH_FASTRD_MODE,
|
||||
SPI_FLASH_SLOWRD_MODE
|
||||
} SpiFlashRdMode;
|
||||
ESP_ROM_SPIFLASH_QIO_MODE = 0,
|
||||
ESP_ROM_SPIFLASH_QOUT_MODE,
|
||||
ESP_ROM_SPIFLASH_DIO_MODE,
|
||||
ESP_ROM_SPIFLASH_DOUT_MODE,
|
||||
ESP_ROM_SPIFLASH_FASTRD_MODE,
|
||||
ESP_ROM_SPIFLASH_SLOWRD_MODE
|
||||
} esp_rom_spiflash_read_mode_t;
|
||||
|
||||
typedef enum {
|
||||
SPI_FLASH_RESULT_OK,
|
||||
SPI_FLASH_RESULT_ERR,
|
||||
SPI_FLASH_RESULT_TIMEOUT
|
||||
} SpiFlashOpResult;
|
||||
ESP_ROM_SPIFLASH_RESULT_OK,
|
||||
ESP_ROM_SPIFLASH_RESULT_ERR,
|
||||
ESP_ROM_SPIFLASH_RESULT_TIMEOUT
|
||||
} esp_rom_spiflash_result_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t deviceId;
|
||||
uint32_t device_id;
|
||||
uint32_t chip_size; // chip size in bytes
|
||||
uint32_t block_size;
|
||||
uint32_t sector_size;
|
||||
uint32_t page_size;
|
||||
uint32_t status_mask;
|
||||
} SpiFlashChip;
|
||||
} esp_rom_spiflash_chip_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t data_length;
|
||||
@ -148,7 +148,7 @@ typedef struct {
|
||||
uint8_t write_cmd;
|
||||
uint16_t data_mask;
|
||||
uint16_t data;
|
||||
} SpiCommonCmd;
|
||||
} esp_rom_spiflash_common_cmd_t;
|
||||
|
||||
/**
|
||||
* @brief Fix the bug in SPI hardware communication with Flash/Ext-SRAM in High Speed.
|
||||
@ -160,7 +160,7 @@ typedef struct {
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
void spi_dummy_len_fix(uint8_t spi, uint8_t freqdiv);
|
||||
void esp_rom_spiflash_fix_dummylen(uint8_t spi, uint8_t freqdiv);
|
||||
|
||||
/**
|
||||
* @brief Select SPI Flash to QIO mode when WP pad is read from Flash.
|
||||
@ -173,7 +173,7 @@ void spi_dummy_len_fix(uint8_t spi, uint8_t freqdiv);
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
void SelectSpiQIO(uint8_t wp_gpio_num, uint32_t ishspi);
|
||||
void esp_rom_spiflash_select_qiomode(uint8_t wp_gpio_num, uint32_t ishspi);
|
||||
|
||||
/**
|
||||
* @brief Set SPI Flash pad drivers.
|
||||
@ -191,7 +191,7 @@ void SelectSpiQIO(uint8_t wp_gpio_num, uint32_t ishspi);
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
void SetSpiDrvs(uint8_t wp_gpio_num, uint32_t ishspi, uint8_t *drvs);
|
||||
void esp_rom_spiflash_set_drvs(uint8_t wp_gpio_num, uint32_t ishspi, uint8_t *drvs);
|
||||
|
||||
/**
|
||||
* @brief Select SPI Flash function for pads.
|
||||
@ -202,7 +202,7 @@ void SetSpiDrvs(uint8_t wp_gpio_num, uint32_t ishspi, uint8_t *drvs);
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
void SelectSpiFunction(uint32_t ishspi);
|
||||
void esp_rom_spiflash_select_padsfunc(uint32_t ishspi);
|
||||
|
||||
/**
|
||||
* @brief SPI Flash init, clock divisor is 4, use 1 line Slow read mode.
|
||||
@ -215,89 +215,89 @@ void SelectSpiFunction(uint32_t ishspi);
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
void spi_flash_attach(uint32_t ishspi, bool legacy);
|
||||
void esp_rom_spiflash_attach(uint32_t ishspi, bool legacy);
|
||||
|
||||
/**
|
||||
* @brief SPI Read Flash status register. We use CMD 0x05 (RDSR).
|
||||
* Please do not call this function in SDK.
|
||||
*
|
||||
* @param SpiFlashChip *spi : The information for Flash, which is exported from ld file.
|
||||
* @param esp_rom_spiflash_chip_t *spi : The information for Flash, which is exported from ld file.
|
||||
*
|
||||
* @param uint32_t *status : The pointer to which to return the Flash status value.
|
||||
*
|
||||
* @return SPI_FLASH_RESULT_OK : read OK.
|
||||
* SPI_FLASH_RESULT_ERR : read error.
|
||||
* SPI_FLASH_RESULT_TIMEOUT : read timeout.
|
||||
* @return ESP_ROM_SPIFLASH_RESULT_OK : read OK.
|
||||
* ESP_ROM_SPIFLASH_RESULT_ERR : read error.
|
||||
* ESP_ROM_SPIFLASH_RESULT_TIMEOUT : read timeout.
|
||||
*/
|
||||
SpiFlashOpResult SPI_read_status(SpiFlashChip *spi, uint32_t *status);
|
||||
esp_rom_spiflash_result_t esp_rom_spiflash_read_status(esp_rom_spiflash_chip_t *spi, uint32_t *status);
|
||||
|
||||
/**
|
||||
* @brief SPI Read Flash status register bits 8-15. We use CMD 0x35 (RDSR2).
|
||||
* Please do not call this function in SDK.
|
||||
*
|
||||
* @param SpiFlashChip *spi : The information for Flash, which is exported from ld file.
|
||||
* @param esp_rom_spiflash_chip_t *spi : The information for Flash, which is exported from ld file.
|
||||
*
|
||||
* @param uint32_t *status : The pointer to which to return the Flash status value.
|
||||
*
|
||||
* @return SPI_FLASH_RESULT_OK : read OK.
|
||||
* SPI_FLASH_RESULT_ERR : read error.
|
||||
* SPI_FLASH_RESULT_TIMEOUT : read timeout.
|
||||
* @return ESP_ROM_SPIFLASH_RESULT_OK : read OK.
|
||||
* ESP_ROM_SPIFLASH_RESULT_ERR : read error.
|
||||
* ESP_ROM_SPIFLASH_RESULT_TIMEOUT : read timeout.
|
||||
*/
|
||||
SpiFlashOpResult SPI_read_status_high(uint32_t *status);
|
||||
esp_rom_spiflash_result_t esp_rom_spiflash_read_statushigh(esp_rom_spiflash_chip_t *spi, uint32_t *status);
|
||||
|
||||
/**
|
||||
* @brief Write status to Falsh status register.
|
||||
* Please do not call this function in SDK.
|
||||
*
|
||||
* @param SpiFlashChip *spi : The information for Flash, which is exported from ld file.
|
||||
* @param esp_rom_spiflash_chip_t *spi : The information for Flash, which is exported from ld file.
|
||||
*
|
||||
* @param uint32_t status_value : Value to .
|
||||
*
|
||||
* @return SPI_FLASH_RESULT_OK : write OK.
|
||||
* SPI_FLASH_RESULT_ERR : write error.
|
||||
* SPI_FLASH_RESULT_TIMEOUT : write timeout.
|
||||
* @return ESP_ROM_SPIFLASH_RESULT_OK : write OK.
|
||||
* ESP_ROM_SPIFLASH_RESULT_ERR : write error.
|
||||
* ESP_ROM_SPIFLASH_RESULT_TIMEOUT : write timeout.
|
||||
*/
|
||||
SpiFlashOpResult SPI_write_status(SpiFlashChip *spi, uint32_t status_value);
|
||||
esp_rom_spiflash_result_t esp_rom_spiflash_write_status(esp_rom_spiflash_chip_t *spi, uint32_t status_value);
|
||||
|
||||
/**
|
||||
* @brief Use a command to Read Flash status register.
|
||||
* Please do not call this function in SDK.
|
||||
*
|
||||
* @param SpiFlashChip *spi : The information for Flash, which is exported from ld file.
|
||||
* @param esp_rom_spiflash_chip_t *spi : The information for Flash, which is exported from ld file.
|
||||
*
|
||||
* @param uint32_t*status : The pointer to which to return the Flash status value.
|
||||
*
|
||||
* @return SPI_FLASH_RESULT_OK : read OK.
|
||||
* SPI_FLASH_RESULT_ERR : read error.
|
||||
* SPI_FLASH_RESULT_TIMEOUT : read timeout.
|
||||
* @return ESP_ROM_SPIFLASH_RESULT_OK : read OK.
|
||||
* ESP_ROM_SPIFLASH_RESULT_ERR : read error.
|
||||
* ESP_ROM_SPIFLASH_RESULT_TIMEOUT : read timeout.
|
||||
*/
|
||||
SpiFlashOpResult SPI_user_command_read(uint32_t *status, uint8_t cmd);
|
||||
esp_rom_spiflash_result_t esp_rom_spiflash_read_user_cmd(uint32_t *status, uint8_t cmd);
|
||||
|
||||
/**
|
||||
* @brief Config SPI Flash read mode when init.
|
||||
* Please do not call this function in SDK.
|
||||
*
|
||||
* @param SpiFlashRdMode mode : QIO/QOUT/DIO/DOUT/FastRD/SlowRD.
|
||||
* @param esp_rom_spiflash_read_mode_t mode : QIO/QOUT/DIO/DOUT/FastRD/SlowRD.
|
||||
*
|
||||
* @param uint8_t legacy: In legacy mode, more SPI command is used in line.
|
||||
*
|
||||
* @return SPI_FLASH_RESULT_OK : config OK.
|
||||
* SPI_FLASH_RESULT_ERR : config error.
|
||||
* SPI_FLASH_RESULT_TIMEOUT : config timeout.
|
||||
* @return ESP_ROM_SPIFLASH_RESULT_OK : config OK.
|
||||
* ESP_ROM_SPIFLASH_RESULT_ERR : config error.
|
||||
* ESP_ROM_SPIFLASH_RESULT_TIMEOUT : config timeout.
|
||||
*/
|
||||
SpiFlashOpResult SPIReadModeCnfig(SpiFlashRdMode mode, bool legacy);
|
||||
esp_rom_spiflash_result_t esp_rom_spiflash_config_readmode(esp_rom_spiflash_read_mode_t mode, bool legacy);
|
||||
|
||||
/**
|
||||
* @brief Config SPI Flash read mode when Flash is running in some mode.
|
||||
* Please do not call this function in SDK.
|
||||
*
|
||||
* @param SpiFlashRdMode mode : QIO/QOUT/DIO/DOUT/FastRD/SlowRD.
|
||||
* @param esp_rom_spiflash_read_mode_t mode : QIO/QOUT/DIO/DOUT/FastRD/SlowRD.
|
||||
*
|
||||
* @return SPI_FLASH_RESULT_OK : config OK.
|
||||
* SPI_FLASH_RESULT_ERR : config error.
|
||||
* SPI_FLASH_RESULT_TIMEOUT : config timeout.
|
||||
* @return ESP_ROM_SPIFLASH_RESULT_OK : config OK.
|
||||
* ESP_ROM_SPIFLASH_RESULT_ERR : config error.
|
||||
* ESP_ROM_SPIFLASH_RESULT_TIMEOUT : config timeout.
|
||||
*/
|
||||
SpiFlashOpResult SPIMasterReadModeCnfig(SpiFlashRdMode mode);
|
||||
esp_rom_spiflash_result_t esp_rom_spiflash_master_config_readmode(esp_rom_spiflash_read_mode_t mode);
|
||||
|
||||
/**
|
||||
* @brief Config SPI Flash clock divisor.
|
||||
@ -307,23 +307,23 @@ SpiFlashOpResult SPIMasterReadModeCnfig(SpiFlashRdMode mode);
|
||||
*
|
||||
* @param uint8_t spi: 0 for SPI0, 1 for SPI1.
|
||||
*
|
||||
* @return SPI_FLASH_RESULT_OK : config OK.
|
||||
* SPI_FLASH_RESULT_ERR : config error.
|
||||
* SPI_FLASH_RESULT_TIMEOUT : config timeout.
|
||||
* @return ESP_ROM_SPIFLASH_RESULT_OK : config OK.
|
||||
* ESP_ROM_SPIFLASH_RESULT_ERR : config error.
|
||||
* ESP_ROM_SPIFLASH_RESULT_TIMEOUT : config timeout.
|
||||
*/
|
||||
SpiFlashOpResult SPIClkConfig(uint8_t freqdiv, uint8_t spi);
|
||||
esp_rom_spiflash_result_t esp_rom_spiflash_config_clk(uint8_t freqdiv, uint8_t spi);
|
||||
|
||||
/**
|
||||
* @brief Send CommonCmd to Flash so that is can go into QIO mode, some Flash use different CMD.
|
||||
* Please do not call this function in SDK.
|
||||
*
|
||||
* @param SpiCommonCmd *cmd : A struct to show the action of a command.
|
||||
* @param esp_rom_spiflash_common_cmd_t *cmd : A struct to show the action of a command.
|
||||
*
|
||||
* @return uint16_t 0 : do not send command any more.
|
||||
* 1 : go to the next command.
|
||||
* n > 1 : skip (n - 1) commands.
|
||||
*/
|
||||
uint16_t SPI_Common_Command(SpiCommonCmd *cmd);
|
||||
uint16_t esp_rom_spiflash_common_cmd(esp_rom_spiflash_common_cmd_t *cmd);
|
||||
|
||||
/**
|
||||
* @brief Unlock SPI write protect.
|
||||
@ -331,11 +331,11 @@ uint16_t SPI_Common_Command(SpiCommonCmd *cmd);
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
* @return SPI_FLASH_RESULT_OK : Unlock OK.
|
||||
* SPI_FLASH_RESULT_ERR : Unlock error.
|
||||
* SPI_FLASH_RESULT_TIMEOUT : Unlock timeout.
|
||||
* @return ESP_ROM_SPIFLASH_RESULT_OK : Unlock OK.
|
||||
* ESP_ROM_SPIFLASH_RESULT_ERR : Unlock error.
|
||||
* ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Unlock timeout.
|
||||
*/
|
||||
SpiFlashOpResult SPIUnlock(void);
|
||||
esp_rom_spiflash_result_t esp_rom_spiflash_unlock(void);
|
||||
|
||||
/**
|
||||
* @brief SPI write protect.
|
||||
@ -343,11 +343,11 @@ SpiFlashOpResult SPIUnlock(void);
|
||||
*
|
||||
* @param None.
|
||||
*
|
||||
* @return SPI_FLASH_RESULT_OK : Lock OK.
|
||||
* SPI_FLASH_RESULT_ERR : Lock error.
|
||||
* SPI_FLASH_RESULT_TIMEOUT : Lock timeout.
|
||||
* @return ESP_ROM_SPIFLASH_RESULT_OK : Lock OK.
|
||||
* ESP_ROM_SPIFLASH_RESULT_ERR : Lock error.
|
||||
* ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Lock timeout.
|
||||
*/
|
||||
SpiFlashOpResult SPILock(void);
|
||||
esp_rom_spiflash_result_t esp_rom_spiflash_lock(void);
|
||||
|
||||
/**
|
||||
* @brief Update SPI Flash parameter.
|
||||
@ -365,11 +365,12 @@ SpiFlashOpResult SPILock(void);
|
||||
*
|
||||
* @param uint32_t status_mask : The Mask used when read status from Flash(use single CMD).
|
||||
*
|
||||
* @return SPI_FLASH_RESULT_OK : Update OK.
|
||||
* SPI_FLASH_RESULT_ERR : Update error.
|
||||
* SPI_FLASH_RESULT_TIMEOUT : Update timeout.
|
||||
* @return ESP_ROM_SPIFLASH_RESULT_OK : Update OK.
|
||||
* ESP_ROM_SPIFLASH_RESULT_ERR : Update error.
|
||||
* ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Update timeout.
|
||||
*/
|
||||
SpiFlashOpResult SPIParamCfg(uint32_t deviceId, uint32_t chip_size, uint32_t block_size, uint32_t sector_size, uint32_t page_size, uint32_t status_mask);
|
||||
esp_rom_spiflash_result_t esp_rom_spiflash_config_param(uint32_t deviceId, uint32_t chip_size, uint32_t block_size,
|
||||
uint32_t sector_size, uint32_t page_size, uint32_t status_mask);
|
||||
|
||||
/**
|
||||
* @brief Erase whole flash chip.
|
||||
@ -377,11 +378,11 @@ SpiFlashOpResult SPIParamCfg(uint32_t deviceId, uint32_t chip_size, uint32_t blo
|
||||
*
|
||||
* @param None
|
||||
*
|
||||
* @return SPI_FLASH_RESULT_OK : Erase OK.
|
||||
* SPI_FLASH_RESULT_ERR : Erase error.
|
||||
* SPI_FLASH_RESULT_TIMEOUT : Erase timeout.
|
||||
* @return ESP_ROM_SPIFLASH_RESULT_OK : Erase OK.
|
||||
* ESP_ROM_SPIFLASH_RESULT_ERR : Erase error.
|
||||
* ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Erase timeout.
|
||||
*/
|
||||
SpiFlashOpResult SPIEraseChip(void);
|
||||
esp_rom_spiflash_result_t esp_rom_spiflash_erase_chip(void);
|
||||
|
||||
/**
|
||||
* @brief Erase a 64KB block of flash
|
||||
@ -390,11 +391,11 @@ SpiFlashOpResult SPIEraseChip(void);
|
||||
*
|
||||
* @param uint32_t block_num : Which block to erase.
|
||||
*
|
||||
* @return SPI_FLASH_RESULT_OK : Erase OK.
|
||||
* SPI_FLASH_RESULT_ERR : Erase error.
|
||||
* SPI_FLASH_RESULT_TIMEOUT : Erase timeout.
|
||||
* @return ESP_ROM_SPIFLASH_RESULT_OK : Erase OK.
|
||||
* ESP_ROM_SPIFLASH_RESULT_ERR : Erase error.
|
||||
* ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Erase timeout.
|
||||
*/
|
||||
SpiFlashOpResult SPIEraseBlock(uint32_t block_num);
|
||||
esp_rom_spiflash_result_t esp_rom_spiflash_erase_block(uint32_t block_num);
|
||||
|
||||
/**
|
||||
* @brief Erase a sector of flash.
|
||||
@ -403,11 +404,11 @@ SpiFlashOpResult SPIEraseBlock(uint32_t block_num);
|
||||
*
|
||||
* @param uint32_t sector_num : Which sector to erase.
|
||||
*
|
||||
* @return SPI_FLASH_RESULT_OK : Erase OK.
|
||||
* SPI_FLASH_RESULT_ERR : Erase error.
|
||||
* SPI_FLASH_RESULT_TIMEOUT : Erase timeout.
|
||||
* @return ESP_ROM_SPIFLASH_RESULT_OK : Erase OK.
|
||||
* ESP_ROM_SPIFLASH_RESULT_ERR : Erase error.
|
||||
* ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Erase timeout.
|
||||
*/
|
||||
SpiFlashOpResult SPIEraseSector(uint32_t sector_num);
|
||||
esp_rom_spiflash_result_t esp_rom_spiflash_erase_sector(uint32_t sector_num);
|
||||
|
||||
/**
|
||||
* @brief Erase some sectors.
|
||||
@ -417,11 +418,11 @@ SpiFlashOpResult SPIEraseSector(uint32_t sector_num);
|
||||
*
|
||||
* @param uint32_t area_len : Length to erase, should be sector aligned.
|
||||
*
|
||||
* @return SPI_FLASH_RESULT_OK : Erase OK.
|
||||
* SPI_FLASH_RESULT_ERR : Erase error.
|
||||
* SPI_FLASH_RESULT_TIMEOUT : Erase timeout.
|
||||
* @return ESP_ROM_SPIFLASH_RESULT_OK : Erase OK.
|
||||
* ESP_ROM_SPIFLASH_RESULT_ERR : Erase error.
|
||||
* ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Erase timeout.
|
||||
*/
|
||||
SpiFlashOpResult SPIEraseArea(uint32_t start_addr, uint32_t area_len);
|
||||
esp_rom_spiflash_result_t esp_rom_spiflash_erase_area(uint32_t start_addr, uint32_t area_len);
|
||||
|
||||
/**
|
||||
* @brief Write Data to Flash, you should Erase it yourself if need.
|
||||
@ -433,11 +434,11 @@ SpiFlashOpResult SPIEraseArea(uint32_t start_addr, uint32_t area_len);
|
||||
*
|
||||
* @param uint32_t len : Length to write, should be 4 bytes aligned.
|
||||
*
|
||||
* @return SPI_FLASH_RESULT_OK : Write OK.
|
||||
* SPI_FLASH_RESULT_ERR : Write error.
|
||||
* SPI_FLASH_RESULT_TIMEOUT : Write timeout.
|
||||
* @return ESP_ROM_SPIFLASH_RESULT_OK : Write OK.
|
||||
* ESP_ROM_SPIFLASH_RESULT_ERR : Write error.
|
||||
* ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Write timeout.
|
||||
*/
|
||||
SpiFlashOpResult SPIWrite(uint32_t dest_addr, const uint32_t *src, int32_t len);
|
||||
esp_rom_spiflash_result_t esp_rom_spiflash_write(uint32_t dest_addr, const uint32_t *src, int32_t len);
|
||||
|
||||
/**
|
||||
* @brief Read Data from Flash, you should Erase it yourself if need.
|
||||
@ -449,11 +450,11 @@ SpiFlashOpResult SPIWrite(uint32_t dest_addr, const uint32_t *src, int32_t len);
|
||||
*
|
||||
* @param uint32_t len : Length to read, should be 4 bytes aligned.
|
||||
*
|
||||
* @return SPI_FLASH_RESULT_OK : Read OK.
|
||||
* SPI_FLASH_RESULT_ERR : Read error.
|
||||
* SPI_FLASH_RESULT_TIMEOUT : Read timeout.
|
||||
* @return ESP_ROM_SPIFLASH_RESULT_OK : Read OK.
|
||||
* ESP_ROM_SPIFLASH_RESULT_ERR : Read error.
|
||||
* ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Read timeout.
|
||||
*/
|
||||
SpiFlashOpResult SPIRead(uint32_t src_addr, uint32_t *dest, int32_t len);
|
||||
esp_rom_spiflash_result_t esp_rom_spiflash_read(uint32_t src_addr, uint32_t *dest, int32_t len);
|
||||
|
||||
/**
|
||||
* @brief SPI1 go into encrypto mode.
|
||||
@ -463,7 +464,7 @@ SpiFlashOpResult SPIRead(uint32_t src_addr, uint32_t *dest, int32_t len);
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
void SPI_Write_Encrypt_Enable(void);
|
||||
void esp_rom_spiflash_write_encrypted_enable(void);
|
||||
|
||||
/**
|
||||
* @brief Prepare 32 Bytes data to encrpto writing, you should Erase it yourself if need.
|
||||
@ -473,11 +474,11 @@ void SPI_Write_Encrypt_Enable(void);
|
||||
*
|
||||
* @param uint32_t *data : The pointer to data which is to write.
|
||||
*
|
||||
* @return SPI_FLASH_RESULT_OK : Prepare OK.
|
||||
* SPI_FLASH_RESULT_ERR : Prepare error.
|
||||
* SPI_FLASH_RESULT_TIMEOUT : Prepare timeout.
|
||||
* @return ESP_ROM_SPIFLASH_RESULT_OK : Prepare OK.
|
||||
* ESP_ROM_SPIFLASH_RESULT_ERR : Prepare error.
|
||||
* ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Prepare timeout.
|
||||
*/
|
||||
SpiFlashOpResult SPI_Prepare_Encrypt_Data(uint32_t flash_addr, uint32_t *data);
|
||||
esp_rom_spiflash_result_t esp_rom_spiflash_prepare_encrypted_data(uint32_t flash_addr, uint32_t *data);
|
||||
|
||||
/**
|
||||
* @brief SPI1 go out of encrypto mode.
|
||||
@ -487,7 +488,7 @@ SpiFlashOpResult SPI_Prepare_Encrypt_Data(uint32_t flash_addr, uint32_t *data);
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
void SPI_Write_Encrypt_Disable(void);
|
||||
void esp_rom_spiflash_write_encrypted_disable(void);
|
||||
|
||||
/**
|
||||
* @brief Write data to flash with transparent encryption.
|
||||
@ -503,11 +504,11 @@ void SPI_Write_Encrypt_Disable(void);
|
||||
*
|
||||
* @param uint32_t len : Length to write, should be 32 bytes aligned.
|
||||
*
|
||||
* @return SPI_FLASH_RESULT_OK : Data written successfully.
|
||||
* SPI_FLASH_RESULT_ERR : Encryption write error.
|
||||
* SPI_FLASH_RESULT_TIMEOUT : Encrypto write timeout.
|
||||
* @return ESP_ROM_SPIFLASH_RESULT_OK : Data written successfully.
|
||||
* ESP_ROM_SPIFLASH_RESULT_ERR : Encryption write error.
|
||||
* ESP_ROM_SPIFLASH_RESULT_TIMEOUT : Encrypto write timeout.
|
||||
*/
|
||||
SpiFlashOpResult SPI_Encrypt_Write(uint32_t flash_addr, uint32_t *data, uint32_t len);
|
||||
esp_rom_spiflash_result_t esp_rom_spiflash_write_encrypted(uint32_t flash_addr, uint32_t *data, uint32_t len);
|
||||
|
||||
|
||||
/** @brief Wait until SPI flash write operation is complete
|
||||
@ -517,16 +518,16 @@ SpiFlashOpResult SPI_Encrypt_Write(uint32_t flash_addr, uint32_t *data, uint32_t
|
||||
* Reads the Write In Progress bit of the SPI flash status register,
|
||||
* repeats until this bit is zero (indicating write complete).
|
||||
*
|
||||
* @return SPI_FLASH_RESULT_OK : Write is complete
|
||||
* SPI_FLASH_RESULT_ERR : Error while reading status.
|
||||
* @return ESP_ROM_SPIFLASH_RESULT_OK : Write is complete
|
||||
* ESP_ROM_SPIFLASH_RESULT_ERR : Error while reading status.
|
||||
*/
|
||||
SpiFlashOpResult SPI_Wait_Idle(SpiFlashChip *spi);
|
||||
esp_rom_spiflash_result_t esp_rom_spiflash_wait_idle(esp_rom_spiflash_chip_t *spi);
|
||||
|
||||
|
||||
/** @brief Global SpiFlashChip structure used by ROM functions
|
||||
/** @brief Global esp_rom_spiflash_chip_t structure used by ROM functions
|
||||
*
|
||||
*/
|
||||
extern SpiFlashChip g_rom_flashchip;
|
||||
extern esp_rom_spiflash_chip_t g_rom_flashchip;
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
@ -1,102 +0,0 @@
|
||||
// Copyright 2010-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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef _SOC_BB_REG_H_
|
||||
#define _SOC_BB_REG_H_
|
||||
|
||||
#define apb_bb_offset 0x6001c000
|
||||
|
||||
#define BB_DLY apb_bb_offset + 0x00009b00 // reg 00
|
||||
#define BB_TEST apb_bb_offset + 0x00009b08 // reg 02
|
||||
#define BB_TM1 apb_bb_offset + 0x00009b0c // reg 03
|
||||
#define BB_TM_CNTL apb_bb_offset + 0x00009b14 // reg 05
|
||||
#define BB_DEL_CNTL apb_bb_offset + 0x00009b28 // reg 10
|
||||
#define BB_PARAL_CNTL apb_bb_offset + 0x00009b2c // reg 11
|
||||
#define BB_FSM1 apb_bb_offset + 0x00009b44 // reg 17
|
||||
#define BB_MXG apb_bb_offset + 0x00009b48 // reg 18
|
||||
#define BB_MNOF apb_bb_offset + 0x00009b4c // reg 19
|
||||
#define BB_SIZE apb_bb_offset + 0x00009b50 // reg 20
|
||||
#define BB_TM3a apb_bb_offset + 0x00009b54 // reg 21
|
||||
#define BB_TM4a apb_bb_offset + 0x00009b58 // reg 22
|
||||
#define BB_GAIN apb_bb_offset + 0x00009b5c // reg 23
|
||||
#define BB_CNTL apb_bb_offset + 0x00009b60 // reg 24
|
||||
#define BB_CAD apb_bb_offset + 0x00009b64 // reg 25
|
||||
#define BB_DET apb_bb_offset + 0x00009b68 // reg 26
|
||||
#define BB_DETL apb_bb_offset + 0x00009b6c // reg 27
|
||||
|
||||
#define BB_MASK_PCLL apb_bb_offset + 0x00009d08 // reg 66
|
||||
#define BB_MASK_PCLH apb_bb_offset + 0x00009d0c // reg 67
|
||||
#define BB_RX_CTRL4 apb_bb_offset + 0x00009d10 // reg 68
|
||||
#define BB_RX_CTRL apb_bb_offset + 0x00009d1c // reg 71
|
||||
#define BB_RX_CTRL2 apb_bb_offset + 0x00009d20 // reg 72
|
||||
#define BB_RX_CTRL3 apb_bb_offset + 0x00009d24 // reg 73
|
||||
#define BB_DEL4 apb_bb_offset + 0x00009d40 // reg 80
|
||||
#define BB_TM5 apb_bb_offset + 0x00009d44 // reg 81
|
||||
#define BB_TM6 apb_bb_offset + 0x00009d48 // reg 82
|
||||
#define BB_PMCTRL apb_bb_offset + 0x00009d4c // reg 83
|
||||
#define BB_PWR apb_bb_offset + 0x00009d68 // reg 90
|
||||
#define BB_BCTRL2 apb_bb_offset + 0x00009d70 // reg 92
|
||||
|
||||
#define BB_MASK_PL apb_bb_offset + 0x00009884 // reg 97
|
||||
#define BB_MASK_PCHL apb_bb_offset + 0x00009888 // reg 98
|
||||
#define BB_MASK_PCHH apb_bb_offset + 0x0000988c // reg 99
|
||||
|
||||
#define BB_MASK_CL apb_bb_offset + 0x0000989c // reg 103
|
||||
#define BB_TONE apb_bb_offset + 0x000098a0 // reg 104
|
||||
#define BB_MASK_CH apb_bb_offset + 0x000098d4 // reg 117
|
||||
#define BB_SER apb_bb_offset + 0x000098ec // reg 123
|
||||
#define BB_GN_TB apb_bb_offset + 0x00009e00 // reg 128
|
||||
|
||||
#define BB_MODE apb_bb_offset + 0x00009c00 // reg 640
|
||||
#define BB_TXCTRL apb_bb_offset + 0x00009c04 // reg 641
|
||||
#define BB_BCTRL3 apb_bb_offset + 0x00009c08 // reg 642
|
||||
#define BB_BCTRL apb_bb_offset + 0x00009c28 // reg 650
|
||||
#define BB_SMCTRL apb_bb_offset + 0x00009c48 // reg 658
|
||||
#define BB_SMCTRL2 apb_bb_offset + 0x00009c4C // reg 659
|
||||
#define BB_TXCNT apb_bb_offset + 0x00009c58 // reg 662
|
||||
#define BB_RXCTRL apb_bb_offset + 0x00009c68 // reg 666
|
||||
|
||||
#define BB_TXGAIN apb_bb_offset + 0x00009900 // reg 704
|
||||
|
||||
#define BB_RXS_CNTL apb_bb_offset + 0x00009988 // reg 738
|
||||
#define BB_MASK2_PCLL apb_bb_offset + 0x000099a8 // reg 746
|
||||
#define BB_MASK2_PCLH apb_bb_offset + 0x000099ac // reg 747
|
||||
#define BB_MASK_PH apb_bb_offset + 0x000099b0 // reg 748
|
||||
#define BB_MASK2_PCHL apb_bb_offset + 0x000099b8 // reg 750
|
||||
#define BB_MASK2_PCHH apb_bb_offset + 0x000099bc // reg 751
|
||||
//
|
||||
#define BB_TX_TONE_CNTL apb_bb_offset + 0x000099f0 // reg 764
|
||||
#define BB_ADD_CNTL0 apb_bb_offset + 0x00009a28 // reg 778
|
||||
#define BB_ADD_CNTL2 apb_bb_offset + 0x00009a2c // reg 779
|
||||
#define BB_GAIN_CNTL0 apb_bb_offset + 0x00009a34 // reg 781
|
||||
#define BB_GAIN_CNTL1 apb_bb_offset + 0x00009a38 // reg 782
|
||||
#define BB_GAIN_CNTL2 apb_bb_offset + 0x00009a3c // reg 783
|
||||
#define BB_AGCMEM_CTRL apb_bb_offset + 0x00009a68 // reg 794
|
||||
|
||||
#define BB_11B_RECORD apb_bb_offset + 0x00009808 // reg 802
|
||||
#define BB_FILTER_CNTL apb_bb_offset + 0x0000980c // reg 803
|
||||
#define BB_ANALOG_CTRL1 apb_bb_offset + 0x00009838
|
||||
#define BB_ANALOG_CTRL2 apb_bb_offset + 0x0000983c //reg 815
|
||||
#define BB_ANALOG_CTRL3 apb_bb_offset + 0x00009840 //reg 816
|
||||
#define BB_RFCFG_CTRL0 apb_bb_offset + 0x00009844 //reg 817
|
||||
#define BB_RFCFG_CTRL1 apb_bb_offset + 0x00009848 //reg 818
|
||||
|
||||
#define BB_ADD_CNTL1 apb_bb_offset + 0x00009860 //reg824
|
||||
#define BB_PA_CNTL apb_bb_offset + 0x00009864 //reg825
|
||||
#define BB_RFCFG_CTRL2 apb_bb_offset + 0x0000986c //reg827
|
||||
#define BB_RXDEL_CTRL apb_bb_offset + 0x00009d18
|
||||
#define BB_RXLENGTH_CTRL apb_bb_offset + 0x00009d1c
|
||||
|
||||
#endif /* _SOC_BB_REG_H_ */
|
||||
|
@ -1,104 +0,0 @@
|
||||
// Copyright 2010-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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef _SOC_BOOT_MODE_H_
|
||||
#define _SOC_BOOT_MODE_H_
|
||||
|
||||
#include "soc.h"
|
||||
|
||||
/*SPI Boot*/
|
||||
#define IS_1XXXX(v) (((v)&0x10)==0x10)
|
||||
|
||||
/*HSPI Boot*/
|
||||
#define IS_010XX(v) (((v)&0x1c)==0x08)
|
||||
|
||||
/*Download Boot, SDIO/UART0/UART1*/
|
||||
#define IS_00XXX(v) (((v)&0x18)==0x00)
|
||||
|
||||
/*Download Boot, SDIO/UART0/UART1,FEI_FEO V2*/
|
||||
#define IS_00X00(v) (((v)&0x1b)==0x00)
|
||||
|
||||
/*Download Boot, SDIO/UART0/UART1,FEI_REO V2*/
|
||||
#define IS_00X01(v) (((v)&0x1b)==0x01)
|
||||
|
||||
/*Download Boot, SDIO/UART0/UART1,REI_FEO V2*/
|
||||
#define IS_00X10(v) (((v)&0x1b)==0x02)
|
||||
|
||||
/*Download Boot, SDIO/UART0/UART1,REI_FEO V2*/
|
||||
#define IS_00X11(v) (((v)&0x1b)==0x03)
|
||||
|
||||
/*ATE/ANALOG Mode*/
|
||||
#define IS_01110(v) (((v)&0x1f)==0x0e)
|
||||
|
||||
/*Diagnostic Mode+UART0 download Mode*/
|
||||
#define IS_01111(v) (((v)&0x1f)==0x0f)
|
||||
|
||||
/*legacy SPI Boot*/
|
||||
#define IS_01100(v) (((v)&0x1f)==0x0c)
|
||||
|
||||
/*SDIO_Slave download Mode V1.1*/
|
||||
#define IS_01101(v) (((v)&0x1f)==0x0d)
|
||||
|
||||
|
||||
|
||||
#define BOOT_MODE_GET() (GPIO_REG_READ(GPIO_STRAP))
|
||||
|
||||
/*do not include download mode*/
|
||||
#define ETS_IS_UART_BOOT() IS_01111(BOOT_MODE_GET())
|
||||
|
||||
/*all spi boot including spi/hspi/legacy*/
|
||||
#define ETS_IS_FLASH_BOOT() (IS_1XXXX(BOOT_MODE_GET()) || IS_010XX(BOOT_MODE_GET()) || IS_01100(BOOT_MODE_GET()))
|
||||
|
||||
/*all faster spi boot including spi/hspi*/
|
||||
#define ETS_IS_FAST_FLASH_BOOT() (IS_1XXXX(BOOT_MODE_GET()) || IS_010XX(BOOT_MODE_GET()))
|
||||
|
||||
/*all spi boot including spi/legacy*/
|
||||
#define ETS_IS_SPI_FLASH_BOOT() (IS_1XXXX(BOOT_MODE_GET()) || IS_01100(BOOT_MODE_GET()))
|
||||
|
||||
/*all spi boot including hspi/legacy*/
|
||||
#define ETS_IS_HSPI_FLASH_BOOT() IS_010XX(BOOT_MODE_GET())
|
||||
|
||||
/*all sdio V2 of failing edge input, failing edge output*/
|
||||
#define ETS_IS_SDIO_FEI_FEO_V2_BOOT() IS_00X00(BOOT_MODE_GET())
|
||||
|
||||
/*all sdio V2 of failing edge input, raising edge output*/
|
||||
#define ETS_IS_SDIO_FEI_REO_V2_BOOT() IS_00X01(BOOT_MODE_GET())
|
||||
|
||||
/*all sdio V2 of raising edge input, failing edge output*/
|
||||
#define ETS_IS_SDIO_REI_FEO_V2_BOOT() IS_00X10(BOOT_MODE_GET())
|
||||
|
||||
/*all sdio V2 of raising edge input, raising edge output*/
|
||||
#define ETS_IS_SDIO_REI_REO_V2_BOOT() IS_00X11(BOOT_MODE_GET())
|
||||
|
||||
/*all sdio V1 of raising edge input, failing edge output*/
|
||||
#define ETS_IS_SDIO_REI_FEO_V1_BOOT() IS_01101(BOOT_MODE_GET())
|
||||
|
||||
/*do not include download mode*/
|
||||
#define ETS_IS_SDIO_BOOT() IS_01101(BOOT_MODE_GET())
|
||||
|
||||
/*joint download boot*/
|
||||
#define ETS_IS_SDIO_UART_BOOT() IS_00XXX(BOOT_MODE_GET())
|
||||
|
||||
/*ATE mode*/
|
||||
#define ETS_IS_ATE_BOOT() IS_01110(BOOT_MODE_GET())
|
||||
|
||||
/*A bit to control flash boot print*/
|
||||
#define ETS_IS_PRINT_BOOT() (BOOT_MODE_GET() & 0x2)
|
||||
|
||||
/*used by ETS_IS_SDIO_UART_BOOT*/
|
||||
#define SEL_NO_BOOT 0
|
||||
#define SEL_SDIO_BOOT BIT0
|
||||
#define SEL_UART_BOOT BIT1
|
||||
|
||||
#endif /* _SOC_BOOT_MODE_H_ */
|
@ -1,106 +0,0 @@
|
||||
// Copyright 2010-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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef _SOC_CPU_H
|
||||
#define _SOC_CPU_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include "xtensa/corebits.h"
|
||||
|
||||
/* C macros for xtensa special register read/write/exchange */
|
||||
|
||||
#define RSR(reg, curval) asm volatile ("rsr %0, " #reg : "=r" (curval));
|
||||
#define WSR(reg, newval) asm volatile ("wsr %0, " #reg : : "r" (newval));
|
||||
#define XSR(reg, swapval) asm volatile ("xsr %0, " #reg : "+r" (swapval));
|
||||
|
||||
/** @brief Read current stack pointer address
|
||||
*
|
||||
*/
|
||||
static inline void *get_sp()
|
||||
{
|
||||
void *sp;
|
||||
asm volatile ("mov %0, sp;" : "=r" (sp));
|
||||
return sp;
|
||||
}
|
||||
|
||||
/* Functions to set page attributes for Region Protection option in the CPU.
|
||||
* See Xtensa ISA Reference manual for explanation of arguments (section 4.6.3.2).
|
||||
*/
|
||||
|
||||
static inline void cpu_write_dtlb(uint32_t vpn, unsigned attr)
|
||||
{
|
||||
asm volatile ("wdtlb %1, %0; dsync\n" :: "r" (vpn), "r" (attr));
|
||||
}
|
||||
|
||||
|
||||
static inline void cpu_write_itlb(unsigned vpn, unsigned attr)
|
||||
{
|
||||
asm volatile ("witlb %1, %0; isync\n" :: "r" (vpn), "r" (attr));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Configure memory region protection
|
||||
*
|
||||
* Make page 0 access raise an exception.
|
||||
* Also protect some other unused pages so we can catch weirdness.
|
||||
* Useful attribute values:
|
||||
* 0 — cached, RW
|
||||
* 2 — bypass cache, RWX (default value after CPU reset)
|
||||
* 15 — no access, raise exception
|
||||
*/
|
||||
|
||||
static inline void cpu_configure_region_protection()
|
||||
{
|
||||
const uint32_t pages_to_protect[] = {0x00000000, 0x80000000, 0xa0000000, 0xc0000000, 0xe0000000};
|
||||
for (int i = 0; i < sizeof(pages_to_protect)/sizeof(pages_to_protect[0]); ++i) {
|
||||
cpu_write_dtlb(pages_to_protect[i], 0xf);
|
||||
cpu_write_itlb(pages_to_protect[i], 0xf);
|
||||
}
|
||||
cpu_write_dtlb(0x20000000, 0);
|
||||
cpu_write_itlb(0x20000000, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set CPU frequency to the value defined in menuconfig
|
||||
*
|
||||
* Called from cpu_start.c, not intended to be called from other places.
|
||||
* This is a temporary function which will be replaced once dynamic
|
||||
* CPU frequency changing is implemented.
|
||||
*/
|
||||
void esp_set_cpu_freq(void);
|
||||
|
||||
/**
|
||||
* @brief Stall CPU using RTC controller
|
||||
* @param cpu_id ID of the CPU to stall (0 = PRO, 1 = APP)
|
||||
*/
|
||||
void esp_cpu_stall(int cpu_id);
|
||||
|
||||
/**
|
||||
* @brief Un-stall CPU using RTC controller
|
||||
* @param cpu_id ID of the CPU to un-stall (0 = PRO, 1 = APP)
|
||||
*/
|
||||
void esp_cpu_unstall(int cpu_id);
|
||||
|
||||
/**
|
||||
* @brief Returns true if a JTAG debugger is attached to CPU
|
||||
* OCD (on chip debug) port.
|
||||
*
|
||||
* @note If "Make exception and panic handlers JTAG/OCD aware"
|
||||
* is disabled, this function always returns false.
|
||||
*/
|
||||
bool esp_cpu_in_ocd_debug_mode();
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,101 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _EMAC_EX_H_
|
||||
#define _EMAC_EX_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "soc.h"
|
||||
#define REG_EMAC_EX_BASE (DR_REG_EMAC_BASE + 0x800)
|
||||
|
||||
#define EMAC_EX_CLKOUT_CONF_REG (REG_EMAC_EX_BASE + 0x0000)
|
||||
#define EMAC_EX_CLK_OUT_DLY_NUM 0x00000003
|
||||
#define EMAC_EX_CLK_OUT_DLY_NUM_S 8
|
||||
#define EMAC_EX_CLK_OUT_H_DIV_NUM 0x0000000F
|
||||
#define EMAC_EX_CLK_OUT_H_DIV_NUM_S 4
|
||||
#define EMAC_EX_CLK_OUT_DIV_NUM 0x0000000F
|
||||
#define EMAC_EX_CLK_OUT_DIV_NUM_S 0
|
||||
|
||||
#define EMAC_EX_OSCCLK_CONF_REG (REG_EMAC_EX_BASE + 0x0004)
|
||||
#define EMAC_EX_OSC_CLK_SEL (BIT(24))
|
||||
#define EMAC_EX_OSC_CLK_SEL_S 24
|
||||
#define EMAC_EX_OSC_H_DIV_NUM_100M 0x0000003F
|
||||
#define EMAC_EX_OSC_H_DIV_NUM_100M_S 18
|
||||
#define EMAC_EX_OSC_DIV_NUM_100M 0x0000003F
|
||||
#define EMAC_EX_OSC_DIV_NUM_100M_S 12
|
||||
#define EMAC_EX_OSC_H_DIV_NUM_10M 0x0000003F
|
||||
#define EMAC_EX_OSC_H_DIV_NUM_10M_S 6
|
||||
#define EMAC_EX_OSC_DIV_NUM_10M 0x0000003F
|
||||
#define EMAC_EX_OSC_DIV_NUM_10M_S 0
|
||||
|
||||
#define EMAC_EX_CLK_CTRL_REG (REG_EMAC_EX_BASE + 0x0008)
|
||||
#define EMAC_EX_CLK_EN (BIT(5))
|
||||
#define EMAC_EX_CLK_EN_S 5
|
||||
#define EMAC_EX_MII_CLK_RX_EN (BIT(4))
|
||||
#define EMAC_EX_MII_CLK_RX_EN_S 4
|
||||
#define EMAC_EX_MII_CLK_TX_EN (BIT(3))
|
||||
#define EMAC_EX_MII_CLK_TX_EN_S 3
|
||||
#define EMAC_EX_RX_125_CLK_EN (BIT(2))
|
||||
#define EMAC_EX_RX_125_CLK_EN_S 2
|
||||
#define EMAC_EX_INT_OSC_EN (BIT(1))
|
||||
#define EMAC_EX_INT_OSC_EN_S 1
|
||||
#define EMAC_EX_EXT_OSC_EN (BIT(0))
|
||||
#define EMAC_EX_EXT_OSC_EN_S 0
|
||||
|
||||
#define EMAC_EX_PHYINF_CONF_REG (REG_EMAC_EX_BASE + 0x000c)
|
||||
#define EMAC_EX_TX_ERR_OUT_EN (BIT(20))
|
||||
#define EMAC_EX_TX_ERR_OUT_EN_S 20
|
||||
#define EMAC_EX_SCR_SMI_DLY_RX_SYNC (BIT(19))
|
||||
#define EMAC_EX_SCR_SMI_DLY_RX_SYNC_S 19
|
||||
#define EMAC_EX_PMT_CTRL_EN (BIT(18))
|
||||
#define EMAC_EX_PMT_CTRL_EN_S 18
|
||||
#define EMAC_EX_SBD_CLK_GATING_EN (BIT(17))
|
||||
#define EMAC_EX_SBD_CLK_GATING_EN_S 17
|
||||
#define EMAC_EX_SS_MODE (BIT(16))
|
||||
#define EMAC_EX_SS_MODE_S 16
|
||||
#define EMAC_EX_PHY_INTF_SEL 0x00000007
|
||||
#define EMAC_EX_PHY_INTF_SEL_S 13
|
||||
#define EMAC_EX_REVMII_PHY_ADDR 0x0000001F
|
||||
#define EMAC_EX_REVMII_PHY_ADDR_S 8
|
||||
#define EMAC_EX_CORE_PHY_ADDR 0x0000001F
|
||||
#define EMAC_EX_CORE_PHY_ADDR_S 3
|
||||
#define EMAC_EX_SBD_FLOWCTRL (BIT(2))
|
||||
#define EMAC_EX_SBD_FLOWCTRL_S 2
|
||||
#define EMAC_EX_EXT_REVMII_RX_CLK_SEL (BIT(1))
|
||||
#define EMAC_EX_EXT_REVMII_RX_CLK_SEL_S 1
|
||||
#define EMAC_EX_INT_REVMII_RX_CLK_SEL (BIT(0))
|
||||
#define EMAC_EX_INT_REVMII_RX_CLK_SEL_S 0
|
||||
|
||||
#define EMAC_EX_PHY_INTF_RMII 4
|
||||
|
||||
#define EMAC_EX_EMAC_PD_SEL_REG (REG_EMAC_EX_BASE + 0x0010)
|
||||
#define EMAC_EX_RAM_PD_EN 0x00000003
|
||||
#define EMAC_EX_RAM_PD_EN_S 0
|
||||
|
||||
#define EMAC_EX_DATE_REG (REG_EMAC_EX_BASE + 0x00fc)
|
||||
#define EMAC_EX_DATE 0xFFFFFFFF
|
||||
#define EMAC_EX_DATE_S 0
|
||||
#define EMAC_EX_DATE_VERSION 0x16042200
|
||||
|
||||
#define EMAC_CLK_EN_REG 0x3ff000cc
|
||||
#define EMAC_CLK_EN (BIT(14))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -1,714 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef _EMAC_H_
|
||||
#define _EMAC_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "soc.h"
|
||||
#define REG_EMAC_BASE DR_REG_EMAC_BASE
|
||||
|
||||
#define EMAC_DMABUSMODE_REG (REG_EMAC_BASE + 0x0000)
|
||||
#define EMAC_DMAREBINCRBURST (BIT(31))
|
||||
#define EMAC_DMAREBINCRBURST_S 31
|
||||
#define EMAC_DMACHANNELPRIOWT 0x00000003
|
||||
#define EMAC_DMACHANNELPRIOWT_S 28
|
||||
#define EMAC_DMATXRXPRIO (BIT(27))
|
||||
#define EMAC_DMATXRXPRIO_S 27
|
||||
#define EMAC_DMAMIXEDBURST (BIT(26))
|
||||
#define EMAC_DMAMIXEDBURST_S 26
|
||||
#define EMAC_DMAADDRALIBEA (BIT(25))
|
||||
#define EMAC_DMAADDRALIBEA_S 25
|
||||
#define EMAC_PBLX8_MODE (BIT(24))
|
||||
#define EMAC_PBLX8_MODE_S 24
|
||||
#define EMAC_USE_SEP_PBL (BIT(23))
|
||||
#define EMAC_USE_SEP_PBL_S 23
|
||||
#define EMAC_RX_DMA_PBL 0x0000003F
|
||||
#define EMAC_RX_DMA_PBL_S 17
|
||||
#define EMAC_FIXED_BURST (BIT(16))
|
||||
#define EMAC_FIXED_BURST_S 16
|
||||
#define EMAC_PRI_RATIO 0x00000003
|
||||
#define EMAC_PRI_RATIO_S 14
|
||||
#define EMAC_PROG_BURST_LEN 0x0000003F
|
||||
#define EMAC_PROG_BURST_LEN_S 8
|
||||
#define EMAC_ALT_DESC_SIZE (BIT(7))
|
||||
#define EMAC_ALT_DESC_SIZE_S 7
|
||||
#define EMAC_DESC_SKIP_LEN 0x0000001F
|
||||
#define EMAC_DESC_SKIP_LEN_S 2
|
||||
#define EMAC_DMA_ARB_SCH (BIT(1))
|
||||
#define EMAC_DMA_ARB_SCH_S 1
|
||||
#define EMAC_SW_RST (BIT(0))
|
||||
#define EMAC_SW_RST_S 0
|
||||
|
||||
#define EMAC_DMATXPOLLDEMAND_REG (REG_EMAC_BASE + 0x0004)
|
||||
#define EMAC_TRANS_POLL_DEMAND 0xFFFFFFFF
|
||||
#define EMAC_TRANS_POLL_DEMAND_S 0
|
||||
|
||||
#define EMAC_DMARXPOLLDEMAND_REG (REG_EMAC_BASE + 0x0008)
|
||||
#define EMAC_RECV_POLL_DEMAND 0xFFFFFFFF
|
||||
#define EMAC_RECV_POLL_DEMAND_S 0
|
||||
|
||||
#define EMAC_DMARXBASEADDR_REG (REG_EMAC_BASE + 0x000C)
|
||||
#define EMAC_START_RECV_LIST 0xFFFFFFFF
|
||||
#define EMAC_START_RECV_LIST_S 0
|
||||
|
||||
#define EMAC_DMATXBASEADDR_REG (REG_EMAC_BASE + 0x0010)
|
||||
#define EMAC_START_TRANS_LIST 0xFFFFFFFF
|
||||
#define EMAC_START_TRANS_LIST_S 0
|
||||
|
||||
#define EMAC_DMASTATUS_REG (REG_EMAC_BASE + 0x0014)
|
||||
#define EMAC_GMAC_LPI_INT (BIT(30))
|
||||
#define EMAC_GMAC_LPI_INT_S 30
|
||||
#define EMAC_TS_TRI_INT (BIT(29))
|
||||
#define EMAC_TS_TRI_INT_S 29
|
||||
#define EMAC_GMAC_PMT_INT (BIT(28))
|
||||
#define EMAC_GMAC_PMT_INT_S 28
|
||||
#define EMAC_GMAC_MMC_INT (BIT(27))
|
||||
#define EMAC_GMAC_MMC_INT_S 27
|
||||
#define EMAC_GMAC_LINE_INF_INT (BIT(26))
|
||||
#define EMAC_GMAC_LINE_INF_INT_S 26
|
||||
#define EMAC_ERROR_BITS 0x00000007
|
||||
#define EMAC_ERROR_BITS_S 23
|
||||
#define EMAC_TRANS_PROC_STATE 0x00000007
|
||||
#define EMAC_TRANS_PROC_STATE_S 20
|
||||
#define EMAC_RECV_PROC_STATE 0x00000007
|
||||
#define EMAC_RECV_PROC_STATE_S 17
|
||||
#define EMAC_NORM_INT_SUMM (BIT(16))
|
||||
#define EMAC_NORM_INT_SUMM_S 16
|
||||
#define EMAC_ABN_INT_SUMM (BIT(15))
|
||||
#define EMAC_ABN_INT_SUMM_S 15
|
||||
#define EMAC_EARLY_RECV_INT (BIT(14))
|
||||
#define EMAC_EARLY_RECV_INT_S 14
|
||||
#define EMAC_FATAL_BUS_ERR_INT (BIT(13))
|
||||
#define EMAC_FATAL_BUS_ERR_INT_S 13
|
||||
#define EMAC_EARLY_TRANS_INT (BIT(10))
|
||||
#define EMAC_EARLY_TRANS_INT_S 10
|
||||
#define EMAC_RECV_WDT_TO (BIT(9))
|
||||
#define EMAC_RECV_WDT_TO_S 9
|
||||
#define EMAC_RECV_PROC_STOP (BIT(8))
|
||||
#define EMAC_RECV_PROC_STOP_S 8
|
||||
#define EMAC_RECV_BUF_UNAVAIL (BIT(7))
|
||||
#define EMAC_RECV_BUF_UNAVAIL_S 7
|
||||
#define EMAC_RECV_INT (BIT(6))
|
||||
#define EMAC_RECV_INT_S 6
|
||||
#define EMAC_TRANS_UNDFLOW (BIT(5))
|
||||
#define EMAC_TRANS_UNDFLOW_S 5
|
||||
#define EMAC_RECV_OVFLOW (BIT(4))
|
||||
#define EMAC_RECV_OVFLOW_S 4
|
||||
#define EMAC_TRANS_JABBER_TO (BIT(3))
|
||||
#define EMAC_TRANS_JABBER_TO_S 3
|
||||
#define EMAC_TRANS_BUF_UNAVAIL (BIT(2))
|
||||
#define EMAC_TRANS_BUF_UNAVAIL_S 2
|
||||
#define EMAC_TRANS_PROC_STOP (BIT(1))
|
||||
#define EMAC_TRANS_PROC_STOP_S 1
|
||||
#define EMAC_TRANS_INT (BIT(0))
|
||||
#define EMAC_TRANS_INT_S 0
|
||||
|
||||
#define EMAC_DMAOPERATION_MODE_REG (REG_EMAC_BASE + 0x0018)
|
||||
#define EMAC_DIS_DROP_TCPIP_CHKSUM_ERR_FRAM (BIT(26))
|
||||
#define EMAC_DIS_DROP_TCPIP_CHKSUM_ERR_FRAM_S 26
|
||||
#define EMAC_RECV_STORE_FORWARD (BIT(25))
|
||||
#define EMAC_RECV_STORE_FORWARD_S 25
|
||||
#define EMAC_DIS_FLUSH_RECV_FRAMES (BIT(24))
|
||||
#define EMAC_DIS_FLUSH_RECV_FRAMES_S 24
|
||||
#define EMAC_MSB_THRESHOLD_ACTIVATING_FLOW_CONTROL (BIT(23))
|
||||
#define EMAC_MSB_THRESHOLD_ACTIVATING_FLOW_CONTROL_S 23
|
||||
#define EMAC_MSB_THRESHOLD_DEACTIVATING_FLOW_CONTROL (BIT(22))
|
||||
#define EMAC_MSB_THRESHOLD_DEACTIVATING_FLOW_CONTROL_S 22
|
||||
#define EMAC_TRANSMIT_STORE_FORWARD (BIT(21))
|
||||
#define EMAC_TRANSMIT_STORE_FORWARD_S 21
|
||||
#define EMAC_FLUSH_TRANSMIT_FIFO (BIT(20))
|
||||
#define EMAC_FLUSH_TRANSMIT_FIFO_S 20
|
||||
#define EMAC_TRANSMIT_THRESHOLD_CONTROL 0x00000007
|
||||
#define EMAC_TRANSMIT_THRESHOLD_CONTROL_S 14
|
||||
#define EMAC_START_STOP_TRANSMISSION_COMMAND (BIT(13))
|
||||
#define EMAC_START_STOP_TRANSMISSION_COMMAND_S 13
|
||||
#define EMAC_THRESHOLD_DEACTIVATING_FLOW_CONTROL 0x00000003
|
||||
#define EMAC_THRESHOLD_DEACTIVATING_FLOW_CONTROL_S 11
|
||||
#define EMAC_THRESHOLD_ACTIVATING_FLOW_CONTROL 0x00000003
|
||||
#define EMAC_THRESHOLD_ACTIVATING_FLOW_CONTROL_S 9
|
||||
#define EMAC_ENABLE_HW_FLOW_CONTROL (BIT(8))
|
||||
#define EMAC_ENABLE_HW_FLOW_CONTROL_S 8
|
||||
#define EMAC_FORWARD_ERROR_FRAMES (BIT(7))
|
||||
#define EMAC_FORWARD_ERROR_FRAMES_S 7
|
||||
#define EMAC_FORWARD_UNDERSIZED_GOOD_FRAMES (BIT(6))
|
||||
#define EMAC_FORWARD_UNDERSIZED_GOOD_FRAMES_S 6
|
||||
#define EMAC_DROP_GIANT_FRAMES (BIT(5))
|
||||
#define EMAC_DROP_GIANT_FRAMES_S 5
|
||||
#define EMAC_RECEIVE_THRESHOLD_CONTROL 0x00000003
|
||||
#define EMAC_RECEIVE_THRESHOLD_CONTROL_S 3
|
||||
#define EMAC_OPERATE_SECOND_FRAME (BIT(2))
|
||||
#define EMAC_OPERATE_SECOND_FRAME_S 2
|
||||
#define EMAC_START_STOP_RECEIVE (BIT(1))
|
||||
#define EMAC_START_STOP_RECEIVE_S 1
|
||||
|
||||
#define EMAC_DMAINTERRUPT_EN_REG (REG_EMAC_BASE + 0x001C)
|
||||
#define EMAC_NORMAL_INTERRUPT_SUMMARY_ENABLE (BIT(16))
|
||||
#define EMAC_NORMAL_INTERRUPT_SUMMARY_ENABLE_S 16
|
||||
#define EMAC_ABNORMAL_INTERRUPT_SUMMARY_ENABLE (BIT(15))
|
||||
#define EMAC_ABNORMAL_INTERRUPT_SUMMARY_ENABLE_S 15
|
||||
#define EMAC_EARLY_RECEIVE_INTERRUPT_ENABLE (BIT(14))
|
||||
#define EMAC_EARLY_RECEIVE_INTERRUPT_ENABLE_S 14
|
||||
#define EMAC_FATAL_BUS_ERROR_ENABLE (BIT(13))
|
||||
#define EMAC_FATAL_BUS_ERROR_ENABLE_S 13
|
||||
#define EMAC_EARLY_TRANSMIT_INTERRUPT_ENABLE (BIT(10))
|
||||
#define EMAC_EARLY_TRANSMIT_INTERRUPT_ENABLE_S 10
|
||||
#define EMAC_RECEIVE_WATCHDOG_TIMEOUT_ENABLE (BIT(9))
|
||||
#define EMAC_RECEIVE_WATCHDOG_TIMEOUT_ENABLE_S 9
|
||||
#define EMAC_RECEIVE_STOPPED_ENABLE (BIT(8))
|
||||
#define EMAC_RECEIVE_STOPPED_ENABLE_S 8
|
||||
#define EMAC_RECEIVE_BUFFER_UNAVAILABLE_ENABLE (BIT(7))
|
||||
#define EMAC_RECEIVE_BUFFER_UNAVAILABLE_ENABLE_S 7
|
||||
#define EMAC_RECEIVE_INTERRUPT_ENABLE (BIT(6))
|
||||
#define EMAC_RECEIVE_INTERRUPT_ENABLE_S 6
|
||||
#define EMAC_UNDERFLOW_INTERRUPT_ENABLE (BIT(5))
|
||||
#define EMAC_UNDERFLOW_INTERRUPT_ENABLE_S 5
|
||||
#define EMAC_OVERFLOW_INTERRUPT_ENABLE (BIT(4))
|
||||
#define EMAC_OVERFLOW_INTERRUPT_ENABLE_S 4
|
||||
#define EMAC_TRANSMIT_JABBER_TIMEOUT_ENABLE (BIT(3))
|
||||
#define EMAC_TRANSMIT_JABBER_TIMEOUT_ENABLE_S 3
|
||||
#define EMAC_TRANSMIT_BUFFER_UNAVAILABLE_ENABLE (BIT(2))
|
||||
#define EMAC_TRANSMIT_BUFFER_UNAVAILABLE_ENABLE_S 2
|
||||
#define EMAC_TRANSMIT_STOPPED_ENABLE (BIT(1))
|
||||
#define EMAC_TRANSMIT_STOPPED_ENABLE_S 1
|
||||
#define EMAC_TRANSMIT_INTERRUPT_ENABLE (BIT(0))
|
||||
#define EMAC_TRANSMIT_INTERRUPT_ENABLE_S 0
|
||||
|
||||
#define EMAC_DMAMISSEDFR_REG (REG_EMAC_BASE + 0x0020)
|
||||
#define EMAC_OVERFLOW_BIT_FIFO_OVERFLOW_COUNTER (BIT(28))
|
||||
#define EMAC_OVERFLOW_BIT_FIFO_OVERFLOW_COUNTER_S 28
|
||||
#define EMAC_OVERFLOW_FRAME_COUNTER 0x000007FF
|
||||
#define EMAC_OVERFLOW_FRAME_COUNTER_S 17
|
||||
#define EMAC_OVERFLOW_BIT_MISSED_FRAME_COUNTER (BIT(16))
|
||||
#define EMAC_OVERFLOW_BIT_MISSED_FRAME_COUNTER_S 16
|
||||
#define EMAC_MISSED_FRAME_COUNTER 0x0000FFFF
|
||||
#define EMAC_MISSED_FRAME_COUNTER_S 0
|
||||
|
||||
#define EMAC_DMARECEIVE_INTERRUPT_WATCHDOG_TIMER_REG (REG_EMAC_BASE + 0x0024)
|
||||
#define EMAC_RI_WATCHDOG_TIMER_COUNT 0x000000FF
|
||||
#define EMAC_RI_WATCHDOG_TIMER_COUNT_S 0
|
||||
|
||||
#define EMAC_DMATXCURRDESC_REG (REG_EMAC_BASE + 0x0048)
|
||||
#define EMAC_HOST_TRANSMIT_DESCRIPTOR_ADDRESS_POINTER 0xFFFFFFFF
|
||||
#define EMAC_HOST_TRANSMIT_DESCRIPTOR_ADDRESS_POINTER_S 0
|
||||
|
||||
#define EMAC_DMARXCURRDESC_REG (REG_EMAC_BASE + 0x004C)
|
||||
#define EMAC_HOST_RECEIVE_DESCRIPTOR_ADDRESS_POINTER 0xFFFFFFFF
|
||||
#define EMAC_HOST_RECEIVE_DESCRIPTOR_ADDRESS_POINTER_S 0
|
||||
|
||||
#define EMAC_DMATXCURRADDR_BUF_REG (REG_EMAC_BASE + 0x0050)
|
||||
#define EMAC_HOST_TRANSMIT_BUFFER_ADDRESS_POINTER 0xFFFFFFFF
|
||||
#define EMAC_HOST_TRANSMIT_BUFFER_ADDRESS_POINTER_S 0
|
||||
|
||||
#define EMAC_DMARXCURRADDR_BUF_REG (REG_EMAC_BASE + 0x0054)
|
||||
#define EMAC_HOST_RECEIVE_BUFFER_ADDRESS_POINTER 0xFFFFFFFF
|
||||
#define EMAC_HOST_RECEIVE_BUFFER_ADDRESS_POINTER_S 0
|
||||
|
||||
#define EMAC_DMAHWFEATURE_REG (REG_EMAC_BASE + 0x0058)
|
||||
#define EMAC_SELECTED_PHY_INTERFACE 0x00000007
|
||||
#define EMAC_SELECTED_PHY_INTERFACE_S 28
|
||||
#define EMAC_SOURCE_ADDRESS_VLAN_INSERTION (BIT(27))
|
||||
#define EMAC_SOURCE_ADDRESS_VLAN_INSERTION_S 27
|
||||
#define EMAC_FLEXIBLE_PULSE_PER_SECOND_OUTPUT (BIT(26))
|
||||
#define EMAC_FLEXIBLE_PULSE_PER_SECOND_OUTPUT_S 26
|
||||
#define EMAC_TIMESTAMPING_INTERNAL_SYSTEM_TIME (BIT(25))
|
||||
#define EMAC_TIMESTAMPING_INTERNAL_SYSTEM_TIME_S 25
|
||||
#define EMAC_ENHANCED_DESCRIPTOR (BIT(24))
|
||||
#define EMAC_ENHANCED_DESCRIPTOR_S 24
|
||||
#define EMAC_NUMBER_ADDITIONAL_TX_CHANNELS 0x00000003
|
||||
#define EMAC_NUMBER_ADDITIONAL_TX_CHANNELS_S 22
|
||||
#define EMAC_NUMBER_ADDITIONAL_RX_CHANNELS 0x00000003
|
||||
#define EMAC_NUMBER_ADDITIONAL_RX_CHANNELS_S 20
|
||||
#define EMAC_RXFIFOSIZE (BIT(19))
|
||||
#define EMAC_RXFIFOSIZE_S 19
|
||||
#define EMAC_IP_CHECKSUM_OFFLOAD_TYPE2 (BIT(18))
|
||||
#define EMAC_IP_CHECKSUM_OFFLOAD_TYPE2_S 18
|
||||
#define EMAC_IP_CHECKSUM_OFFLOAD_TYPE1 (BIT(17))
|
||||
#define EMAC_IP_CHECKSUM_OFFLOAD_TYPE1_S 17
|
||||
#define EMAC_CHECKSUM_OFFLOAD_TX (BIT(16))
|
||||
#define EMAC_CHECKSUM_OFFLOAD_TX_S 16
|
||||
#define EMAC_AV_FEATURE_SEL (BIT(15))
|
||||
#define EMAC_AV_FEATURE_SEL_S 15
|
||||
#define EMAC_EEE_SEL (BIT(14))
|
||||
#define EMAC_EEE_SEL_S 14
|
||||
#define EMAC_TSVER2_SEL (BIT(13))
|
||||
#define EMAC_TSVER2_SEL_S 13
|
||||
#define EMAC_TSVER1_SEL (BIT(12))
|
||||
#define EMAC_TSVER1_SEL_S 12
|
||||
#define EMAC_MMC_SEL (BIT(11))
|
||||
#define EMAC_MMC_SEL_S 11
|
||||
#define EMAC_MGK_SEL (BIT(10))
|
||||
#define EMAC_MGK_SEL_S 10
|
||||
#define EMAC_RWK_SEL (BIT(9))
|
||||
#define EMAC_RWK_SEL_S 9
|
||||
#define EMAC_SMA_SEL (BIT(8))
|
||||
#define EMAC_SMA_SEL_S 8
|
||||
#define EMAC_L3L4FLTR_EN (BIT(7))
|
||||
#define EMAC_L3L4FLTR_EN_S 7
|
||||
#define EMAC_PCS_SEL (BIT(6))
|
||||
#define EMAC_PCS_SEL_S 6
|
||||
#define EMAC_ADDMACADR_SEL (BIT(5))
|
||||
#define EMAC_ADDMACADR_SEL_S 5
|
||||
#define EMAC_HASH_SEL (BIT(4))
|
||||
#define EMAC_HASH_SEL_S 4
|
||||
#define EMAC_EXTHASH_EN (BIT(3))
|
||||
#define EMAC_EXTHASH_EN_S 3
|
||||
#define EMAC_HD_SEL (BIT(2))
|
||||
#define EMAC_HD_SEL_S 2
|
||||
#define EMAC_GMII_SEL (BIT(1))
|
||||
#define EMAC_GMII_SEL_S 1
|
||||
#define EMAC_MII_SEL (BIT(0))
|
||||
#define EMAC_MII_SEL_S 0
|
||||
|
||||
#define EMAC_DMASLOTFNCTRLSTS_REG (REG_EMAC_BASE + 0x0130)
|
||||
#define EMAC_REFERENCE_SLOT_NUMBER 0x0000000F
|
||||
#define EMAC_REFERENCE_SLOT_NUMBER_S 16
|
||||
#define EMAC_ADVANCE_SLOT_CHECK (BIT(1))
|
||||
#define EMAC_ADVANCE_SLOT_CHECK_S 1
|
||||
#define EMAC_ENABLE_SLOT_COMPARISON (BIT(0))
|
||||
#define EMAC_ENABLE_SLOT_COMPARISON_S 0
|
||||
|
||||
#define EMAC_DMACHANNELCTRL_REG (REG_EMAC_BASE + 0x0160)
|
||||
#define EMAC_AVERAGE_BITS_PER_SLOT_INTERRUPT_ENABLE (BIT(17))
|
||||
#define EMAC_AVERAGE_BITS_PER_SLOT_INTERRUPT_ENABLE_S 17
|
||||
#define EMAC_SLOT_COUNT 0x00000007
|
||||
#define EMAC_SLOT_COUNT_S 4
|
||||
#define EMAC_CREDIT_CONTROL (BIT(1))
|
||||
#define EMAC_CREDIT_CONTROL_S 1
|
||||
#define EMAC_CREDIT_BASED_SHAPER_DISABLE (BIT(0))
|
||||
#define EMAC_CREDIT_BASED_SHAPER_DISABLE_S 0
|
||||
|
||||
#define EMAC_DMACHANNELAVSTS_REG (REG_EMAC_BASE + 0x0064)
|
||||
#define EMAC_ABS_UPDATED (BIT(17))
|
||||
#define EMAC_ABS_UPDATED_S 17
|
||||
#define EMAC_AVERAGE_BITS_PER_SLOT 0x0001FFFF
|
||||
#define EMAC_AVERAGE_BITS_PER_SLOT_S 0
|
||||
|
||||
#define EMAC_DMAIDLESLOPECREDIT_REG (REG_EMAC_BASE + 0x0068)
|
||||
#define EMAC_IDLESLOPECREDIT 0x00003FFF
|
||||
#define EMAC_IDLESLOPECREDIT_S 0
|
||||
|
||||
#define EMAC_DMASENDSLOPECREDIT_REG (REG_EMAC_BASE + 0x006C)
|
||||
#define EMAC_SENDSLOPECREDIT 0x00003FFF
|
||||
#define EMAC_SENDSLOPECREDIT_S 0
|
||||
|
||||
#define EMAC_DMAHIGHCREDIT_REG (REG_EMAC_BASE + 0x0070)
|
||||
#define EMAC_HICREDIT 0x1FFFFFFF
|
||||
#define EMAC_HICREDIT_S 0
|
||||
|
||||
#define EMAC_DMALOCREDIT_REG (REG_EMAC_BASE + 0x0074)
|
||||
#define EMAC_LOCREDIT 0x1FFFFFFF
|
||||
#define EMAC_LOCREDIT_S 0
|
||||
|
||||
#define EMAC_GMACCONFIG_REG (REG_EMAC_BASE + 0x1000)
|
||||
#define EMAC_SOURCE_ADDRESS_INSERTION_REPLACEMENT_CONTROL 0x00000007
|
||||
#define EMAC_SOURCE_ADDRESS_INSERTION_REPLACEMENT_CONTROL_S 28
|
||||
#define EMAC_AS_SUPPORT_2K_PACKETS (BIT(27))
|
||||
#define EMAC_AS_SUPPORT_2K_PACKETS_S 27
|
||||
#define EMAC_SMII_FORCE_TRANSMIT_ERROR (BIT(26))
|
||||
#define EMAC_SMII_FORCE_TRANSMIT_ERROR_S 26
|
||||
#define EMAC_CRC_STRIPPING_TYPE_FRAMES (BIT(25))
|
||||
#define EMAC_CRC_STRIPPING_TYPE_FRAMES_S 25
|
||||
#define EMAC_TRANSMIT_CONFIGURATION (BIT(24))
|
||||
#define EMAC_TRANSMIT_CONFIGURATION_S 24
|
||||
#define EMAC_GMACWATCHDOG (BIT(23))
|
||||
#define EMAC_GMACWATCHDOG_S 23
|
||||
#define EMAC_GMACJABBER (BIT(22))
|
||||
#define EMAC_GMACJABBER_S 22
|
||||
#define EMAC_GMACFRAMEBURST (BIT(21))
|
||||
#define EMAC_GMACFRAMEBURST_S 21
|
||||
#define EMAC_GMACJUMBOFRAME (BIT(20))
|
||||
#define EMAC_GMACJUMBOFRAME_S 20
|
||||
#define EMAC_GMACINTERFRAMEGAP 0x00000007
|
||||
#define EMAC_GMACINTERFRAMEGAP_S 17
|
||||
#define EMAC_GMACDISABLECRS (BIT(16))
|
||||
#define EMAC_GMACDISABLECRS_S 16
|
||||
#define EMAC_GMACMIIGMII (BIT(15))
|
||||
#define EMAC_GMACMIIGMII_S 15
|
||||
#define EMAC_GMACFESPEED (BIT(14))
|
||||
#define EMAC_GMACFESPEED_S 14
|
||||
#define EMAC_GMACRXOWN (BIT(13))
|
||||
#define EMAC_GMACRXOWN_S 13
|
||||
#define EMAC_GMACLOOPBACK (BIT(12))
|
||||
#define EMAC_GMACLOOPBACK_S 12
|
||||
#define EMAC_GMACDUPLEX (BIT(11))
|
||||
#define EMAC_GMACDUPLEX_S 11
|
||||
#define EMAC_GMACRXIPCOFFLOAD (BIT(10))
|
||||
#define EMAC_GMACRXIPCOFFLOAD_S 10
|
||||
#define EMAC_GMACRETRY (BIT(9))
|
||||
#define EMAC_GMACRETRY_S 9
|
||||
#define EMAC_GMACLINK (BIT(8))
|
||||
#define EMAC_GMACLINK_S 8
|
||||
#define EMAC_GMACPADCRCSTRIP (BIT(7))
|
||||
#define EMAC_GMACPADCRCSTRIP_S 7
|
||||
#define EMAC_GMACBACKOFFLIMIT 0x00000003
|
||||
#define EMAC_GMACBACKOFFLIMIT_S 5
|
||||
#define EMAC_GMACDEFERRALCHECK (BIT(4))
|
||||
#define EMAC_GMACDEFERRALCHECK_S 4
|
||||
#define EMAC_GMACTX (BIT(3))
|
||||
#define EMAC_GMACTX_S 3
|
||||
#define EMAC_GMACRX (BIT(2))
|
||||
#define EMAC_GMACRX_S 2
|
||||
#define EMAC_PREAMBLE_LENGTH_TRANSMIT_FRAMES 0x00000003
|
||||
#define EMAC_PREAMBLE_LENGTH_TRANSMIT_FRAMES_S 0
|
||||
|
||||
#define EMAC_GMACFRAMEFILTER_REG (REG_EMAC_BASE + 0x1004)
|
||||
#define EMAC_RECEIVEALL (BIT(31))
|
||||
#define EMAC_RECEIVEALL_S 31
|
||||
#define EMAC_DROP_NON_TCP_UDP_IP_FRAMES (BIT(21))
|
||||
#define EMAC_DROP_NON_TCP_UDP_IP_FRAMES_S 21
|
||||
#define EMAC_LAYER_3_AND_LAYER_4_FILTER_ENABLE (BIT(20))
|
||||
#define EMAC_LAYER_3_AND_LAYER_4_FILTER_ENABLE_S 20
|
||||
#define EMAC_VLAN_TAG_FILTER_ENABLE (BIT(16))
|
||||
#define EMAC_VLAN_TAG_FILTER_ENABLE_S 16
|
||||
#define EMAC_HASH_OR_PERFECT_FILTE (BIT(10))
|
||||
#define EMAC_HASH_OR_PERFECT_FILTE_S 10
|
||||
#define EMAC_SOURCE_ADDRESS_FILTER_ENABLE (BIT(9))
|
||||
#define EMAC_SOURCE_ADDRESS_FILTER_ENABLE_S 9
|
||||
#define EMAC_SA_INVERSE_FILTERING (BIT(8))
|
||||
#define EMAC_SA_INVERSE_FILTERING_S 8
|
||||
#define EMAC_PASS_CONTROL_FRAMES 0x00000003
|
||||
#define EMAC_PASS_CONTROL_FRAMES_S 6
|
||||
#define EMAC_DISABLE_BROADCAST_FRAMES (BIT(5))
|
||||
#define EMAC_DISABLE_BROADCAST_FRAMES_S 5
|
||||
#define EMAC_PASS_ALL_MULTICAST (BIT(4))
|
||||
#define EMAC_PASS_ALL_MULTICAST_S 4
|
||||
#define EMAC_DA_INVERSE_FILTERING (BIT(3))
|
||||
#define EMAC_DA_INVERSE_FILTERING_S 3
|
||||
#define EMAC_HASH_MULTICAST (BIT(2))
|
||||
#define EMAC_HASH_MULTICAST_S 2
|
||||
#define EMAC_HASH_UNICAST (BIT(1))
|
||||
#define EMAC_HASH_UNICAST_S 1
|
||||
#define EMAC_PROMISCUOUS_MODE (BIT(0))
|
||||
#define EMAC_PROMISCUOUS_MODE_S 0
|
||||
|
||||
#define EMAC_GMACHASHHIGH_REG (REG_EMAC_BASE + 0x1008)
|
||||
#define EMAC_HASH_TABLE_HIGH 0xFFFFFFFF
|
||||
#define EMAC_HASH_TABLE_HIGH_S 0
|
||||
|
||||
#define EMAC_GMACHASHLOW_REG (REG_EMAC_BASE + 0x100C)
|
||||
#define EMAC_HASH_TABLE_LOW 0xFFFFFFFF
|
||||
#define EMAC_HASH_TABLE_LOW_S 0
|
||||
|
||||
#define EMAC_GMACGMIIADDR_REG (REG_EMAC_BASE + 0x1010)
|
||||
#define EMAC_GMIIDEV 0x0000001F
|
||||
#define EMAC_GMIIDEV_S 11
|
||||
#define EMAC_GMIIREG 0x0000001F
|
||||
#define EMAC_GMIIREG_S 6
|
||||
#define EMAC_GMIICSRCLK 0x0000000F
|
||||
#define EMAC_GMIICSRCLK_S 2
|
||||
#define EMAC_GMIIWRITE (BIT(1))
|
||||
#define EMAC_GMIIWRITE_S 1
|
||||
#define EMAC_GMIIBUSY (BIT(0))
|
||||
#define EMAC_GMIIBUSY_S 0
|
||||
|
||||
#define EMAC_GMACGMIIDATA_REG (REG_EMAC_BASE + 0x1014)
|
||||
#define EMAC_GMII_DATA 0x0000FFFF
|
||||
#define EMAC_GMII_DATA_S 0
|
||||
|
||||
#define EMAC_GMACFLOWCONTROL_REG (REG_EMAC_BASE + 0x1018)
|
||||
#define EMAC_PAUSE_TIME 0x0000FFFF
|
||||
#define EMAC_PAUSE_TIME_S 16
|
||||
#define EMAC_DISABLE_ZERO_QUANTA_PAUSE (BIT(7))
|
||||
#define EMAC_DISABLE_ZERO_QUANTA_PAUSE_S 7
|
||||
#define EMAC_PAUSE_LOW_THRESHOLD 0x00000003
|
||||
#define EMAC_PAUSE_LOW_THRESHOLD_S 4
|
||||
#define EMAC_UNICAST_PAUSE_FRAME_DETECT (BIT(3))
|
||||
#define EMAC_UNICAST_PAUSE_FRAME_DETECT_S 3
|
||||
#define EMAC_RECEIVE_FLOW_CONTROL_ENABLE (BIT(2))
|
||||
#define EMAC_RECEIVE_FLOW_CONTROL_ENABLE_S 2
|
||||
#define EMAC_TRANSMIT_FLOW_CONTROL_ENABLE (BIT(1))
|
||||
#define EMAC_TRANSMIT_FLOW_CONTROL_ENABLE_S 1
|
||||
#define EMAC_FLOW_CONTROL_BUSY_BACKPRESSURE_ACTIVATE (BIT(0))
|
||||
#define EMAC_FLOW_CONTROL_BUSY_BACKPRESSURE_ACTIVATE_S 0
|
||||
|
||||
#define EMAC_GMACVLAN_REG (REG_EMAC_BASE + 0x101C)
|
||||
#define EMAC_VLAN_TAG_HASH_TABLE_MATCH_ENABLE (BIT(19))
|
||||
#define EMAC_VLAN_TAG_HASH_TABLE_MATCH_ENABLE_S 19
|
||||
#define EMAC_ENABLE_S_VLAN (BIT(18))
|
||||
#define EMAC_ENABLE_S_VLAN_S 18
|
||||
#define EMAC_VLAN_TAG_INVERSE_MATCH_ENABLE (BIT(17))
|
||||
#define EMAC_VLAN_TAG_INVERSE_MATCH_ENABLE_S 17
|
||||
#define EMAC_ENABLE_VLAN_TAG_COMPARISON (BIT(16))
|
||||
#define EMAC_ENABLE_VLAN_TAG_COMPARISON_S 16
|
||||
#define EMAC_VLAN_TAG_IDENTIFIER_RECEIVE_FRAMES 0x0000FFFF
|
||||
#define EMAC_VLAN_TAG_IDENTIFIER_RECEIVE_FRAMES_S 0
|
||||
|
||||
#define EMAC_GMACVERSION_REG (REG_EMAC_BASE + 0x1020)
|
||||
#define EMAC_USERVER 0x000000FF
|
||||
#define EMAC_USERVER_S 8
|
||||
#define EMAC_SNPSVER 0x000000FF
|
||||
#define EMAC_SNPSVER_S 0
|
||||
|
||||
#define EMAC_GMACDEBUG_REG (REG_EMAC_BASE + 0x1024)
|
||||
#define EMAC_MTL_TXSTATUS_FIFO_FULL_STATUS (BIT(25))
|
||||
#define EMAC_MTL_TXSTATUS_FIFO_FULL_STATUS_S 25
|
||||
#define EMAC_MTL_TX_FIFO_NOT_EMPTY_STATUS (BIT(24))
|
||||
#define EMAC_MTL_TX_FIFO_NOT_EMPTY_STATUS_S 24
|
||||
#define EMAC_MTL_TX_FIFO_WRITE_CONTROLLER_STATUS (BIT(22))
|
||||
#define EMAC_MTL_TX_FIFO_WRITE_CONTROLLER_STATUS_S 22
|
||||
#define EMAC_MTL_TX_FIFO_READ_CONTROLLER_STATUS 0x00000003
|
||||
#define EMAC_MTL_TX_FIFO_READ_CONTROLLER_STATUS_S 20
|
||||
#define EMAC_MAC_TRANSMITTER_PAUSE (BIT(19))
|
||||
#define EMAC_MAC_TRANSMITTER_PAUSE_S 19
|
||||
#define EMAC_MAC_TRANSMIT_FRAME_CONTROLLER_STATUS 0x00000003
|
||||
#define EMAC_MAC_TRANSMIT_FRAME_CONTROLLER_STATUS_S 17
|
||||
#define EMAC_MAC_TRANSMIT_PROTOCOL_ENGINE_STATUS (BIT(16))
|
||||
#define EMAC_MAC_TRANSMIT_PROTOCOL_ENGINE_STATUS_S 16
|
||||
#define EMAC_MTL_RXFIFO_FILL_LEVEL_STATUS 0x00000003
|
||||
#define EMAC_MTL_RXFIFO_FILL_LEVEL_STATUS_S 8
|
||||
#define EMAC_MTL_RXFIFO_READ_CONTROLLER_STATE 0x00000003
|
||||
#define EMAC_MTL_RXFIFO_READ_CONTROLLER_STATE_S 5
|
||||
#define EMAC_MTL_RX_FIFO_WRITE_CONTROLLER_ACTIVE_STATUS (BIT(4))
|
||||
#define EMAC_MTL_RX_FIFO_WRITE_CONTROLLER_ACTIVE_STATUS_S 4
|
||||
#define EMAC_MAC_RECEIVE_FRAME_FIFO_CONTROLLER_STATUS 0x00000003
|
||||
#define EMAC_MAC_RECEIVE_FRAME_FIFO_CONTROLLER_STATUS_S 1
|
||||
#define EMAC_MAC_RECEIVE_PROTOCOL_ENGINE_STATUS (BIT(0))
|
||||
#define EMAC_MAC_RECEIVE_PROTOCOL_ENGINE_STATUS_S 0
|
||||
|
||||
#define EMAC_GMACLPITIMERSCONTROL_REG (REG_EMAC_BASE + 0x1034)
|
||||
#define EMAC_LPI_LS_TIMER 0x000003FF
|
||||
#define EMAC_LPI_LS_TIMER_S 16
|
||||
#define EMAC_LPI_TW_TIMER 0x0000FFFF
|
||||
#define EMAC_LPI_TW_TIMER_S 0
|
||||
|
||||
#define EMAC_GMACINTERRUPTSTATUS_REG (REG_EMAC_BASE + 0x1038)
|
||||
#define EMAC_GPI_INTERRUPT_STATUS (BIT(11))
|
||||
#define EMAC_GPI_INTERRUPT_STATUS_S 11
|
||||
#define EMAC_LPI_INTERRUPT_STATUS (BIT(10))
|
||||
#define EMAC_LPI_INTERRUPT_STATUS_S 10
|
||||
#define EMAC_TIMESTAMP_INTERRUP_STATUS (BIT(9))
|
||||
#define EMAC_TIMESTAMP_INTERRUP_STATUS_S 9
|
||||
#define EMAC_MMC_RECEIVE_CHECKSUM_OFFLOAD_INTERRUPT_STATUS (BIT(7))
|
||||
#define EMAC_MMC_RECEIVE_CHECKSUM_OFFLOAD_INTERRUPT_STATUS_S 7
|
||||
#define EMAC_MMC_TRANSMIT_INTERRUPT_STATUS (BIT(6))
|
||||
#define EMAC_MMC_TRANSMIT_INTERRUPT_STATUS_S 6
|
||||
#define EMAC_MMC_RECEIVE_INTERRUPT_STATUS (BIT(5))
|
||||
#define EMAC_MMC_RECEIVE_INTERRUPT_STATUS_S 5
|
||||
#define EMAC_MMC_INTERRUPT_STATUS (BIT(4))
|
||||
#define EMAC_MMC_INTERRUPT_STATUS_S 4
|
||||
#define EMAC_PMT_INTERRUPT_STATUS (BIT(3))
|
||||
#define EMAC_PMT_INTERRUPT_STATUS_S 3
|
||||
#define EMAC_PCS_AUTO_NEGOTIATION_COMPLETE (BIT(2))
|
||||
#define EMAC_PCS_AUTO_NEGOTIATION_COMPLETE_S 2
|
||||
#define EMAC_PCS_LINK_STATUS_CHANGED (BIT(1))
|
||||
#define EMAC_PCS_LINK_STATUS_CHANGED_S 1
|
||||
#define EMAC_INTERRUPT_STATUS (BIT(0))
|
||||
#define EMAC_INTERRUPT_STATUS_S 0
|
||||
|
||||
#define EMAC_GMACINTERRUPTMASK_REG (REG_EMAC_BASE + 0x103C)
|
||||
#define EMAC_LPI_INTERRUPT_MASK (BIT(10))
|
||||
#define EMAC_LPI_INTERRUPT_MASK_S 10
|
||||
#define EMAC_TIMESTAMP_INTERRUPT_MASK (BIT(9))
|
||||
#define EMAC_TIMESTAMP_INTERRUPT_MASK_S 9
|
||||
#define EMAC_PMT_INTERRUPT_MASK (BIT(3))
|
||||
#define EMAC_PMT_INTERRUPT_MASK_S 3
|
||||
#define EMAC_PCS_AN_COMPLETION_INTERRUPT_MASK (BIT(2))
|
||||
#define EMAC_PCS_AN_COMPLETION_INTERRUPT_MASK_S 2
|
||||
#define EMAC_PCS_LINK_STATUS_INTERRUPT_MASK (BIT(1))
|
||||
#define EMAC_PCS_LINK_STATUS_INTERRUPT_MASK_S 1
|
||||
#define EMAC_INTERRUPT_MASK (BIT(0))
|
||||
#define EMAC_INTERRUPT_MASK_S 0
|
||||
|
||||
#define EMAC_GMACADDR0HIGH_REG (REG_EMAC_BASE + 0x1040)
|
||||
#define EMAC_ADDRESS_ENABLE0 (BIT(31))
|
||||
#define EMAC_ADDRESS_ENABLE0_S 31
|
||||
#define EMAC_MAC_ADDRESS0_HI 0x0000FFFF
|
||||
#define EMAC_MAC_ADDRESS0_HI_S 0
|
||||
|
||||
#define EMAC_GMACADDR0LOW_REG (REG_EMAC_BASE + 0x1044)
|
||||
#define EMAC_MAC_ADDRESS0_LOW 0xFFFFFFFF
|
||||
#define EMAC_MAC_ADDRESS0_LOW_S 0
|
||||
|
||||
#define EMAC_GMACADDR1HIGH_REG (REG_EMAC_BASE + 0x1048)
|
||||
#define EMAC_ADDRESS_ENABLE1 (BIT(31))
|
||||
#define EMAC_ADDRESS_ENABLE1_S 31
|
||||
#define EMAC_SOURCE_ADDRESS (BIT(30))
|
||||
#define EMAC_SOURCE_ADDRESS_S 30
|
||||
#define EMAC_MASK_BYTE_CONTROL 0x0000003F
|
||||
#define EMAC_MASK_BYTE_CONTROL_S 24
|
||||
#define EMAC_MAC_ADDRESS1_HI 0x0000FFFF
|
||||
#define EMAC_MAC_ADDRESS1_HI_S 0
|
||||
|
||||
#define EMAC_GMACADDR1LOW_REG (REG_EMAC_BASE + 0x104C)
|
||||
#define EMAC_MAC_ADDRESS1_LOW 0xFFFFFFFF
|
||||
#define EMAC_MAC_ADDRESS1_LOW_S 0
|
||||
|
||||
#define EMAC_GMAC_AN_CONTROL_REG (REG_EMAC_BASE + 0x10C0)
|
||||
#define EMAC_SGMII_RAL_CONTROL (BIT(18))
|
||||
#define EMAC_SGMII_RAL_CONTROL_S 18
|
||||
#define EMAC_LOCK_REFERENCE (BIT(17))
|
||||
#define EMAC_LOCK_REFERENCE_S 17
|
||||
#define EMAC_ENABLE_COMMA_DETECT (BIT(16))
|
||||
#define EMAC_ENABLE_COMMA_DETECT_S 16
|
||||
#define EMAC_EXTERNAL_LOOPBACK_ENABLE (BIT(14))
|
||||
#define EMAC_EXTERNAL_LOOPBACK_ENABLE_S 14
|
||||
#define EMAC_AUTO_NEGOTIATION_ENABLE (BIT(12))
|
||||
#define EMAC_AUTO_NEGOTIATION_ENABLE_S 12
|
||||
#define EMAC_RESTART_AUTO_NEGOTIATION (BIT(9))
|
||||
#define EMAC_RESTART_AUTO_NEGOTIATION_S 9
|
||||
|
||||
#define EMAC_GMAC_AN_STATUS_REG (REG_EMAC_BASE + 0x10C4)
|
||||
#define EMAC_EXTENDED_STATUS (BIT(8))
|
||||
#define EMAC_EXTENDED_STATUS_S 8
|
||||
#define EMAC_AUTO_NEGOTIATION_COMPLETE (BIT(5))
|
||||
#define EMAC_AUTO_NEGOTIATION_COMPLETE_S 5
|
||||
#define EMAC_AUTO_NEGOTIATION_ABILITY (BIT(3))
|
||||
#define EMAC_AUTO_NEGOTIATION_ABILITY_S 3
|
||||
#define EMAC_LINK_AN_STATUS (BIT(2))
|
||||
#define EMAC_LINK_AN_STATUS_S 2
|
||||
|
||||
#define EMAC_GMAC_AUTO_NEGOTIATION_ADVERTISEMENT_REG (REG_EMAC_BASE + 0x10C8)
|
||||
#define EMAC_ADV_NEXT_PAGE_SUPPORT (BIT(15))
|
||||
#define EMAC_ADV_NEXT_PAGE_SUPPORT_S 15
|
||||
#define EMAC_ADV_REMOTE_FAULT_ENCODING 0x00000003
|
||||
#define EMAC_ADV_REMOTE_FAULT_ENCODING_S 12
|
||||
#define EMAC_ADV_PAUSE_ENCODING 0x00000003
|
||||
#define EMAC_ADV_PAUSE_ENCODING_S 7
|
||||
#define EMAC_ADV_HALF_DUPLEX (BIT(6))
|
||||
#define EMAC_ADV_HALF_DUPLEX_S 6
|
||||
#define EMAC_ADV_FULL_DUPLEX (BIT(5))
|
||||
#define EMAC_ADV_FULL_DUPLEX_S 5
|
||||
|
||||
#define EMAC_GMAC_AUTO_NEGOTIATION_LINK_PARTNER_ABILITY_REG (REG_EMAC_BASE + 0x10CC)
|
||||
#define EMAC_LINK_NEXT_PAGE_SUPPORT (BIT(15))
|
||||
#define EMAC_LINK_NEXT_PAGE_SUPPORT_S 15
|
||||
#define EMAC_LINK_ACKNOWLEDGE (BIT(14))
|
||||
#define EMAC_LINK_ACKNOWLEDGE_S 14
|
||||
#define EMAC_LINK_REMOTE_FAULT_ENCODING 0x00000003
|
||||
#define EMAC_LINK_REMOTE_FAULT_ENCODING_S 12
|
||||
#define EMAC_LINK_PAUSE_ENCODING 0x00000003
|
||||
#define EMAC_LINK_PAUSE_ENCODING_S 7
|
||||
#define EMAC_LINK_HALF_DUPLEX (BIT(6))
|
||||
#define EMAC_LINK_HALF_DUPLEX_S 6
|
||||
#define EMAC_LINK_FULL_DUPLEX (BIT(5))
|
||||
#define EMAC_LINK_FULL_DUPLEX_S 5
|
||||
|
||||
#define EMAC_GMAC_AUTO_NEGOTIATION_EXPANSION_REG (REG_EMAC_BASE + 0x10D0)
|
||||
#define EMAC_NEXT_PAGE_ABILITY (BIT(2))
|
||||
#define EMAC_NEXT_PAGE_ABILITY_S 2
|
||||
#define EMAC_NEW_PAGE_RECEIVED (BIT(1))
|
||||
#define EMAC_NEW_PAGE_RECEIVED_S 1
|
||||
|
||||
#define EMAC_GMAC_TBI_EXTENDED_STATUS_REG (REG_EMAC_BASE + 0x10D4)
|
||||
#define EMAC_1000BASE_X_FULL_DUPLEX_CAPABLE (BIT(15))
|
||||
#define EMAC_1000BASE_X_FULL_DUPLEX_CAPABLE_S 15
|
||||
#define EMAC_1000BASE_X_HALF_DUPLEX_CAPABLE (BIT(14))
|
||||
#define EMAC_1000BASE_X_HALF_DUPLEX_CAPABLE_S 14
|
||||
|
||||
#define EMAC_GMAC_CONTROL_STATUS_REG (REG_EMAC_BASE + 0x10D8)
|
||||
#define EMAC_SMIDRXS (BIT(16))
|
||||
#define EMAC_SMIDRXS_S 16
|
||||
#define EMAC_FALSE_CARRIER_DETECTED (BIT(5))
|
||||
#define EMAC_FALSE_CARRIER_DETECTED_S 5
|
||||
#define EMAC_JABBER_TIMEOUT (BIT(4))
|
||||
#define EMAC_JABBER_TIMEOUT_S 4
|
||||
#define EMAC_LINK_STATUS (BIT(3))
|
||||
#define EMAC_LINK_STATUS_S 3
|
||||
#define EMAC_LINK_SPEED 0x00000003
|
||||
#define EMAC_LINK_SPEED_S 1
|
||||
#define EMAC_LINK_MODE (BIT(0))
|
||||
#define EMAC_LINK_MODE_S 0
|
||||
|
||||
#define EMAC_GMAC_WATCHDOG_TIMEOUT_REG (REG_EMAC_BASE + 0x10DC)
|
||||
#define EMAC_PROGRAMMABLE_WATCHDOG_ENABLE (BIT(16))
|
||||
#define EMAC_PROGRAMMABLE_WATCHDOG_ENABLE_S 16
|
||||
#define EMAC_WATCHDOG_TIMEOUT 0x00003FFF
|
||||
#define EMAC_WATCHDOG_TIMEOUT_S 0
|
||||
|
||||
#define EMAC_GMAC_GENERAL_PURPOSE_IO_REG (REG_EMAC_BASE + 0x10E0)
|
||||
#define EMAC_GPI_TYPE 0x0000000F
|
||||
#define EMAC_GPI_TYPE_S 24
|
||||
#define EMAC_GPI_INTERRUPT_ENABLE 0x0000000F
|
||||
#define EMAC_GPI_INTERRUPT_ENABLE_S 16
|
||||
#define EMAC_GENERAL_PURPOSE_OUTPUT 0x0000000F
|
||||
#define EMAC_GENERAL_PURPOSE_OUTPUT_S 8
|
||||
#define EMAC_GENERAL_PURPOSE_INPUT_STATUS 0x0000000F
|
||||
#define EMAC_GENERAL_PURPOSE_INPUT_STATUS_S 0
|
||||
|
||||
#define EMAC_GMAC_LAYER3_LAYER4_CONTROL0_REG (REG_EMAC_BASE + 0x1400)
|
||||
#define EMAC_LAYER4_DESTINATION_PORT_INVERSE_MATCH_ENABLE (BIT(21))
|
||||
#define EMAC_LAYER4_DESTINATION_PORT_INVERSE_MATCH_ENABLE_S 21
|
||||
#define EMAC_LAYER4_DESTINATION_PORT_MATCH_ENABLE (BIT(20))
|
||||
#define EMAC_LAYER4_DESTINATION_PORT_MATCH_ENABLE_S 20
|
||||
#define EMAC_LAYER4_SOURCE_PORT_INVERSE_MATCH_ENABLE (BIT(19))
|
||||
#define EMAC_LAYER4_SOURCE_PORT_INVERSE_MATCH_ENABLE_S 19
|
||||
#define EMAC_LAYER4_SOURCE_PORT_MATCH_ENABLE (BIT(18))
|
||||
#define EMAC_LAYER4_SOURCE_PORT_MATCH_ENABLE_S 18
|
||||
#define EMAC_LAYER4_PROTOCOL_ENABLE (BIT(16))
|
||||
#define EMAC_LAYER4_PROTOCOL_ENABLE_S 16
|
||||
#define EMAC_LAYER3_IP_DA_HIGHER_BITS_MATCH 0x0000001F
|
||||
#define EMAC_LAYER3_IP_DA_HIGHER_BITS_MATCH_S 11
|
||||
#define EMAC_LAYER3_IP_SA_HIGHER_BITS_MATCH 0x0000001F
|
||||
#define EMAC_LAYER3_IP_SA_HIGHER_BITS_MATCH_S 6
|
||||
#define EMAC_LAYER3_IP_DA_INVERSE_MATCH_ENABLE (BIT(5))
|
||||
#define EMAC_LAYER3_IP_DA_INVERSE_MATCH_ENABLE_S 5
|
||||
#define EMAC_LAYER3_IP_DA_MATCH_ENABLE (BIT(4))
|
||||
#define EMAC_LAYER3_IP_DA_MATCH_ENABLE_S 4
|
||||
#define EMAC_LAYER3_IP_SA_INVERSE_MATCH_ENABLE (BIT(3))
|
||||
#define EMAC_LAYER3_IP_SA_INVERSE_MATCH_ENABLE_S 3
|
||||
#define EMAC_LAYER3_IP_SA_MATCH_ENABLE (BIT(2))
|
||||
#define EMAC_LAYER3_IP_SA_MATCH_ENABLE_S 2
|
||||
#define EMAC_LAYER3_PROTOCOL_ENABLE (BIT(0))
|
||||
#define EMAC_LAYER3_PROTOCOL_ENABLE_S 0
|
||||
|
||||
#define EMAC_GMAC_LAYER4_ADDRESS0_REG (REG_EMAC_BASE + 0x1404)
|
||||
#define EMAC_LAYER4_DESTINATION_PORT_NUMBER_FIELD 0x0000FFFF
|
||||
#define EMAC_LAYER4_DESTINATION_PORT_NUMBER_FIELD_S 16
|
||||
#define EMAC_LAYER4_SOURCE_PORT_NUMBER_FIELD 0x0000FFFF
|
||||
#define EMAC_LAYER4_SOURCE_PORT_NUMBER_FIELD_S 0
|
||||
|
||||
#define EMAC_GMAC_LAYER3_ADDRESS0_REG (REG_EMAC_BASE + 0x1410)
|
||||
#define EMAC_LAYER3_ADDRESS0_FIELD 0xFFFFFFFF
|
||||
#define EMAC_LAYER3_ADDRESS0_FIELD_S 0
|
||||
|
||||
#define EMAC_GMAC_LAYER3_ADDRESS1_REG (REG_EMAC_BASE + 0x1414)
|
||||
#define EMAC_LAYER3_ADDRESS1_FIELD 0xFFFFFFFF
|
||||
#define EMAC_LAYER3_ADDRESS1_FIELD_S 0
|
||||
|
||||
#define EMAC_GMAC_LAYER3_ADDRESS2_REG (REG_EMAC_BASE + 0x1418)
|
||||
#define EMAC_LAYER3_ADDRESS2_FIELD 0xFFFFFFFF
|
||||
#define EMAC_LAYER3_ADDRESS2_FIELD_S 0
|
||||
|
||||
#define EMAC_GMAC_LAYER3_ADDRESS3_REG (REG_EMAC_BASE + 0x141C)
|
||||
#define EMAC_LAYER3_ADDRESS3_FIELD 0xFFFFFFFF
|
||||
#define EMAC_LAYER3_ADDRESS3_FIELD_S 0
|
||||
|
||||
#define EMAC_GMAC_HASH_TABLE0_REG (REG_EMAC_BASE + 0x1500)
|
||||
#define EMAC_FIRST32_BITS_HASH_TABLE 0xFFFFFFFF
|
||||
#define EMAC_FIRST32_BITS_HASH_TABLE_S 0
|
||||
|
||||
#define EMAC_GMAC_VLAN_TAG_INCLUSION_REPLACEMENT_REG (REG_EMAC_BASE + 0x1584)
|
||||
#define EMAC_VLAN_C_VLAN_S_VLAN (BIT(19))
|
||||
#define EMAC_VLAN_C_VLAN_S_VLAN_S 19
|
||||
#define EMAC_VLAN_PRIORITY_CONTROL (BIT(18))
|
||||
#define EMAC_VLAN_PRIORITY_CONTROL_S 18
|
||||
#define EMAC_VLAN_TAG_CONTROL_TRANSMIT_FRAMES 0x00000003
|
||||
#define EMAC_VLAN_TAG_CONTROL_TRANSMIT_FRAMES_S 16
|
||||
#define EMAC_VLAN_TAG_TRANSMIT_FRAMES 0x0000FFFF
|
||||
#define EMAC_VLAN_TAG_TRANSMIT_FRAMES_S 0
|
||||
|
||||
#define EMAC_GMAC_VLAN_HASH_TABLE_REG (REG_EMAC_BASE + 0x1588)
|
||||
#define EMAC_VLAN_HASH_TABLE 0x0000FFFF
|
||||
#define EMAC_VLAN_HASH_TABLE_S 0
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -1,49 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef _SOC_FRC_TIMER_REG_H_
|
||||
#define _SOC_FRC_TIMER_REG_H_
|
||||
|
||||
#include "soc.h"
|
||||
|
||||
/**
|
||||
* These are the register definitions for "legacy" timers
|
||||
*/
|
||||
|
||||
#define REG_FRC_TIMER_BASE(i) (DR_REG_FRC_TIMER_BASE + i*0x20)
|
||||
|
||||
#define FRC_TIMER_LOAD_REG(i) (REG_FRC_TIMER_BASE(i) + 0x0) // timer load value (23 bit for i==0, 32 bit for i==1)
|
||||
#define FRC_TIMER_LOAD_VALUE(i) ((i == 0)?0x007FFFFF:0xffffffff)
|
||||
#define FRC_TIMER_LOAD_VALUE_S 0
|
||||
|
||||
#define FRC_TIMER_COUNT_REG(i) (REG_FRC_TIMER_BASE(i) + 0x4) // timer count value (23 bit for i==0, 32 bit for i==1)
|
||||
#define FRC_TIMER_COUNT ((i == 0)?0x007FFFFF:0xffffffff)
|
||||
#define FRC_TIMER_COUNT_S 0
|
||||
|
||||
#define FRC_TIMER_CTRL_REG(i) (REG_FRC_TIMER_BASE(i) + 0x8)
|
||||
#define FRC_TIMER_INT_ENABLE (BIT(8)) // enable interrupt
|
||||
#define FRC_TIMER_ENABLE (BIT(7)) // enable timer
|
||||
#define FRC_TIMER_AUTOLOAD (BIT(6)) // enable autoload
|
||||
#define FRC_TIMER_PRESCALER 0x00000007 // 0: divide by 1, 2: divide by 16, 4: divide by 256
|
||||
#define FRC_TIMER_PRESCALER_S 1
|
||||
#define FRC_TIMER_EDGE_INT (BIT(0)) // 0: level, 1: edge
|
||||
|
||||
#define FRC_TIMER_INT_REG(i) (REG_FRC_TIMER_BASE(i) + 0xC)
|
||||
#define FRC_TIMER_INT_CLR (BIT(0)) // clear interrupt
|
||||
|
||||
#define FRC_TIMER_ALARM_REG(i) (REG_FRC_TIMER_BASE(i) + 0x10) // timer alarm value; register only present for i == 1
|
||||
#define FRC_TIMER_ALARM 0xFFFFFFFF
|
||||
#define FRC_TIMER_ALARM_S 0
|
||||
|
||||
#endif //_SOC_FRC_TIMER_REG_H_
|
File diff suppressed because it is too large
Load Diff
@ -1,160 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_GPIO_SD_REG_H_
|
||||
#define _SOC_GPIO_SD_REG_H_
|
||||
|
||||
#include "soc.h"
|
||||
#define GPIO_SIGMADELTA0_REG (DR_REG_GPIO_SD_BASE + 0x0000)
|
||||
/* GPIO_SD0_PRESCALE : R/W ;bitpos:[15:8] ;default: 8'hff ; */
|
||||
/*description: */
|
||||
#define GPIO_SD0_PRESCALE 0x000000FF
|
||||
#define GPIO_SD0_PRESCALE_M ((GPIO_SD0_PRESCALE_V)<<(GPIO_SD0_PRESCALE_S))
|
||||
#define GPIO_SD0_PRESCALE_V 0xFF
|
||||
#define GPIO_SD0_PRESCALE_S 8
|
||||
/* GPIO_SD0_IN : R/W ;bitpos:[7:0] ;default: 8'h0 ; */
|
||||
/*description: */
|
||||
#define GPIO_SD0_IN 0x000000FF
|
||||
#define GPIO_SD0_IN_M ((GPIO_SD0_IN_V)<<(GPIO_SD0_IN_S))
|
||||
#define GPIO_SD0_IN_V 0xFF
|
||||
#define GPIO_SD0_IN_S 0
|
||||
|
||||
#define GPIO_SIGMADELTA1_REG (DR_REG_GPIO_SD_BASE + 0x0004)
|
||||
/* GPIO_SD1_PRESCALE : R/W ;bitpos:[15:8] ;default: 8'hff ; */
|
||||
/*description: */
|
||||
#define GPIO_SD1_PRESCALE 0x000000FF
|
||||
#define GPIO_SD1_PRESCALE_M ((GPIO_SD1_PRESCALE_V)<<(GPIO_SD1_PRESCALE_S))
|
||||
#define GPIO_SD1_PRESCALE_V 0xFF
|
||||
#define GPIO_SD1_PRESCALE_S 8
|
||||
/* GPIO_SD1_IN : R/W ;bitpos:[7:0] ;default: 8'h0 ; */
|
||||
/*description: */
|
||||
#define GPIO_SD1_IN 0x000000FF
|
||||
#define GPIO_SD1_IN_M ((GPIO_SD1_IN_V)<<(GPIO_SD1_IN_S))
|
||||
#define GPIO_SD1_IN_V 0xFF
|
||||
#define GPIO_SD1_IN_S 0
|
||||
|
||||
#define GPIO_SIGMADELTA2_REG (DR_REG_GPIO_SD_BASE + 0x0008)
|
||||
/* GPIO_SD2_PRESCALE : R/W ;bitpos:[15:8] ;default: 8'hff ; */
|
||||
/*description: */
|
||||
#define GPIO_SD2_PRESCALE 0x000000FF
|
||||
#define GPIO_SD2_PRESCALE_M ((GPIO_SD2_PRESCALE_V)<<(GPIO_SD2_PRESCALE_S))
|
||||
#define GPIO_SD2_PRESCALE_V 0xFF
|
||||
#define GPIO_SD2_PRESCALE_S 8
|
||||
/* GPIO_SD2_IN : R/W ;bitpos:[7:0] ;default: 8'h0 ; */
|
||||
/*description: */
|
||||
#define GPIO_SD2_IN 0x000000FF
|
||||
#define GPIO_SD2_IN_M ((GPIO_SD2_IN_V)<<(GPIO_SD2_IN_S))
|
||||
#define GPIO_SD2_IN_V 0xFF
|
||||
#define GPIO_SD2_IN_S 0
|
||||
|
||||
#define GPIO_SIGMADELTA3_REG (DR_REG_GPIO_SD_BASE + 0x000c)
|
||||
/* GPIO_SD3_PRESCALE : R/W ;bitpos:[15:8] ;default: 8'hff ; */
|
||||
/*description: */
|
||||
#define GPIO_SD3_PRESCALE 0x000000FF
|
||||
#define GPIO_SD3_PRESCALE_M ((GPIO_SD3_PRESCALE_V)<<(GPIO_SD3_PRESCALE_S))
|
||||
#define GPIO_SD3_PRESCALE_V 0xFF
|
||||
#define GPIO_SD3_PRESCALE_S 8
|
||||
/* GPIO_SD3_IN : R/W ;bitpos:[7:0] ;default: 8'h0 ; */
|
||||
/*description: */
|
||||
#define GPIO_SD3_IN 0x000000FF
|
||||
#define GPIO_SD3_IN_M ((GPIO_SD3_IN_V)<<(GPIO_SD3_IN_S))
|
||||
#define GPIO_SD3_IN_V 0xFF
|
||||
#define GPIO_SD3_IN_S 0
|
||||
|
||||
#define GPIO_SIGMADELTA4_REG (DR_REG_GPIO_SD_BASE + 0x0010)
|
||||
/* GPIO_SD4_PRESCALE : R/W ;bitpos:[15:8] ;default: 8'hff ; */
|
||||
/*description: */
|
||||
#define GPIO_SD4_PRESCALE 0x000000FF
|
||||
#define GPIO_SD4_PRESCALE_M ((GPIO_SD4_PRESCALE_V)<<(GPIO_SD4_PRESCALE_S))
|
||||
#define GPIO_SD4_PRESCALE_V 0xFF
|
||||
#define GPIO_SD4_PRESCALE_S 8
|
||||
/* GPIO_SD4_IN : R/W ;bitpos:[7:0] ;default: 8'h0 ; */
|
||||
/*description: */
|
||||
#define GPIO_SD4_IN 0x000000FF
|
||||
#define GPIO_SD4_IN_M ((GPIO_SD4_IN_V)<<(GPIO_SD4_IN_S))
|
||||
#define GPIO_SD4_IN_V 0xFF
|
||||
#define GPIO_SD4_IN_S 0
|
||||
|
||||
#define GPIO_SIGMADELTA5_REG (DR_REG_GPIO_SD_BASE + 0x0014)
|
||||
/* GPIO_SD5_PRESCALE : R/W ;bitpos:[15:8] ;default: 8'hff ; */
|
||||
/*description: */
|
||||
#define GPIO_SD5_PRESCALE 0x000000FF
|
||||
#define GPIO_SD5_PRESCALE_M ((GPIO_SD5_PRESCALE_V)<<(GPIO_SD5_PRESCALE_S))
|
||||
#define GPIO_SD5_PRESCALE_V 0xFF
|
||||
#define GPIO_SD5_PRESCALE_S 8
|
||||
/* GPIO_SD5_IN : R/W ;bitpos:[7:0] ;default: 8'h0 ; */
|
||||
/*description: */
|
||||
#define GPIO_SD5_IN 0x000000FF
|
||||
#define GPIO_SD5_IN_M ((GPIO_SD5_IN_V)<<(GPIO_SD5_IN_S))
|
||||
#define GPIO_SD5_IN_V 0xFF
|
||||
#define GPIO_SD5_IN_S 0
|
||||
|
||||
#define GPIO_SIGMADELTA6_REG (DR_REG_GPIO_SD_BASE + 0x0018)
|
||||
/* GPIO_SD6_PRESCALE : R/W ;bitpos:[15:8] ;default: 8'hff ; */
|
||||
/*description: */
|
||||
#define GPIO_SD6_PRESCALE 0x000000FF
|
||||
#define GPIO_SD6_PRESCALE_M ((GPIO_SD6_PRESCALE_V)<<(GPIO_SD6_PRESCALE_S))
|
||||
#define GPIO_SD6_PRESCALE_V 0xFF
|
||||
#define GPIO_SD6_PRESCALE_S 8
|
||||
/* GPIO_SD6_IN : R/W ;bitpos:[7:0] ;default: 8'h0 ; */
|
||||
/*description: */
|
||||
#define GPIO_SD6_IN 0x000000FF
|
||||
#define GPIO_SD6_IN_M ((GPIO_SD6_IN_V)<<(GPIO_SD6_IN_S))
|
||||
#define GPIO_SD6_IN_V 0xFF
|
||||
#define GPIO_SD6_IN_S 0
|
||||
|
||||
#define GPIO_SIGMADELTA7_REG (DR_REG_GPIO_SD_BASE + 0x001c)
|
||||
/* GPIO_SD7_PRESCALE : R/W ;bitpos:[15:8] ;default: 8'hff ; */
|
||||
/*description: */
|
||||
#define GPIO_SD7_PRESCALE 0x000000FF
|
||||
#define GPIO_SD7_PRESCALE_M ((GPIO_SD7_PRESCALE_V)<<(GPIO_SD7_PRESCALE_S))
|
||||
#define GPIO_SD7_PRESCALE_V 0xFF
|
||||
#define GPIO_SD7_PRESCALE_S 8
|
||||
/* GPIO_SD7_IN : R/W ;bitpos:[7:0] ;default: 8'h0 ; */
|
||||
/*description: */
|
||||
#define GPIO_SD7_IN 0x000000FF
|
||||
#define GPIO_SD7_IN_M ((GPIO_SD7_IN_V)<<(GPIO_SD7_IN_S))
|
||||
#define GPIO_SD7_IN_V 0xFF
|
||||
#define GPIO_SD7_IN_S 0
|
||||
|
||||
#define GPIO_SIGMADELTA_CG_REG (DR_REG_GPIO_SD_BASE + 0x0020)
|
||||
/* GPIO_SD_CLK_EN : R/W ;bitpos:[31] ;default: 1'h0 ; */
|
||||
/*description: */
|
||||
#define GPIO_SD_CLK_EN (BIT(31))
|
||||
#define GPIO_SD_CLK_EN_M (BIT(31))
|
||||
#define GPIO_SD_CLK_EN_V 0x1
|
||||
#define GPIO_SD_CLK_EN_S 31
|
||||
|
||||
#define GPIO_SIGMADELTA_MISC_REG (DR_REG_GPIO_SD_BASE + 0x0024)
|
||||
/* GPIO_SPI_SWAP : R/W ;bitpos:[31] ;default: 1'h0 ; */
|
||||
/*description: */
|
||||
#define GPIO_SPI_SWAP (BIT(31))
|
||||
#define GPIO_SPI_SWAP_M (BIT(31))
|
||||
#define GPIO_SPI_SWAP_V 0x1
|
||||
#define GPIO_SPI_SWAP_S 31
|
||||
|
||||
#define GPIO_SIGMADELTA_VERSION_REG (DR_REG_GPIO_SD_BASE + 0x0028)
|
||||
/* GPIO_SD_DATE : R/W ;bitpos:[27:0] ;default: 28'h1506190 ; */
|
||||
/*description: */
|
||||
#define GPIO_SD_DATE 0x0FFFFFFF
|
||||
#define GPIO_SD_DATE_M ((GPIO_SD_DATE_V)<<(GPIO_SD_DATE_S))
|
||||
#define GPIO_SD_DATE_V 0xFFFFFFF
|
||||
#define GPIO_SD_DATE_S 0
|
||||
#define SIGMADELTA_GPIO_SD_DATE_VERSION 0x1506190
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /*_SOC_GPIO_SD_REG_H_ */
|
||||
|
||||
|
@ -1,48 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_GPIO_SD_STRUCT_H_
|
||||
#define _SOC_GPIO_SD_STRUCT_H_
|
||||
typedef volatile struct {
|
||||
union {
|
||||
struct {
|
||||
uint32_t duty: 8;
|
||||
uint32_t prescale: 8;
|
||||
uint32_t reserved16: 16;
|
||||
};
|
||||
uint32_t val;
|
||||
} channel[8];
|
||||
union {
|
||||
struct {
|
||||
uint32_t reserved0: 31;
|
||||
uint32_t clk_en: 1;
|
||||
};
|
||||
uint32_t val;
|
||||
} cg;
|
||||
union {
|
||||
struct {
|
||||
uint32_t reserved0: 31;
|
||||
uint32_t spi_swap: 1;
|
||||
};
|
||||
uint32_t val;
|
||||
} misc;
|
||||
union {
|
||||
struct {
|
||||
uint32_t date: 28;
|
||||
uint32_t reserved28: 4;
|
||||
};
|
||||
uint32_t val;
|
||||
} version;
|
||||
} gpio_sd_dev_t;
|
||||
extern gpio_sd_dev_t SIGMADELTA;
|
||||
#endif /* _SOC_GPIO_SD_STRUCT_H_ */
|
@ -1,422 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_GPIO_SIG_MAP_H_
|
||||
#define _SOC_GPIO_SIG_MAP_H_
|
||||
|
||||
#define SPICLK_IN_IDX 0
|
||||
#define SPICLK_OUT_IDX 0
|
||||
#define SPIQ_IN_IDX 1
|
||||
#define SPIQ_OUT_IDX 1
|
||||
#define SPID_IN_IDX 2
|
||||
#define SPID_OUT_IDX 2
|
||||
#define SPIHD_IN_IDX 3
|
||||
#define SPIHD_OUT_IDX 3
|
||||
#define SPIWP_IN_IDX 4
|
||||
#define SPIWP_OUT_IDX 4
|
||||
#define SPICS0_IN_IDX 5
|
||||
#define SPICS0_OUT_IDX 5
|
||||
#define SPICS1_IN_IDX 6
|
||||
#define SPICS1_OUT_IDX 6
|
||||
#define SPICS2_IN_IDX 7
|
||||
#define SPICS2_OUT_IDX 7
|
||||
#define HSPICLK_IN_IDX 8
|
||||
#define HSPICLK_OUT_IDX 8
|
||||
#define HSPIQ_IN_IDX 9
|
||||
#define HSPIQ_OUT_IDX 9
|
||||
#define HSPID_IN_IDX 10
|
||||
#define HSPID_OUT_IDX 10
|
||||
#define HSPICS0_IN_IDX 11
|
||||
#define HSPICS0_OUT_IDX 11
|
||||
#define HSPIHD_IN_IDX 12
|
||||
#define HSPIHD_OUT_IDX 12
|
||||
#define HSPIWP_IN_IDX 13
|
||||
#define HSPIWP_OUT_IDX 13
|
||||
#define U0RXD_IN_IDX 14
|
||||
#define U0TXD_OUT_IDX 14
|
||||
#define U0CTS_IN_IDX 15
|
||||
#define U0RTS_OUT_IDX 15
|
||||
#define U0DSR_IN_IDX 16
|
||||
#define U0DTR_OUT_IDX 16
|
||||
#define U1RXD_IN_IDX 17
|
||||
#define U1TXD_OUT_IDX 17
|
||||
#define U1CTS_IN_IDX 18
|
||||
#define U1RTS_OUT_IDX 18
|
||||
#define I2CM_SCL_O_IDX 19
|
||||
#define I2CM_SDA_I_IDX 20
|
||||
#define I2CM_SDA_O_IDX 20
|
||||
#define EXT_I2C_SCL_O_IDX 21
|
||||
#define EXT_I2C_SDA_O_IDX 22
|
||||
#define EXT_I2C_SDA_I_IDX 22
|
||||
#define I2S0O_BCK_IN_IDX 23
|
||||
#define I2S0O_BCK_OUT_IDX 23
|
||||
#define I2S1O_BCK_IN_IDX 24
|
||||
#define I2S1O_BCK_OUT_IDX 24
|
||||
#define I2S0O_WS_IN_IDX 25
|
||||
#define I2S0O_WS_OUT_IDX 25
|
||||
#define I2S1O_WS_IN_IDX 26
|
||||
#define I2S1O_WS_OUT_IDX 26
|
||||
#define I2S0I_BCK_IN_IDX 27
|
||||
#define I2S0I_BCK_OUT_IDX 27
|
||||
#define I2S0I_WS_IN_IDX 28
|
||||
#define I2S0I_WS_OUT_IDX 28
|
||||
#define I2CEXT0_SCL_IN_IDX 29
|
||||
#define I2CEXT0_SCL_OUT_IDX 29
|
||||
#define I2CEXT0_SDA_IN_IDX 30
|
||||
#define I2CEXT0_SDA_OUT_IDX 30
|
||||
#define PWM0_SYNC0_IN_IDX 31
|
||||
#define SDIO_TOHOST_INT_OUT_IDX 31
|
||||
#define PWM0_SYNC1_IN_IDX 32
|
||||
#define PWM0_OUT0A_IDX 32
|
||||
#define PWM0_SYNC2_IN_IDX 33
|
||||
#define PWM0_OUT0B_IDX 33
|
||||
#define PWM0_F0_IN_IDX 34
|
||||
#define PWM0_OUT1A_IDX 34
|
||||
#define PWM0_F1_IN_IDX 35
|
||||
#define PWM0_OUT1B_IDX 35
|
||||
#define PWM0_F2_IN_IDX 36
|
||||
#define PWM0_OUT2A_IDX 36
|
||||
#define GPIO_BT_ACTIVE_IDX 37
|
||||
#define PWM0_OUT2B_IDX 37
|
||||
#define GPIO_BT_PRIORITY_IDX 38
|
||||
#define PCNT_SIG_CH0_IN0_IDX 39
|
||||
#define PCNT_SIG_CH1_IN0_IDX 40
|
||||
#define GPIO_WLAN_ACTIVE_IDX 40
|
||||
#define PCNT_CTRL_CH0_IN0_IDX 41
|
||||
#define BB_DIAG0_IDX 41
|
||||
#define PCNT_CTRL_CH1_IN0_IDX 42
|
||||
#define BB_DIAG1_IDX 42
|
||||
#define PCNT_SIG_CH0_IN1_IDX 43
|
||||
#define BB_DIAG2_IDX 43
|
||||
#define PCNT_SIG_CH1_IN1_IDX 44
|
||||
#define BB_DIAG3_IDX 44
|
||||
#define PCNT_CTRL_CH0_IN1_IDX 45
|
||||
#define BB_DIAG4_IDX 45
|
||||
#define PCNT_CTRL_CH1_IN1_IDX 46
|
||||
#define BB_DIAG5_IDX 46
|
||||
#define PCNT_SIG_CH0_IN2_IDX 47
|
||||
#define BB_DIAG6_IDX 47
|
||||
#define PCNT_SIG_CH1_IN2_IDX 48
|
||||
#define BB_DIAG7_IDX 48
|
||||
#define PCNT_CTRL_CH0_IN2_IDX 49
|
||||
#define BB_DIAG8_IDX 49
|
||||
#define PCNT_CTRL_CH1_IN2_IDX 50
|
||||
#define BB_DIAG9_IDX 50
|
||||
#define PCNT_SIG_CH0_IN3_IDX 51
|
||||
#define BB_DIAG10_IDX 51
|
||||
#define PCNT_SIG_CH1_IN3_IDX 52
|
||||
#define BB_DIAG11_IDX 52
|
||||
#define PCNT_CTRL_CH0_IN3_IDX 53
|
||||
#define BB_DIAG12_IDX 53
|
||||
#define PCNT_CTRL_CH1_IN3_IDX 54
|
||||
#define BB_DIAG13_IDX 54
|
||||
#define PCNT_SIG_CH0_IN4_IDX 55
|
||||
#define BB_DIAG14_IDX 55
|
||||
#define PCNT_SIG_CH1_IN4_IDX 56
|
||||
#define BB_DIAG15_IDX 56
|
||||
#define PCNT_CTRL_CH0_IN4_IDX 57
|
||||
#define BB_DIAG16_IDX 57
|
||||
#define PCNT_CTRL_CH1_IN4_IDX 58
|
||||
#define BB_DIAG17_IDX 58
|
||||
#define BB_DIAG18_IDX 59
|
||||
#define BB_DIAG19_IDX 60
|
||||
#define HSPICS1_IN_IDX 61
|
||||
#define HSPICS1_OUT_IDX 61
|
||||
#define HSPICS2_IN_IDX 62
|
||||
#define HSPICS2_OUT_IDX 62
|
||||
#define VSPICLK_IN_IDX 63
|
||||
#define VSPICLK_OUT_IDX 63
|
||||
#define VSPIQ_IN_IDX 64
|
||||
#define VSPIQ_OUT_IDX 64
|
||||
#define VSPID_IN_IDX 65
|
||||
#define VSPID_OUT_IDX 65
|
||||
#define VSPIHD_IN_IDX 66
|
||||
#define VSPIHD_OUT_IDX 66
|
||||
#define VSPIWP_IN_IDX 67
|
||||
#define VSPIWP_OUT_IDX 67
|
||||
#define VSPICS0_IN_IDX 68
|
||||
#define VSPICS0_OUT_IDX 68
|
||||
#define VSPICS1_IN_IDX 69
|
||||
#define VSPICS1_OUT_IDX 69
|
||||
#define VSPICS2_IN_IDX 70
|
||||
#define VSPICS2_OUT_IDX 70
|
||||
#define PCNT_SIG_CH0_IN5_IDX 71
|
||||
#define LEDC_HS_SIG_OUT0_IDX 71
|
||||
#define PCNT_SIG_CH1_IN5_IDX 72
|
||||
#define LEDC_HS_SIG_OUT1_IDX 72
|
||||
#define PCNT_CTRL_CH0_IN5_IDX 73
|
||||
#define LEDC_HS_SIG_OUT2_IDX 73
|
||||
#define PCNT_CTRL_CH1_IN5_IDX 74
|
||||
#define LEDC_HS_SIG_OUT3_IDX 74
|
||||
#define PCNT_SIG_CH0_IN6_IDX 75
|
||||
#define LEDC_HS_SIG_OUT4_IDX 75
|
||||
#define PCNT_SIG_CH1_IN6_IDX 76
|
||||
#define LEDC_HS_SIG_OUT5_IDX 76
|
||||
#define PCNT_CTRL_CH0_IN6_IDX 77
|
||||
#define LEDC_HS_SIG_OUT6_IDX 77
|
||||
#define PCNT_CTRL_CH1_IN6_IDX 78
|
||||
#define LEDC_HS_SIG_OUT7_IDX 78
|
||||
#define PCNT_SIG_CH0_IN7_IDX 79
|
||||
#define LEDC_LS_SIG_OUT0_IDX 79
|
||||
#define PCNT_SIG_CH1_IN7_IDX 80
|
||||
#define LEDC_LS_SIG_OUT1_IDX 80
|
||||
#define PCNT_CTRL_CH0_IN7_IDX 81
|
||||
#define LEDC_LS_SIG_OUT2_IDX 81
|
||||
#define PCNT_CTRL_CH1_IN7_IDX 82
|
||||
#define LEDC_LS_SIG_OUT3_IDX 82
|
||||
#define RMT_SIG_IN0_IDX 83
|
||||
#define LEDC_LS_SIG_OUT4_IDX 83
|
||||
#define RMT_SIG_IN1_IDX 84
|
||||
#define LEDC_LS_SIG_OUT5_IDX 84
|
||||
#define RMT_SIG_IN2_IDX 85
|
||||
#define LEDC_LS_SIG_OUT6_IDX 85
|
||||
#define RMT_SIG_IN3_IDX 86
|
||||
#define LEDC_LS_SIG_OUT7_IDX 86
|
||||
#define RMT_SIG_IN4_IDX 87
|
||||
#define RMT_SIG_OUT0_IDX 87
|
||||
#define RMT_SIG_IN5_IDX 88
|
||||
#define RMT_SIG_OUT1_IDX 88
|
||||
#define RMT_SIG_IN6_IDX 89
|
||||
#define RMT_SIG_OUT2_IDX 89
|
||||
#define RMT_SIG_IN7_IDX 90
|
||||
#define RMT_SIG_OUT3_IDX 90
|
||||
#define RMT_SIG_OUT4_IDX 91
|
||||
#define RMT_SIG_OUT5_IDX 92
|
||||
#define EXT_ADC_START_IDX 93
|
||||
#define RMT_SIG_OUT6_IDX 93
|
||||
#define CAN_RX_IDX 94
|
||||
#define RMT_SIG_OUT7_IDX 94
|
||||
#define I2CEXT1_SCL_IN_IDX 95
|
||||
#define I2CEXT1_SCL_OUT_IDX 95
|
||||
#define I2CEXT1_SDA_IN_IDX 96
|
||||
#define I2CEXT1_SDA_OUT_IDX 96
|
||||
#define HOST_CARD_DETECT_N_1_IDX 97
|
||||
#define HOST_CCMD_OD_PULLUP_EN_N_IDX 97
|
||||
#define HOST_CARD_DETECT_N_2_IDX 98
|
||||
#define HOST_RST_N_1_IDX 98
|
||||
#define HOST_CARD_WRITE_PRT_1_IDX 99
|
||||
#define HOST_RST_N_2_IDX 99
|
||||
#define HOST_CARD_WRITE_PRT_2_IDX 100
|
||||
#define GPIO_SD0_OUT_IDX 100
|
||||
#define HOST_CARD_INT_N_1_IDX 101
|
||||
#define GPIO_SD1_OUT_IDX 101
|
||||
#define HOST_CARD_INT_N_2_IDX 102
|
||||
#define GPIO_SD2_OUT_IDX 102
|
||||
#define PWM1_SYNC0_IN_IDX 103
|
||||
#define GPIO_SD3_OUT_IDX 103
|
||||
#define PWM1_SYNC1_IN_IDX 104
|
||||
#define GPIO_SD4_OUT_IDX 104
|
||||
#define PWM1_SYNC2_IN_IDX 105
|
||||
#define GPIO_SD5_OUT_IDX 105
|
||||
#define PWM1_F0_IN_IDX 106
|
||||
#define GPIO_SD6_OUT_IDX 106
|
||||
#define PWM1_F1_IN_IDX 107
|
||||
#define GPIO_SD7_OUT_IDX 107
|
||||
#define PWM1_F2_IN_IDX 108
|
||||
#define PWM1_OUT0A_IDX 108
|
||||
#define PWM0_CAP0_IN_IDX 109
|
||||
#define PWM1_OUT0B_IDX 109
|
||||
#define PWM0_CAP1_IN_IDX 110
|
||||
#define PWM1_OUT1A_IDX 110
|
||||
#define PWM0_CAP2_IN_IDX 111
|
||||
#define PWM1_OUT1B_IDX 111
|
||||
#define PWM1_CAP0_IN_IDX 112
|
||||
#define PWM1_OUT2A_IDX 112
|
||||
#define PWM1_CAP1_IN_IDX 113
|
||||
#define PWM1_OUT2B_IDX 113
|
||||
#define PWM1_CAP2_IN_IDX 114
|
||||
#define PWM2_OUT1H_IDX 114
|
||||
#define PWM2_FLTA_IDX 115
|
||||
#define PWM2_OUT1L_IDX 115
|
||||
#define PWM2_FLTB_IDX 116
|
||||
#define PWM2_OUT2H_IDX 116
|
||||
#define PWM2_CAP1_IN_IDX 117
|
||||
#define PWM2_OUT2L_IDX 117
|
||||
#define PWM2_CAP2_IN_IDX 118
|
||||
#define PWM2_OUT3H_IDX 118
|
||||
#define PWM2_CAP3_IN_IDX 119
|
||||
#define PWM2_OUT3L_IDX 119
|
||||
#define PWM3_FLTA_IDX 120
|
||||
#define PWM2_OUT4H_IDX 120
|
||||
#define PWM3_FLTB_IDX 121
|
||||
#define PWM2_OUT4L_IDX 121
|
||||
#define PWM3_CAP1_IN_IDX 122
|
||||
#define PWM3_CAP2_IN_IDX 123
|
||||
#define CAN_TX_IDX 123
|
||||
#define PWM3_CAP3_IN_IDX 124
|
||||
#define CAN_BUS_OFF_ON_IDX 124
|
||||
#define CAN_CLKOUT_IDX 125
|
||||
#define SPID4_IN_IDX 128
|
||||
#define SPID4_OUT_IDX 128
|
||||
#define SPID5_IN_IDX 129
|
||||
#define SPID5_OUT_IDX 129
|
||||
#define SPID6_IN_IDX 130
|
||||
#define SPID6_OUT_IDX 130
|
||||
#define SPID7_IN_IDX 131
|
||||
#define SPID7_OUT_IDX 131
|
||||
#define HSPID4_IN_IDX 132
|
||||
#define HSPID4_OUT_IDX 132
|
||||
#define HSPID5_IN_IDX 133
|
||||
#define HSPID5_OUT_IDX 133
|
||||
#define HSPID6_IN_IDX 134
|
||||
#define HSPID6_OUT_IDX 134
|
||||
#define HSPID7_IN_IDX 135
|
||||
#define HSPID7_OUT_IDX 135
|
||||
#define VSPID4_IN_IDX 136
|
||||
#define VSPID4_OUT_IDX 136
|
||||
#define VSPID5_IN_IDX 137
|
||||
#define VSPID5_OUT_IDX 137
|
||||
#define VSPID6_IN_IDX 138
|
||||
#define VSPID6_OUT_IDX 138
|
||||
#define VSPID7_IN_IDX 139
|
||||
#define VSPID7_OUT_IDX 139
|
||||
#define I2S0I_DATA_IN0_IDX 140
|
||||
#define I2S0O_DATA_OUT0_IDX 140
|
||||
#define I2S0I_DATA_IN1_IDX 141
|
||||
#define I2S0O_DATA_OUT1_IDX 141
|
||||
#define I2S0I_DATA_IN2_IDX 142
|
||||
#define I2S0O_DATA_OUT2_IDX 142
|
||||
#define I2S0I_DATA_IN3_IDX 143
|
||||
#define I2S0O_DATA_OUT3_IDX 143
|
||||
#define I2S0I_DATA_IN4_IDX 144
|
||||
#define I2S0O_DATA_OUT4_IDX 144
|
||||
#define I2S0I_DATA_IN5_IDX 145
|
||||
#define I2S0O_DATA_OUT5_IDX 145
|
||||
#define I2S0I_DATA_IN6_IDX 146
|
||||
#define I2S0O_DATA_OUT6_IDX 146
|
||||
#define I2S0I_DATA_IN7_IDX 147
|
||||
#define I2S0O_DATA_OUT7_IDX 147
|
||||
#define I2S0I_DATA_IN8_IDX 148
|
||||
#define I2S0O_DATA_OUT8_IDX 148
|
||||
#define I2S0I_DATA_IN9_IDX 149
|
||||
#define I2S0O_DATA_OUT9_IDX 149
|
||||
#define I2S0I_DATA_IN10_IDX 150
|
||||
#define I2S0O_DATA_OUT10_IDX 150
|
||||
#define I2S0I_DATA_IN11_IDX 151
|
||||
#define I2S0O_DATA_OUT11_IDX 151
|
||||
#define I2S0I_DATA_IN12_IDX 152
|
||||
#define I2S0O_DATA_OUT12_IDX 152
|
||||
#define I2S0I_DATA_IN13_IDX 153
|
||||
#define I2S0O_DATA_OUT13_IDX 153
|
||||
#define I2S0I_DATA_IN14_IDX 154
|
||||
#define I2S0O_DATA_OUT14_IDX 154
|
||||
#define I2S0I_DATA_IN15_IDX 155
|
||||
#define I2S0O_DATA_OUT15_IDX 155
|
||||
#define I2S0O_DATA_OUT16_IDX 156
|
||||
#define I2S0O_DATA_OUT17_IDX 157
|
||||
#define I2S0O_DATA_OUT18_IDX 158
|
||||
#define I2S0O_DATA_OUT19_IDX 159
|
||||
#define I2S0O_DATA_OUT20_IDX 160
|
||||
#define I2S0O_DATA_OUT21_IDX 161
|
||||
#define I2S0O_DATA_OUT22_IDX 162
|
||||
#define I2S0O_DATA_OUT23_IDX 163
|
||||
#define I2S1I_BCK_IN_IDX 164
|
||||
#define I2S1I_BCK_OUT_IDX 164
|
||||
#define I2S1I_WS_IN_IDX 165
|
||||
#define I2S1I_WS_OUT_IDX 165
|
||||
#define I2S1I_DATA_IN0_IDX 166
|
||||
#define I2S1O_DATA_OUT0_IDX 166
|
||||
#define I2S1I_DATA_IN1_IDX 167
|
||||
#define I2S1O_DATA_OUT1_IDX 167
|
||||
#define I2S1I_DATA_IN2_IDX 168
|
||||
#define I2S1O_DATA_OUT2_IDX 168
|
||||
#define I2S1I_DATA_IN3_IDX 169
|
||||
#define I2S1O_DATA_OUT3_IDX 169
|
||||
#define I2S1I_DATA_IN4_IDX 170
|
||||
#define I2S1O_DATA_OUT4_IDX 170
|
||||
#define I2S1I_DATA_IN5_IDX 171
|
||||
#define I2S1O_DATA_OUT5_IDX 171
|
||||
#define I2S1I_DATA_IN6_IDX 172
|
||||
#define I2S1O_DATA_OUT6_IDX 172
|
||||
#define I2S1I_DATA_IN7_IDX 173
|
||||
#define I2S1O_DATA_OUT7_IDX 173
|
||||
#define I2S1I_DATA_IN8_IDX 174
|
||||
#define I2S1O_DATA_OUT8_IDX 174
|
||||
#define I2S1I_DATA_IN9_IDX 175
|
||||
#define I2S1O_DATA_OUT9_IDX 175
|
||||
#define I2S1I_DATA_IN10_IDX 176
|
||||
#define I2S1O_DATA_OUT10_IDX 176
|
||||
#define I2S1I_DATA_IN11_IDX 177
|
||||
#define I2S1O_DATA_OUT11_IDX 177
|
||||
#define I2S1I_DATA_IN12_IDX 178
|
||||
#define I2S1O_DATA_OUT12_IDX 178
|
||||
#define I2S1I_DATA_IN13_IDX 179
|
||||
#define I2S1O_DATA_OUT13_IDX 179
|
||||
#define I2S1I_DATA_IN14_IDX 180
|
||||
#define I2S1O_DATA_OUT14_IDX 180
|
||||
#define I2S1I_DATA_IN15_IDX 181
|
||||
#define I2S1O_DATA_OUT15_IDX 181
|
||||
#define I2S1O_DATA_OUT16_IDX 182
|
||||
#define I2S1O_DATA_OUT17_IDX 183
|
||||
#define I2S1O_DATA_OUT18_IDX 184
|
||||
#define I2S1O_DATA_OUT19_IDX 185
|
||||
#define I2S1O_DATA_OUT20_IDX 186
|
||||
#define I2S1O_DATA_OUT21_IDX 187
|
||||
#define I2S1O_DATA_OUT22_IDX 188
|
||||
#define I2S1O_DATA_OUT23_IDX 189
|
||||
#define I2S0I_H_SYNC_IDX 190
|
||||
#define PWM3_OUT1H_IDX 190
|
||||
#define I2S0I_V_SYNC_IDX 191
|
||||
#define PWM3_OUT1L_IDX 191
|
||||
#define I2S0I_H_ENABLE_IDX 192
|
||||
#define PWM3_OUT2H_IDX 192
|
||||
#define I2S1I_H_SYNC_IDX 193
|
||||
#define PWM3_OUT2L_IDX 193
|
||||
#define I2S1I_V_SYNC_IDX 194
|
||||
#define PWM3_OUT3H_IDX 194
|
||||
#define I2S1I_H_ENABLE_IDX 195
|
||||
#define PWM3_OUT3L_IDX 195
|
||||
#define PWM3_OUT4H_IDX 196
|
||||
#define PWM3_OUT4L_IDX 197
|
||||
#define U2RXD_IN_IDX 198
|
||||
#define U2TXD_OUT_IDX 198
|
||||
#define U2CTS_IN_IDX 199
|
||||
#define U2RTS_OUT_IDX 199
|
||||
#define EMAC_MDC_I_IDX 200
|
||||
#define EMAC_MDC_O_IDX 200
|
||||
#define EMAC_MDI_I_IDX 201
|
||||
#define EMAC_MDO_O_IDX 201
|
||||
#define EMAC_CRS_I_IDX 202
|
||||
#define EMAC_CRS_O_IDX 202
|
||||
#define EMAC_COL_I_IDX 203
|
||||
#define EMAC_COL_O_IDX 203
|
||||
#define PCMFSYNC_IN_IDX 204
|
||||
#define BT_AUDIO0_IRQ_IDX 204
|
||||
#define PCMCLK_IN_IDX 205
|
||||
#define BT_AUDIO1_IRQ_IDX 205
|
||||
#define PCMDIN_IDX 206
|
||||
#define BT_AUDIO2_IRQ_IDX 206
|
||||
#define BLE_AUDIO0_IRQ_IDX 207
|
||||
#define BLE_AUDIO1_IRQ_IDX 208
|
||||
#define BLE_AUDIO2_IRQ_IDX 209
|
||||
#define PCMFSYNC_OUT_IDX 210
|
||||
#define PCMCLK_OUT_IDX 211
|
||||
#define PCMDOUT_IDX 212
|
||||
#define BLE_AUDIO_SYNC0_P_IDX 213
|
||||
#define BLE_AUDIO_SYNC1_P_IDX 214
|
||||
#define BLE_AUDIO_SYNC2_P_IDX 215
|
||||
#define ANT_SEL0_IDX 216
|
||||
#define ANT_SEL1_IDX 217
|
||||
#define ANT_SEL2_IDX 218
|
||||
#define ANT_SEL3_IDX 219
|
||||
#define ANT_SEL4_IDX 220
|
||||
#define ANT_SEL5_IDX 221
|
||||
#define ANT_SEL6_IDX 222
|
||||
#define ANT_SEL7_IDX 223
|
||||
#define SIG_IN_FUNC224_IDX 224
|
||||
#define SIG_IN_FUNC225_IDX 225
|
||||
#define SIG_IN_FUNC226_IDX 226
|
||||
#define SIG_IN_FUNC227_IDX 227
|
||||
#define SIG_IN_FUNC228_IDX 228
|
||||
#define SIG_GPIO_OUT_IDX 256
|
||||
#endif /* _SOC_GPIO_SIG_MAP_H_ */
|
@ -1,204 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_GPIO_STRUCT_H_
|
||||
#define _SOC_GPIO_STRUCT_H_
|
||||
typedef volatile struct {
|
||||
uint32_t bt_select; /*NA*/
|
||||
uint32_t out; /*GPIO0~31 output value*/
|
||||
uint32_t out_w1ts; /*GPIO0~31 output value write 1 to set*/
|
||||
uint32_t out_w1tc; /*GPIO0~31 output value write 1 to clear*/
|
||||
union {
|
||||
struct {
|
||||
uint32_t data: 8; /*GPIO32~39 output value*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} out1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t data: 8; /*GPIO32~39 output value write 1 to set*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} out1_w1ts;
|
||||
union {
|
||||
struct {
|
||||
uint32_t data: 8; /*GPIO32~39 output value write 1 to clear*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} out1_w1tc;
|
||||
union {
|
||||
struct {
|
||||
uint32_t sel: 8; /*SDIO PADS on/off control from outside*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} sdio_select;
|
||||
uint32_t enable; /*GPIO0~31 output enable*/
|
||||
uint32_t enable_w1ts; /*GPIO0~31 output enable write 1 to set*/
|
||||
uint32_t enable_w1tc; /*GPIO0~31 output enable write 1 to clear*/
|
||||
union {
|
||||
struct {
|
||||
uint32_t data: 8; /*GPIO32~39 output enable*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} enable1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t data: 8; /*GPIO32~39 output enable write 1 to set*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} enable1_w1ts;
|
||||
union {
|
||||
struct {
|
||||
uint32_t data: 8; /*GPIO32~39 output enable write 1 to clear*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} enable1_w1tc;
|
||||
union {
|
||||
struct {
|
||||
uint32_t strapping: 16; /*GPIO strapping results: {2'd0 boot_sel_dig[7:1] vsdio_boot_sel boot_sel_chip[5:0]} . Boot_sel_dig[7:1]: {U0RXD SD_CLK SD_CMD SD_DATA0 SD_DATA1 SD_DATA2 SD_DATA3} . vsdio_boot_sel: MTDI. boot_sel_chip[5:0]: {GPIO0 U0TXD GPIO2 GPIO4 MTDO GPIO5} */
|
||||
uint32_t reserved16:16;
|
||||
};
|
||||
uint32_t val;
|
||||
} strap;
|
||||
uint32_t in; /*GPIO0~31 input value*/
|
||||
union {
|
||||
struct {
|
||||
uint32_t data: 8; /*GPIO32~39 input value*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} in1;
|
||||
uint32_t status; /*GPIO0~31 interrupt status*/
|
||||
uint32_t status_w1ts; /*GPIO0~31 interrupt status write 1 to set*/
|
||||
uint32_t status_w1tc; /*GPIO0~31 interrupt status write 1 to clear*/
|
||||
union {
|
||||
struct {
|
||||
uint32_t intr_st: 8; /*GPIO32~39 interrupt status*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} status1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t intr_st: 8; /*GPIO32~39 interrupt status write 1 to set*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} status1_w1ts;
|
||||
union {
|
||||
struct {
|
||||
uint32_t intr_st: 8; /*GPIO32~39 interrupt status write 1 to clear*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} status1_w1tc;
|
||||
uint32_t reserved_5c;
|
||||
uint32_t acpu_int; /*GPIO0~31 APP CPU interrupt status*/
|
||||
uint32_t acpu_nmi_int; /*GPIO0~31 APP CPU non-maskable interrupt status*/
|
||||
uint32_t pcpu_int; /*GPIO0~31 PRO CPU interrupt status*/
|
||||
uint32_t pcpu_nmi_int; /*GPIO0~31 PRO CPU non-maskable interrupt status*/
|
||||
uint32_t cpusdio_int; /*SDIO's extent GPIO0~31 interrupt*/
|
||||
union {
|
||||
struct {
|
||||
uint32_t intr: 8; /*GPIO32~39 APP CPU interrupt status*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} acpu_int1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t intr: 8; /*GPIO32~39 APP CPU non-maskable interrupt status*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} acpu_nmi_int1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t intr: 8; /*GPIO32~39 PRO CPU interrupt status*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} pcpu_int1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t intr: 8; /*GPIO32~39 PRO CPU non-maskable interrupt status*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} pcpu_nmi_int1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t intr: 8; /*SDIO's extent GPIO32~39 interrupt*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} cpusdio_int1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t reserved0: 2;
|
||||
uint32_t pad_driver: 1; /*if set to 0: normal output if set to 1: open drain*/
|
||||
uint32_t reserved3: 4;
|
||||
uint32_t int_type: 3; /*if set to 0: GPIO interrupt disable if set to 1: rising edge trigger if set to 2: falling edge trigger if set to 3: any edge trigger if set to 4: low level trigger if set to 5: high level trigger*/
|
||||
uint32_t wakeup_enable: 1; /*GPIO wake up enable only available in light sleep*/
|
||||
uint32_t config: 2; /*NA*/
|
||||
uint32_t int_ena: 5; /*bit0: APP CPU interrupt enable bit1: APP CPU non-maskable interrupt enable bit3: PRO CPU interrupt enable bit4: PRO CPU non-maskable interrupt enable bit5: SDIO's extent interrupt enable*/
|
||||
uint32_t reserved18: 14;
|
||||
};
|
||||
uint32_t val;
|
||||
} pin[40];
|
||||
union {
|
||||
struct {
|
||||
uint32_t rtc_max: 10;
|
||||
uint32_t reserved10: 21;
|
||||
uint32_t start: 1;
|
||||
};
|
||||
uint32_t val;
|
||||
} cali_conf;
|
||||
union {
|
||||
struct {
|
||||
uint32_t value_sync2: 20;
|
||||
uint32_t reserved20: 10;
|
||||
uint32_t rdy_real: 1;
|
||||
uint32_t rdy_sync2: 1;
|
||||
};
|
||||
uint32_t val;
|
||||
} cali_data;
|
||||
union {
|
||||
struct {
|
||||
uint32_t func_sel: 6; /*select one of the 256 inputs*/
|
||||
uint32_t sig_in_inv: 1; /*revert the value of the input if you want to revert please set the value to 1*/
|
||||
uint32_t sig_in_sel: 1; /*if the slow signal bypass the io matrix or not if you want setting the value to 1*/
|
||||
uint32_t reserved8: 24; /*The 256 registers below are selection control for 256 input signals connected to GPIO matrix's 40 GPIO input if GPIO_FUNCx_IN_SEL is set to n(0<=n<40): it means GPIOn input is used for input signal x if GPIO_FUNCx_IN_SEL is set to 0x38: the input signal x is set to 1 if GPIO_FUNCx_IN_SEL is set to 0x30: the input signal x is set to 0*/
|
||||
};
|
||||
uint32_t val;
|
||||
} func_in_sel_cfg[256];
|
||||
union {
|
||||
struct {
|
||||
uint32_t func_sel: 9; /*select one of the 256 output to 40 GPIO*/
|
||||
uint32_t inv_sel: 1; /*invert the output value if you want to revert the output value setting the value to 1*/
|
||||
uint32_t oen_sel: 1; /*weather using the logical oen signal or not using the value setting by the register*/
|
||||
uint32_t oen_inv_sel: 1; /*invert the output enable value if you want to revert the output enable value setting the value to 1*/
|
||||
uint32_t reserved12: 20; /*The 40 registers below are selection control for 40 GPIO output if GPIO_FUNCx_OUT_SEL is set to n(0<=n<256): it means GPIOn input is used for output signal x if GPIO_FUNCx_OUT_INV_SEL is set to 1 the output signal x is set to ~value. if GPIO_FUNC0_OUT_SEL is 256 or GPIO_FUNC0_OEN_SEL is 1 using GPIO_ENABLE_DATA[x] for the enable value else using the signal enable*/
|
||||
};
|
||||
uint32_t val;
|
||||
} func_out_sel_cfg[40];
|
||||
} gpio_dev_t;
|
||||
extern gpio_dev_t GPIO;
|
||||
#endif /* _SOC_GPIO_STRUCT_H_ */
|
@ -1,60 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef __HWCRYPTO_REG_H__
|
||||
#define __HWCRYPTO_REG_H__
|
||||
|
||||
#include "soc.h"
|
||||
|
||||
/* registers for RSA acceleration via Multiple Precision Integer ops */
|
||||
#define RSA_MEM_M_BLOCK_BASE ((DR_REG_RSA_BASE)+0x000)
|
||||
/* RB & Z use the same memory block, depending on phase of operation */
|
||||
#define RSA_MEM_RB_BLOCK_BASE ((DR_REG_RSA_BASE)+0x200)
|
||||
#define RSA_MEM_Z_BLOCK_BASE ((DR_REG_RSA_BASE)+0x200)
|
||||
#define RSA_MEM_Y_BLOCK_BASE ((DR_REG_RSA_BASE)+0x400)
|
||||
#define RSA_MEM_X_BLOCK_BASE ((DR_REG_RSA_BASE)+0x600)
|
||||
|
||||
#define RSA_M_DASH_REG (DR_REG_RSA_BASE + 0x800)
|
||||
#define RSA_MODEXP_MODE_REG (DR_REG_RSA_BASE + 0x804)
|
||||
#define RSA_START_MODEXP_REG (DR_REG_RSA_BASE + 0x808)
|
||||
#define RSA_MULT_MODE_REG (DR_REG_RSA_BASE + 0x80c)
|
||||
#define RSA_MULT_START_REG (DR_REG_RSA_BASE + 0x810)
|
||||
|
||||
#define RSA_INTERRUPT_REG (DR_REG_RSA_BASE + 0x814)
|
||||
|
||||
#define RSA_CLEAN_REG (DR_REG_RSA_BASE + 0x818)
|
||||
|
||||
/* SHA acceleration registers */
|
||||
#define SHA_TEXT_BASE ((DR_REG_SHA_BASE) + 0x00)
|
||||
|
||||
#define SHA_1_START_REG ((DR_REG_SHA_BASE) + 0x80)
|
||||
#define SHA_1_CONTINUE_REG ((DR_REG_SHA_BASE) + 0x84)
|
||||
#define SHA_1_LOAD_REG ((DR_REG_SHA_BASE) + 0x88)
|
||||
#define SHA_1_BUSY_REG ((DR_REG_SHA_BASE) + 0x8c)
|
||||
|
||||
#define SHA_256_START_REG ((DR_REG_SHA_BASE) + 0x90)
|
||||
#define SHA_256_CONTINUE_REG ((DR_REG_SHA_BASE) + 0x94)
|
||||
#define SHA_256_LOAD_REG ((DR_REG_SHA_BASE) + 0x98)
|
||||
#define SHA_256_BUSY_REG ((DR_REG_SHA_BASE) + 0x9c)
|
||||
|
||||
#define SHA_384_START_REG ((DR_REG_SHA_BASE) + 0xa0)
|
||||
#define SHA_384_CONTINUE_REG ((DR_REG_SHA_BASE) + 0xa4)
|
||||
#define SHA_384_LOAD_REG ((DR_REG_SHA_BASE) + 0xa8)
|
||||
#define SHA_384_BUSY_REG ((DR_REG_SHA_BASE) + 0xac)
|
||||
|
||||
#define SHA_512_START_REG ((DR_REG_SHA_BASE) + 0xb0)
|
||||
#define SHA_512_CONTINUE_REG ((DR_REG_SHA_BASE) + 0xb4)
|
||||
#define SHA_512_LOAD_REG ((DR_REG_SHA_BASE) + 0xb8)
|
||||
#define SHA_512_BUSY_REG ((DR_REG_SHA_BASE) + 0xbc)
|
||||
|
||||
#endif
|
@ -1,951 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_I2C_REG_H_
|
||||
#define _SOC_I2C_REG_H_
|
||||
|
||||
|
||||
#include "soc.h"
|
||||
|
||||
#define REG_I2C_BASE(i) (DR_REG_I2C_EXT_BASE + (i) * 0x14000 )
|
||||
|
||||
#define I2C_SCL_LOW_PERIOD_REG(i) (REG_I2C_BASE(i) + 0x0000)
|
||||
/* I2C_SCL_LOW_PERIOD : R/W ;bitpos:[13:0] ;default: 14'b0 ; */
|
||||
/*description: This register is used to configure the low level width of SCL clock.*/
|
||||
#define I2C_SCL_LOW_PERIOD 0x00003FFF
|
||||
#define I2C_SCL_LOW_PERIOD_M ((I2C_SCL_LOW_PERIOD_V)<<(I2C_SCL_LOW_PERIOD_S))
|
||||
#define I2C_SCL_LOW_PERIOD_V 0x3FFF
|
||||
#define I2C_SCL_LOW_PERIOD_S 0
|
||||
|
||||
#define I2C_CTR_REG(i) (REG_I2C_BASE(i) + 0x0004)
|
||||
/* I2C_CLK_EN : R/W ;bitpos:[8] ;default: 1'b0 ; */
|
||||
/*description: This is the clock gating control bit for reading or writing registers.*/
|
||||
#define I2C_CLK_EN (BIT(8))
|
||||
#define I2C_CLK_EN_M (BIT(8))
|
||||
#define I2C_CLK_EN_V 0x1
|
||||
#define I2C_CLK_EN_S 8
|
||||
/* I2C_RX_LSB_FIRST : R/W ;bitpos:[7] ;default: 1'h0 ; */
|
||||
/*description: This bit is used to control the storage mode for received datas.
|
||||
1: receive data from most significant bit 0: receive data from least significant bit*/
|
||||
#define I2C_RX_LSB_FIRST (BIT(7))
|
||||
#define I2C_RX_LSB_FIRST_M (BIT(7))
|
||||
#define I2C_RX_LSB_FIRST_V 0x1
|
||||
#define I2C_RX_LSB_FIRST_S 7
|
||||
/* I2C_TX_LSB_FIRST : R/W ;bitpos:[6] ;default: 1'b0 ; */
|
||||
/*description: This bit is used to control the sending mode for data need to
|
||||
be send. 1: receive data from most significant bit 0: receive data from least significant bit*/
|
||||
#define I2C_TX_LSB_FIRST (BIT(6))
|
||||
#define I2C_TX_LSB_FIRST_M (BIT(6))
|
||||
#define I2C_TX_LSB_FIRST_V 0x1
|
||||
#define I2C_TX_LSB_FIRST_S 6
|
||||
/* I2C_TRANS_START : R/W ;bitpos:[5] ;default: 1'b0 ; */
|
||||
/*description: Set this bit to start sending data in txfifo.*/
|
||||
#define I2C_TRANS_START (BIT(5))
|
||||
#define I2C_TRANS_START_M (BIT(5))
|
||||
#define I2C_TRANS_START_V 0x1
|
||||
#define I2C_TRANS_START_S 5
|
||||
/* I2C_MS_MODE : R/W ;bitpos:[4] ;default: 1'b0 ; */
|
||||
/*description: Set this bit to configure the module as i2c master clear this
|
||||
bit to configure the module as i2c slave.*/
|
||||
#define I2C_MS_MODE (BIT(4))
|
||||
#define I2C_MS_MODE_M (BIT(4))
|
||||
#define I2C_MS_MODE_V 0x1
|
||||
#define I2C_MS_MODE_S 4
|
||||
/* I2C_SAMPLE_SCL_LEVEL : R/W ;bitpos:[2] ;default: 1'b0 ; */
|
||||
/*description: Set this bit to sample data in SCL low level. clear this bit
|
||||
to sample data in SCL high level.*/
|
||||
#define I2C_SAMPLE_SCL_LEVEL (BIT(2))
|
||||
#define I2C_SAMPLE_SCL_LEVEL_M (BIT(2))
|
||||
#define I2C_SAMPLE_SCL_LEVEL_V 0x1
|
||||
#define I2C_SAMPLE_SCL_LEVEL_S 2
|
||||
/* I2C_SCL_FORCE_OUT : R/W ;bitpos:[1] ;default: 1'b1 ; */
|
||||
/*description: 1: normally ouput scl clock 0: exchange the function of scl_o
|
||||
and scl_oe (scl_o is the original internal output scl signal scl_oe is the enable bit for the internal output scl signal)*/
|
||||
#define I2C_SCL_FORCE_OUT (BIT(1))
|
||||
#define I2C_SCL_FORCE_OUT_M (BIT(1))
|
||||
#define I2C_SCL_FORCE_OUT_V 0x1
|
||||
#define I2C_SCL_FORCE_OUT_S 1
|
||||
/* I2C_SDA_FORCE_OUT : R/W ;bitpos:[0] ;default: 1'b1 ; */
|
||||
/*description: 1: normally ouput sda data 0: exchange the function of sda_o
|
||||
and sda_oe (sda_o is the original internal output sda signal sda_oe is the enable bit for the internal output sda signal)*/
|
||||
#define I2C_SDA_FORCE_OUT (BIT(0))
|
||||
#define I2C_SDA_FORCE_OUT_M (BIT(0))
|
||||
#define I2C_SDA_FORCE_OUT_V 0x1
|
||||
#define I2C_SDA_FORCE_OUT_S 0
|
||||
|
||||
#define I2C_SR_REG(i) (REG_I2C_BASE(i) + 0x0008)
|
||||
/* I2C_SCL_STATE_LAST : RO ;bitpos:[30:28] ;default: 3'b0 ; */
|
||||
/*description: This register stores the value of state machine to produce SCL.
|
||||
3'h0: SCL_IDLE 3'h1:SCL_START 3'h2:SCL_LOW_EDGE 3'h3: SCL_LOW 3'h4:SCL_HIGH_EDGE 3'h5:SCL_HIGH 3'h6:SCL_STOP*/
|
||||
#define I2C_SCL_STATE_LAST 0x00000007
|
||||
#define I2C_SCL_STATE_LAST_M ((I2C_SCL_STATE_LAST_V)<<(I2C_SCL_STATE_LAST_S))
|
||||
#define I2C_SCL_STATE_LAST_V 0x7
|
||||
#define I2C_SCL_STATE_LAST_S 28
|
||||
/* I2C_SCL_MAIN_STATE_LAST : RO ;bitpos:[26:24] ;default: 3'b0 ; */
|
||||
/*description: This register stores the value of state machine for i2c module.
|
||||
3'h0: SCL_MAIN_IDLE 3'h1: SCL_ADDRESS_SHIFT 3'h2: SCL_ACK_ADDRESS 3'h3: SCL_RX_DATA 3'h4 SCL_TX_DATA 3'h5:SCL_SEND_ACK 3'h6:SCL_WAIT_ACK*/
|
||||
#define I2C_SCL_MAIN_STATE_LAST 0x00000007
|
||||
#define I2C_SCL_MAIN_STATE_LAST_M ((I2C_SCL_MAIN_STATE_LAST_V)<<(I2C_SCL_MAIN_STATE_LAST_S))
|
||||
#define I2C_SCL_MAIN_STATE_LAST_V 0x7
|
||||
#define I2C_SCL_MAIN_STATE_LAST_S 24
|
||||
/* I2C_TXFIFO_CNT : RO ;bitpos:[23:18] ;default: 6'b0 ; */
|
||||
/*description: This register stores the amount of received data in ram.*/
|
||||
#define I2C_TXFIFO_CNT 0x0000003F
|
||||
#define I2C_TXFIFO_CNT_M ((I2C_TXFIFO_CNT_V)<<(I2C_TXFIFO_CNT_S))
|
||||
#define I2C_TXFIFO_CNT_V 0x3F
|
||||
#define I2C_TXFIFO_CNT_S 18
|
||||
/* I2C_RXFIFO_CNT : RO ;bitpos:[13:8] ;default: 6'b0 ; */
|
||||
/*description: This register represent the amount of data need to send.*/
|
||||
#define I2C_RXFIFO_CNT 0x0000003F
|
||||
#define I2C_RXFIFO_CNT_M ((I2C_RXFIFO_CNT_V)<<(I2C_RXFIFO_CNT_S))
|
||||
#define I2C_RXFIFO_CNT_V 0x3F
|
||||
#define I2C_RXFIFO_CNT_S 8
|
||||
/* I2C_BYTE_TRANS : RO ;bitpos:[6] ;default: 1'b0 ; */
|
||||
/*description: This register changes to high level when one byte is transferred.*/
|
||||
#define I2C_BYTE_TRANS (BIT(6))
|
||||
#define I2C_BYTE_TRANS_M (BIT(6))
|
||||
#define I2C_BYTE_TRANS_V 0x1
|
||||
#define I2C_BYTE_TRANS_S 6
|
||||
/* I2C_SLAVE_ADDRESSED : RO ;bitpos:[5] ;default: 1'b0 ; */
|
||||
/*description: when configured as i2c slave and the address send by master
|
||||
is equal to slave's address then this bit will be high level.*/
|
||||
#define I2C_SLAVE_ADDRESSED (BIT(5))
|
||||
#define I2C_SLAVE_ADDRESSED_M (BIT(5))
|
||||
#define I2C_SLAVE_ADDRESSED_V 0x1
|
||||
#define I2C_SLAVE_ADDRESSED_S 5
|
||||
/* I2C_BUS_BUSY : RO ;bitpos:[4] ;default: 1'b0 ; */
|
||||
/*description: 1:I2C bus is busy transferring data. 0:I2C bus is in idle state.*/
|
||||
#define I2C_BUS_BUSY (BIT(4))
|
||||
#define I2C_BUS_BUSY_M (BIT(4))
|
||||
#define I2C_BUS_BUSY_V 0x1
|
||||
#define I2C_BUS_BUSY_S 4
|
||||
/* I2C_ARB_LOST : RO ;bitpos:[3] ;default: 1'b0 ; */
|
||||
/*description: when I2C lost control of SDA line this register changes to high level.*/
|
||||
#define I2C_ARB_LOST (BIT(3))
|
||||
#define I2C_ARB_LOST_M (BIT(3))
|
||||
#define I2C_ARB_LOST_V 0x1
|
||||
#define I2C_ARB_LOST_S 3
|
||||
/* I2C_TIME_OUT : RO ;bitpos:[2] ;default: 1'b0 ; */
|
||||
/*description: when I2C takes more than time_out_reg clocks to receive a data
|
||||
then this register changes to high level.*/
|
||||
#define I2C_TIME_OUT (BIT(2))
|
||||
#define I2C_TIME_OUT_M (BIT(2))
|
||||
#define I2C_TIME_OUT_V 0x1
|
||||
#define I2C_TIME_OUT_S 2
|
||||
/* I2C_SLAVE_RW : RO ;bitpos:[1] ;default: 1'b0 ; */
|
||||
/*description: when in slave mode 1: master read slave 0: master write slave.*/
|
||||
#define I2C_SLAVE_RW (BIT(1))
|
||||
#define I2C_SLAVE_RW_M (BIT(1))
|
||||
#define I2C_SLAVE_RW_V 0x1
|
||||
#define I2C_SLAVE_RW_S 1
|
||||
/* I2C_ACK_REC : RO ;bitpos:[0] ;default: 1'b0 ; */
|
||||
/*description: This register stores the value of ACK bit.*/
|
||||
#define I2C_ACK_REC (BIT(0))
|
||||
#define I2C_ACK_REC_M (BIT(0))
|
||||
#define I2C_ACK_REC_V 0x1
|
||||
#define I2C_ACK_REC_S 0
|
||||
|
||||
#define I2C_TO_REG(i) (REG_I2C_BASE(i) + 0x000c)
|
||||
/* I2C_TIME_OUT_REG : R/W ;bitpos:[19:0] ;default: 20'b0 ; */
|
||||
/*description: This register is used to configure the max clock number of receiving a data.*/
|
||||
#define I2C_TIME_OUT_REG 0x000FFFFF
|
||||
#define I2C_TIME_OUT_REG_M ((I2C_TIME_OUT_REG_V)<<(I2C_TIME_OUT_REG_S))
|
||||
#define I2C_TIME_OUT_REG_V 0xFFFFF
|
||||
#define I2C_TIME_OUT_REG_S 0
|
||||
|
||||
#define I2C_SLAVE_ADDR_REG(i) (REG_I2C_BASE(i) + 0x0010)
|
||||
/* I2C_ADDR_10BIT_EN : R/W ;bitpos:[31] ;default: 1'b0 ; */
|
||||
/*description: This register is used to enable slave 10bit address mode.*/
|
||||
#define I2C_ADDR_10BIT_EN (BIT(31))
|
||||
#define I2C_ADDR_10BIT_EN_M (BIT(31))
|
||||
#define I2C_ADDR_10BIT_EN_V 0x1
|
||||
#define I2C_ADDR_10BIT_EN_S 31
|
||||
/* I2C_SLAVE_ADDR : R/W ;bitpos:[14:0] ;default: 15'b0 ; */
|
||||
/*description: when configured as i2c slave this register is used to configure
|
||||
slave's address.*/
|
||||
#define I2C_SLAVE_ADDR 0x00007FFF
|
||||
#define I2C_SLAVE_ADDR_M ((I2C_SLAVE_ADDR_V)<<(I2C_SLAVE_ADDR_S))
|
||||
#define I2C_SLAVE_ADDR_V 0x7FFF
|
||||
#define I2C_SLAVE_ADDR_S 0
|
||||
|
||||
#define I2C_RXFIFO_ST_REG(i) (REG_I2C_BASE(i) + 0x0014)
|
||||
/* I2C_TXFIFO_END_ADDR : RO ;bitpos:[19:15] ;default: 5'b0 ; */
|
||||
/*description: This is the offset address of the last sending data as described
|
||||
in nonfifo_tx_thres register.*/
|
||||
#define I2C_TXFIFO_END_ADDR 0x0000001F
|
||||
#define I2C_TXFIFO_END_ADDR_M ((I2C_TXFIFO_END_ADDR_V)<<(I2C_TXFIFO_END_ADDR_S))
|
||||
#define I2C_TXFIFO_END_ADDR_V 0x1F
|
||||
#define I2C_TXFIFO_END_ADDR_S 15
|
||||
/* I2C_TXFIFO_START_ADDR : RO ;bitpos:[14:10] ;default: 5'b0 ; */
|
||||
/*description: This is the offset address of the first sending data as described
|
||||
in nonfifo_tx_thres register.*/
|
||||
#define I2C_TXFIFO_START_ADDR 0x0000001F
|
||||
#define I2C_TXFIFO_START_ADDR_M ((I2C_TXFIFO_START_ADDR_V)<<(I2C_TXFIFO_START_ADDR_S))
|
||||
#define I2C_TXFIFO_START_ADDR_V 0x1F
|
||||
#define I2C_TXFIFO_START_ADDR_S 10
|
||||
/* I2C_RXFIFO_END_ADDR : RO ;bitpos:[9:5] ;default: 5'b0 ; */
|
||||
/*description: This is the offset address of the first receiving data as described
|
||||
in nonfifo_rx_thres_register.*/
|
||||
#define I2C_RXFIFO_END_ADDR 0x0000001F
|
||||
#define I2C_RXFIFO_END_ADDR_M ((I2C_RXFIFO_END_ADDR_V)<<(I2C_RXFIFO_END_ADDR_S))
|
||||
#define I2C_RXFIFO_END_ADDR_V 0x1F
|
||||
#define I2C_RXFIFO_END_ADDR_S 5
|
||||
/* I2C_RXFIFO_START_ADDR : RO ;bitpos:[4:0] ;default: 5'b0 ; */
|
||||
/*description: This is the offset address of the last receiving data as described
|
||||
in nonfifo_rx_thres_register.*/
|
||||
#define I2C_RXFIFO_START_ADDR 0x0000001F
|
||||
#define I2C_RXFIFO_START_ADDR_M ((I2C_RXFIFO_START_ADDR_V)<<(I2C_RXFIFO_START_ADDR_S))
|
||||
#define I2C_RXFIFO_START_ADDR_V 0x1F
|
||||
#define I2C_RXFIFO_START_ADDR_S 0
|
||||
|
||||
#define I2C_FIFO_CONF_REG(i) (REG_I2C_BASE(i) + 0x0018)
|
||||
/* I2C_NONFIFO_TX_THRES : R/W ;bitpos:[25:20] ;default: 6'h15 ; */
|
||||
/*description: when I2C sends more than nonfifo_tx_thres data it will produce
|
||||
tx_send_empty_int_raw interrupt and update the current offset address of the sending data.*/
|
||||
#define I2C_NONFIFO_TX_THRES 0x0000003F
|
||||
#define I2C_NONFIFO_TX_THRES_M ((I2C_NONFIFO_TX_THRES_V)<<(I2C_NONFIFO_TX_THRES_S))
|
||||
#define I2C_NONFIFO_TX_THRES_V 0x3F
|
||||
#define I2C_NONFIFO_TX_THRES_S 20
|
||||
/* I2C_NONFIFO_RX_THRES : R/W ;bitpos:[19:14] ;default: 6'h15 ; */
|
||||
/*description: when I2C receives more than nonfifo_rx_thres data it will produce
|
||||
rx_send_full_int_raw interrupt and update the current offset address of the receiving data.*/
|
||||
#define I2C_NONFIFO_RX_THRES 0x0000003F
|
||||
#define I2C_NONFIFO_RX_THRES_M ((I2C_NONFIFO_RX_THRES_V)<<(I2C_NONFIFO_RX_THRES_S))
|
||||
#define I2C_NONFIFO_RX_THRES_V 0x3F
|
||||
#define I2C_NONFIFO_RX_THRES_S 14
|
||||
/* I2C_TX_FIFO_RST : R/W ;bitpos:[13] ;default: 1'b0 ; */
|
||||
/*description: Set this bit to reset tx fifo when using apb fifo access.*/
|
||||
#define I2C_TX_FIFO_RST (BIT(13))
|
||||
#define I2C_TX_FIFO_RST_M (BIT(13))
|
||||
#define I2C_TX_FIFO_RST_V 0x1
|
||||
#define I2C_TX_FIFO_RST_S 13
|
||||
/* I2C_RX_FIFO_RST : R/W ;bitpos:[12] ;default: 1'b0 ; */
|
||||
/*description: Set this bit to reset rx fifo when using apb fifo access.*/
|
||||
#define I2C_RX_FIFO_RST (BIT(12))
|
||||
#define I2C_RX_FIFO_RST_M (BIT(12))
|
||||
#define I2C_RX_FIFO_RST_V 0x1
|
||||
#define I2C_RX_FIFO_RST_S 12
|
||||
/* I2C_FIFO_ADDR_CFG_EN : R/W ;bitpos:[11] ;default: 1'b0 ; */
|
||||
/*description: When this bit is set to 1 then the byte after address represent
|
||||
the offset address of I2C Slave's ram.*/
|
||||
#define I2C_FIFO_ADDR_CFG_EN (BIT(11))
|
||||
#define I2C_FIFO_ADDR_CFG_EN_M (BIT(11))
|
||||
#define I2C_FIFO_ADDR_CFG_EN_V 0x1
|
||||
#define I2C_FIFO_ADDR_CFG_EN_S 11
|
||||
/* I2C_NONFIFO_EN : R/W ;bitpos:[10] ;default: 1'b0 ; */
|
||||
/*description: Set this bit to enble apb nonfifo access.*/
|
||||
#define I2C_NONFIFO_EN (BIT(10))
|
||||
#define I2C_NONFIFO_EN_M (BIT(10))
|
||||
#define I2C_NONFIFO_EN_V 0x1
|
||||
#define I2C_NONFIFO_EN_S 10
|
||||
/* I2C_TXFIFO_EMPTY_THRHD : R/W ;bitpos:[9:5] ;default: 5'h4 ; */
|
||||
/*description: Config txfifo empty threhd value when using apb fifo access*/
|
||||
#define I2C_TXFIFO_EMPTY_THRHD 0x0000001F
|
||||
#define I2C_TXFIFO_EMPTY_THRHD_M ((I2C_TXFIFO_EMPTY_THRHD_V)<<(I2C_TXFIFO_EMPTY_THRHD_S))
|
||||
#define I2C_TXFIFO_EMPTY_THRHD_V 0x1F
|
||||
#define I2C_TXFIFO_EMPTY_THRHD_S 5
|
||||
/* I2C_RXFIFO_FULL_THRHD : R/W ;bitpos:[4:0] ;default: 5'hb ; */
|
||||
/*description: */
|
||||
#define I2C_RXFIFO_FULL_THRHD 0x0000001F
|
||||
#define I2C_RXFIFO_FULL_THRHD_M ((I2C_RXFIFO_FULL_THRHD_V)<<(I2C_RXFIFO_FULL_THRHD_S))
|
||||
#define I2C_RXFIFO_FULL_THRHD_V 0x1F
|
||||
#define I2C_RXFIFO_FULL_THRHD_S 0
|
||||
|
||||
#define I2C_DATA_APB_REG(i) (0x60013000 + (i) * 0x14000 + 0x001c)
|
||||
|
||||
#define I2C_DATA_REG(i) (REG_I2C_BASE(i) + 0x001c)
|
||||
/* I2C_FIFO_RDATA : RO ;bitpos:[7:0] ;default: 8'b0 ; */
|
||||
/*description: The register represent the byte data read from rxfifo when use apb fifo access*/
|
||||
#define I2C_FIFO_RDATA 0x000000FF
|
||||
#define I2C_FIFO_RDATA_M ((I2C_FIFO_RDATA_V)<<(I2C_FIFO_RDATA_S))
|
||||
#define I2C_FIFO_RDATA_V 0xFF
|
||||
#define I2C_FIFO_RDATA_S 0
|
||||
|
||||
#define I2C_INT_RAW_REG(i) (REG_I2C_BASE(i) + 0x0020)
|
||||
/* I2C_TX_SEND_EMPTY_INT_RAW : RO ;bitpos:[12] ;default: 1'b0 ; */
|
||||
/*description: The raw interrupt status bit for tx_send_empty_int interrupt.when
|
||||
I2C sends more data than nonfifo_tx_thres it will produce tx_send_empty_int interrupt..*/
|
||||
#define I2C_TX_SEND_EMPTY_INT_RAW (BIT(12))
|
||||
#define I2C_TX_SEND_EMPTY_INT_RAW_M (BIT(12))
|
||||
#define I2C_TX_SEND_EMPTY_INT_RAW_V 0x1
|
||||
#define I2C_TX_SEND_EMPTY_INT_RAW_S 12
|
||||
/* I2C_RX_REC_FULL_INT_RAW : RO ;bitpos:[11] ;default: 1'b0 ; */
|
||||
/*description: The raw interrupt status bit for rx_rec_full_int interrupt. when
|
||||
I2C receives more data than nonfifo_rx_thres it will produce rx_rec_full_int interrupt.*/
|
||||
#define I2C_RX_REC_FULL_INT_RAW (BIT(11))
|
||||
#define I2C_RX_REC_FULL_INT_RAW_M (BIT(11))
|
||||
#define I2C_RX_REC_FULL_INT_RAW_V 0x1
|
||||
#define I2C_RX_REC_FULL_INT_RAW_S 11
|
||||
/* I2C_ACK_ERR_INT_RAW : RO ;bitpos:[10] ;default: 1'b0 ; */
|
||||
/*description: The raw interrupt status bit for ack_err_int interrupt. when
|
||||
I2C receives a wrong ACK bit it will produce ack_err_int interrupt..*/
|
||||
#define I2C_ACK_ERR_INT_RAW (BIT(10))
|
||||
#define I2C_ACK_ERR_INT_RAW_M (BIT(10))
|
||||
#define I2C_ACK_ERR_INT_RAW_V 0x1
|
||||
#define I2C_ACK_ERR_INT_RAW_S 10
|
||||
/* I2C_TRANS_START_INT_RAW : RO ;bitpos:[9] ;default: 1'b0 ; */
|
||||
/*description: The raw interrupt status bit for trans_start_int interrupt. when
|
||||
I2C sends the START bit it will produce trans_start_int interrupt.*/
|
||||
#define I2C_TRANS_START_INT_RAW (BIT(9))
|
||||
#define I2C_TRANS_START_INT_RAW_M (BIT(9))
|
||||
#define I2C_TRANS_START_INT_RAW_V 0x1
|
||||
#define I2C_TRANS_START_INT_RAW_S 9
|
||||
/* I2C_TIME_OUT_INT_RAW : RO ;bitpos:[8] ;default: 1'b0 ; */
|
||||
/*description: The raw interrupt status bit for time_out_int interrupt. when
|
||||
I2C takes a lot of time to receive a data it will produce time_out_int interrupt.*/
|
||||
#define I2C_TIME_OUT_INT_RAW (BIT(8))
|
||||
#define I2C_TIME_OUT_INT_RAW_M (BIT(8))
|
||||
#define I2C_TIME_OUT_INT_RAW_V 0x1
|
||||
#define I2C_TIME_OUT_INT_RAW_S 8
|
||||
/* I2C_TRANS_COMPLETE_INT_RAW : RO ;bitpos:[7] ;default: 1'b0 ; */
|
||||
/*description: The raw interrupt status bit for trans_complete_int interrupt.
|
||||
when I2C Master finished STOP command it will produce trans_complete_int interrupt.*/
|
||||
#define I2C_TRANS_COMPLETE_INT_RAW (BIT(7))
|
||||
#define I2C_TRANS_COMPLETE_INT_RAW_M (BIT(7))
|
||||
#define I2C_TRANS_COMPLETE_INT_RAW_V 0x1
|
||||
#define I2C_TRANS_COMPLETE_INT_RAW_S 7
|
||||
/* I2C_MASTER_TRAN_COMP_INT_RAW : RO ;bitpos:[6] ;default: 1'b0 ; */
|
||||
/*description: The raw interrupt status bit for master_tra_comp_int interrupt.
|
||||
when I2C Master sends or receives a byte it will produce master_tran_comp_int interrupt.*/
|
||||
#define I2C_MASTER_TRAN_COMP_INT_RAW (BIT(6))
|
||||
#define I2C_MASTER_TRAN_COMP_INT_RAW_M (BIT(6))
|
||||
#define I2C_MASTER_TRAN_COMP_INT_RAW_V 0x1
|
||||
#define I2C_MASTER_TRAN_COMP_INT_RAW_S 6
|
||||
/* I2C_ARBITRATION_LOST_INT_RAW : RO ;bitpos:[5] ;default: 1'b0 ; */
|
||||
/*description: The raw interrupt status bit for arbitration_lost_int interrupt.when
|
||||
I2C lost the usage right of I2C BUS it will produce arbitration_lost_int interrupt.*/
|
||||
#define I2C_ARBITRATION_LOST_INT_RAW (BIT(5))
|
||||
#define I2C_ARBITRATION_LOST_INT_RAW_M (BIT(5))
|
||||
#define I2C_ARBITRATION_LOST_INT_RAW_V 0x1
|
||||
#define I2C_ARBITRATION_LOST_INT_RAW_S 5
|
||||
/* I2C_SLAVE_TRAN_COMP_INT_RAW : RO ;bitpos:[4] ;default: 1'b0 ; */
|
||||
/*description: The raw interrupt status bit for slave_tran_comp_int interrupt.
|
||||
when I2C Slave detectsthe STOP bit it will produce slave_tran_comp_int interrupt.*/
|
||||
#define I2C_SLAVE_TRAN_COMP_INT_RAW (BIT(4))
|
||||
#define I2C_SLAVE_TRAN_COMP_INT_RAW_M (BIT(4))
|
||||
#define I2C_SLAVE_TRAN_COMP_INT_RAW_V 0x1
|
||||
#define I2C_SLAVE_TRAN_COMP_INT_RAW_S 4
|
||||
/* I2C_END_DETECT_INT_RAW : RO ;bitpos:[3] ;default: 1'b0 ; */
|
||||
/*description: The raw interrupt status bit for end_detect_int interrupt. when
|
||||
I2C deals with the END command it will produce end_detect_int interrupt.*/
|
||||
#define I2C_END_DETECT_INT_RAW (BIT(3))
|
||||
#define I2C_END_DETECT_INT_RAW_M (BIT(3))
|
||||
#define I2C_END_DETECT_INT_RAW_V 0x1
|
||||
#define I2C_END_DETECT_INT_RAW_S 3
|
||||
/* I2C_RXFIFO_OVF_INT_RAW : RO ;bitpos:[2] ;default: 1'b0 ; */
|
||||
/*description: The raw interrupt status bit for receiving data overflow when
|
||||
use apb fifo access.*/
|
||||
#define I2C_RXFIFO_OVF_INT_RAW (BIT(2))
|
||||
#define I2C_RXFIFO_OVF_INT_RAW_M (BIT(2))
|
||||
#define I2C_RXFIFO_OVF_INT_RAW_V 0x1
|
||||
#define I2C_RXFIFO_OVF_INT_RAW_S 2
|
||||
/* I2C_TXFIFO_EMPTY_INT_RAW : RO ;bitpos:[1] ;default: 1'b0 ; */
|
||||
/*description: The raw interrupt status bit for txfifo empty when use apb fifo access.*/
|
||||
#define I2C_TXFIFO_EMPTY_INT_RAW (BIT(1))
|
||||
#define I2C_TXFIFO_EMPTY_INT_RAW_M (BIT(1))
|
||||
#define I2C_TXFIFO_EMPTY_INT_RAW_V 0x1
|
||||
#define I2C_TXFIFO_EMPTY_INT_RAW_S 1
|
||||
/* I2C_RXFIFO_FULL_INT_RAW : RO ;bitpos:[0] ;default: 1'b0 ; */
|
||||
/*description: The raw interrupt status bit for rxfifo full when use apb fifo access.*/
|
||||
#define I2C_RXFIFO_FULL_INT_RAW (BIT(0))
|
||||
#define I2C_RXFIFO_FULL_INT_RAW_M (BIT(0))
|
||||
#define I2C_RXFIFO_FULL_INT_RAW_V 0x1
|
||||
#define I2C_RXFIFO_FULL_INT_RAW_S 0
|
||||
|
||||
#define I2C_INT_CLR_REG(i) (REG_I2C_BASE(i) + 0x0024)
|
||||
/* I2C_TX_SEND_EMPTY_INT_CLR : WO ;bitpos:[12] ;default: 1'b0 ; */
|
||||
/*description: Set this bit to clear the tx_send_empty_int interrupt.*/
|
||||
#define I2C_TX_SEND_EMPTY_INT_CLR (BIT(12))
|
||||
#define I2C_TX_SEND_EMPTY_INT_CLR_M (BIT(12))
|
||||
#define I2C_TX_SEND_EMPTY_INT_CLR_V 0x1
|
||||
#define I2C_TX_SEND_EMPTY_INT_CLR_S 12
|
||||
/* I2C_RX_REC_FULL_INT_CLR : WO ;bitpos:[11] ;default: 1'b0 ; */
|
||||
/*description: Set this bit to clear the rx_rec_full_int interrupt.*/
|
||||
#define I2C_RX_REC_FULL_INT_CLR (BIT(11))
|
||||
#define I2C_RX_REC_FULL_INT_CLR_M (BIT(11))
|
||||
#define I2C_RX_REC_FULL_INT_CLR_V 0x1
|
||||
#define I2C_RX_REC_FULL_INT_CLR_S 11
|
||||
/* I2C_ACK_ERR_INT_CLR : WO ;bitpos:[10] ;default: 1'b0 ; */
|
||||
/*description: Set this bit to clear the ack_err_int interrupt.*/
|
||||
#define I2C_ACK_ERR_INT_CLR (BIT(10))
|
||||
#define I2C_ACK_ERR_INT_CLR_M (BIT(10))
|
||||
#define I2C_ACK_ERR_INT_CLR_V 0x1
|
||||
#define I2C_ACK_ERR_INT_CLR_S 10
|
||||
/* I2C_TRANS_START_INT_CLR : WO ;bitpos:[9] ;default: 1'b0 ; */
|
||||
/*description: Set this bit to clear the trans_start_int interrupt.*/
|
||||
#define I2C_TRANS_START_INT_CLR (BIT(9))
|
||||
#define I2C_TRANS_START_INT_CLR_M (BIT(9))
|
||||
#define I2C_TRANS_START_INT_CLR_V 0x1
|
||||
#define I2C_TRANS_START_INT_CLR_S 9
|
||||
/* I2C_TIME_OUT_INT_CLR : WO ;bitpos:[8] ;default: 1'b0 ; */
|
||||
/*description: Set this bit to clear the time_out_int interrupt.*/
|
||||
#define I2C_TIME_OUT_INT_CLR (BIT(8))
|
||||
#define I2C_TIME_OUT_INT_CLR_M (BIT(8))
|
||||
#define I2C_TIME_OUT_INT_CLR_V 0x1
|
||||
#define I2C_TIME_OUT_INT_CLR_S 8
|
||||
/* I2C_TRANS_COMPLETE_INT_CLR : WO ;bitpos:[7] ;default: 1'b0 ; */
|
||||
/*description: Set this bit to clear the trans_complete_int interrupt.*/
|
||||
#define I2C_TRANS_COMPLETE_INT_CLR (BIT(7))
|
||||
#define I2C_TRANS_COMPLETE_INT_CLR_M (BIT(7))
|
||||
#define I2C_TRANS_COMPLETE_INT_CLR_V 0x1
|
||||
#define I2C_TRANS_COMPLETE_INT_CLR_S 7
|
||||
/* I2C_MASTER_TRAN_COMP_INT_CLR : WO ;bitpos:[6] ;default: 1'b0 ; */
|
||||
/*description: Set this bit to clear the master_tran_comp interrupt.*/
|
||||
#define I2C_MASTER_TRAN_COMP_INT_CLR (BIT(6))
|
||||
#define I2C_MASTER_TRAN_COMP_INT_CLR_M (BIT(6))
|
||||
#define I2C_MASTER_TRAN_COMP_INT_CLR_V 0x1
|
||||
#define I2C_MASTER_TRAN_COMP_INT_CLR_S 6
|
||||
/* I2C_ARBITRATION_LOST_INT_CLR : WO ;bitpos:[5] ;default: 1'b0 ; */
|
||||
/*description: Set this bit to clear the arbitration_lost_int interrupt.*/
|
||||
#define I2C_ARBITRATION_LOST_INT_CLR (BIT(5))
|
||||
#define I2C_ARBITRATION_LOST_INT_CLR_M (BIT(5))
|
||||
#define I2C_ARBITRATION_LOST_INT_CLR_V 0x1
|
||||
#define I2C_ARBITRATION_LOST_INT_CLR_S 5
|
||||
/* I2C_SLAVE_TRAN_COMP_INT_CLR : WO ;bitpos:[4] ;default: 1'b0 ; */
|
||||
/*description: Set this bit to clear the slave_tran_comp_int interrupt.*/
|
||||
#define I2C_SLAVE_TRAN_COMP_INT_CLR (BIT(4))
|
||||
#define I2C_SLAVE_TRAN_COMP_INT_CLR_M (BIT(4))
|
||||
#define I2C_SLAVE_TRAN_COMP_INT_CLR_V 0x1
|
||||
#define I2C_SLAVE_TRAN_COMP_INT_CLR_S 4
|
||||
/* I2C_END_DETECT_INT_CLR : WO ;bitpos:[3] ;default: 1'b0 ; */
|
||||
/*description: Set this bit to clear the end_detect_int interrupt.*/
|
||||
#define I2C_END_DETECT_INT_CLR (BIT(3))
|
||||
#define I2C_END_DETECT_INT_CLR_M (BIT(3))
|
||||
#define I2C_END_DETECT_INT_CLR_V 0x1
|
||||
#define I2C_END_DETECT_INT_CLR_S 3
|
||||
/* I2C_RXFIFO_OVF_INT_CLR : WO ;bitpos:[2] ;default: 1'b0 ; */
|
||||
/*description: Set this bit to clear the rxfifo_ovf_int interrupt.*/
|
||||
#define I2C_RXFIFO_OVF_INT_CLR (BIT(2))
|
||||
#define I2C_RXFIFO_OVF_INT_CLR_M (BIT(2))
|
||||
#define I2C_RXFIFO_OVF_INT_CLR_V 0x1
|
||||
#define I2C_RXFIFO_OVF_INT_CLR_S 2
|
||||
/* I2C_TXFIFO_EMPTY_INT_CLR : WO ;bitpos:[1] ;default: 1'b0 ; */
|
||||
/*description: Set this bit to clear the txfifo_empty_int interrupt.*/
|
||||
#define I2C_TXFIFO_EMPTY_INT_CLR (BIT(1))
|
||||
#define I2C_TXFIFO_EMPTY_INT_CLR_M (BIT(1))
|
||||
#define I2C_TXFIFO_EMPTY_INT_CLR_V 0x1
|
||||
#define I2C_TXFIFO_EMPTY_INT_CLR_S 1
|
||||
/* I2C_RXFIFO_FULL_INT_CLR : WO ;bitpos:[0] ;default: 1'b0 ; */
|
||||
/*description: Set this bit to clear the rxfifo_full_int interrupt.*/
|
||||
#define I2C_RXFIFO_FULL_INT_CLR (BIT(0))
|
||||
#define I2C_RXFIFO_FULL_INT_CLR_M (BIT(0))
|
||||
#define I2C_RXFIFO_FULL_INT_CLR_V 0x1
|
||||
#define I2C_RXFIFO_FULL_INT_CLR_S 0
|
||||
|
||||
#define I2C_INT_ENA_REG(i) (REG_I2C_BASE(i) + 0x0028)
|
||||
/* I2C_TX_SEND_EMPTY_INT_ENA : R/W ;bitpos:[12] ;default: 1'b0 ; */
|
||||
/*description: The enable bit for tx_send_empty_int interrupt.*/
|
||||
#define I2C_TX_SEND_EMPTY_INT_ENA (BIT(12))
|
||||
#define I2C_TX_SEND_EMPTY_INT_ENA_M (BIT(12))
|
||||
#define I2C_TX_SEND_EMPTY_INT_ENA_V 0x1
|
||||
#define I2C_TX_SEND_EMPTY_INT_ENA_S 12
|
||||
/* I2C_RX_REC_FULL_INT_ENA : R/W ;bitpos:[11] ;default: 1'b0 ; */
|
||||
/*description: The enable bit for rx_rec_full_int interrupt.*/
|
||||
#define I2C_RX_REC_FULL_INT_ENA (BIT(11))
|
||||
#define I2C_RX_REC_FULL_INT_ENA_M (BIT(11))
|
||||
#define I2C_RX_REC_FULL_INT_ENA_V 0x1
|
||||
#define I2C_RX_REC_FULL_INT_ENA_S 11
|
||||
/* I2C_ACK_ERR_INT_ENA : R/W ;bitpos:[10] ;default: 1'b0 ; */
|
||||
/*description: The enable bit for ack_err_int interrupt.*/
|
||||
#define I2C_ACK_ERR_INT_ENA (BIT(10))
|
||||
#define I2C_ACK_ERR_INT_ENA_M (BIT(10))
|
||||
#define I2C_ACK_ERR_INT_ENA_V 0x1
|
||||
#define I2C_ACK_ERR_INT_ENA_S 10
|
||||
/* I2C_TRANS_START_INT_ENA : R/W ;bitpos:[9] ;default: 1'b0 ; */
|
||||
/*description: The enable bit for trans_start_int interrupt.*/
|
||||
#define I2C_TRANS_START_INT_ENA (BIT(9))
|
||||
#define I2C_TRANS_START_INT_ENA_M (BIT(9))
|
||||
#define I2C_TRANS_START_INT_ENA_V 0x1
|
||||
#define I2C_TRANS_START_INT_ENA_S 9
|
||||
/* I2C_TIME_OUT_INT_ENA : R/W ;bitpos:[8] ;default: 1'b0 ; */
|
||||
/*description: The enable bit for time_out_int interrupt.*/
|
||||
#define I2C_TIME_OUT_INT_ENA (BIT(8))
|
||||
#define I2C_TIME_OUT_INT_ENA_M (BIT(8))
|
||||
#define I2C_TIME_OUT_INT_ENA_V 0x1
|
||||
#define I2C_TIME_OUT_INT_ENA_S 8
|
||||
/* I2C_TRANS_COMPLETE_INT_ENA : R/W ;bitpos:[7] ;default: 1'b0 ; */
|
||||
/*description: The enable bit for trans_complete_int interrupt.*/
|
||||
#define I2C_TRANS_COMPLETE_INT_ENA (BIT(7))
|
||||
#define I2C_TRANS_COMPLETE_INT_ENA_M (BIT(7))
|
||||
#define I2C_TRANS_COMPLETE_INT_ENA_V 0x1
|
||||
#define I2C_TRANS_COMPLETE_INT_ENA_S 7
|
||||
/* I2C_MASTER_TRAN_COMP_INT_ENA : R/W ;bitpos:[6] ;default: 1'b0 ; */
|
||||
/*description: The enable bit for master_tran_comp_int interrupt.*/
|
||||
#define I2C_MASTER_TRAN_COMP_INT_ENA (BIT(6))
|
||||
#define I2C_MASTER_TRAN_COMP_INT_ENA_M (BIT(6))
|
||||
#define I2C_MASTER_TRAN_COMP_INT_ENA_V 0x1
|
||||
#define I2C_MASTER_TRAN_COMP_INT_ENA_S 6
|
||||
/* I2C_ARBITRATION_LOST_INT_ENA : R/W ;bitpos:[5] ;default: 1'b0 ; */
|
||||
/*description: The enable bit for arbitration_lost_int interrupt.*/
|
||||
#define I2C_ARBITRATION_LOST_INT_ENA (BIT(5))
|
||||
#define I2C_ARBITRATION_LOST_INT_ENA_M (BIT(5))
|
||||
#define I2C_ARBITRATION_LOST_INT_ENA_V 0x1
|
||||
#define I2C_ARBITRATION_LOST_INT_ENA_S 5
|
||||
/* I2C_SLAVE_TRAN_COMP_INT_ENA : R/W ;bitpos:[4] ;default: 1'b0 ; */
|
||||
/*description: The enable bit for slave_tran_comp_int interrupt.*/
|
||||
#define I2C_SLAVE_TRAN_COMP_INT_ENA (BIT(4))
|
||||
#define I2C_SLAVE_TRAN_COMP_INT_ENA_M (BIT(4))
|
||||
#define I2C_SLAVE_TRAN_COMP_INT_ENA_V 0x1
|
||||
#define I2C_SLAVE_TRAN_COMP_INT_ENA_S 4
|
||||
/* I2C_END_DETECT_INT_ENA : R/W ;bitpos:[3] ;default: 1'b0 ; */
|
||||
/*description: The enable bit for end_detect_int interrupt.*/
|
||||
#define I2C_END_DETECT_INT_ENA (BIT(3))
|
||||
#define I2C_END_DETECT_INT_ENA_M (BIT(3))
|
||||
#define I2C_END_DETECT_INT_ENA_V 0x1
|
||||
#define I2C_END_DETECT_INT_ENA_S 3
|
||||
/* I2C_RXFIFO_OVF_INT_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */
|
||||
/*description: The enable bit for rxfifo_ovf_int interrupt.*/
|
||||
#define I2C_RXFIFO_OVF_INT_ENA (BIT(2))
|
||||
#define I2C_RXFIFO_OVF_INT_ENA_M (BIT(2))
|
||||
#define I2C_RXFIFO_OVF_INT_ENA_V 0x1
|
||||
#define I2C_RXFIFO_OVF_INT_ENA_S 2
|
||||
/* I2C_TXFIFO_EMPTY_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */
|
||||
/*description: The enable bit for txfifo_empty_int interrupt.*/
|
||||
#define I2C_TXFIFO_EMPTY_INT_ENA (BIT(1))
|
||||
#define I2C_TXFIFO_EMPTY_INT_ENA_M (BIT(1))
|
||||
#define I2C_TXFIFO_EMPTY_INT_ENA_V 0x1
|
||||
#define I2C_TXFIFO_EMPTY_INT_ENA_S 1
|
||||
/* I2C_RXFIFO_FULL_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */
|
||||
/*description: The enable bit for rxfifo_full_int interrupt.*/
|
||||
#define I2C_RXFIFO_FULL_INT_ENA (BIT(0))
|
||||
#define I2C_RXFIFO_FULL_INT_ENA_M (BIT(0))
|
||||
#define I2C_RXFIFO_FULL_INT_ENA_V 0x1
|
||||
#define I2C_RXFIFO_FULL_INT_ENA_S 0
|
||||
|
||||
#define I2C_INT_STATUS_REG(i) (REG_I2C_BASE(i) + 0x002c)
|
||||
/* I2C_TX_SEND_EMPTY_INT_ST : RO ;bitpos:[12] ;default: 1'b0 ; */
|
||||
/*description: The masked interrupt status for tx_send_empty_int interrupt.*/
|
||||
#define I2C_TX_SEND_EMPTY_INT_ST (BIT(12))
|
||||
#define I2C_TX_SEND_EMPTY_INT_ST_M (BIT(12))
|
||||
#define I2C_TX_SEND_EMPTY_INT_ST_V 0x1
|
||||
#define I2C_TX_SEND_EMPTY_INT_ST_S 12
|
||||
/* I2C_RX_REC_FULL_INT_ST : RO ;bitpos:[11] ;default: 1'b0 ; */
|
||||
/*description: The masked interrupt status for rx_rec_full_int interrupt.*/
|
||||
#define I2C_RX_REC_FULL_INT_ST (BIT(11))
|
||||
#define I2C_RX_REC_FULL_INT_ST_M (BIT(11))
|
||||
#define I2C_RX_REC_FULL_INT_ST_V 0x1
|
||||
#define I2C_RX_REC_FULL_INT_ST_S 11
|
||||
/* I2C_ACK_ERR_INT_ST : RO ;bitpos:[10] ;default: 1'b0 ; */
|
||||
/*description: The masked interrupt status for ack_err_int interrupt.*/
|
||||
#define I2C_ACK_ERR_INT_ST (BIT(10))
|
||||
#define I2C_ACK_ERR_INT_ST_M (BIT(10))
|
||||
#define I2C_ACK_ERR_INT_ST_V 0x1
|
||||
#define I2C_ACK_ERR_INT_ST_S 10
|
||||
/* I2C_TRANS_START_INT_ST : RO ;bitpos:[9] ;default: 1'b0 ; */
|
||||
/*description: The masked interrupt status for trans_start_int interrupt.*/
|
||||
#define I2C_TRANS_START_INT_ST (BIT(9))
|
||||
#define I2C_TRANS_START_INT_ST_M (BIT(9))
|
||||
#define I2C_TRANS_START_INT_ST_V 0x1
|
||||
#define I2C_TRANS_START_INT_ST_S 9
|
||||
/* I2C_TIME_OUT_INT_ST : RO ;bitpos:[8] ;default: 1'b0 ; */
|
||||
/*description: The masked interrupt status for time_out_int interrupt.*/
|
||||
#define I2C_TIME_OUT_INT_ST (BIT(8))
|
||||
#define I2C_TIME_OUT_INT_ST_M (BIT(8))
|
||||
#define I2C_TIME_OUT_INT_ST_V 0x1
|
||||
#define I2C_TIME_OUT_INT_ST_S 8
|
||||
/* I2C_TRANS_COMPLETE_INT_ST : RO ;bitpos:[7] ;default: 1'b0 ; */
|
||||
/*description: The masked interrupt status for trans_complete_int interrupt.*/
|
||||
#define I2C_TRANS_COMPLETE_INT_ST (BIT(7))
|
||||
#define I2C_TRANS_COMPLETE_INT_ST_M (BIT(7))
|
||||
#define I2C_TRANS_COMPLETE_INT_ST_V 0x1
|
||||
#define I2C_TRANS_COMPLETE_INT_ST_S 7
|
||||
/* I2C_MASTER_TRAN_COMP_INT_ST : RO ;bitpos:[6] ;default: 1'b0 ; */
|
||||
/*description: The masked interrupt status for master_tran_comp_int interrupt.*/
|
||||
#define I2C_MASTER_TRAN_COMP_INT_ST (BIT(6))
|
||||
#define I2C_MASTER_TRAN_COMP_INT_ST_M (BIT(6))
|
||||
#define I2C_MASTER_TRAN_COMP_INT_ST_V 0x1
|
||||
#define I2C_MASTER_TRAN_COMP_INT_ST_S 6
|
||||
/* I2C_ARBITRATION_LOST_INT_ST : RO ;bitpos:[5] ;default: 1'b0 ; */
|
||||
/*description: The masked interrupt status for arbitration_lost_int interrupt.*/
|
||||
#define I2C_ARBITRATION_LOST_INT_ST (BIT(5))
|
||||
#define I2C_ARBITRATION_LOST_INT_ST_M (BIT(5))
|
||||
#define I2C_ARBITRATION_LOST_INT_ST_V 0x1
|
||||
#define I2C_ARBITRATION_LOST_INT_ST_S 5
|
||||
/* I2C_SLAVE_TRAN_COMP_INT_ST : RO ;bitpos:[4] ;default: 1'b0 ; */
|
||||
/*description: The masked interrupt status for slave_tran_comp_int interrupt.*/
|
||||
#define I2C_SLAVE_TRAN_COMP_INT_ST (BIT(4))
|
||||
#define I2C_SLAVE_TRAN_COMP_INT_ST_M (BIT(4))
|
||||
#define I2C_SLAVE_TRAN_COMP_INT_ST_V 0x1
|
||||
#define I2C_SLAVE_TRAN_COMP_INT_ST_S 4
|
||||
/* I2C_END_DETECT_INT_ST : RO ;bitpos:[3] ;default: 1'b0 ; */
|
||||
/*description: The masked interrupt status for end_detect_int interrupt.*/
|
||||
#define I2C_END_DETECT_INT_ST (BIT(3))
|
||||
#define I2C_END_DETECT_INT_ST_M (BIT(3))
|
||||
#define I2C_END_DETECT_INT_ST_V 0x1
|
||||
#define I2C_END_DETECT_INT_ST_S 3
|
||||
/* I2C_RXFIFO_OVF_INT_ST : RO ;bitpos:[2] ;default: 1'b0 ; */
|
||||
/*description: The masked interrupt status for rxfifo_ovf_int interrupt.*/
|
||||
#define I2C_RXFIFO_OVF_INT_ST (BIT(2))
|
||||
#define I2C_RXFIFO_OVF_INT_ST_M (BIT(2))
|
||||
#define I2C_RXFIFO_OVF_INT_ST_V 0x1
|
||||
#define I2C_RXFIFO_OVF_INT_ST_S 2
|
||||
/* I2C_TXFIFO_EMPTY_INT_ST : RO ;bitpos:[1] ;default: 1'b0 ; */
|
||||
/*description: The masked interrupt status for txfifo_empty_int interrupt.*/
|
||||
#define I2C_TXFIFO_EMPTY_INT_ST (BIT(1))
|
||||
#define I2C_TXFIFO_EMPTY_INT_ST_M (BIT(1))
|
||||
#define I2C_TXFIFO_EMPTY_INT_ST_V 0x1
|
||||
#define I2C_TXFIFO_EMPTY_INT_ST_S 1
|
||||
/* I2C_RXFIFO_FULL_INT_ST : RO ;bitpos:[0] ;default: 1'b0 ; */
|
||||
/*description: The masked interrupt status for rxfifo_full_int interrupt.*/
|
||||
#define I2C_RXFIFO_FULL_INT_ST (BIT(0))
|
||||
#define I2C_RXFIFO_FULL_INT_ST_M (BIT(0))
|
||||
#define I2C_RXFIFO_FULL_INT_ST_V 0x1
|
||||
#define I2C_RXFIFO_FULL_INT_ST_S 0
|
||||
|
||||
#define I2C_SDA_HOLD_REG(i) (REG_I2C_BASE(i) + 0x0030)
|
||||
/* I2C_SDA_HOLD_TIME : R/W ;bitpos:[9:0] ;default: 10'b0 ; */
|
||||
/*description: This register is used to configure the clock num I2C used to
|
||||
hold the data after the negedge of SCL.*/
|
||||
#define I2C_SDA_HOLD_TIME 0x000003FF
|
||||
#define I2C_SDA_HOLD_TIME_M ((I2C_SDA_HOLD_TIME_V)<<(I2C_SDA_HOLD_TIME_S))
|
||||
#define I2C_SDA_HOLD_TIME_V 0x3FF
|
||||
#define I2C_SDA_HOLD_TIME_S 0
|
||||
|
||||
#define I2C_SDA_SAMPLE_REG(i) (REG_I2C_BASE(i) + 0x0034)
|
||||
/* I2C_SDA_SAMPLE_TIME : R/W ;bitpos:[9:0] ;default: 10'b0 ; */
|
||||
/*description: This register is used to configure the clock num I2C used to
|
||||
sample data on SDA after the posedge of SCL*/
|
||||
#define I2C_SDA_SAMPLE_TIME 0x000003FF
|
||||
#define I2C_SDA_SAMPLE_TIME_M ((I2C_SDA_SAMPLE_TIME_V)<<(I2C_SDA_SAMPLE_TIME_S))
|
||||
#define I2C_SDA_SAMPLE_TIME_V 0x3FF
|
||||
#define I2C_SDA_SAMPLE_TIME_S 0
|
||||
|
||||
#define I2C_SCL_HIGH_PERIOD_REG(i) (REG_I2C_BASE(i) + 0x0038)
|
||||
/* I2C_SCL_HIGH_PERIOD : R/W ;bitpos:[13:0] ;default: 14'b0 ; */
|
||||
/*description: This register is used to configure the clock num during SCL is low level.*/
|
||||
#define I2C_SCL_HIGH_PERIOD 0x00003FFF
|
||||
#define I2C_SCL_HIGH_PERIOD_M ((I2C_SCL_HIGH_PERIOD_V)<<(I2C_SCL_HIGH_PERIOD_S))
|
||||
#define I2C_SCL_HIGH_PERIOD_V 0x3FFF
|
||||
#define I2C_SCL_HIGH_PERIOD_S 0
|
||||
|
||||
#define I2C_SCL_START_HOLD_REG(i) (REG_I2C_BASE(i) + 0x0040)
|
||||
/* I2C_SCL_START_HOLD_TIME : R/W ;bitpos:[9:0] ;default: 10'b1000 ; */
|
||||
/*description: This register is used to configure the clock num between the
|
||||
negedge of SDA and negedge of SCL for start mark.*/
|
||||
#define I2C_SCL_START_HOLD_TIME 0x000003FF
|
||||
#define I2C_SCL_START_HOLD_TIME_M ((I2C_SCL_START_HOLD_TIME_V)<<(I2C_SCL_START_HOLD_TIME_S))
|
||||
#define I2C_SCL_START_HOLD_TIME_V 0x3FF
|
||||
#define I2C_SCL_START_HOLD_TIME_S 0
|
||||
|
||||
#define I2C_SCL_RSTART_SETUP_REG(i) (REG_I2C_BASE(i) + 0x0044)
|
||||
/* I2C_SCL_RSTART_SETUP_TIME : R/W ;bitpos:[9:0] ;default: 10'b1000 ; */
|
||||
/*description: This register is used to configure the clock num between the
|
||||
posedge of SCL and the negedge of SDA for restart mark.*/
|
||||
#define I2C_SCL_RSTART_SETUP_TIME 0x000003FF
|
||||
#define I2C_SCL_RSTART_SETUP_TIME_M ((I2C_SCL_RSTART_SETUP_TIME_V)<<(I2C_SCL_RSTART_SETUP_TIME_S))
|
||||
#define I2C_SCL_RSTART_SETUP_TIME_V 0x3FF
|
||||
#define I2C_SCL_RSTART_SETUP_TIME_S 0
|
||||
|
||||
#define I2C_SCL_STOP_HOLD_REG(i) (REG_I2C_BASE(i) + 0x0048)
|
||||
/* I2C_SCL_STOP_HOLD_TIME : R/W ;bitpos:[13:0] ;default: 14'b0 ; */
|
||||
/*description: This register is used to configure the clock num after the STOP bit's posedge.*/
|
||||
#define I2C_SCL_STOP_HOLD_TIME 0x00003FFF
|
||||
#define I2C_SCL_STOP_HOLD_TIME_M ((I2C_SCL_STOP_HOLD_TIME_V)<<(I2C_SCL_STOP_HOLD_TIME_S))
|
||||
#define I2C_SCL_STOP_HOLD_TIME_V 0x3FFF
|
||||
#define I2C_SCL_STOP_HOLD_TIME_S 0
|
||||
|
||||
#define I2C_SCL_STOP_SETUP_REG(i) (REG_I2C_BASE(i) + 0x004C)
|
||||
/* I2C_SCL_STOP_SETUP_TIME : R/W ;bitpos:[9:0] ;default: 10'b0 ; */
|
||||
/*description: This register is used to configure the clock num between the
|
||||
posedge of SCL and the posedge of SDA.*/
|
||||
#define I2C_SCL_STOP_SETUP_TIME 0x000003FF
|
||||
#define I2C_SCL_STOP_SETUP_TIME_M ((I2C_SCL_STOP_SETUP_TIME_V)<<(I2C_SCL_STOP_SETUP_TIME_S))
|
||||
#define I2C_SCL_STOP_SETUP_TIME_V 0x3FF
|
||||
#define I2C_SCL_STOP_SETUP_TIME_S 0
|
||||
|
||||
#define I2C_SCL_FILTER_CFG_REG(i) (REG_I2C_BASE(i) + 0x0050)
|
||||
/* I2C_SCL_FILTER_EN : R/W ;bitpos:[3] ;default: 1'b1 ; */
|
||||
/*description: This is the filter enable bit for SCL.*/
|
||||
#define I2C_SCL_FILTER_EN (BIT(3))
|
||||
#define I2C_SCL_FILTER_EN_M (BIT(3))
|
||||
#define I2C_SCL_FILTER_EN_V 0x1
|
||||
#define I2C_SCL_FILTER_EN_S 3
|
||||
/* I2C_SCL_FILTER_THRES : R/W ;bitpos:[2:0] ;default: 3'b0 ; */
|
||||
/*description: When input SCL's pulse width is smaller than this register value
|
||||
I2C ignores this pulse.*/
|
||||
#define I2C_SCL_FILTER_THRES 0x00000007
|
||||
#define I2C_SCL_FILTER_THRES_M ((I2C_SCL_FILTER_THRES_V)<<(I2C_SCL_FILTER_THRES_S))
|
||||
#define I2C_SCL_FILTER_THRES_V 0x7
|
||||
#define I2C_SCL_FILTER_THRES_S 0
|
||||
|
||||
#define I2C_SDA_FILTER_CFG_REG(i) (REG_I2C_BASE(i) + 0x0054)
|
||||
/* I2C_SDA_FILTER_EN : R/W ;bitpos:[3] ;default: 1'b1 ; */
|
||||
/*description: This is the filter enable bit for SDA.*/
|
||||
#define I2C_SDA_FILTER_EN (BIT(3))
|
||||
#define I2C_SDA_FILTER_EN_M (BIT(3))
|
||||
#define I2C_SDA_FILTER_EN_V 0x1
|
||||
#define I2C_SDA_FILTER_EN_S 3
|
||||
/* I2C_SDA_FILTER_THRES : R/W ;bitpos:[2:0] ;default: 3'b0 ; */
|
||||
/*description: When input SCL's pulse width is smaller than this register value
|
||||
I2C ignores this pulse.*/
|
||||
#define I2C_SDA_FILTER_THRES 0x00000007
|
||||
#define I2C_SDA_FILTER_THRES_M ((I2C_SDA_FILTER_THRES_V)<<(I2C_SDA_FILTER_THRES_S))
|
||||
#define I2C_SDA_FILTER_THRES_V 0x7
|
||||
#define I2C_SDA_FILTER_THRES_S 0
|
||||
|
||||
#define I2C_COMD0_REG(i) (REG_I2C_BASE(i) + 0x0058)
|
||||
/* I2C_COMMAND0_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */
|
||||
/*description: When command0 is done in I2C Master mode this bit changes to high level.*/
|
||||
#define I2C_COMMAND0_DONE (BIT(31))
|
||||
#define I2C_COMMAND0_DONE_M (BIT(31))
|
||||
#define I2C_COMMAND0_DONE_V 0x1
|
||||
#define I2C_COMMAND0_DONE_S 31
|
||||
/* I2C_COMMAND0 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */
|
||||
/*description: This is the content of command0. It consists of three part. op_code
|
||||
is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/
|
||||
#define I2C_COMMAND0 0x00003FFF
|
||||
#define I2C_COMMAND0_M ((I2C_COMMAND0_V)<<(I2C_COMMAND0_S))
|
||||
#define I2C_COMMAND0_V 0x3FFF
|
||||
#define I2C_COMMAND0_S 0
|
||||
|
||||
#define I2C_COMD1_REG(i) (REG_I2C_BASE(i) + 0x005C)
|
||||
/* I2C_COMMAND1_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */
|
||||
/*description: When command1 is done in I2C Master mode this bit changes to high level.*/
|
||||
#define I2C_COMMAND1_DONE (BIT(31))
|
||||
#define I2C_COMMAND1_DONE_M (BIT(31))
|
||||
#define I2C_COMMAND1_DONE_V 0x1
|
||||
#define I2C_COMMAND1_DONE_S 31
|
||||
/* I2C_COMMAND1 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */
|
||||
/*description: This is the content of command1. It consists of three part. op_code
|
||||
is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/
|
||||
#define I2C_COMMAND1 0x00003FFF
|
||||
#define I2C_COMMAND1_M ((I2C_COMMAND1_V)<<(I2C_COMMAND1_S))
|
||||
#define I2C_COMMAND1_V 0x3FFF
|
||||
#define I2C_COMMAND1_S 0
|
||||
|
||||
#define I2C_COMD2_REG(i) (REG_I2C_BASE(i) + 0x0060)
|
||||
/* I2C_COMMAND2_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */
|
||||
/*description: When command2 is done in I2C Master mode this bit changes to high level.*/
|
||||
#define I2C_COMMAND2_DONE (BIT(31))
|
||||
#define I2C_COMMAND2_DONE_M (BIT(31))
|
||||
#define I2C_COMMAND2_DONE_V 0x1
|
||||
#define I2C_COMMAND2_DONE_S 31
|
||||
/* I2C_COMMAND2 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */
|
||||
/*description: This is the content of command2. It consists of three part. op_code
|
||||
is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/
|
||||
#define I2C_COMMAND2 0x00003FFF
|
||||
#define I2C_COMMAND2_M ((I2C_COMMAND2_V)<<(I2C_COMMAND2_S))
|
||||
#define I2C_COMMAND2_V 0x3FFF
|
||||
#define I2C_COMMAND2_S 0
|
||||
|
||||
#define I2C_COMD3_REG(i) (REG_I2C_BASE(i) + 0x0064)
|
||||
/* I2C_COMMAND3_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */
|
||||
/*description: When command3 is done in I2C Master mode this bit changes to high level.*/
|
||||
#define I2C_COMMAND3_DONE (BIT(31))
|
||||
#define I2C_COMMAND3_DONE_M (BIT(31))
|
||||
#define I2C_COMMAND3_DONE_V 0x1
|
||||
#define I2C_COMMAND3_DONE_S 31
|
||||
/* I2C_COMMAND3 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */
|
||||
/*description: This is the content of command3. It consists of three part. op_code
|
||||
is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/
|
||||
#define I2C_COMMAND3 0x00003FFF
|
||||
#define I2C_COMMAND3_M ((I2C_COMMAND3_V)<<(I2C_COMMAND3_S))
|
||||
#define I2C_COMMAND3_V 0x3FFF
|
||||
#define I2C_COMMAND3_S 0
|
||||
|
||||
#define I2C_COMD4_REG(i) (REG_I2C_BASE(i) + 0x0068)
|
||||
/* I2C_COMMAND4_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */
|
||||
/*description: When command4 is done in I2C Master mode this bit changes to high level.*/
|
||||
#define I2C_COMMAND4_DONE (BIT(31))
|
||||
#define I2C_COMMAND4_DONE_M (BIT(31))
|
||||
#define I2C_COMMAND4_DONE_V 0x1
|
||||
#define I2C_COMMAND4_DONE_S 31
|
||||
/* I2C_COMMAND4 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */
|
||||
/*description: This is the content of command4. It consists of three part. op_code
|
||||
is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/
|
||||
#define I2C_COMMAND4 0x00003FFF
|
||||
#define I2C_COMMAND4_M ((I2C_COMMAND4_V)<<(I2C_COMMAND4_S))
|
||||
#define I2C_COMMAND4_V 0x3FFF
|
||||
#define I2C_COMMAND4_S 0
|
||||
|
||||
#define I2C_COMD5_REG(i) (REG_I2C_BASE(i) + 0x006C)
|
||||
/* I2C_COMMAND5_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */
|
||||
/*description: When command5 is done in I2C Master mode this bit changes to high level.*/
|
||||
#define I2C_COMMAND5_DONE (BIT(31))
|
||||
#define I2C_COMMAND5_DONE_M (BIT(31))
|
||||
#define I2C_COMMAND5_DONE_V 0x1
|
||||
#define I2C_COMMAND5_DONE_S 31
|
||||
/* I2C_COMMAND5 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */
|
||||
/*description: This is the content of command5. It consists of three part. op_code
|
||||
is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/
|
||||
#define I2C_COMMAND5 0x00003FFF
|
||||
#define I2C_COMMAND5_M ((I2C_COMMAND5_V)<<(I2C_COMMAND5_S))
|
||||
#define I2C_COMMAND5_V 0x3FFF
|
||||
#define I2C_COMMAND5_S 0
|
||||
|
||||
#define I2C_COMD6_REG(i) (REG_I2C_BASE(i) + 0x0070)
|
||||
/* I2C_COMMAND6_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */
|
||||
/*description: When command6 is done in I2C Master mode this bit changes to high level.*/
|
||||
#define I2C_COMMAND6_DONE (BIT(31))
|
||||
#define I2C_COMMAND6_DONE_M (BIT(31))
|
||||
#define I2C_COMMAND6_DONE_V 0x1
|
||||
#define I2C_COMMAND6_DONE_S 31
|
||||
/* I2C_COMMAND6 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */
|
||||
/*description: This is the content of command6. It consists of three part. op_code
|
||||
is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/
|
||||
#define I2C_COMMAND6 0x00003FFF
|
||||
#define I2C_COMMAND6_M ((I2C_COMMAND6_V)<<(I2C_COMMAND6_S))
|
||||
#define I2C_COMMAND6_V 0x3FFF
|
||||
#define I2C_COMMAND6_S 0
|
||||
|
||||
#define I2C_COMD7_REG(i) (REG_I2C_BASE(i) + 0x0074)
|
||||
/* I2C_COMMAND7_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */
|
||||
/*description: When command7 is done in I2C Master mode this bit changes to high level.*/
|
||||
#define I2C_COMMAND7_DONE (BIT(31))
|
||||
#define I2C_COMMAND7_DONE_M (BIT(31))
|
||||
#define I2C_COMMAND7_DONE_V 0x1
|
||||
#define I2C_COMMAND7_DONE_S 31
|
||||
/* I2C_COMMAND7 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */
|
||||
/*description: This is the content of command7. It consists of three part. op_code
|
||||
is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/
|
||||
#define I2C_COMMAND7 0x00003FFF
|
||||
#define I2C_COMMAND7_M ((I2C_COMMAND7_V)<<(I2C_COMMAND7_S))
|
||||
#define I2C_COMMAND7_V 0x3FFF
|
||||
#define I2C_COMMAND7_S 0
|
||||
|
||||
#define I2C_COMD8_REG(i) (REG_I2C_BASE(i) + 0x0078)
|
||||
/* I2C_COMMAND8_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */
|
||||
/*description: When command8 is done in I2C Master mode this bit changes to high level.*/
|
||||
#define I2C_COMMAND8_DONE (BIT(31))
|
||||
#define I2C_COMMAND8_DONE_M (BIT(31))
|
||||
#define I2C_COMMAND8_DONE_V 0x1
|
||||
#define I2C_COMMAND8_DONE_S 31
|
||||
/* I2C_COMMAND8 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */
|
||||
/*description: This is the content of command8. It consists of three part. op_code
|
||||
is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/
|
||||
#define I2C_COMMAND8 0x00003FFF
|
||||
#define I2C_COMMAND8_M ((I2C_COMMAND8_V)<<(I2C_COMMAND8_S))
|
||||
#define I2C_COMMAND8_V 0x3FFF
|
||||
#define I2C_COMMAND8_S 0
|
||||
|
||||
#define I2C_COMD9_REG(i) (REG_I2C_BASE(i) + 0x007C)
|
||||
/* I2C_COMMAND9_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */
|
||||
/*description: When command9 is done in I2C Master mode this bit changes to high level.*/
|
||||
#define I2C_COMMAND9_DONE (BIT(31))
|
||||
#define I2C_COMMAND9_DONE_M (BIT(31))
|
||||
#define I2C_COMMAND9_DONE_V 0x1
|
||||
#define I2C_COMMAND9_DONE_S 31
|
||||
/* I2C_COMMAND9 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */
|
||||
/*description: This is the content of command9. It consists of three part. op_code
|
||||
is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/
|
||||
#define I2C_COMMAND9 0x00003FFF
|
||||
#define I2C_COMMAND9_M ((I2C_COMMAND9_V)<<(I2C_COMMAND9_S))
|
||||
#define I2C_COMMAND9_V 0x3FFF
|
||||
#define I2C_COMMAND9_S 0
|
||||
|
||||
#define I2C_COMD10_REG(i) (REG_I2C_BASE(i) + 0x0080)
|
||||
/* I2C_COMMAND10_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */
|
||||
/*description: When command10 is done in I2C Master mode this bit changes to high level.*/
|
||||
#define I2C_COMMAND10_DONE (BIT(31))
|
||||
#define I2C_COMMAND10_DONE_M (BIT(31))
|
||||
#define I2C_COMMAND10_DONE_V 0x1
|
||||
#define I2C_COMMAND10_DONE_S 31
|
||||
/* I2C_COMMAND10 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */
|
||||
/*description: This is the content of command10. It consists of three part.
|
||||
op_code is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/
|
||||
#define I2C_COMMAND10 0x00003FFF
|
||||
#define I2C_COMMAND10_M ((I2C_COMMAND10_V)<<(I2C_COMMAND10_S))
|
||||
#define I2C_COMMAND10_V 0x3FFF
|
||||
#define I2C_COMMAND10_S 0
|
||||
|
||||
#define I2C_COMD11_REG(i) (REG_I2C_BASE(i) + 0x0084)
|
||||
/* I2C_COMMAND11_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */
|
||||
/*description: When command11 is done in I2C Master mode this bit changes to high level.*/
|
||||
#define I2C_COMMAND11_DONE (BIT(31))
|
||||
#define I2C_COMMAND11_DONE_M (BIT(31))
|
||||
#define I2C_COMMAND11_DONE_V 0x1
|
||||
#define I2C_COMMAND11_DONE_S 31
|
||||
/* I2C_COMMAND11 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */
|
||||
/*description: This is the content of command11. It consists of three part.
|
||||
op_code is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/
|
||||
#define I2C_COMMAND11 0x00003FFF
|
||||
#define I2C_COMMAND11_M ((I2C_COMMAND11_V)<<(I2C_COMMAND11_S))
|
||||
#define I2C_COMMAND11_V 0x3FFF
|
||||
#define I2C_COMMAND11_S 0
|
||||
|
||||
#define I2C_COMD12_REG(i) (REG_I2C_BASE(i) + 0x0088)
|
||||
/* I2C_COMMAND12_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */
|
||||
/*description: When command12 is done in I2C Master mode this bit changes to high level.*/
|
||||
#define I2C_COMMAND12_DONE (BIT(31))
|
||||
#define I2C_COMMAND12_DONE_M (BIT(31))
|
||||
#define I2C_COMMAND12_DONE_V 0x1
|
||||
#define I2C_COMMAND12_DONE_S 31
|
||||
/* I2C_COMMAND12 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */
|
||||
/*description: This is the content of command12. It consists of three part.
|
||||
op_code is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/
|
||||
#define I2C_COMMAND12 0x00003FFF
|
||||
#define I2C_COMMAND12_M ((I2C_COMMAND12_V)<<(I2C_COMMAND12_S))
|
||||
#define I2C_COMMAND12_V 0x3FFF
|
||||
#define I2C_COMMAND12_S 0
|
||||
|
||||
#define I2C_COMD13_REG(i) (REG_I2C_BASE(i) + 0x008C)
|
||||
/* I2C_COMMAND13_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */
|
||||
/*description: When command13 is done in I2C Master mode this bit changes to high level.*/
|
||||
#define I2C_COMMAND13_DONE (BIT(31))
|
||||
#define I2C_COMMAND13_DONE_M (BIT(31))
|
||||
#define I2C_COMMAND13_DONE_V 0x1
|
||||
#define I2C_COMMAND13_DONE_S 31
|
||||
/* I2C_COMMAND13 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */
|
||||
/*description: This is the content of command13. It consists of three part.
|
||||
op_code is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/
|
||||
#define I2C_COMMAND13 0x00003FFF
|
||||
#define I2C_COMMAND13_M ((I2C_COMMAND13_V)<<(I2C_COMMAND13_S))
|
||||
#define I2C_COMMAND13_V 0x3FFF
|
||||
#define I2C_COMMAND13_S 0
|
||||
|
||||
#define I2C_COMD14_REG(i) (REG_I2C_BASE(i) + 0x0090)
|
||||
/* I2C_COMMAND14_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */
|
||||
/*description: When command14 is done in I2C Master mode this bit changes to high level.*/
|
||||
#define I2C_COMMAND14_DONE (BIT(31))
|
||||
#define I2C_COMMAND14_DONE_M (BIT(31))
|
||||
#define I2C_COMMAND14_DONE_V 0x1
|
||||
#define I2C_COMMAND14_DONE_S 31
|
||||
/* I2C_COMMAND14 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */
|
||||
/*description: This is the content of command14. It consists of three part.
|
||||
op_code is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/
|
||||
#define I2C_COMMAND14 0x00003FFF
|
||||
#define I2C_COMMAND14_M ((I2C_COMMAND14_V)<<(I2C_COMMAND14_S))
|
||||
#define I2C_COMMAND14_V 0x3FFF
|
||||
#define I2C_COMMAND14_S 0
|
||||
|
||||
#define I2C_COMD15_REG(i) (REG_I2C_BASE(i) + 0x0094)
|
||||
/* I2C_COMMAND15_DONE : R/W ;bitpos:[31] ;default: 1'b0 ; */
|
||||
/*description: When command15 is done in I2C Master mode this bit changes to high level.*/
|
||||
#define I2C_COMMAND15_DONE (BIT(31))
|
||||
#define I2C_COMMAND15_DONE_M (BIT(31))
|
||||
#define I2C_COMMAND15_DONE_V 0x1
|
||||
#define I2C_COMMAND15_DONE_S 31
|
||||
/* I2C_COMMAND15 : R/W ;bitpos:[13:0] ;default: 14'b0 ; */
|
||||
/*description: This is the content of command15. It consists of three part.
|
||||
op_code is the command 0: RSTART 1: WRITE 2: READ 3: STOP . 4:END. Byte_num represent the number of data need to be send or data need to be received. ack_check_en ack_exp and ack value are used to control the ack bit.*/
|
||||
#define I2C_COMMAND15 0x00003FFF
|
||||
#define I2C_COMMAND15_M ((I2C_COMMAND15_V)<<(I2C_COMMAND15_S))
|
||||
#define I2C_COMMAND15_V 0x3FFF
|
||||
#define I2C_COMMAND15_S 0
|
||||
|
||||
#define I2C_DATE_REG(i) (REG_I2C_BASE(i) + 0x00F8)
|
||||
/* I2C_DATE : R/W ;bitpos:[31:0] ;default: 32'h16042000 ; */
|
||||
/*description: */
|
||||
#define I2C_DATE 0xFFFFFFFF
|
||||
#define I2C_DATE_M ((I2C_DATE_V)<<(I2C_DATE_S))
|
||||
#define I2C_DATE_V 0xFFFFFFFF
|
||||
#define I2C_DATE_S 0
|
||||
|
||||
#define I2C_FIFO_START_ADDR_REG(i) (REG_I2C_BASE(i) + 0x0100)
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /*_SOC_I2C_REG_H_ */
|
||||
|
||||
|
@ -1,289 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_I2C_STRUCT_H_
|
||||
#define _SOC_I2C_STRUCT_H_
|
||||
typedef volatile struct {
|
||||
union {
|
||||
struct {
|
||||
uint32_t period:14; /*This register is used to configure the low level width of SCL clock.*/
|
||||
uint32_t reserved14: 18;
|
||||
};
|
||||
uint32_t val;
|
||||
} scl_low_period;
|
||||
union {
|
||||
struct {
|
||||
uint32_t sda_force_out: 1; /*1:normally output sda data 0: exchange the function of sda_o and sda_oe (sda_o is the original internal output sda signal sda_oe is the enable bit for the internal output sda signal)*/
|
||||
uint32_t scl_force_out: 1; /*1:normally output scl clock 0: exchange the function of scl_o and scl_oe (scl_o is the original internal output scl signal scl_oe is the enable bit for the internal output scl signal)*/
|
||||
uint32_t sample_scl_level: 1; /*Set this bit to sample data in SCL low level. clear this bit to sample data in SCL high level.*/
|
||||
uint32_t reserved3: 1;
|
||||
uint32_t ms_mode: 1; /*Set this bit to configure the module as i2c master clear this bit to configure the module as i2c slave.*/
|
||||
uint32_t trans_start: 1; /*Set this bit to start sending data in tx_fifo.*/
|
||||
uint32_t tx_lsb_first: 1; /*This bit is used to control the sending mode for data need to be send. 1:receive data from most significant bit 0:receive data from least significant bit*/
|
||||
uint32_t rx_lsb_first: 1; /*This bit is used to control the storage mode for received data. 1:receive data from most significant bit 0:receive data from least significant bit*/
|
||||
uint32_t clk_en: 1; /*This is the clock gating control bit for reading or writing registers.*/
|
||||
uint32_t reserved9: 23;
|
||||
};
|
||||
uint32_t val;
|
||||
} ctr;
|
||||
union {
|
||||
struct {
|
||||
uint32_t ack_rec: 1; /*This register stores the value of ACK bit.*/
|
||||
uint32_t slave_rw: 1; /*when in slave mode 1:master read slave 0: master write slave.*/
|
||||
uint32_t time_out: 1; /*when I2C takes more than time_out_reg clocks to receive a data then this register changes to high level.*/
|
||||
uint32_t arb_lost: 1; /*when I2C lost control of SDA line this register changes to high level.*/
|
||||
uint32_t bus_busy: 1; /*1:I2C bus is busy transferring data. 0:I2C bus is in idle state.*/
|
||||
uint32_t slave_addressed: 1; /*when configured as i2c slave and the address send by master is equal to slave's address then this bit will be high level.*/
|
||||
uint32_t byte_trans: 1; /*This register changes to high level when one byte is transferred.*/
|
||||
uint32_t reserved7: 1;
|
||||
uint32_t rx_fifo_cnt: 6; /*This register represent the amount of data need to send.*/
|
||||
uint32_t reserved14: 4;
|
||||
uint32_t tx_fifo_cnt: 6; /*This register stores the amount of received data in ram.*/
|
||||
uint32_t scl_main_state_last: 3; /*This register stores the value of state machine for i2c module. 3'h0: SCL_MAIN_IDLE 3'h1: SCL_ADDRESS_SHIFT 3'h2: SCL_ACK_ADDRESS 3'h3: SCL_RX_DATA 3'h4 SCL_TX_DATA 3'h5:SCL_SEND_ACK 3'h6:SCL_WAIT_ACK*/
|
||||
uint32_t reserved27: 1;
|
||||
uint32_t scl_state_last: 3; /*This register stores the value of state machine to produce SCL. 3'h0: SCL_IDLE 3'h1:SCL_START 3'h2:SCL_LOW_EDGE 3'h3: SCL_LOW 3'h4:SCL_HIGH_EDGE 3'h5:SCL_HIGH 3'h6:SCL_STOP*/
|
||||
uint32_t reserved31: 1;
|
||||
};
|
||||
uint32_t val;
|
||||
} status_reg;
|
||||
union {
|
||||
struct {
|
||||
uint32_t tout: 20; /*This register is used to configure the max clock number of receiving a data, unit: APB clock cycle.*/
|
||||
uint32_t reserved20:12;
|
||||
};
|
||||
uint32_t val;
|
||||
} timeout;
|
||||
union {
|
||||
struct {
|
||||
uint32_t addr: 15; /*when configured as i2c slave this register is used to configure slave's address.*/
|
||||
uint32_t reserved15: 16;
|
||||
uint32_t en_10bit: 1; /*This register is used to enable slave 10bit address mode.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} slave_addr;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rx_fifo_start_addr: 5; /*This is the offset address of the last receiving data as described in nonfifo_rx_thres_register.*/
|
||||
uint32_t rx_fifo_end_addr: 5; /*This is the offset address of the first receiving data as described in nonfifo_rx_thres_register.*/
|
||||
uint32_t tx_fifo_start_addr: 5; /*This is the offset address of the first sending data as described in nonfifo_tx_thres register.*/
|
||||
uint32_t tx_fifo_end_addr: 5; /*This is the offset address of the last sending data as described in nonfifo_tx_thres register.*/
|
||||
uint32_t reserved20: 12;
|
||||
};
|
||||
uint32_t val;
|
||||
} fifo_st;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rx_fifo_full_thrhd: 5;
|
||||
uint32_t tx_fifo_empty_thrhd:5; /*Config tx_fifo empty threhd value when using apb fifo access*/
|
||||
uint32_t nonfifo_en: 1; /*Set this bit to enble apb nonfifo access.*/
|
||||
uint32_t fifo_addr_cfg_en: 1; /*When this bit is set to 1 then the byte after address represent the offset address of I2C Slave's ram.*/
|
||||
uint32_t rx_fifo_rst: 1; /*Set this bit to reset rx fifo when using apb fifo access.*/
|
||||
uint32_t tx_fifo_rst: 1; /*Set this bit to reset tx fifo when using apb fifo access.*/
|
||||
uint32_t nonfifo_rx_thres: 6; /*when I2C receives more than nonfifo_rx_thres data it will produce rx_send_full_int_raw interrupt and update the current offset address of the receiving data.*/
|
||||
uint32_t nonfifo_tx_thres: 6; /*when I2C sends more than nonfifo_tx_thres data it will produce tx_send_empty_int_raw interrupt and update the current offset address of the sending data.*/
|
||||
uint32_t reserved26: 6;
|
||||
};
|
||||
uint32_t val;
|
||||
} fifo_conf;
|
||||
union {
|
||||
struct {
|
||||
uint8_t data; /*The register represent the byte data read from rx_fifo when use apb fifo access*/
|
||||
uint8_t reserved[3];
|
||||
};
|
||||
uint32_t val;
|
||||
} fifo_data;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rx_fifo_full: 1; /*The raw interrupt status bit for rx_fifo full when use apb fifo access.*/
|
||||
uint32_t tx_fifo_empty: 1; /*The raw interrupt status bit for tx_fifo empty when use apb fifo access.*/
|
||||
uint32_t rx_fifo_ovf: 1; /*The raw interrupt status bit for receiving data overflow when use apb fifo access.*/
|
||||
uint32_t end_detect: 1; /*The raw interrupt status bit for end_detect_int interrupt. when I2C deals with the END command it will produce end_detect_int interrupt.*/
|
||||
uint32_t slave_tran_comp: 1; /*The raw interrupt status bit for slave_tran_comp_int interrupt. when I2C Slave detects the STOP bit it will produce slave_tran_comp_int interrupt.*/
|
||||
uint32_t arbitration_lost: 1; /*The raw interrupt status bit for arbitration_lost_int interrupt.when I2C lost the usage right of I2C BUS it will produce arbitration_lost_int interrupt.*/
|
||||
uint32_t master_tran_comp: 1; /*The raw interrupt status bit for master_tra_comp_int interrupt. when I2C Master sends or receives a byte it will produce master_tran_comp_int interrupt.*/
|
||||
uint32_t trans_complete: 1; /*The raw interrupt status bit for trans_complete_int interrupt. when I2C Master finished STOP command it will produce trans_complete_int interrupt.*/
|
||||
uint32_t time_out: 1; /*The raw interrupt status bit for time_out_int interrupt. when I2C takes a lot of time to receive a data it will produce time_out_int interrupt.*/
|
||||
uint32_t trans_start: 1; /*The raw interrupt status bit for trans_start_int interrupt. when I2C sends the START bit it will produce trans_start_int interrupt.*/
|
||||
uint32_t ack_err: 1; /*The raw interrupt status bit for ack_err_int interrupt. when I2C receives a wrong ACK bit it will produce ack_err_int interrupt..*/
|
||||
uint32_t rx_rec_full: 1; /*The raw interrupt status bit for rx_rec_full_int interrupt. when I2C receives more data than nonfifo_rx_thres it will produce rx_rec_full_int interrupt.*/
|
||||
uint32_t tx_send_empty: 1; /*The raw interrupt status bit for tx_send_empty_int interrupt.when I2C sends more data than nonfifo_tx_thres it will produce tx_send_empty_int interrupt..*/
|
||||
uint32_t reserved13: 19;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_raw;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rx_fifo_full: 1; /*Set this bit to clear the rx_fifo_full_int interrupt.*/
|
||||
uint32_t tx_fifo_empty: 1; /*Set this bit to clear the tx_fifo_empty_int interrupt.*/
|
||||
uint32_t rx_fifo_ovf: 1; /*Set this bit to clear the rx_fifo_ovf_int interrupt.*/
|
||||
uint32_t end_detect: 1; /*Set this bit to clear the end_detect_int interrupt.*/
|
||||
uint32_t slave_tran_comp: 1; /*Set this bit to clear the slave_tran_comp_int interrupt.*/
|
||||
uint32_t arbitration_lost: 1; /*Set this bit to clear the arbitration_lost_int interrupt.*/
|
||||
uint32_t master_tran_comp: 1; /*Set this bit to clear the master_tran_comp interrupt.*/
|
||||
uint32_t trans_complete: 1; /*Set this bit to clear the trans_complete_int interrupt.*/
|
||||
uint32_t time_out: 1; /*Set this bit to clear the time_out_int interrupt.*/
|
||||
uint32_t trans_start: 1; /*Set this bit to clear the trans_start_int interrupt.*/
|
||||
uint32_t ack_err: 1; /*Set this bit to clear the ack_err_int interrupt.*/
|
||||
uint32_t rx_rec_full: 1; /*Set this bit to clear the rx_rec_full_int interrupt.*/
|
||||
uint32_t tx_send_empty: 1; /*Set this bit to clear the tx_send_empty_int interrupt.*/
|
||||
uint32_t reserved13: 19;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_clr;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rx_fifo_full: 1; /*The enable bit for rx_fifo_full_int interrupt.*/
|
||||
uint32_t tx_fifo_empty: 1; /*The enable bit for tx_fifo_empty_int interrupt.*/
|
||||
uint32_t rx_fifo_ovf: 1; /*The enable bit for rx_fifo_ovf_int interrupt.*/
|
||||
uint32_t end_detect: 1; /*The enable bit for end_detect_int interrupt.*/
|
||||
uint32_t slave_tran_comp: 1; /*The enable bit for slave_tran_comp_int interrupt.*/
|
||||
uint32_t arbitration_lost: 1; /*The enable bit for arbitration_lost_int interrupt.*/
|
||||
uint32_t master_tran_comp: 1; /*The enable bit for master_tran_comp_int interrupt.*/
|
||||
uint32_t trans_complete: 1; /*The enable bit for trans_complete_int interrupt.*/
|
||||
uint32_t time_out: 1; /*The enable bit for time_out_int interrupt.*/
|
||||
uint32_t trans_start: 1; /*The enable bit for trans_start_int interrupt.*/
|
||||
uint32_t ack_err: 1; /*The enable bit for ack_err_int interrupt.*/
|
||||
uint32_t rx_rec_full: 1; /*The enable bit for rx_rec_full_int interrupt.*/
|
||||
uint32_t tx_send_empty: 1; /*The enable bit for tx_send_empty_int interrupt.*/
|
||||
uint32_t reserved13: 19;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_ena;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rx_fifo_full: 1; /*The masked interrupt status for rx_fifo_full_int interrupt.*/
|
||||
uint32_t tx_fifo_empty: 1; /*The masked interrupt status for tx_fifo_empty_int interrupt.*/
|
||||
uint32_t rx_fifo_ovf: 1; /*The masked interrupt status for rx_fifo_ovf_int interrupt.*/
|
||||
uint32_t end_detect: 1; /*The masked interrupt status for end_detect_int interrupt.*/
|
||||
uint32_t slave_tran_comp: 1; /*The masked interrupt status for slave_tran_comp_int interrupt.*/
|
||||
uint32_t arbitration_lost: 1; /*The masked interrupt status for arbitration_lost_int interrupt.*/
|
||||
uint32_t master_tran_comp: 1; /*The masked interrupt status for master_tran_comp_int interrupt.*/
|
||||
uint32_t trans_complete: 1; /*The masked interrupt status for trans_complete_int interrupt.*/
|
||||
uint32_t time_out: 1; /*The masked interrupt status for time_out_int interrupt.*/
|
||||
uint32_t trans_start: 1; /*The masked interrupt status for trans_start_int interrupt.*/
|
||||
uint32_t ack_err: 1; /*The masked interrupt status for ack_err_int interrupt.*/
|
||||
uint32_t rx_rec_full: 1; /*The masked interrupt status for rx_rec_full_int interrupt.*/
|
||||
uint32_t tx_send_empty: 1; /*The masked interrupt status for tx_send_empty_int interrupt.*/
|
||||
uint32_t reserved13: 19;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_status;
|
||||
union {
|
||||
struct {
|
||||
uint32_t time: 10; /*This register is used to configure the clock num I2C used to hold the data after the negedge of SCL.*/
|
||||
uint32_t reserved10: 22;
|
||||
};
|
||||
uint32_t val;
|
||||
} sda_hold;
|
||||
union {
|
||||
struct {
|
||||
uint32_t time: 10; /*This register is used to configure the clock num I2C used to sample data on SDA after the posedge of SCL*/
|
||||
uint32_t reserved10: 22;
|
||||
};
|
||||
uint32_t val;
|
||||
} sda_sample;
|
||||
union {
|
||||
struct {
|
||||
uint32_t period: 14; /*This register is used to configure the clock num during SCL is low level.*/
|
||||
uint32_t reserved14: 18;
|
||||
};
|
||||
uint32_t val;
|
||||
} scl_high_period;
|
||||
uint32_t reserved_3c;
|
||||
union {
|
||||
struct {
|
||||
uint32_t time: 10; /*This register is used to configure the clock num between the negedge of SDA and negedge of SCL for start mark.*/
|
||||
uint32_t reserved10: 22;
|
||||
};
|
||||
uint32_t val;
|
||||
} scl_start_hold;
|
||||
union {
|
||||
struct {
|
||||
uint32_t time: 10; /*This register is used to configure the clock num between the posedge of SCL and the negedge of SDA for restart mark.*/
|
||||
uint32_t reserved10: 22;
|
||||
};
|
||||
uint32_t val;
|
||||
} scl_rstart_setup;
|
||||
union {
|
||||
struct {
|
||||
uint32_t time: 14; /*This register is used to configure the clock num after the STOP bit's posedge.*/
|
||||
uint32_t reserved14: 18;
|
||||
};
|
||||
uint32_t val;
|
||||
} scl_stop_hold;
|
||||
union {
|
||||
struct {
|
||||
uint32_t time: 10; /*This register is used to configure the clock num between the posedge of SCL and the posedge of SDA.*/
|
||||
uint32_t reserved10: 22;
|
||||
};
|
||||
uint32_t val;
|
||||
} scl_stop_setup;
|
||||
union {
|
||||
struct {
|
||||
uint32_t thres: 3; /*When input SCL's pulse width is smaller than this register value I2C ignores this pulse.*/
|
||||
uint32_t en: 1; /*This is the filter enable bit for SCL.*/
|
||||
uint32_t reserved4: 28;
|
||||
};
|
||||
uint32_t val;
|
||||
} scl_filter_cfg;
|
||||
union {
|
||||
struct {
|
||||
uint32_t thres: 3; /*When input SCL's pulse width is smaller than this register value I2C ignores this pulse.*/
|
||||
uint32_t en: 1; /*This is the filter enable bit for SDA.*/
|
||||
uint32_t reserved4: 28;
|
||||
};
|
||||
uint32_t val;
|
||||
} sda_filter_cfg;
|
||||
union {
|
||||
struct {
|
||||
uint32_t byte_num: 8; /*Byte_num represent the number of data need to be send or data need to be received.*/
|
||||
uint32_t ack_en: 1; /*ack_check_en ack_exp and ack value are used to control the ack bit.*/
|
||||
uint32_t ack_exp: 1; /*ack_check_en ack_exp and ack value are used to control the ack bit.*/
|
||||
uint32_t ack_val: 1; /*ack_check_en ack_exp and ack value are used to control the ack bit.*/
|
||||
uint32_t op_code: 3; /*op_code is the command 0:RSTART 1:WRITE 2:READ 3:STOP . 4:END.*/
|
||||
uint32_t reserved14: 17;
|
||||
uint32_t done: 1; /*When command0 is done in I2C Master mode this bit changes to high level.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} command[16];
|
||||
uint32_t reserved_98;
|
||||
uint32_t reserved_9c;
|
||||
uint32_t reserved_a0;
|
||||
uint32_t reserved_a4;
|
||||
uint32_t reserved_a8;
|
||||
uint32_t reserved_ac;
|
||||
uint32_t reserved_b0;
|
||||
uint32_t reserved_b4;
|
||||
uint32_t reserved_b8;
|
||||
uint32_t reserved_bc;
|
||||
uint32_t reserved_c0;
|
||||
uint32_t reserved_c4;
|
||||
uint32_t reserved_c8;
|
||||
uint32_t reserved_cc;
|
||||
uint32_t reserved_d0;
|
||||
uint32_t reserved_d4;
|
||||
uint32_t reserved_d8;
|
||||
uint32_t reserved_dc;
|
||||
uint32_t reserved_e0;
|
||||
uint32_t reserved_e4;
|
||||
uint32_t reserved_e8;
|
||||
uint32_t reserved_ec;
|
||||
uint32_t reserved_f0;
|
||||
uint32_t reserved_f4;
|
||||
uint32_t date; /**/
|
||||
uint32_t reserved_fc;
|
||||
uint32_t ram_data[32]; /*This the start address for ram when use apb nonfifo access.*/
|
||||
} i2c_dev_t;
|
||||
extern i2c_dev_t I2C0;
|
||||
extern i2c_dev_t I2C1;
|
||||
#endif /* _SOC_I2C_STRUCT_H_ */
|
File diff suppressed because it is too large
Load Diff
@ -1,461 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_I2S_STRUCT_H_
|
||||
#define _SOC_I2S_STRUCT_H_
|
||||
typedef volatile struct {
|
||||
uint32_t reserved_0;
|
||||
uint32_t reserved_4;
|
||||
union {
|
||||
struct {
|
||||
uint32_t tx_reset: 1;
|
||||
uint32_t rx_reset: 1;
|
||||
uint32_t tx_fifo_reset: 1;
|
||||
uint32_t rx_fifo_reset: 1;
|
||||
uint32_t tx_start: 1;
|
||||
uint32_t rx_start: 1;
|
||||
uint32_t tx_slave_mod: 1;
|
||||
uint32_t rx_slave_mod: 1;
|
||||
uint32_t tx_right_first: 1;
|
||||
uint32_t rx_right_first: 1;
|
||||
uint32_t tx_msb_shift: 1;
|
||||
uint32_t rx_msb_shift: 1;
|
||||
uint32_t tx_short_sync: 1;
|
||||
uint32_t rx_short_sync: 1;
|
||||
uint32_t tx_mono: 1;
|
||||
uint32_t rx_mono: 1;
|
||||
uint32_t tx_msb_right: 1;
|
||||
uint32_t rx_msb_right: 1;
|
||||
uint32_t sig_loopback: 1;
|
||||
uint32_t reserved19: 13;
|
||||
};
|
||||
uint32_t val;
|
||||
} conf;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rx_take_data: 1;
|
||||
uint32_t tx_put_data: 1;
|
||||
uint32_t rx_wfull: 1;
|
||||
uint32_t rx_rempty: 1;
|
||||
uint32_t tx_wfull: 1;
|
||||
uint32_t tx_rempty: 1;
|
||||
uint32_t rx_hung: 1;
|
||||
uint32_t tx_hung: 1;
|
||||
uint32_t in_done: 1;
|
||||
uint32_t in_suc_eof: 1;
|
||||
uint32_t in_err_eof: 1;
|
||||
uint32_t out_done: 1;
|
||||
uint32_t out_eof: 1;
|
||||
uint32_t in_dscr_err: 1;
|
||||
uint32_t out_dscr_err: 1;
|
||||
uint32_t in_dscr_empty: 1;
|
||||
uint32_t out_total_eof: 1;
|
||||
uint32_t reserved17: 15;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_raw;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rx_take_data: 1;
|
||||
uint32_t tx_put_data: 1;
|
||||
uint32_t rx_wfull: 1;
|
||||
uint32_t rx_rempty: 1;
|
||||
uint32_t tx_wfull: 1;
|
||||
uint32_t tx_rempty: 1;
|
||||
uint32_t rx_hung: 1;
|
||||
uint32_t tx_hung: 1;
|
||||
uint32_t in_done: 1;
|
||||
uint32_t in_suc_eof: 1;
|
||||
uint32_t in_err_eof: 1;
|
||||
uint32_t out_done: 1;
|
||||
uint32_t out_eof: 1;
|
||||
uint32_t in_dscr_err: 1;
|
||||
uint32_t out_dscr_err: 1;
|
||||
uint32_t in_dscr_empty: 1;
|
||||
uint32_t out_total_eof: 1;
|
||||
uint32_t reserved17: 15;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_st;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rx_take_data: 1;
|
||||
uint32_t tx_put_data: 1;
|
||||
uint32_t rx_wfull: 1;
|
||||
uint32_t rx_rempty: 1;
|
||||
uint32_t tx_wfull: 1;
|
||||
uint32_t tx_rempty: 1;
|
||||
uint32_t rx_hung: 1;
|
||||
uint32_t tx_hung: 1;
|
||||
uint32_t in_done: 1;
|
||||
uint32_t in_suc_eof: 1;
|
||||
uint32_t in_err_eof: 1;
|
||||
uint32_t out_done: 1;
|
||||
uint32_t out_eof: 1;
|
||||
uint32_t in_dscr_err: 1;
|
||||
uint32_t out_dscr_err: 1;
|
||||
uint32_t in_dscr_empty: 1;
|
||||
uint32_t out_total_eof: 1;
|
||||
uint32_t reserved17: 15;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_ena;
|
||||
union {
|
||||
struct {
|
||||
uint32_t take_data: 1;
|
||||
uint32_t put_data: 1;
|
||||
uint32_t rx_wfull: 1;
|
||||
uint32_t rx_rempty: 1;
|
||||
uint32_t tx_wfull: 1;
|
||||
uint32_t tx_rempty: 1;
|
||||
uint32_t rx_hung: 1;
|
||||
uint32_t tx_hung: 1;
|
||||
uint32_t in_done: 1;
|
||||
uint32_t in_suc_eof: 1;
|
||||
uint32_t in_err_eof: 1;
|
||||
uint32_t out_done: 1;
|
||||
uint32_t out_eof: 1;
|
||||
uint32_t in_dscr_err: 1;
|
||||
uint32_t out_dscr_err: 1;
|
||||
uint32_t in_dscr_empty: 1;
|
||||
uint32_t out_total_eof: 1;
|
||||
uint32_t reserved17: 15;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_clr;
|
||||
union {
|
||||
struct {
|
||||
uint32_t tx_bck_in_delay: 2;
|
||||
uint32_t tx_ws_in_delay: 2;
|
||||
uint32_t rx_bck_in_delay: 2;
|
||||
uint32_t rx_ws_in_delay: 2;
|
||||
uint32_t rx_sd_in_delay: 2;
|
||||
uint32_t tx_bck_out_delay: 2;
|
||||
uint32_t tx_ws_out_delay: 2;
|
||||
uint32_t tx_sd_out_delay: 2;
|
||||
uint32_t rx_ws_out_delay: 2;
|
||||
uint32_t rx_bck_out_delay: 2;
|
||||
uint32_t tx_dsync_sw: 1;
|
||||
uint32_t rx_dsync_sw: 1;
|
||||
uint32_t data_enable_delay: 2;
|
||||
uint32_t tx_bck_in_inv: 1;
|
||||
uint32_t reserved25: 7;
|
||||
};
|
||||
uint32_t val;
|
||||
} timing;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rx_data_num: 6;
|
||||
uint32_t tx_data_num: 6;
|
||||
uint32_t dscr_en: 1;
|
||||
uint32_t tx_fifo_mod: 3;
|
||||
uint32_t rx_fifo_mod: 3;
|
||||
uint32_t tx_fifo_mod_force_en: 1;
|
||||
uint32_t rx_fifo_mod_force_en: 1;
|
||||
uint32_t reserved21: 11;
|
||||
};
|
||||
uint32_t val;
|
||||
} fifo_conf;
|
||||
uint32_t rx_eof_num;
|
||||
uint32_t conf_single_data;
|
||||
union {
|
||||
struct {
|
||||
uint32_t tx_chan_mod: 3;
|
||||
uint32_t rx_chan_mod: 2;
|
||||
uint32_t reserved5: 27;
|
||||
};
|
||||
uint32_t val;
|
||||
} conf_chan;
|
||||
union {
|
||||
struct {
|
||||
uint32_t addr: 20;
|
||||
uint32_t reserved20: 8;
|
||||
uint32_t stop: 1;
|
||||
uint32_t start: 1;
|
||||
uint32_t restart: 1;
|
||||
uint32_t park: 1;
|
||||
};
|
||||
uint32_t val;
|
||||
} out_link;
|
||||
union {
|
||||
struct {
|
||||
uint32_t addr: 20;
|
||||
uint32_t reserved20: 8;
|
||||
uint32_t stop: 1;
|
||||
uint32_t start: 1;
|
||||
uint32_t restart: 1;
|
||||
uint32_t park: 1;
|
||||
};
|
||||
uint32_t val;
|
||||
} in_link;
|
||||
uint32_t out_eof_des_addr;
|
||||
uint32_t in_eof_des_addr;
|
||||
uint32_t out_eof_bfr_des_addr;
|
||||
union {
|
||||
struct {
|
||||
uint32_t mode: 3;
|
||||
uint32_t reserved3: 1;
|
||||
uint32_t addr: 2;
|
||||
uint32_t reserved6: 26;
|
||||
};
|
||||
uint32_t val;
|
||||
} ahb_test;
|
||||
uint32_t in_link_dscr;
|
||||
uint32_t in_link_dscr_bf0;
|
||||
uint32_t in_link_dscr_bf1;
|
||||
uint32_t out_link_dscr;
|
||||
uint32_t out_link_dscr_bf0;
|
||||
uint32_t out_link_dscr_bf1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t in_rst: 1;
|
||||
uint32_t out_rst: 1;
|
||||
uint32_t ahbm_fifo_rst: 1;
|
||||
uint32_t ahbm_rst: 1;
|
||||
uint32_t out_loop_test: 1;
|
||||
uint32_t in_loop_test: 1;
|
||||
uint32_t out_auto_wrback: 1;
|
||||
uint32_t out_no_restart_clr: 1;
|
||||
uint32_t out_eof_mode: 1;
|
||||
uint32_t outdscr_burst_en: 1;
|
||||
uint32_t indscr_burst_en: 1;
|
||||
uint32_t out_data_burst_en: 1;
|
||||
uint32_t check_owner: 1;
|
||||
uint32_t mem_trans_en: 1;
|
||||
uint32_t reserved14: 18;
|
||||
};
|
||||
uint32_t val;
|
||||
} lc_conf;
|
||||
union {
|
||||
struct {
|
||||
uint32_t wdata: 9;
|
||||
uint32_t reserved9: 7;
|
||||
uint32_t push: 1;
|
||||
uint32_t reserved17: 15;
|
||||
};
|
||||
uint32_t val;
|
||||
} out_fifo_push;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rdata: 12;
|
||||
uint32_t reserved12: 4;
|
||||
uint32_t pop: 1;
|
||||
uint32_t reserved17: 15;
|
||||
};
|
||||
uint32_t val;
|
||||
} in_fifo_pop;
|
||||
uint32_t lc_state0;
|
||||
uint32_t lc_state1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t fifo_timeout: 8;
|
||||
uint32_t fifo_timeout_shift: 3;
|
||||
uint32_t fifo_timeout_ena: 1;
|
||||
uint32_t reserved12: 20;
|
||||
};
|
||||
uint32_t val;
|
||||
} lc_hung_conf;
|
||||
uint32_t reserved_78;
|
||||
uint32_t reserved_7c;
|
||||
union {
|
||||
struct {
|
||||
uint32_t y_max:16;
|
||||
uint32_t y_min:16;
|
||||
};
|
||||
uint32_t val;
|
||||
} cvsd_conf0;
|
||||
union {
|
||||
struct {
|
||||
uint32_t sigma_max:16;
|
||||
uint32_t sigma_min:16;
|
||||
};
|
||||
uint32_t val;
|
||||
} cvsd_conf1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t cvsd_k: 3;
|
||||
uint32_t cvsd_j: 3;
|
||||
uint32_t cvsd_beta: 10;
|
||||
uint32_t cvsd_h: 3;
|
||||
uint32_t reserved19:13;
|
||||
};
|
||||
uint32_t val;
|
||||
} cvsd_conf2;
|
||||
union {
|
||||
struct {
|
||||
uint32_t good_pack_max: 6;
|
||||
uint32_t n_err_seg: 3;
|
||||
uint32_t shift_rate: 3;
|
||||
uint32_t max_slide_sample: 8;
|
||||
uint32_t pack_len_8k: 5;
|
||||
uint32_t n_min_err: 3;
|
||||
uint32_t reserved28: 4;
|
||||
};
|
||||
uint32_t val;
|
||||
} plc_conf0;
|
||||
union {
|
||||
struct {
|
||||
uint32_t bad_cef_atten_para: 8;
|
||||
uint32_t bad_cef_atten_para_shift: 4;
|
||||
uint32_t bad_ola_win2_para_shift: 4;
|
||||
uint32_t bad_ola_win2_para: 8;
|
||||
uint32_t slide_win_len: 8;
|
||||
};
|
||||
uint32_t val;
|
||||
} plc_conf1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t cvsd_seg_mod: 2;
|
||||
uint32_t min_period: 5;
|
||||
uint32_t reserved7: 25;
|
||||
};
|
||||
uint32_t val;
|
||||
} plc_conf2;
|
||||
union {
|
||||
struct {
|
||||
uint32_t en: 1;
|
||||
uint32_t chan_mod: 1;
|
||||
uint32_t cvsd_dec_pack_err: 1;
|
||||
uint32_t cvsd_pack_len_8k: 5;
|
||||
uint32_t cvsd_inf_en: 1;
|
||||
uint32_t cvsd_dec_start: 1;
|
||||
uint32_t cvsd_dec_reset: 1;
|
||||
uint32_t plc_en: 1;
|
||||
uint32_t plc2dma_en: 1;
|
||||
uint32_t reserved13: 19;
|
||||
};
|
||||
uint32_t val;
|
||||
} esco_conf0;
|
||||
union {
|
||||
struct {
|
||||
uint32_t with_en: 1;
|
||||
uint32_t no_en: 1;
|
||||
uint32_t cvsd_enc_start: 1;
|
||||
uint32_t cvsd_enc_reset: 1;
|
||||
uint32_t reserved4: 28;
|
||||
};
|
||||
uint32_t val;
|
||||
} sco_conf0;
|
||||
union {
|
||||
struct {
|
||||
uint32_t tx_pcm_conf: 3;
|
||||
uint32_t tx_pcm_bypass: 1;
|
||||
uint32_t rx_pcm_conf: 3;
|
||||
uint32_t rx_pcm_bypass: 1;
|
||||
uint32_t tx_stop_en: 1;
|
||||
uint32_t tx_zeros_rm_en: 1;
|
||||
uint32_t reserved10: 22;
|
||||
};
|
||||
uint32_t val;
|
||||
} conf1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t fifo_force_pd: 1;
|
||||
uint32_t fifo_force_pu: 1;
|
||||
uint32_t plc_mem_force_pd: 1;
|
||||
uint32_t plc_mem_force_pu: 1;
|
||||
uint32_t reserved4: 28;
|
||||
};
|
||||
uint32_t val;
|
||||
} pd_conf;
|
||||
union {
|
||||
struct {
|
||||
uint32_t camera_en: 1;
|
||||
uint32_t lcd_tx_wrx2_en: 1;
|
||||
uint32_t lcd_tx_sdx2_en: 1;
|
||||
uint32_t data_enable_test_en: 1;
|
||||
uint32_t data_enable: 1;
|
||||
uint32_t lcd_en: 1;
|
||||
uint32_t ext_adc_start_en: 1;
|
||||
uint32_t inter_valid_en: 1;
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} conf2;
|
||||
union {
|
||||
struct {
|
||||
uint32_t clkm_div_num: 8;
|
||||
uint32_t clkm_div_b: 6;
|
||||
uint32_t clkm_div_a: 6;
|
||||
uint32_t clk_en: 1;
|
||||
uint32_t clka_en: 1;
|
||||
uint32_t reserved22: 10;
|
||||
};
|
||||
uint32_t val;
|
||||
} clkm_conf;
|
||||
union {
|
||||
struct {
|
||||
uint32_t tx_bck_div_num: 6;
|
||||
uint32_t rx_bck_div_num: 6;
|
||||
uint32_t tx_bits_mod: 6;
|
||||
uint32_t rx_bits_mod: 6;
|
||||
uint32_t reserved24: 8;
|
||||
};
|
||||
uint32_t val;
|
||||
} sample_rate_conf;
|
||||
union {
|
||||
struct {
|
||||
uint32_t tx_pdm_en: 1;
|
||||
uint32_t rx_pdm_en: 1;
|
||||
uint32_t pcm2pdm_conv_en: 1;
|
||||
uint32_t pdm2pcm_conv_en: 1;
|
||||
uint32_t tx_sinc_osr2: 4;
|
||||
uint32_t tx_prescale: 8;
|
||||
uint32_t tx_hp_in_shift: 2;
|
||||
uint32_t tx_lp_in_shift: 2;
|
||||
uint32_t tx_sinc_in_shift: 2;
|
||||
uint32_t tx_sigmadelta_in_shift: 2;
|
||||
uint32_t rx_sinc_dsr_16_en: 1;
|
||||
uint32_t txhp_bypass: 1;
|
||||
uint32_t reserved26: 6;
|
||||
};
|
||||
uint32_t val;
|
||||
} pdm_conf;
|
||||
union {
|
||||
struct {
|
||||
uint32_t tx_pdm_fs: 10;
|
||||
uint32_t tx_pdm_fp: 10;
|
||||
uint32_t reserved20:12;
|
||||
};
|
||||
uint32_t val;
|
||||
} pdm_freq_conf;
|
||||
union {
|
||||
struct {
|
||||
uint32_t tx_idle: 1;
|
||||
uint32_t tx_fifo_reset_back: 1;
|
||||
uint32_t rx_fifo_reset_back: 1;
|
||||
uint32_t reserved3: 29;
|
||||
};
|
||||
uint32_t val;
|
||||
} state;
|
||||
uint32_t reserved_c0;
|
||||
uint32_t reserved_c4;
|
||||
uint32_t reserved_c8;
|
||||
uint32_t reserved_cc;
|
||||
uint32_t reserved_d0;
|
||||
uint32_t reserved_d4;
|
||||
uint32_t reserved_d8;
|
||||
uint32_t reserved_dc;
|
||||
uint32_t reserved_e0;
|
||||
uint32_t reserved_e4;
|
||||
uint32_t reserved_e8;
|
||||
uint32_t reserved_ec;
|
||||
uint32_t reserved_f0;
|
||||
uint32_t reserved_f4;
|
||||
uint32_t reserved_f8;
|
||||
uint32_t date; /**/
|
||||
} i2s_dev_t;
|
||||
extern i2s_dev_t I2S0;
|
||||
extern i2s_dev_t I2S1;
|
||||
|
||||
#endif /* _SOC_I2S_STRUCT_H_ */
|
@ -1,298 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_IO_MUX_REG_H_
|
||||
#define _SOC_IO_MUX_REG_H_
|
||||
|
||||
#include "soc.h"
|
||||
|
||||
#define SLP_OE (BIT(0))
|
||||
#define SLP_SEL (BIT(1))
|
||||
#define SLP_PD (BIT(2))
|
||||
#define SLP_PU (BIT(3))
|
||||
#define SLP_IE (BIT(4))
|
||||
#define SLP_DRV 0x3
|
||||
#define SLP_DRV_S 5
|
||||
#define FUN_PD (BIT(7))
|
||||
#define FUN_PU (BIT(8))
|
||||
#define FUN_IE (BIT(9))
|
||||
#define FUN_DRV 0x3
|
||||
#define FUN_DRV_S 10
|
||||
#define MCU_SEL 0x7
|
||||
#define MCU_SEL_S 12
|
||||
|
||||
#define PIN_INPUT_ENABLE(PIN_NAME) SET_PERI_REG_MASK(PIN_NAME,FUN_IE)
|
||||
#define PIN_INPUT_DISABLE(PIN_NAME) CLEAR_PERI_REG_MASK(PIN_NAME,FUN_IE)
|
||||
#define PIN_SET_DRV(PIN_NAME, drv) REG_SET_FIELD(PIN_NAME, FUN_DRV, (drv));
|
||||
|
||||
/*
|
||||
* @attention
|
||||
* The PIN_PULL[UP|DWN]_[EN|DIS]() functions used to exist as macros in previous SDK versions.
|
||||
* Unfortunately, however, they do not work for some GPIOs on the ESP32 chip, which needs pullups
|
||||
* and -downs turned on and off through RTC registers. The functions still exist for compatibility
|
||||
* with older code, but are marked as deprecated in order to generate a warning.
|
||||
* Please replace them in this fashion: (make sure to include driver/gpio.h as well)
|
||||
* PIN_PULLUP_EN(GPIO_PIN_MUX_REG[x]) -> gpio_pullup_en(x)
|
||||
* PIN_PULLUP_DIS(GPIO_PIN_MUX_REG[x]) -> gpio_pullup_dis(x)
|
||||
* PIN_PULLDWN_EN(GPIO_PIN_MUX_REG[x]) -> gpio_pulldown_en(x)
|
||||
* PIN_PULLDWN_DIS(GPIO_PIN_MUX_REG[x]) -> gpio_pulldown_dis(x)
|
||||
*
|
||||
*/
|
||||
static inline void __attribute__ ((deprecated)) PIN_PULLUP_DIS(uint32_t PIN_NAME)
|
||||
{
|
||||
REG_CLR_BIT(PIN_NAME, FUN_PU);
|
||||
}
|
||||
|
||||
static inline void __attribute__ ((deprecated)) PIN_PULLUP_EN(uint32_t PIN_NAME)
|
||||
{
|
||||
REG_SET_BIT(PIN_NAME, FUN_PU);
|
||||
}
|
||||
|
||||
static inline void __attribute__ ((deprecated)) PIN_PULLDWN_DIS(uint32_t PIN_NAME)
|
||||
{
|
||||
REG_CLR_BIT(PIN_NAME, FUN_PD);
|
||||
}
|
||||
|
||||
static inline void __attribute__ ((deprecated)) PIN_PULLDWN_EN(uint32_t PIN_NAME)
|
||||
{
|
||||
REG_SET_BIT(PIN_NAME, FUN_PD);
|
||||
}
|
||||
|
||||
|
||||
#define PIN_FUNC_SELECT(PIN_NAME, FUNC) REG_SET_FIELD(PIN_NAME, MCU_SEL, FUNC)
|
||||
|
||||
#define PIN_FUNC_GPIO 2
|
||||
|
||||
#define PIN_CTRL (DR_REG_IO_MUX_BASE +0x00)
|
||||
#define CLK_OUT3 0xf
|
||||
#define CLK_OUT3_S 8
|
||||
#define CLK_OUT2 0xf
|
||||
#define CLK_OUT2_S 4
|
||||
#define CLK_OUT1 0xf
|
||||
#define CLK_OUT1_S 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO0_U (DR_REG_IO_MUX_BASE +0x44)
|
||||
#define FUNC_GPIO0_EMAC_TX_CLK 5
|
||||
#define FUNC_GPIO0_GPIO0 2
|
||||
#define FUNC_GPIO0_CLK_OUT1 1
|
||||
#define FUNC_GPIO0_GPIO0_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_U0TXD_U (DR_REG_IO_MUX_BASE +0x88)
|
||||
#define FUNC_U0TXD_EMAC_RXD2 5
|
||||
#define FUNC_U0TXD_GPIO1 2
|
||||
#define FUNC_U0TXD_CLK_OUT3 1
|
||||
#define FUNC_U0TXD_U0TXD 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO2_U (DR_REG_IO_MUX_BASE +0x40)
|
||||
#define FUNC_GPIO2_SD_DATA0 4
|
||||
#define FUNC_GPIO2_HS2_DATA0 3
|
||||
#define FUNC_GPIO2_GPIO2 2
|
||||
#define FUNC_GPIO2_HSPIWP 1
|
||||
#define FUNC_GPIO2_GPIO2_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_U0RXD_U (DR_REG_IO_MUX_BASE +0x84)
|
||||
#define FUNC_U0RXD_GPIO3 2
|
||||
#define FUNC_U0RXD_CLK_OUT2 1
|
||||
#define FUNC_U0RXD_U0RXD 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO4_U (DR_REG_IO_MUX_BASE +0x48)
|
||||
#define FUNC_GPIO4_EMAC_TX_ER 5
|
||||
#define FUNC_GPIO4_SD_DATA1 4
|
||||
#define FUNC_GPIO4_HS2_DATA1 3
|
||||
#define FUNC_GPIO4_GPIO4 2
|
||||
#define FUNC_GPIO4_HSPIHD 1
|
||||
#define FUNC_GPIO4_GPIO4_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO5_U (DR_REG_IO_MUX_BASE +0x6c)
|
||||
#define FUNC_GPIO5_EMAC_RX_CLK 5
|
||||
#define FUNC_GPIO5_HS1_DATA6 3
|
||||
#define FUNC_GPIO5_GPIO5 2
|
||||
#define FUNC_GPIO5_VSPICS0 1
|
||||
#define FUNC_GPIO5_GPIO5_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_SD_CLK_U (DR_REG_IO_MUX_BASE +0x60)
|
||||
#define FUNC_SD_CLK_U1CTS 4
|
||||
#define FUNC_SD_CLK_HS1_CLK 3
|
||||
#define FUNC_SD_CLK_GPIO6 2
|
||||
#define FUNC_SD_CLK_SPICLK 1
|
||||
#define FUNC_SD_CLK_SD_CLK 0
|
||||
|
||||
#define PERIPHS_IO_MUX_SD_DATA0_U (DR_REG_IO_MUX_BASE +0x64)
|
||||
#define FUNC_SD_DATA0_U2RTS 4
|
||||
#define FUNC_SD_DATA0_HS1_DATA0 3
|
||||
#define FUNC_SD_DATA0_GPIO7 2
|
||||
#define FUNC_SD_DATA0_SPIQ 1
|
||||
#define FUNC_SD_DATA0_SD_DATA0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_SD_DATA1_U (DR_REG_IO_MUX_BASE +0x68)
|
||||
#define FUNC_SD_DATA1_U2CTS 4
|
||||
#define FUNC_SD_DATA1_HS1_DATA1 3
|
||||
#define FUNC_SD_DATA1_GPIO8 2
|
||||
#define FUNC_SD_DATA1_SPID 1
|
||||
#define FUNC_SD_DATA1_SD_DATA1 0
|
||||
|
||||
#define PERIPHS_IO_MUX_SD_DATA2_U (DR_REG_IO_MUX_BASE +0x54)
|
||||
#define FUNC_SD_DATA2_U1RXD 4
|
||||
#define FUNC_SD_DATA2_HS1_DATA2 3
|
||||
#define FUNC_SD_DATA2_GPIO9 2
|
||||
#define FUNC_SD_DATA2_SPIHD 1
|
||||
#define FUNC_SD_DATA2_SD_DATA2 0
|
||||
|
||||
#define PERIPHS_IO_MUX_SD_DATA3_U (DR_REG_IO_MUX_BASE +0x58)
|
||||
#define FUNC_SD_DATA3_U1TXD 4
|
||||
#define FUNC_SD_DATA3_HS1_DATA3 3
|
||||
#define FUNC_SD_DATA3_GPIO10 2
|
||||
#define FUNC_SD_DATA3_SPIWP 1
|
||||
#define FUNC_SD_DATA3_SD_DATA3 0
|
||||
|
||||
#define PERIPHS_IO_MUX_SD_CMD_U (DR_REG_IO_MUX_BASE +0x5c)
|
||||
#define FUNC_SD_CMD_U1RTS 4
|
||||
#define FUNC_SD_CMD_HS1_CMD 3
|
||||
#define FUNC_SD_CMD_GPIO11 2
|
||||
#define FUNC_SD_CMD_SPICS0 1
|
||||
#define FUNC_SD_CMD_SD_CMD 0
|
||||
|
||||
#define PERIPHS_IO_MUX_MTDI_U (DR_REG_IO_MUX_BASE +0x34)
|
||||
#define FUNC_MTDI_EMAC_TXD3 5
|
||||
#define FUNC_MTDI_SD_DATA2 4
|
||||
#define FUNC_MTDI_HS2_DATA2 3
|
||||
#define FUNC_MTDI_GPIO12 2
|
||||
#define FUNC_MTDI_HSPIQ 1
|
||||
#define FUNC_MTDI_MTDI 0
|
||||
|
||||
#define PERIPHS_IO_MUX_MTCK_U (DR_REG_IO_MUX_BASE +0x38)
|
||||
#define FUNC_MTCK_EMAC_RX_ER 5
|
||||
#define FUNC_MTCK_SD_DATA3 4
|
||||
#define FUNC_MTCK_HS2_DATA3 3
|
||||
#define FUNC_MTCK_GPIO13 2
|
||||
#define FUNC_MTCK_HSPID 1
|
||||
#define FUNC_MTCK_MTCK 0
|
||||
|
||||
#define PERIPHS_IO_MUX_MTMS_U (DR_REG_IO_MUX_BASE +0x30)
|
||||
#define FUNC_MTMS_EMAC_TXD2 5
|
||||
#define FUNC_MTMS_SD_CLK 4
|
||||
#define FUNC_MTMS_HS2_CLK 3
|
||||
#define FUNC_MTMS_GPIO14 2
|
||||
#define FUNC_MTMS_HSPICLK 1
|
||||
#define FUNC_MTMS_MTMS 0
|
||||
|
||||
#define PERIPHS_IO_MUX_MTDO_U (DR_REG_IO_MUX_BASE +0x3c)
|
||||
#define FUNC_MTDO_EMAC_RXD3 5
|
||||
#define FUNC_MTDO_SD_CMD 4
|
||||
#define FUNC_MTDO_HS2_CMD 3
|
||||
#define FUNC_MTDO_GPIO15 2
|
||||
#define FUNC_MTDO_HSPICS0 1
|
||||
#define FUNC_MTDO_MTDO 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO16_U (DR_REG_IO_MUX_BASE +0x4c)
|
||||
#define FUNC_GPIO16_EMAC_CLK_OUT 5
|
||||
#define FUNC_GPIO16_U2RXD 4
|
||||
#define FUNC_GPIO16_HS1_DATA4 3
|
||||
#define FUNC_GPIO16_GPIO16 2
|
||||
#define FUNC_GPIO16_GPIO16_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO17_U (DR_REG_IO_MUX_BASE +0x50)
|
||||
#define FUNC_GPIO17_EMAC_CLK_OUT_180 5
|
||||
#define FUNC_GPIO17_U2TXD 4
|
||||
#define FUNC_GPIO17_HS1_DATA5 3
|
||||
#define FUNC_GPIO17_GPIO17 2
|
||||
#define FUNC_GPIO17_GPIO17_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO18_U (DR_REG_IO_MUX_BASE +0x70)
|
||||
#define FUNC_GPIO18_HS1_DATA7 3
|
||||
#define FUNC_GPIO18_GPIO18 2
|
||||
#define FUNC_GPIO18_VSPICLK 1
|
||||
#define FUNC_GPIO18_GPIO18_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO19_U (DR_REG_IO_MUX_BASE +0x74)
|
||||
#define FUNC_GPIO19_EMAC_TXD0 5
|
||||
#define FUNC_GPIO19_U0CTS 3
|
||||
#define FUNC_GPIO19_GPIO19 2
|
||||
#define FUNC_GPIO19_VSPIQ 1
|
||||
#define FUNC_GPIO19_GPIO19_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO20_U (DR_REG_IO_MUX_BASE +0x78)
|
||||
#define FUNC_GPIO20_GPIO20 2
|
||||
#define FUNC_GPIO20_GPIO20_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO21_U (DR_REG_IO_MUX_BASE +0x7c)
|
||||
#define FUNC_GPIO21_EMAC_TX_EN 5
|
||||
#define FUNC_GPIO21_GPIO21 2
|
||||
#define FUNC_GPIO21_VSPIHD 1
|
||||
#define FUNC_GPIO21_GPIO21_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO22_U (DR_REG_IO_MUX_BASE +0x80)
|
||||
#define FUNC_GPIO22_EMAC_TXD1 5
|
||||
#define FUNC_GPIO22_U0RTS 3
|
||||
#define FUNC_GPIO22_GPIO22 2
|
||||
#define FUNC_GPIO22_VSPIWP 1
|
||||
#define FUNC_GPIO22_GPIO22_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO23_U (DR_REG_IO_MUX_BASE +0x8c)
|
||||
#define FUNC_GPIO23_HS1_STROBE 3
|
||||
#define FUNC_GPIO23_GPIO23 2
|
||||
#define FUNC_GPIO23_VSPID 1
|
||||
#define FUNC_GPIO23_GPIO23_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO24_U (DR_REG_IO_MUX_BASE +0x90)
|
||||
#define FUNC_GPIO24_GPIO24 2
|
||||
#define FUNC_GPIO24_GPIO24_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO25_U (DR_REG_IO_MUX_BASE +0x24)
|
||||
#define FUNC_GPIO25_EMAC_RXD0 5
|
||||
#define FUNC_GPIO25_GPIO25 2
|
||||
#define FUNC_GPIO25_GPIO25_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO26_U (DR_REG_IO_MUX_BASE +0x28)
|
||||
#define FUNC_GPIO26_EMAC_RXD1 5
|
||||
#define FUNC_GPIO26_GPIO26 2
|
||||
#define FUNC_GPIO26_GPIO26_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO27_U (DR_REG_IO_MUX_BASE +0x2c)
|
||||
#define FUNC_GPIO27_EMAC_RX_DV 5
|
||||
#define FUNC_GPIO27_GPIO27 2
|
||||
#define FUNC_GPIO27_GPIO27_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO32_U (DR_REG_IO_MUX_BASE +0x1c)
|
||||
#define FUNC_GPIO32_GPIO32 2
|
||||
#define FUNC_GPIO32_GPIO32_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO33_U (DR_REG_IO_MUX_BASE +0x20)
|
||||
#define FUNC_GPIO33_GPIO33 2
|
||||
#define FUNC_GPIO33_GPIO33_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO34_U (DR_REG_IO_MUX_BASE +0x14)
|
||||
#define FUNC_GPIO34_GPIO34 2
|
||||
#define FUNC_GPIO34_GPIO34_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO35_U (DR_REG_IO_MUX_BASE +0x18)
|
||||
#define FUNC_GPIO35_GPIO35 2
|
||||
#define FUNC_GPIO35_GPIO35_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO36_U (DR_REG_IO_MUX_BASE +0x04)
|
||||
#define FUNC_GPIO36_GPIO36 2
|
||||
#define FUNC_GPIO36_GPIO36_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO37_U (DR_REG_IO_MUX_BASE +0x08)
|
||||
#define FUNC_GPIO37_GPIO37 2
|
||||
#define FUNC_GPIO37_GPIO37_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO38_U (DR_REG_IO_MUX_BASE +0x0c)
|
||||
#define FUNC_GPIO38_GPIO38 2
|
||||
#define FUNC_GPIO38_GPIO38_0 0
|
||||
|
||||
#define PERIPHS_IO_MUX_GPIO39_U (DR_REG_IO_MUX_BASE +0x10)
|
||||
#define FUNC_GPIO39_GPIO39 2
|
||||
#define FUNC_GPIO39_GPIO39_0 0
|
||||
|
||||
#endif /* _SOC_IO_MUX_REG_H_ */
|
File diff suppressed because it is too large
Load Diff
@ -1,246 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_LEDC_STRUCT_H_
|
||||
#define _SOC_LEDC_STRUCT_H_
|
||||
typedef volatile struct {
|
||||
struct {
|
||||
struct {
|
||||
union {
|
||||
struct {
|
||||
uint32_t timer_sel: 2; /*There are four high speed timers the two bits are used to select one of them for high speed channel. 2'b00: seletc hstimer0. 2'b01: select hstimer1. 2'b10: select hstimer2. 2'b11: select hstimer3.*/
|
||||
uint32_t sig_out_en: 1; /*This is the output enable control bit for high speed channel*/
|
||||
uint32_t idle_lv: 1; /*This bit is used to control the output value when high speed channel is off.*/
|
||||
uint32_t low_speed_update: 1; /*This bit is only useful for low speed timer channels, reserved for high speed timers*/
|
||||
uint32_t reserved4: 26;
|
||||
uint32_t clk_en: 1; /*This bit is clock gating control signal. when software configure LED_PWM internal registers it controls the register clock.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} conf0;
|
||||
union {
|
||||
struct {
|
||||
uint32_t hpoint: 20; /*The output value changes to high when htimerx(x=[0 3]) selected by high speed channel has reached reg_hpoint_hsch0[19:0]*/
|
||||
uint32_t reserved20: 12;
|
||||
};
|
||||
uint32_t val;
|
||||
} hpoint;
|
||||
union {
|
||||
struct {
|
||||
uint32_t duty: 25; /*The register is used to control output duty. When hstimerx(x=[0 3]) chosen by high speed channel has reached reg_lpoint_hsch0 the output signal changes to low. reg_lpoint_hsch0=(reg_hpoint_hsch0[19:0]+reg_duty_hsch0[24:4]) (1) reg_lpoint_hsch0=(reg_hpoint_hsch0[19:0]+reg_duty_hsch0[24:4] +1) (2) The least four bits in this register represent the decimal part and determines when to choose (1) or (2)*/
|
||||
uint32_t reserved25: 7;
|
||||
};
|
||||
uint32_t val;
|
||||
} duty;
|
||||
union {
|
||||
struct {
|
||||
uint32_t duty_scale:10; /*This register controls the increase or decrease step scale for high speed channel.*/
|
||||
uint32_t duty_cycle:10; /*This register is used to increase or decrease the duty every reg_duty_cycle_hsch0 cycles for high speed channel.*/
|
||||
uint32_t duty_num: 10; /*This register is used to control the number of increased or decreased times for high speed channel.*/
|
||||
uint32_t duty_inc: 1; /*This register is used to increase the duty of output signal or decrease the duty of output signal for high speed channel.*/
|
||||
uint32_t duty_start: 1; /*When reg_duty_num_hsch0 reg_duty_cycle_hsch0 and reg_duty_scale_hsch0 has been configured. these register won't take effect until set reg_duty_start_hsch0. this bit is automatically cleared by hardware.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} conf1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t duty_read: 25; /*This register represents the current duty of the output signal for high speed channel.*/
|
||||
uint32_t reserved25: 7;
|
||||
};
|
||||
uint32_t val;
|
||||
} duty_rd;
|
||||
} channel[8];
|
||||
} channel_group[2]; /*two channel groups : 0: high-speed channels; 1: low-speed channels*/
|
||||
struct {
|
||||
struct {
|
||||
union {
|
||||
struct {
|
||||
uint32_t bit_num: 5; /*This register controls the range of the counter in high speed timer. the counter range is [0 2**reg_hstimer0_lim] the max bit width for counter is 20.*/
|
||||
uint32_t div_num: 18; /*This register is used to configure parameter for divider in high speed timer the least significant eight bits represent the decimal part.*/
|
||||
uint32_t pause: 1; /*This bit is used to pause the counter in high speed timer*/
|
||||
uint32_t rst: 1; /*This bit is used to reset high speed timer the counter will be 0 after reset.*/
|
||||
uint32_t tick_sel: 1; /*This bit is used to choose apb_clk or ref_tick for high speed timer. 1'b1:apb_clk 0:ref_tick*/
|
||||
uint32_t low_speed_update: 1; /*This bit is only useful for low speed timer channels, reserved for high speed timers*/
|
||||
uint32_t reserved26: 5;
|
||||
};
|
||||
uint32_t val;
|
||||
} conf;
|
||||
union {
|
||||
struct {
|
||||
uint32_t timer_cnt: 20; /*software can read this register to get the current counter value in high speed timer*/
|
||||
uint32_t reserved20: 12;
|
||||
};
|
||||
uint32_t val;
|
||||
} value;
|
||||
} timer[4];
|
||||
} timer_group[2]; /*two channel groups : 0: high-speed channels; 1: low-speed channels*/
|
||||
union {
|
||||
struct {
|
||||
uint32_t hstimer0_ovf: 1; /*The interrupt raw bit for high speed channel0 counter overflow.*/
|
||||
uint32_t hstimer1_ovf: 1; /*The interrupt raw bit for high speed channel1 counter overflow.*/
|
||||
uint32_t hstimer2_ovf: 1; /*The interrupt raw bit for high speed channel2 counter overflow.*/
|
||||
uint32_t hstimer3_ovf: 1; /*The interrupt raw bit for high speed channel3 counter overflow.*/
|
||||
uint32_t lstimer0_ovf: 1; /*The interrupt raw bit for low speed channel0 counter overflow.*/
|
||||
uint32_t lstimer1_ovf: 1; /*The interrupt raw bit for low speed channel1 counter overflow.*/
|
||||
uint32_t lstimer2_ovf: 1; /*The interrupt raw bit for low speed channel2 counter overflow.*/
|
||||
uint32_t lstimer3_ovf: 1; /*The interrupt raw bit for low speed channel3 counter overflow.*/
|
||||
uint32_t duty_chng_end_hsch0: 1; /*The interrupt raw bit for high speed channel 0 duty change done.*/
|
||||
uint32_t duty_chng_end_hsch1: 1; /*The interrupt raw bit for high speed channel 1 duty change done.*/
|
||||
uint32_t duty_chng_end_hsch2: 1; /*The interrupt raw bit for high speed channel 2 duty change done.*/
|
||||
uint32_t duty_chng_end_hsch3: 1; /*The interrupt raw bit for high speed channel 3 duty change done.*/
|
||||
uint32_t duty_chng_end_hsch4: 1; /*The interrupt raw bit for high speed channel 4 duty change done.*/
|
||||
uint32_t duty_chng_end_hsch5: 1; /*The interrupt raw bit for high speed channel 5 duty change done.*/
|
||||
uint32_t duty_chng_end_hsch6: 1; /*The interrupt raw bit for high speed channel 6 duty change done.*/
|
||||
uint32_t duty_chng_end_hsch7: 1; /*The interrupt raw bit for high speed channel 7 duty change done.*/
|
||||
uint32_t duty_chng_end_lsch0: 1; /*The interrupt raw bit for low speed channel 0 duty change done.*/
|
||||
uint32_t duty_chng_end_lsch1: 1; /*The interrupt raw bit for low speed channel 1 duty change done.*/
|
||||
uint32_t duty_chng_end_lsch2: 1; /*The interrupt raw bit for low speed channel 2 duty change done.*/
|
||||
uint32_t duty_chng_end_lsch3: 1; /*The interrupt raw bit for low speed channel 3 duty change done.*/
|
||||
uint32_t duty_chng_end_lsch4: 1; /*The interrupt raw bit for low speed channel 4 duty change done.*/
|
||||
uint32_t duty_chng_end_lsch5: 1; /*The interrupt raw bit for low speed channel 5 duty change done.*/
|
||||
uint32_t duty_chng_end_lsch6: 1; /*The interrupt raw bit for low speed channel 6 duty change done.*/
|
||||
uint32_t duty_chng_end_lsch7: 1; /*The interrupt raw bit for low speed channel 7 duty change done.*/
|
||||
uint32_t reserved24: 8;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_raw;
|
||||
union {
|
||||
struct {
|
||||
uint32_t hstimer0_ovf: 1; /*The interrupt status bit for high speed channel0 counter overflow event.*/
|
||||
uint32_t hstimer1_ovf: 1; /*The interrupt status bit for high speed channel1 counter overflow event.*/
|
||||
uint32_t hstimer2_ovf: 1; /*The interrupt status bit for high speed channel2 counter overflow event.*/
|
||||
uint32_t hstimer3_ovf: 1; /*The interrupt status bit for high speed channel3 counter overflow event.*/
|
||||
uint32_t lstimer0_ovf: 1; /*The interrupt status bit for low speed channel0 counter overflow event.*/
|
||||
uint32_t lstimer1_ovf: 1; /*The interrupt status bit for low speed channel1 counter overflow event.*/
|
||||
uint32_t lstimer2_ovf: 1; /*The interrupt status bit for low speed channel2 counter overflow event.*/
|
||||
uint32_t lstimer3_ovf: 1; /*The interrupt status bit for low speed channel3 counter overflow event.*/
|
||||
uint32_t duty_chng_end_hsch0: 1; /*The interrupt enable bit for high speed channel 0 duty change done event.*/
|
||||
uint32_t duty_chng_end_hsch1: 1; /*The interrupt status bit for high speed channel 1 duty change done event.*/
|
||||
uint32_t duty_chng_end_hsch2: 1; /*The interrupt status bit for high speed channel 2 duty change done event.*/
|
||||
uint32_t duty_chng_end_hsch3: 1; /*The interrupt status bit for high speed channel 3 duty change done event.*/
|
||||
uint32_t duty_chng_end_hsch4: 1; /*The interrupt status bit for high speed channel 4 duty change done event.*/
|
||||
uint32_t duty_chng_end_hsch5: 1; /*The interrupt status bit for high speed channel 5 duty change done event.*/
|
||||
uint32_t duty_chng_end_hsch6: 1; /*The interrupt status bit for high speed channel 6 duty change done event.*/
|
||||
uint32_t duty_chng_end_hsch7: 1; /*The interrupt status bit for high speed channel 7 duty change done event.*/
|
||||
uint32_t duty_chng_end_lsch0: 1; /*The interrupt status bit for low speed channel 0 duty change done event.*/
|
||||
uint32_t duty_chng_end_lsch1: 1; /*The interrupt status bit for low speed channel 1 duty change done event.*/
|
||||
uint32_t duty_chng_end_lsch2: 1; /*The interrupt status bit for low speed channel 2 duty change done event.*/
|
||||
uint32_t duty_chng_end_lsch3: 1; /*The interrupt status bit for low speed channel 3 duty change done event.*/
|
||||
uint32_t duty_chng_end_lsch4: 1; /*The interrupt status bit for low speed channel 4 duty change done event.*/
|
||||
uint32_t duty_chng_end_lsch5: 1; /*The interrupt status bit for low speed channel 5 duty change done event.*/
|
||||
uint32_t duty_chng_end_lsch6: 1; /*The interrupt status bit for low speed channel 6 duty change done event.*/
|
||||
uint32_t duty_chng_end_lsch7: 1; /*The interrupt status bit for low speed channel 7 duty change done event*/
|
||||
uint32_t reserved24: 8;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_st;
|
||||
union {
|
||||
struct {
|
||||
uint32_t hstimer0_ovf: 1; /*The interrupt enable bit for high speed channel0 counter overflow interrupt.*/
|
||||
uint32_t hstimer1_ovf: 1; /*The interrupt enable bit for high speed channel1 counter overflow interrupt.*/
|
||||
uint32_t hstimer2_ovf: 1; /*The interrupt enable bit for high speed channel2 counter overflow interrupt.*/
|
||||
uint32_t hstimer3_ovf: 1; /*The interrupt enable bit for high speed channel3 counter overflow interrupt.*/
|
||||
uint32_t lstimer0_ovf: 1; /*The interrupt enable bit for low speed channel0 counter overflow interrupt.*/
|
||||
uint32_t lstimer1_ovf: 1; /*The interrupt enable bit for low speed channel1 counter overflow interrupt.*/
|
||||
uint32_t lstimer2_ovf: 1; /*The interrupt enable bit for low speed channel2 counter overflow interrupt.*/
|
||||
uint32_t lstimer3_ovf: 1; /*The interrupt enable bit for low speed channel3 counter overflow interrupt.*/
|
||||
uint32_t duty_chng_end_hsch0: 1; /*The interrupt enable bit for high speed channel 0 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_hsch1: 1; /*The interrupt enable bit for high speed channel 1 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_hsch2: 1; /*The interrupt enable bit for high speed channel 2 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_hsch3: 1; /*The interrupt enable bit for high speed channel 3 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_hsch4: 1; /*The interrupt enable bit for high speed channel 4 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_hsch5: 1; /*The interrupt enable bit for high speed channel 5 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_hsch6: 1; /*The interrupt enable bit for high speed channel 6 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_hsch7: 1; /*The interrupt enable bit for high speed channel 7 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_lsch0: 1; /*The interrupt enable bit for low speed channel 0 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_lsch1: 1; /*The interrupt enable bit for low speed channel 1 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_lsch2: 1; /*The interrupt enable bit for low speed channel 2 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_lsch3: 1; /*The interrupt enable bit for low speed channel 3 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_lsch4: 1; /*The interrupt enable bit for low speed channel 4 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_lsch5: 1; /*The interrupt enable bit for low speed channel 5 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_lsch6: 1; /*The interrupt enable bit for low speed channel 6 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_lsch7: 1; /*The interrupt enable bit for low speed channel 7 duty change done interrupt.*/
|
||||
uint32_t reserved24: 8;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_ena;
|
||||
union {
|
||||
struct {
|
||||
uint32_t hstimer0_ovf: 1; /*Set this bit to clear high speed channel0 counter overflow interrupt.*/
|
||||
uint32_t hstimer1_ovf: 1; /*Set this bit to clear high speed channel1 counter overflow interrupt.*/
|
||||
uint32_t hstimer2_ovf: 1; /*Set this bit to clear high speed channel2 counter overflow interrupt.*/
|
||||
uint32_t hstimer3_ovf: 1; /*Set this bit to clear high speed channel3 counter overflow interrupt.*/
|
||||
uint32_t lstimer0_ovf: 1; /*Set this bit to clear low speed channel0 counter overflow interrupt.*/
|
||||
uint32_t lstimer1_ovf: 1; /*Set this bit to clear low speed channel1 counter overflow interrupt.*/
|
||||
uint32_t lstimer2_ovf: 1; /*Set this bit to clear low speed channel2 counter overflow interrupt.*/
|
||||
uint32_t lstimer3_ovf: 1; /*Set this bit to clear low speed channel3 counter overflow interrupt.*/
|
||||
uint32_t duty_chng_end_hsch0: 1; /*Set this bit to clear high speed channel 0 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_hsch1: 1; /*Set this bit to clear high speed channel 1 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_hsch2: 1; /*Set this bit to clear high speed channel 2 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_hsch3: 1; /*Set this bit to clear high speed channel 3 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_hsch4: 1; /*Set this bit to clear high speed channel 4 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_hsch5: 1; /*Set this bit to clear high speed channel 5 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_hsch6: 1; /*Set this bit to clear high speed channel 6 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_hsch7: 1; /*Set this bit to clear high speed channel 7 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_lsch0: 1; /*Set this bit to clear low speed channel 0 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_lsch1: 1; /*Set this bit to clear low speed channel 1 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_lsch2: 1; /*Set this bit to clear low speed channel 2 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_lsch3: 1; /*Set this bit to clear low speed channel 3 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_lsch4: 1; /*Set this bit to clear low speed channel 4 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_lsch5: 1; /*Set this bit to clear low speed channel 5 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_lsch6: 1; /*Set this bit to clear low speed channel 6 duty change done interrupt.*/
|
||||
uint32_t duty_chng_end_lsch7: 1; /*Set this bit to clear low speed channel 7 duty change done interrupt.*/
|
||||
uint32_t reserved24: 8;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_clr;
|
||||
union {
|
||||
struct {
|
||||
uint32_t apb_clk_sel: 1; /*This bit decides the slow clock for LEDC low speed channels, so we want to replace the field name with slow_clk_sel*/
|
||||
uint32_t reserved1: 31;
|
||||
};
|
||||
struct {
|
||||
uint32_t slow_clk_sel: 1; /*This bit is used to set the frequency of slow_clk. 1'b1:80mhz 1'b0:8mhz, (only used by LEDC low speed channels/timers)*/
|
||||
uint32_t reserved: 31;
|
||||
};
|
||||
uint32_t val;
|
||||
} conf;
|
||||
uint32_t reserved_194;
|
||||
uint32_t reserved_198;
|
||||
uint32_t reserved_19c;
|
||||
uint32_t reserved_1a0;
|
||||
uint32_t reserved_1a4;
|
||||
uint32_t reserved_1a8;
|
||||
uint32_t reserved_1ac;
|
||||
uint32_t reserved_1b0;
|
||||
uint32_t reserved_1b4;
|
||||
uint32_t reserved_1b8;
|
||||
uint32_t reserved_1bc;
|
||||
uint32_t reserved_1c0;
|
||||
uint32_t reserved_1c4;
|
||||
uint32_t reserved_1c8;
|
||||
uint32_t reserved_1cc;
|
||||
uint32_t reserved_1d0;
|
||||
uint32_t reserved_1d4;
|
||||
uint32_t reserved_1d8;
|
||||
uint32_t reserved_1dc;
|
||||
uint32_t reserved_1e0;
|
||||
uint32_t reserved_1e4;
|
||||
uint32_t reserved_1e8;
|
||||
uint32_t reserved_1ec;
|
||||
uint32_t reserved_1f0;
|
||||
uint32_t reserved_1f4;
|
||||
uint32_t reserved_1f8;
|
||||
uint32_t date; /*This register represents the version .*/
|
||||
} ledc_dev_t;
|
||||
extern ledc_dev_t LEDC;
|
||||
#endif /* _SOC_LEDC_STRUCT_H_ */
|
File diff suppressed because it is too large
Load Diff
@ -1,172 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_PCNT_STRUCT_H_
|
||||
#define _SOC_PCNT_STRUCT_H_
|
||||
typedef volatile struct {
|
||||
struct{
|
||||
union {
|
||||
struct {
|
||||
uint32_t filter_thres: 10; /*This register is used to filter pulse whose width is smaller than this value for unit0.*/
|
||||
uint32_t filter_en: 1; /*This is the enable bit for filtering input signals for unit0.*/
|
||||
uint32_t thr_zero_en: 1; /*This is the enable bit for comparing unit0's count with 0 value.*/
|
||||
uint32_t thr_h_lim_en: 1; /*This is the enable bit for comparing unit0's count with thr_h_lim value.*/
|
||||
uint32_t thr_l_lim_en: 1; /*This is the enable bit for comparing unit0's count with thr_l_lim value.*/
|
||||
uint32_t thr_thres0_en: 1; /*This is the enable bit for comparing unit0's count with thres0 value.*/
|
||||
uint32_t thr_thres1_en: 1; /*This is the enable bit for comparing unit0's count with thres1 value .*/
|
||||
uint32_t ch0_neg_mode: 2; /*This register is used to control the mode of channel0's input neg-edge signal for unit0. 2'd1:increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/
|
||||
uint32_t ch0_pos_mode: 2; /*This register is used to control the mode of channel0's input pos-edge signal for unit0. 2'd1:increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/
|
||||
uint32_t ch0_hctrl_mode: 2; /*This register is used to control the mode of channel0's high control signal for unit0. 2'd0:increase when control signal is low 2'd1:decrease when control signal is high others:forbidden*/
|
||||
uint32_t ch0_lctrl_mode: 2; /*This register is used to control the mode of channel0's low control signal for unit0. 2'd0:increase when control signal is low 2'd1:decrease when control signal is high others:forbidden*/
|
||||
uint32_t ch1_neg_mode: 2; /*This register is used to control the mode of channel1's input neg-edge signal for unit0. 2'd1:increase at the negedge of input signal 2'd2:decrease at the negedge of input signal others:forbidden*/
|
||||
uint32_t ch1_pos_mode: 2; /*This register is used to control the mode of channel1's input pos-edge signal for unit0. 2'd1:increase at the posedge of input signal 2'd2:decrease at the posedge of input signal others:forbidden*/
|
||||
uint32_t ch1_hctrl_mode: 2; /*This register is used to control the mode of channel1's high control signal for unit0. 2'd0:increase when control signal is low 2'd1:decrease when control signal is high others:forbidden*/
|
||||
uint32_t ch1_lctrl_mode: 2; /*This register is used to control the mode of channel1's low control signal for unit0. 2'd0:increase when control signal is low 2'd1:decrease when control signal is high others:forbidden*/
|
||||
};
|
||||
uint32_t val;
|
||||
} conf0;
|
||||
union {
|
||||
struct {
|
||||
uint32_t cnt_thres0:16; /*This register is used to configure thres0 value for unit0.*/
|
||||
uint32_t cnt_thres1:16; /*This register is used to configure thres1 value for unit0.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} conf1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t cnt_h_lim:16; /*This register is used to configure thr_h_lim value for unit0.*/
|
||||
uint32_t cnt_l_lim:16; /*This register is used to configure thr_l_lim value for unit0.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} conf2;
|
||||
} conf_unit[8];
|
||||
union {
|
||||
struct {
|
||||
uint32_t cnt_val : 16; /*This register stores the current pulse count value for unit0.*/
|
||||
uint32_t reserved16: 16;
|
||||
};
|
||||
uint32_t val;
|
||||
} cnt_unit[8];
|
||||
union {
|
||||
struct {
|
||||
uint32_t cnt_thr_event_u0: 1; /*This is the interrupt raw bit for channel0 event.*/
|
||||
uint32_t cnt_thr_event_u1: 1; /*This is the interrupt raw bit for channel1 event.*/
|
||||
uint32_t cnt_thr_event_u2: 1; /*This is the interrupt raw bit for channel2 event.*/
|
||||
uint32_t cnt_thr_event_u3: 1; /*This is the interrupt raw bit for channel3 event.*/
|
||||
uint32_t cnt_thr_event_u4: 1; /*This is the interrupt raw bit for channel4 event.*/
|
||||
uint32_t cnt_thr_event_u5: 1; /*This is the interrupt raw bit for channel5 event.*/
|
||||
uint32_t cnt_thr_event_u6: 1; /*This is the interrupt raw bit for channel6 event.*/
|
||||
uint32_t cnt_thr_event_u7: 1; /*This is the interrupt raw bit for channel7 event.*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_raw;
|
||||
union {
|
||||
struct {
|
||||
uint32_t cnt_thr_event_u0: 1; /*This is the interrupt status bit for channel0 event.*/
|
||||
uint32_t cnt_thr_event_u1: 1; /*This is the interrupt status bit for channel1 event.*/
|
||||
uint32_t cnt_thr_event_u2: 1; /*This is the interrupt status bit for channel2 event.*/
|
||||
uint32_t cnt_thr_event_u3: 1; /*This is the interrupt status bit for channel3 event.*/
|
||||
uint32_t cnt_thr_event_u4: 1; /*This is the interrupt status bit for channel4 event.*/
|
||||
uint32_t cnt_thr_event_u5: 1; /*This is the interrupt status bit for channel5 event.*/
|
||||
uint32_t cnt_thr_event_u6: 1; /*This is the interrupt status bit for channel6 event.*/
|
||||
uint32_t cnt_thr_event_u7: 1; /*This is the interrupt status bit for channel7 event.*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_st;
|
||||
union {
|
||||
struct {
|
||||
uint32_t cnt_thr_event_u0: 1; /*This is the interrupt enable bit for channel0 event.*/
|
||||
uint32_t cnt_thr_event_u1: 1; /*This is the interrupt enable bit for channel1 event.*/
|
||||
uint32_t cnt_thr_event_u2: 1; /*This is the interrupt enable bit for channel2 event.*/
|
||||
uint32_t cnt_thr_event_u3: 1; /*This is the interrupt enable bit for channel3 event.*/
|
||||
uint32_t cnt_thr_event_u4: 1; /*This is the interrupt enable bit for channel4 event.*/
|
||||
uint32_t cnt_thr_event_u5: 1; /*This is the interrupt enable bit for channel5 event.*/
|
||||
uint32_t cnt_thr_event_u6: 1; /*This is the interrupt enable bit for channel6 event.*/
|
||||
uint32_t cnt_thr_event_u7: 1; /*This is the interrupt enable bit for channel7 event.*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_ena;
|
||||
union {
|
||||
struct {
|
||||
uint32_t cnt_thr_event_u0: 1; /*Set this bit to clear channel0 event interrupt.*/
|
||||
uint32_t cnt_thr_event_u1: 1; /*Set this bit to clear channel1 event interrupt.*/
|
||||
uint32_t cnt_thr_event_u2: 1; /*Set this bit to clear channel2 event interrupt.*/
|
||||
uint32_t cnt_thr_event_u3: 1; /*Set this bit to clear channel3 event interrupt.*/
|
||||
uint32_t cnt_thr_event_u4: 1; /*Set this bit to clear channel4 event interrupt.*/
|
||||
uint32_t cnt_thr_event_u5: 1; /*Set this bit to clear channel5 event interrupt.*/
|
||||
uint32_t cnt_thr_event_u6: 1; /*Set this bit to clear channel6 event interrupt.*/
|
||||
uint32_t cnt_thr_event_u7: 1; /*Set this bit to clear channel7 event interrupt.*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_clr;
|
||||
union {
|
||||
struct {
|
||||
uint32_t cnt_mode:2; /*0: positive value to zero; 1: negative value to zero; 2: counter value negative ; 3: counter value positive*/
|
||||
uint32_t thres1_lat:1; /* counter value equals to thresh1*/
|
||||
uint32_t thres0_lat:1; /* counter value equals to thresh0*/
|
||||
uint32_t l_lim_lat:1; /* counter value reaches h_lim*/
|
||||
uint32_t h_lim_lat:1; /* counter value reaches l_lim*/
|
||||
uint32_t zero_lat:1; /* counter value equals zero*/
|
||||
uint32_t reserved7:25;
|
||||
};
|
||||
uint32_t val;
|
||||
} status_unit[8];
|
||||
union {
|
||||
struct {
|
||||
uint32_t cnt_rst_u0: 1; /*Set this bit to clear unit0's counter.*/
|
||||
uint32_t cnt_pause_u0: 1; /*Set this bit to pause unit0's counter.*/
|
||||
uint32_t cnt_rst_u1: 1; /*Set this bit to clear unit1's counter.*/
|
||||
uint32_t cnt_pause_u1: 1; /*Set this bit to pause unit1's counter.*/
|
||||
uint32_t cnt_rst_u2: 1; /*Set this bit to clear unit2's counter.*/
|
||||
uint32_t cnt_pause_u2: 1; /*Set this bit to pause unit2's counter.*/
|
||||
uint32_t cnt_rst_u3: 1; /*Set this bit to clear unit3's counter.*/
|
||||
uint32_t cnt_pause_u3: 1; /*Set this bit to pause unit3's counter.*/
|
||||
uint32_t cnt_rst_u4: 1; /*Set this bit to clear unit4's counter.*/
|
||||
uint32_t cnt_pause_u4: 1; /*Set this bit to pause unit4's counter.*/
|
||||
uint32_t cnt_rst_u5: 1; /*Set this bit to clear unit5's counter.*/
|
||||
uint32_t cnt_pause_u5: 1; /*Set this bit to pause unit5's counter.*/
|
||||
uint32_t cnt_rst_u6: 1; /*Set this bit to clear unit6's counter.*/
|
||||
uint32_t cnt_pause_u6: 1; /*Set this bit to pause unit6's counter.*/
|
||||
uint32_t cnt_rst_u7: 1; /*Set this bit to clear unit7's counter.*/
|
||||
uint32_t cnt_pause_u7: 1; /*Set this bit to pause unit7's counter.*/
|
||||
uint32_t clk_en: 1;
|
||||
uint32_t reserved17: 15;
|
||||
};
|
||||
uint32_t val;
|
||||
} ctrl;
|
||||
uint32_t reserved_b4;
|
||||
uint32_t reserved_b8;
|
||||
uint32_t reserved_bc;
|
||||
uint32_t reserved_c0;
|
||||
uint32_t reserved_c4;
|
||||
uint32_t reserved_c8;
|
||||
uint32_t reserved_cc;
|
||||
uint32_t reserved_d0;
|
||||
uint32_t reserved_d4;
|
||||
uint32_t reserved_d8;
|
||||
uint32_t reserved_dc;
|
||||
uint32_t reserved_e0;
|
||||
uint32_t reserved_e4;
|
||||
uint32_t reserved_e8;
|
||||
uint32_t reserved_ec;
|
||||
uint32_t reserved_f0;
|
||||
uint32_t reserved_f4;
|
||||
uint32_t reserved_f8;
|
||||
uint32_t date; /**/
|
||||
} pcnt_dev_t;
|
||||
extern pcnt_dev_t PCNT;
|
||||
#endif /* _SOC_PCNT_STRUCT_H_ */
|
@ -1,65 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_PID_H_
|
||||
#define _SOC_PID_H_
|
||||
|
||||
#define PROPID_GEN_BASE 0x3FF1F000
|
||||
//Bits 1..7: 1 if interrupt will be triggering PID change
|
||||
#define PROPID_CONFIG_INTERRUPT_ENABLE ((PROPID_GEN_BASE)+0x000)
|
||||
//Vectors for the various interrupt handlers
|
||||
#define PROPID_CONFIG_INTERRUPT_ADDR_1 ((PROPID_GEN_BASE)+0x004)
|
||||
#define PROPID_CONFIG_INTERRUPT_ADDR_2 ((PROPID_GEN_BASE)+0x008)
|
||||
#define PROPID_CONFIG_INTERRUPT_ADDR_3 ((PROPID_GEN_BASE)+0x00C)
|
||||
#define PROPID_CONFIG_INTERRUPT_ADDR_4 ((PROPID_GEN_BASE)+0x010)
|
||||
#define PROPID_CONFIG_INTERRUPT_ADDR_5 ((PROPID_GEN_BASE)+0x014)
|
||||
#define PROPID_CONFIG_INTERRUPT_ADDR_6 ((PROPID_GEN_BASE)+0x018)
|
||||
#define PROPID_CONFIG_INTERRUPT_ADDR_7 ((PROPID_GEN_BASE)+0x01C)
|
||||
|
||||
//Delay, in CPU cycles, before switching to new PID
|
||||
#define PROPID_CONFIG_PID_DELAY ((PROPID_GEN_BASE)+0x020)
|
||||
#define PROPID_CONFIG_NMI_DELAY ((PROPID_GEN_BASE)+0x024)
|
||||
|
||||
//Last detected interrupt. Set by hw on int.
|
||||
#define PROPID_TABLE_LEVEL ((PROPID_GEN_BASE)+0x028)
|
||||
//PID/prev int data for each int
|
||||
#define PROPID_FROM_1 ((PROPID_GEN_BASE)+0x02C)
|
||||
#define PROPID_FROM_2 ((PROPID_GEN_BASE)+0x030)
|
||||
#define PROPID_FROM_3 ((PROPID_GEN_BASE)+0x034)
|
||||
#define PROPID_FROM_4 ((PROPID_GEN_BASE)+0x038)
|
||||
#define PROPID_FROM_5 ((PROPID_GEN_BASE)+0x03C)
|
||||
#define PROPID_FROM_6 ((PROPID_GEN_BASE)+0x040)
|
||||
#define PROPID_FROM_7 ((PROPID_GEN_BASE)+0x044)
|
||||
#define PROPID_FROM_PID_MASK 0x7
|
||||
#define PROPID_FROM_PID_S 0
|
||||
#define PROPID_FROM_INT_MASK 0xF
|
||||
#define PROPID_FROM_INT_S 3
|
||||
|
||||
//PID to be set after confirm routine
|
||||
#define PROPID_PID_NEW ((PROPID_GEN_BASE)+0x048)
|
||||
//Write to kick off PID change
|
||||
#define PROPID_PID_CONFIRM ((PROPID_GEN_BASE)+0x04c)
|
||||
//current PID?
|
||||
#define PROPID_PID_REG ((PROPID_GEN_BASE)+0x050)
|
||||
|
||||
//Write to mask NMI
|
||||
#define PROPID_PID_NMI_MASK_HW_ENABLE ((PROPID_GEN_BASE)+0x054)
|
||||
//Write to unmask NMI
|
||||
#define PROPID_PID_NMI_MASK_HW_DISABLE ((PROPID_GEN_BASE)+0x058)
|
||||
#define PROPID_PID_NMI_MASK_HW_REG ((PROPID_GEN_BASE)+0x05c)
|
||||
|
||||
//Debug regs
|
||||
#define PROPID_PID ((PROPID_GEN_BASE)+0x060)
|
||||
#define PROPID_NMI_MASK_HW ((PROPID_GEN_BASE)+0x064)
|
||||
|
||||
#endif /* _SOC_PID_H_ */
|
File diff suppressed because it is too large
Load Diff
@ -1,262 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_RMT_STRUCT_H_
|
||||
#define _SOC_RMT_STRUCT_H_
|
||||
typedef volatile struct {
|
||||
uint32_t data_ch[8]; /*The R/W ram address for channel0-7 by apb fifo access.*/
|
||||
struct{
|
||||
union {
|
||||
struct {
|
||||
uint32_t div_cnt: 8; /*This register is used to configure the frequency divider's factor in channel0-7.*/
|
||||
uint32_t idle_thres: 16; /*In receive mode when no edge is detected on the input signal for longer than reg_idle_thres_ch0 then the receive process is done.*/
|
||||
uint32_t mem_size: 4; /*This register is used to configure the the amount of memory blocks allocated to channel0-7.*/
|
||||
uint32_t carrier_en: 1; /*This is the carrier modulation enable control bit for channel0-7.*/
|
||||
uint32_t carrier_out_lv: 1; /*This bit is used to configure the way carrier wave is modulated for channel0-7.1'b1:transmit on low output level 1'b0:transmit on high output level.*/
|
||||
uint32_t mem_pd: 1; /*This bit is used to reduce power consumed by memory. 1:memory is in low power state.*/
|
||||
uint32_t clk_en: 1; /*This bit is used to control clock.when software configure RMT internal registers it controls the register clock.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} conf0;
|
||||
union {
|
||||
struct {
|
||||
uint32_t tx_start: 1; /*Set this bit to start sending data for channel0-7.*/
|
||||
uint32_t rx_en: 1; /*Set this bit to enable receiving data for channel0-7.*/
|
||||
uint32_t mem_wr_rst: 1; /*Set this bit to reset write ram address for channel0-7 by receiver access.*/
|
||||
uint32_t mem_rd_rst: 1; /*Set this bit to reset read ram address for channel0-7 by transmitter access.*/
|
||||
uint32_t apb_mem_rst: 1; /*Set this bit to reset W/R ram address for channel0-7 by apb fifo access*/
|
||||
uint32_t mem_owner: 1; /*This is the mark of channel0-7's ram usage right.1'b1:receiver uses the ram 0:transmitter uses the ram*/
|
||||
uint32_t tx_conti_mode: 1; /*Set this bit to continue sending from the first data to the last data in channel0-7 again and again.*/
|
||||
uint32_t rx_filter_en: 1; /*This is the receive filter enable bit for channel0-7.*/
|
||||
uint32_t rx_filter_thres: 8; /*in receive mode channel0-7 ignore input pulse when the pulse width is smaller then this value.*/
|
||||
uint32_t ref_cnt_rst: 1; /*This bit is used to reset divider in channel0-7.*/
|
||||
uint32_t ref_always_on: 1; /*This bit is used to select base clock. 1'b1:clk_apb 1'b0:clk_ref*/
|
||||
uint32_t idle_out_lv: 1; /*This bit configures the output signal's level for channel0-7 in IDLE state.*/
|
||||
uint32_t idle_out_en: 1; /*This is the output enable control bit for channel0-7 in IDLE state.*/
|
||||
uint32_t reserved20: 12;
|
||||
};
|
||||
uint32_t val;
|
||||
} conf1;
|
||||
} conf_ch[8];
|
||||
uint32_t status_ch[8]; /*The status for channel0-7*/
|
||||
uint32_t apb_mem_addr_ch[8]; /*The ram relative address in channel0-7 by apb fifo access*/
|
||||
union {
|
||||
struct {
|
||||
uint32_t ch0_tx_end: 1; /*The interrupt raw bit for channel 0 turns to high level when the transmit process is done.*/
|
||||
uint32_t ch0_rx_end: 1; /*The interrupt raw bit for channel 0 turns to high level when the receive process is done.*/
|
||||
uint32_t ch0_err: 1; /*The interrupt raw bit for channel 0 turns to high level when channel 0 detects some errors.*/
|
||||
uint32_t ch1_tx_end: 1; /*The interrupt raw bit for channel 1 turns to high level when the transmit process is done.*/
|
||||
uint32_t ch1_rx_end: 1; /*The interrupt raw bit for channel 1 turns to high level when the receive process is done.*/
|
||||
uint32_t ch1_err: 1; /*The interrupt raw bit for channel 1 turns to high level when channel 1 detects some errors.*/
|
||||
uint32_t ch2_tx_end: 1; /*The interrupt raw bit for channel 2 turns to high level when the transmit process is done.*/
|
||||
uint32_t ch2_rx_end: 1; /*The interrupt raw bit for channel 2 turns to high level when the receive process is done.*/
|
||||
uint32_t ch2_err: 1; /*The interrupt raw bit for channel 2 turns to high level when channel 2 detects some errors.*/
|
||||
uint32_t ch3_tx_end: 1; /*The interrupt raw bit for channel 3 turns to high level when the transmit process is done.*/
|
||||
uint32_t ch3_rx_end: 1; /*The interrupt raw bit for channel 3 turns to high level when the receive process is done.*/
|
||||
uint32_t ch3_err: 1; /*The interrupt raw bit for channel 3 turns to high level when channel 3 detects some errors.*/
|
||||
uint32_t ch4_tx_end: 1; /*The interrupt raw bit for channel 4 turns to high level when the transmit process is done.*/
|
||||
uint32_t ch4_rx_end: 1; /*The interrupt raw bit for channel 4 turns to high level when the receive process is done.*/
|
||||
uint32_t ch4_err: 1; /*The interrupt raw bit for channel 4 turns to high level when channel 4 detects some errors.*/
|
||||
uint32_t ch5_tx_end: 1; /*The interrupt raw bit for channel 5 turns to high level when the transmit process is done.*/
|
||||
uint32_t ch5_rx_end: 1; /*The interrupt raw bit for channel 5 turns to high level when the receive process is done.*/
|
||||
uint32_t ch5_err: 1; /*The interrupt raw bit for channel 5 turns to high level when channel 5 detects some errors.*/
|
||||
uint32_t ch6_tx_end: 1; /*The interrupt raw bit for channel 6 turns to high level when the transmit process is done.*/
|
||||
uint32_t ch6_rx_end: 1; /*The interrupt raw bit for channel 6 turns to high level when the receive process is done.*/
|
||||
uint32_t ch6_err: 1; /*The interrupt raw bit for channel 6 turns to high level when channel 6 detects some errors.*/
|
||||
uint32_t ch7_tx_end: 1; /*The interrupt raw bit for channel 7 turns to high level when the transmit process is done.*/
|
||||
uint32_t ch7_rx_end: 1; /*The interrupt raw bit for channel 7 turns to high level when the receive process is done.*/
|
||||
uint32_t ch7_err: 1; /*The interrupt raw bit for channel 7 turns to high level when channel 7 detects some errors.*/
|
||||
uint32_t ch0_tx_thr_event: 1; /*The interrupt raw bit for channel 0 turns to high level when transmitter in channel0 have send data more than reg_rmt_tx_lim_ch0 after detecting this interrupt software can updata the old data with new data.*/
|
||||
uint32_t ch1_tx_thr_event: 1; /*The interrupt raw bit for channel 1 turns to high level when transmitter in channel1 have send data more than reg_rmt_tx_lim_ch1 after detecting this interrupt software can updata the old data with new data.*/
|
||||
uint32_t ch2_tx_thr_event: 1; /*The interrupt raw bit for channel 2 turns to high level when transmitter in channel2 have send data more than reg_rmt_tx_lim_ch2 after detecting this interrupt software can updata the old data with new data.*/
|
||||
uint32_t ch3_tx_thr_event: 1; /*The interrupt raw bit for channel 3 turns to high level when transmitter in channel3 have send data more than reg_rmt_tx_lim_ch3 after detecting this interrupt software can updata the old data with new data.*/
|
||||
uint32_t ch4_tx_thr_event: 1; /*The interrupt raw bit for channel 4 turns to high level when transmitter in channel4 have send data more than reg_rmt_tx_lim_ch4 after detecting this interrupt software can updata the old data with new data.*/
|
||||
uint32_t ch5_tx_thr_event: 1; /*The interrupt raw bit for channel 5 turns to high level when transmitter in channel5 have send data more than reg_rmt_tx_lim_ch5 after detecting this interrupt software can updata the old data with new data.*/
|
||||
uint32_t ch6_tx_thr_event: 1; /*The interrupt raw bit for channel 6 turns to high level when transmitter in channel6 have send data more than reg_rmt_tx_lim_ch6 after detecting this interrupt software can updata the old data with new data.*/
|
||||
uint32_t ch7_tx_thr_event: 1; /*The interrupt raw bit for channel 7 turns to high level when transmitter in channel7 have send data more than reg_rmt_tx_lim_ch7 after detecting this interrupt software can updata the old data with new data.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} int_raw;
|
||||
union {
|
||||
struct {
|
||||
uint32_t ch0_tx_end: 1; /*The interrupt state bit for channel 0's mt_ch0_tx_end_int_raw when mt_ch0_tx_end_int_ena is set to 0.*/
|
||||
uint32_t ch0_rx_end: 1; /*The interrupt state bit for channel 0's rmt_ch0_rx_end_int_raw when rmt_ch0_rx_end_int_ena is set to 0.*/
|
||||
uint32_t ch0_err: 1; /*The interrupt state bit for channel 0's rmt_ch0_err_int_raw when rmt_ch0_err_int_ena is set to 0.*/
|
||||
uint32_t ch1_tx_end: 1; /*The interrupt state bit for channel 1's mt_ch1_tx_end_int_raw when mt_ch1_tx_end_int_ena is set to 1.*/
|
||||
uint32_t ch1_rx_end: 1; /*The interrupt state bit for channel 1's rmt_ch1_rx_end_int_raw when rmt_ch1_rx_end_int_ena is set to 1.*/
|
||||
uint32_t ch1_err: 1; /*The interrupt state bit for channel 1's rmt_ch1_err_int_raw when rmt_ch1_err_int_ena is set to 1.*/
|
||||
uint32_t ch2_tx_end: 1; /*The interrupt state bit for channel 2's mt_ch2_tx_end_int_raw when mt_ch2_tx_end_int_ena is set to 1.*/
|
||||
uint32_t ch2_rx_end: 1; /*The interrupt state bit for channel 2's rmt_ch2_rx_end_int_raw when rmt_ch2_rx_end_int_ena is set to 1.*/
|
||||
uint32_t ch2_err: 1; /*The interrupt state bit for channel 2's rmt_ch2_err_int_raw when rmt_ch2_err_int_ena is set to 1.*/
|
||||
uint32_t ch3_tx_end: 1; /*The interrupt state bit for channel 3's mt_ch3_tx_end_int_raw when mt_ch3_tx_end_int_ena is set to 1.*/
|
||||
uint32_t ch3_rx_end: 1; /*The interrupt state bit for channel 3's rmt_ch3_rx_end_int_raw when rmt_ch3_rx_end_int_ena is set to 1.*/
|
||||
uint32_t ch3_err: 1; /*The interrupt state bit for channel 3's rmt_ch3_err_int_raw when rmt_ch3_err_int_ena is set to 1.*/
|
||||
uint32_t ch4_tx_end: 1; /*The interrupt state bit for channel 4's mt_ch4_tx_end_int_raw when mt_ch4_tx_end_int_ena is set to 1.*/
|
||||
uint32_t ch4_rx_end: 1; /*The interrupt state bit for channel 4's rmt_ch4_rx_end_int_raw when rmt_ch4_rx_end_int_ena is set to 1.*/
|
||||
uint32_t ch4_err: 1; /*The interrupt state bit for channel 4's rmt_ch4_err_int_raw when rmt_ch4_err_int_ena is set to 1.*/
|
||||
uint32_t ch5_tx_end: 1; /*The interrupt state bit for channel 5's mt_ch5_tx_end_int_raw when mt_ch5_tx_end_int_ena is set to 1.*/
|
||||
uint32_t ch5_rx_end: 1; /*The interrupt state bit for channel 5's rmt_ch5_rx_end_int_raw when rmt_ch5_rx_end_int_ena is set to 1.*/
|
||||
uint32_t ch5_err: 1; /*The interrupt state bit for channel 5's rmt_ch5_err_int_raw when rmt_ch5_err_int_ena is set to 1.*/
|
||||
uint32_t ch6_tx_end: 1; /*The interrupt state bit for channel 6's mt_ch6_tx_end_int_raw when mt_ch6_tx_end_int_ena is set to 1.*/
|
||||
uint32_t ch6_rx_end: 1; /*The interrupt state bit for channel 6's rmt_ch6_rx_end_int_raw when rmt_ch6_rx_end_int_ena is set to 1.*/
|
||||
uint32_t ch6_err: 1; /*The interrupt state bit for channel 6's rmt_ch6_err_int_raw when rmt_ch6_err_int_ena is set to 1.*/
|
||||
uint32_t ch7_tx_end: 1; /*The interrupt state bit for channel 7's mt_ch7_tx_end_int_raw when mt_ch7_tx_end_int_ena is set to 1.*/
|
||||
uint32_t ch7_rx_end: 1; /*The interrupt state bit for channel 7's rmt_ch7_rx_end_int_raw when rmt_ch7_rx_end_int_ena is set to 1.*/
|
||||
uint32_t ch7_err: 1; /*The interrupt state bit for channel 7's rmt_ch7_err_int_raw when rmt_ch7_err_int_ena is set to 1.*/
|
||||
uint32_t ch0_tx_thr_event: 1; /*The interrupt state bit for channel 0's rmt_ch0_tx_thr_event_int_raw when mt_ch0_tx_thr_event_int_ena is set to 1.*/
|
||||
uint32_t ch1_tx_thr_event: 1; /*The interrupt state bit for channel 1's rmt_ch1_tx_thr_event_int_raw when mt_ch1_tx_thr_event_int_ena is set to 1.*/
|
||||
uint32_t ch2_tx_thr_event: 1; /*The interrupt state bit for channel 2's rmt_ch2_tx_thr_event_int_raw when mt_ch2_tx_thr_event_int_ena is set to 1.*/
|
||||
uint32_t ch3_tx_thr_event: 1; /*The interrupt state bit for channel 3's rmt_ch3_tx_thr_event_int_raw when mt_ch3_tx_thr_event_int_ena is set to 1.*/
|
||||
uint32_t ch4_tx_thr_event: 1; /*The interrupt state bit for channel 4's rmt_ch4_tx_thr_event_int_raw when mt_ch4_tx_thr_event_int_ena is set to 1.*/
|
||||
uint32_t ch5_tx_thr_event: 1; /*The interrupt state bit for channel 5's rmt_ch5_tx_thr_event_int_raw when mt_ch5_tx_thr_event_int_ena is set to 1.*/
|
||||
uint32_t ch6_tx_thr_event: 1; /*The interrupt state bit for channel 6's rmt_ch6_tx_thr_event_int_raw when mt_ch6_tx_thr_event_int_ena is set to 1.*/
|
||||
uint32_t ch7_tx_thr_event: 1; /*The interrupt state bit for channel 7's rmt_ch7_tx_thr_event_int_raw when mt_ch7_tx_thr_event_int_ena is set to 1.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} int_st;
|
||||
union {
|
||||
struct {
|
||||
uint32_t ch0_tx_end: 1; /*Set this bit to enable rmt_ch0_tx_end_int_st.*/
|
||||
uint32_t ch0_rx_end: 1; /*Set this bit to enable rmt_ch0_rx_end_int_st.*/
|
||||
uint32_t ch0_err: 1; /*Set this bit to enable rmt_ch0_err_int_st.*/
|
||||
uint32_t ch1_tx_end: 1; /*Set this bit to enable rmt_ch1_tx_end_int_st.*/
|
||||
uint32_t ch1_rx_end: 1; /*Set this bit to enable rmt_ch1_rx_end_int_st.*/
|
||||
uint32_t ch1_err: 1; /*Set this bit to enable rmt_ch1_err_int_st.*/
|
||||
uint32_t ch2_tx_end: 1; /*Set this bit to enable rmt_ch2_tx_end_int_st.*/
|
||||
uint32_t ch2_rx_end: 1; /*Set this bit to enable rmt_ch2_rx_end_int_st.*/
|
||||
uint32_t ch2_err: 1; /*Set this bit to enable rmt_ch2_err_int_st.*/
|
||||
uint32_t ch3_tx_end: 1; /*Set this bit to enable rmt_ch3_tx_end_int_st.*/
|
||||
uint32_t ch3_rx_end: 1; /*Set this bit to enable rmt_ch3_rx_end_int_st.*/
|
||||
uint32_t ch3_err: 1; /*Set this bit to enable rmt_ch3_err_int_st.*/
|
||||
uint32_t ch4_tx_end: 1; /*Set this bit to enable rmt_ch4_tx_end_int_st.*/
|
||||
uint32_t ch4_rx_end: 1; /*Set this bit to enable rmt_ch4_rx_end_int_st.*/
|
||||
uint32_t ch4_err: 1; /*Set this bit to enable rmt_ch4_err_int_st.*/
|
||||
uint32_t ch5_tx_end: 1; /*Set this bit to enable rmt_ch5_tx_end_int_st.*/
|
||||
uint32_t ch5_rx_end: 1; /*Set this bit to enable rmt_ch5_rx_end_int_st.*/
|
||||
uint32_t ch5_err: 1; /*Set this bit to enable rmt_ch5_err_int_st.*/
|
||||
uint32_t ch6_tx_end: 1; /*Set this bit to enable rmt_ch6_tx_end_int_st.*/
|
||||
uint32_t ch6_rx_end: 1; /*Set this bit to enable rmt_ch6_rx_end_int_st.*/
|
||||
uint32_t ch6_err: 1; /*Set this bit to enable rmt_ch6_err_int_st.*/
|
||||
uint32_t ch7_tx_end: 1; /*Set this bit to enable rmt_ch7_tx_end_int_st.*/
|
||||
uint32_t ch7_rx_end: 1; /*Set this bit to enable rmt_ch7_rx_end_int_st.*/
|
||||
uint32_t ch7_err: 1; /*Set this bit to enable rmt_ch7_err_int_st.*/
|
||||
uint32_t ch0_tx_thr_event: 1; /*Set this bit to enable rmt_ch0_tx_thr_event_int_st.*/
|
||||
uint32_t ch1_tx_thr_event: 1; /*Set this bit to enable rmt_ch1_tx_thr_event_int_st.*/
|
||||
uint32_t ch2_tx_thr_event: 1; /*Set this bit to enable rmt_ch2_tx_thr_event_int_st.*/
|
||||
uint32_t ch3_tx_thr_event: 1; /*Set this bit to enable rmt_ch3_tx_thr_event_int_st.*/
|
||||
uint32_t ch4_tx_thr_event: 1; /*Set this bit to enable rmt_ch4_tx_thr_event_int_st.*/
|
||||
uint32_t ch5_tx_thr_event: 1; /*Set this bit to enable rmt_ch5_tx_thr_event_int_st.*/
|
||||
uint32_t ch6_tx_thr_event: 1; /*Set this bit to enable rmt_ch6_tx_thr_event_int_st.*/
|
||||
uint32_t ch7_tx_thr_event: 1; /*Set this bit to enable rmt_ch7_tx_thr_event_int_st.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} int_ena;
|
||||
union {
|
||||
struct {
|
||||
uint32_t ch0_tx_end: 1; /*Set this bit to clear the rmt_ch0_rx_end_int_raw..*/
|
||||
uint32_t ch0_rx_end: 1; /*Set this bit to clear the rmt_ch0_tx_end_int_raw.*/
|
||||
uint32_t ch0_err: 1; /*Set this bit to clear the rmt_ch0_err_int_raw.*/
|
||||
uint32_t ch1_tx_end: 1; /*Set this bit to clear the rmt_ch1_rx_end_int_raw..*/
|
||||
uint32_t ch1_rx_end: 1; /*Set this bit to clear the rmt_ch1_tx_end_int_raw.*/
|
||||
uint32_t ch1_err: 1; /*Set this bit to clear the rmt_ch1_err_int_raw.*/
|
||||
uint32_t ch2_tx_end: 1; /*Set this bit to clear the rmt_ch2_rx_end_int_raw..*/
|
||||
uint32_t ch2_rx_end: 1; /*Set this bit to clear the rmt_ch2_tx_end_int_raw.*/
|
||||
uint32_t ch2_err: 1; /*Set this bit to clear the rmt_ch2_err_int_raw.*/
|
||||
uint32_t ch3_tx_end: 1; /*Set this bit to clear the rmt_ch3_rx_end_int_raw..*/
|
||||
uint32_t ch3_rx_end: 1; /*Set this bit to clear the rmt_ch3_tx_end_int_raw.*/
|
||||
uint32_t ch3_err: 1; /*Set this bit to clear the rmt_ch3_err_int_raw.*/
|
||||
uint32_t ch4_tx_end: 1; /*Set this bit to clear the rmt_ch4_rx_end_int_raw..*/
|
||||
uint32_t ch4_rx_end: 1; /*Set this bit to clear the rmt_ch4_tx_end_int_raw.*/
|
||||
uint32_t ch4_err: 1; /*Set this bit to clear the rmt_ch4_err_int_raw.*/
|
||||
uint32_t ch5_tx_end: 1; /*Set this bit to clear the rmt_ch5_rx_end_int_raw..*/
|
||||
uint32_t ch5_rx_end: 1; /*Set this bit to clear the rmt_ch5_tx_end_int_raw.*/
|
||||
uint32_t ch5_err: 1; /*Set this bit to clear the rmt_ch5_err_int_raw.*/
|
||||
uint32_t ch6_tx_end: 1; /*Set this bit to clear the rmt_ch6_rx_end_int_raw..*/
|
||||
uint32_t ch6_rx_end: 1; /*Set this bit to clear the rmt_ch6_tx_end_int_raw.*/
|
||||
uint32_t ch6_err: 1; /*Set this bit to clear the rmt_ch6_err_int_raw.*/
|
||||
uint32_t ch7_tx_end: 1; /*Set this bit to clear the rmt_ch7_rx_end_int_raw..*/
|
||||
uint32_t ch7_rx_end: 1; /*Set this bit to clear the rmt_ch7_tx_end_int_raw.*/
|
||||
uint32_t ch7_err: 1; /*Set this bit to clear the rmt_ch7_err_int_raw.*/
|
||||
uint32_t ch0_tx_thr_event: 1; /*Set this bit to clear the rmt_ch0_tx_thr_event_int_raw interrupt.*/
|
||||
uint32_t ch1_tx_thr_event: 1; /*Set this bit to clear the rmt_ch1_tx_thr_event_int_raw interrupt.*/
|
||||
uint32_t ch2_tx_thr_event: 1; /*Set this bit to clear the rmt_ch2_tx_thr_event_int_raw interrupt.*/
|
||||
uint32_t ch3_tx_thr_event: 1; /*Set this bit to clear the rmt_ch3_tx_thr_event_int_raw interrupt.*/
|
||||
uint32_t ch4_tx_thr_event: 1; /*Set this bit to clear the rmt_ch4_tx_thr_event_int_raw interrupt.*/
|
||||
uint32_t ch5_tx_thr_event: 1; /*Set this bit to clear the rmt_ch5_tx_thr_event_int_raw interrupt.*/
|
||||
uint32_t ch6_tx_thr_event: 1; /*Set this bit to clear the rmt_ch6_tx_thr_event_int_raw interrupt.*/
|
||||
uint32_t ch7_tx_thr_event: 1; /*Set this bit to clear the rmt_ch7_tx_thr_event_int_raw interrupt.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} int_clr;
|
||||
union {
|
||||
struct {
|
||||
uint32_t low: 16; /*This register is used to configure carrier wave's low level value for channel0-7.*/
|
||||
uint32_t high:16; /*This register is used to configure carrier wave's high level value for channel0-7.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} carrier_duty_ch[8];
|
||||
union {
|
||||
struct {
|
||||
uint32_t limit: 9; /*When channel0-7 sends more than reg_rmt_tx_lim_ch0 data then channel0-7 produce the relative interrupt.*/
|
||||
uint32_t reserved9: 23;
|
||||
};
|
||||
uint32_t val;
|
||||
} tx_lim_ch[8];
|
||||
union {
|
||||
struct {
|
||||
uint32_t fifo_mask: 1; /*Set this bit to disable apb fifo access*/
|
||||
uint32_t mem_tx_wrap_en: 1; /*when data need to be send is more than channel's mem can store then set this bit to enable reuse of mem this bit is used together with reg_rmt_tx_lim_chn.*/
|
||||
uint32_t reserved2: 30;
|
||||
};
|
||||
uint32_t val;
|
||||
} apb_conf;
|
||||
uint32_t reserved_f4;
|
||||
uint32_t reserved_f8;
|
||||
uint32_t date; /*This is the version register.*/
|
||||
} rmt_dev_t;
|
||||
extern rmt_dev_t RMT;
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
struct {
|
||||
uint32_t duration0 :15;
|
||||
uint32_t level0 :1;
|
||||
uint32_t duration1 :15;
|
||||
uint32_t level1 :1;
|
||||
};
|
||||
uint32_t val;
|
||||
};
|
||||
} rmt_item32_t;
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
struct {
|
||||
uint16_t duration :15;
|
||||
uint16_t level :1;
|
||||
};
|
||||
uint16_t val;
|
||||
};
|
||||
} rmt_item16_t;
|
||||
|
||||
//Allow access to RMT memory using RMTMEM.chan[0].data32[8]
|
||||
typedef volatile struct {
|
||||
struct {
|
||||
union {
|
||||
rmt_item32_t data32[64];
|
||||
rmt_item16_t data16[128];
|
||||
};
|
||||
} chan[8];
|
||||
} rmt_mem_t;
|
||||
extern rmt_mem_t RMTMEM;
|
||||
|
||||
#endif /* _SOC_RMT_STRUCT_H_ */
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,94 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_SDMMC_REG_H_
|
||||
#define _SOC_SDMMC_REG_H_
|
||||
#include "soc.h"
|
||||
|
||||
#define SDMMC_CTRL_REG (DR_REG_SDMMC_BASE + 0x00)
|
||||
#define SDMMC_PWREN_REG (DR_REG_SDMMC_BASE + 0x04)
|
||||
#define SDMMC_CLKDIV_REG (DR_REG_SDMMC_BASE + 0x08)
|
||||
#define SDMMC_CLKSRC_REG (DR_REG_SDMMC_BASE + 0x0c)
|
||||
#define SDMMC_CLKENA_REG (DR_REG_SDMMC_BASE + 0x10)
|
||||
#define SDMMC_TMOUT_REG (DR_REG_SDMMC_BASE + 0x14)
|
||||
#define SDMMC_CTYPE_REG (DR_REG_SDMMC_BASE + 0x18)
|
||||
#define SDMMC_BLKSIZ_REG (DR_REG_SDMMC_BASE + 0x1c)
|
||||
#define SDMMC_BYTCNT_REG (DR_REG_SDMMC_BASE + 0x20)
|
||||
#define SDMMC_INTMASK_REG (DR_REG_SDMMC_BASE + 0x24)
|
||||
#define SDMMC_CMDARG_REG (DR_REG_SDMMC_BASE + 0x28)
|
||||
#define SDMMC_CMD_REG (DR_REG_SDMMC_BASE + 0x2c)
|
||||
#define SDMMC_RESP0_REG (DR_REG_SDMMC_BASE + 0x30)
|
||||
#define SDMMC_RESP1_REG (DR_REG_SDMMC_BASE + 0x34)
|
||||
#define SDMMC_RESP2_REG (DR_REG_SDMMC_BASE + 0x38)
|
||||
#define SDMMC_RESP3_REG (DR_REG_SDMMC_BASE + 0x3c)
|
||||
|
||||
#define SDMMC_MINTSTS_REG (DR_REG_SDMMC_BASE + 0x40)
|
||||
#define SDMMC_RINTSTS_REG (DR_REG_SDMMC_BASE + 0x44)
|
||||
#define SDMMC_STATUS_REG (DR_REG_SDMMC_BASE + 0x48)
|
||||
#define SDMMC_FIFOTH_REG (DR_REG_SDMMC_BASE + 0x4c)
|
||||
#define SDMMC_CDETECT_REG (DR_REG_SDMMC_BASE + 0x50)
|
||||
#define SDMMC_WRTPRT_REG (DR_REG_SDMMC_BASE + 0x54)
|
||||
#define SDMMC_GPIO_REG (DR_REG_SDMMC_BASE + 0x58)
|
||||
#define SDMMC_TCBCNT_REG (DR_REG_SDMMC_BASE + 0x5c)
|
||||
#define SDMMC_TBBCNT_REG (DR_REG_SDMMC_BASE + 0x60)
|
||||
#define SDMMC_DEBNCE_REG (DR_REG_SDMMC_BASE + 0x64)
|
||||
#define SDMMC_USRID_REG (DR_REG_SDMMC_BASE + 0x68)
|
||||
#define SDMMC_VERID_REG (DR_REG_SDMMC_BASE + 0x6c)
|
||||
#define SDMMC_HCON_REG (DR_REG_SDMMC_BASE + 0x70)
|
||||
#define SDMMC_UHS_REG_REG (DR_REG_SDMMC_BASE + 0x74)
|
||||
#define SDMMC_RST_N_REG (DR_REG_SDMMC_BASE + 0x78)
|
||||
#define SDMMC_BMOD_REG (DR_REG_SDMMC_BASE + 0x80)
|
||||
#define SDMMC_PLDMND_REG (DR_REG_SDMMC_BASE + 0x84)
|
||||
#define SDMMC_DBADDR_REG (DR_REG_SDMMC_BASE + 0x88)
|
||||
#define SDMMC_DBADDRU_REG (DR_REG_SDMMC_BASE + 0x8c)
|
||||
#define SDMMC_IDSTS_REG (DR_REG_SDMMC_BASE + 0x8c)
|
||||
#define SDMMC_IDINTEN_REG (DR_REG_SDMMC_BASE + 0x90)
|
||||
#define SDMMC_DSCADDR_REG (DR_REG_SDMMC_BASE + 0x94)
|
||||
#define SDMMC_DSCADDRL_REG (DR_REG_SDMMC_BASE + 0x98)
|
||||
#define SDMMC_DSCADDRU_REG (DR_REG_SDMMC_BASE + 0x9c)
|
||||
#define SDMMC_BUFADDRL_REG (DR_REG_SDMMC_BASE + 0xa0)
|
||||
#define SDMMC_BUFADDRU_REG (DR_REG_SDMMC_BASE + 0xa4)
|
||||
#define SDMMC_CARDTHRCTL_REG (DR_REG_SDMMC_BASE + 0x100)
|
||||
#define SDMMC_BACK_END_POWER_REG (DR_REG_SDMMC_BASE + 0x104)
|
||||
#define SDMMC_UHS_REG_EXT_REG (DR_REG_SDMMC_BASE + 0x108)
|
||||
#define SDMMC_EMMC_DDR_REG_REG (DR_REG_SDMMC_BASE + 0x10c)
|
||||
#define SDMMC_ENABLE_SHIFT_REG (DR_REG_SDMMC_BASE + 0x110)
|
||||
|
||||
#define SDMMC_CLOCK_REG (DR_REG_SDMMC_BASE + 0x800)
|
||||
|
||||
#define SDMMC_INTMASK_EBE BIT(15)
|
||||
#define SDMMC_INTMASK_ACD BIT(14)
|
||||
#define SDMMC_INTMASK_SBE BIT(13)
|
||||
#define SDMMC_INTMASK_HLE BIT(12)
|
||||
#define SDMMC_INTMASK_FRUN BIT(11)
|
||||
#define SDMMC_INTMASK_HTO BIT(10)
|
||||
#define SDMMC_INTMASK_DTO BIT(9)
|
||||
#define SDMMC_INTMASK_RTO BIT(8)
|
||||
#define SDMMC_INTMASK_DCRC BIT(7)
|
||||
#define SDMMC_INTMASK_RCRC BIT(6)
|
||||
#define SDMMC_INTMASK_RXDR BIT(5)
|
||||
#define SDMMC_INTMASK_TXDR BIT(4)
|
||||
#define SDMMC_INTMASK_DATA_OVER BIT(3)
|
||||
#define SDMMC_INTMASK_CMD_DONE BIT(2)
|
||||
#define SDMMC_INTMASK_RESP_ERR BIT(1)
|
||||
#define SDMMC_INTMASK_CD BIT(0)
|
||||
|
||||
#define SDMMC_IDMAC_INTMASK_AI BIT(9)
|
||||
#define SDMMC_IDMAC_INTMASK_NI BIT(8)
|
||||
#define SDMMC_IDMAC_INTMASK_CES BIT(5)
|
||||
#define SDMMC_IDMAC_INTMASK_DU BIT(4)
|
||||
#define SDMMC_IDMAC_INTMASK_FBE BIT(2)
|
||||
#define SDMMC_IDMAC_INTMASK_RI BIT(1)
|
||||
#define SDMMC_IDMAC_INTMASK_TI BIT(0)
|
||||
|
||||
#endif /* _SOC_SDMMC_REG_H_ */
|
@ -1,371 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_SDMMC_STRUCT_H_
|
||||
#define _SOC_SDMMC_STRUCT_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct {
|
||||
uint32_t reserved1: 1;
|
||||
uint32_t disable_int_on_completion: 1;
|
||||
uint32_t last_descriptor: 1;
|
||||
uint32_t first_descriptor: 1;
|
||||
uint32_t second_address_chained: 1;
|
||||
uint32_t end_of_ring: 1;
|
||||
uint32_t reserved2: 24;
|
||||
uint32_t card_error_summary: 1;
|
||||
uint32_t owned_by_idmac: 1;
|
||||
uint32_t buffer1_size: 13;
|
||||
uint32_t buffer2_size: 13;
|
||||
uint32_t reserved3: 6;
|
||||
void* buffer1_ptr;
|
||||
union {
|
||||
void* buffer2_ptr;
|
||||
void* next_desc_ptr;
|
||||
};
|
||||
} sdmmc_desc_t;
|
||||
|
||||
#define SDMMC_DMA_MAX_BUF_LEN 4096
|
||||
|
||||
_Static_assert(sizeof(sdmmc_desc_t) == 16, "invalid size of sdmmc_desc_t structure");
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint32_t cmd_index: 6; ///< Command index
|
||||
uint32_t response_expect: 1; ///< set if response is expected
|
||||
uint32_t response_long: 1; ///< 0: short response expected, 1: long response expected
|
||||
uint32_t check_response_crc: 1; ///< set if controller should check response CRC
|
||||
uint32_t data_expected: 1; ///< 0: no data expected, 1: data expected
|
||||
uint32_t rw: 1; ///< 0: read from card, 1: write to card (don't care if no data expected)
|
||||
uint32_t stream_mode: 1; ///< 0: block transfer, 1: stream transfer (don't care if no data expected)
|
||||
uint32_t send_auto_stop: 1; ///< set to send stop at the end of the transfer
|
||||
uint32_t wait_complete: 1; ///< 0: send command at once, 1: wait for previous command to complete
|
||||
uint32_t stop_abort_cmd: 1; ///< set if this is a stop or abort command intended to stop current transfer
|
||||
uint32_t send_init: 1; ///< set to send init sequence (80 clocks of 1)
|
||||
uint32_t card_num: 5; ///< card number
|
||||
uint32_t update_clk_reg: 1; ///< 0: normal command, 1: don't send command, just update clock registers
|
||||
uint32_t read_ceata: 1; ///< set if performing read from CE-ATA device
|
||||
uint32_t ccs_expected: 1; ///< set if CCS is expected from CE-ATA device
|
||||
uint32_t enable_boot: 1; ///< set for mandatory boot mode
|
||||
uint32_t expect_boot_ack: 1; ///< when set along with enable_boot, controller expects boot ack pattern
|
||||
uint32_t disable_boot: 1; ///< set to terminate boot operation (don't set along with enable_boot)
|
||||
uint32_t boot_mode: 1; ///< 0: mandatory boot operation, 1: alternate boot operation
|
||||
uint32_t volt_switch: 1; ///< set to enable voltage switching (for CMD11 only)
|
||||
uint32_t use_hold_reg: 1; ///< clear to bypass HOLD register
|
||||
uint32_t reserved: 1;
|
||||
uint32_t start_command: 1; ///< Start command; once command is sent to the card, bit is cleared.
|
||||
} sdmmc_hw_cmd_t; ///< command format used in cmd register; this structure is defined to make it easier to build command values
|
||||
|
||||
_Static_assert(sizeof(sdmmc_hw_cmd_t) == 4, "invalid size of sdmmc_cmd_t structure");
|
||||
|
||||
|
||||
typedef volatile struct {
|
||||
union {
|
||||
struct {
|
||||
uint32_t controller_reset: 1;
|
||||
uint32_t fifo_reset: 1;
|
||||
uint32_t dma_reset: 1;
|
||||
uint32_t reserved1: 1;
|
||||
uint32_t int_enable: 1;
|
||||
uint32_t dma_enable: 1;
|
||||
uint32_t read_wait: 1;
|
||||
uint32_t send_irq_response: 1;
|
||||
uint32_t abort_read_data: 1;
|
||||
uint32_t send_ccsd: 1;
|
||||
uint32_t send_auto_stop_ccsd: 1;
|
||||
uint32_t ceata_device_interrupt_status: 1;
|
||||
uint32_t reserved2: 4;
|
||||
uint32_t card_voltage_a: 4;
|
||||
uint32_t card_voltage_b: 4;
|
||||
uint32_t enable_od_pullup: 1;
|
||||
uint32_t use_internal_dma: 1;
|
||||
uint32_t reserved3: 6;
|
||||
};
|
||||
uint32_t val;
|
||||
} ctrl;
|
||||
|
||||
uint32_t pwren; ///< 1: enable power to card, 0: disable power to card
|
||||
|
||||
union {
|
||||
struct {
|
||||
uint32_t div0: 8; ///< 0: bypass, 1-255: divide clock by (2*div0).
|
||||
uint32_t div1: 8; ///< 0: bypass, 1-255: divide clock by (2*div0).
|
||||
uint32_t div2: 8; ///< 0: bypass, 1-255: divide clock by (2*div0).
|
||||
uint32_t div3: 8; ///< 0: bypass, 1-255: divide clock by (2*div0).
|
||||
};
|
||||
uint32_t val;
|
||||
} clkdiv;
|
||||
|
||||
union {
|
||||
struct {
|
||||
uint32_t card0: 2; ///< 0-3: select clock divider for card 0 among div0-div3
|
||||
uint32_t card1: 2; ///< 0-3: select clock divider for card 1 among div0-div3
|
||||
uint32_t reserved: 28;
|
||||
};
|
||||
uint32_t val;
|
||||
} clksrc;
|
||||
|
||||
union {
|
||||
struct {
|
||||
uint32_t cclk_enable: 16; ///< 1: enable clock to card, 0: disable clock
|
||||
uint32_t cclk_low_power: 16; ///< 1: enable clock gating when card is idle, 0: disable clock gating
|
||||
};
|
||||
uint32_t val;
|
||||
} clkena;
|
||||
|
||||
union {
|
||||
struct {
|
||||
uint32_t response: 8; ///< response timeout, in card output clock cycles
|
||||
uint32_t data: 24; ///< data read timeout, in card output clock cycles
|
||||
};
|
||||
uint32_t val;
|
||||
} tmout;
|
||||
|
||||
union {
|
||||
struct {
|
||||
uint32_t card_width: 16; ///< one bit for each card: 0: 1-bit mode, 1: 4-bit mode
|
||||
uint32_t card_width_8: 16; ///< one bit for each card: 0: not 8-bit mode (corresponding card_width bit is used), 1: 8-bit mode (card_width bit is ignored)
|
||||
};
|
||||
uint32_t val;
|
||||
} ctype;
|
||||
|
||||
uint32_t blksiz: 16; ///< block size, default 0x200
|
||||
uint32_t : 16;
|
||||
|
||||
uint32_t bytcnt; ///< number of bytes to be transferred
|
||||
|
||||
union {
|
||||
struct {
|
||||
uint32_t cd: 1; ///< Card detect interrupt enable
|
||||
uint32_t re: 1; ///< Response error interrupt enable
|
||||
uint32_t cmd_done: 1; ///< Command done interrupt enable
|
||||
uint32_t dto: 1; ///< Data transfer over interrupt enable
|
||||
uint32_t txdr: 1; ///< Transmit FIFO data request interrupt enable
|
||||
uint32_t rxdr: 1; ///< Receive FIFO data request interrupt enable
|
||||
uint32_t rcrc: 1; ///< Response CRC error interrupt enable
|
||||
uint32_t dcrc: 1; ///< Data CRC error interrupt enable
|
||||
uint32_t rto: 1; ///< Response timeout interrupt enable
|
||||
uint32_t drto: 1; ///< Data read timeout interrupt enable
|
||||
uint32_t hto: 1; ///< Data starvation-by-host timeout interrupt enable
|
||||
uint32_t frun: 1; ///< FIFO underrun/overrun error interrupt enable
|
||||
uint32_t hle: 1; ///< Hardware locked write error interrupt enable
|
||||
uint32_t sbi_bci: 1; ///< Start bit error / busy clear interrupt enable
|
||||
uint32_t acd: 1; ///< Auto command done interrupt enable
|
||||
uint32_t ebe: 1; ///< End bit error / write no CRC interrupt enable
|
||||
uint32_t sdio: 16; ///< SDIO interrupt enable
|
||||
};
|
||||
uint32_t val;
|
||||
} intmask;
|
||||
|
||||
uint32_t cmdarg; ///< Command argument to be passed to card
|
||||
|
||||
sdmmc_hw_cmd_t cmd;
|
||||
|
||||
uint32_t resp[4]; ///< Response from card
|
||||
|
||||
union {
|
||||
struct {
|
||||
uint32_t cd: 1; ///< Card detect interrupt masked status
|
||||
uint32_t re: 1; ///< Response error interrupt masked status
|
||||
uint32_t cmd_done: 1; ///< Command done interrupt masked status
|
||||
uint32_t dto: 1; ///< Data transfer over interrupt masked status
|
||||
uint32_t txdr: 1; ///< Transmit FIFO data request interrupt masked status
|
||||
uint32_t rxdr: 1; ///< Receive FIFO data request interrupt masked status
|
||||
uint32_t rcrc: 1; ///< Response CRC error interrupt masked status
|
||||
uint32_t dcrc: 1; ///< Data CRC error interrupt masked status
|
||||
uint32_t rto: 1; ///< Response timeout interrupt masked status
|
||||
uint32_t drto: 1; ///< Data read timeout interrupt masked status
|
||||
uint32_t hto: 1; ///< Data starvation-by-host timeout interrupt masked status
|
||||
uint32_t frun: 1; ///< FIFO underrun/overrun error interrupt masked status
|
||||
uint32_t hle: 1; ///< Hardware locked write error interrupt masked status
|
||||
uint32_t sbi_bci: 1; ///< Start bit error / busy clear interrupt masked status
|
||||
uint32_t acd: 1; ///< Auto command done interrupt masked status
|
||||
uint32_t ebe: 1; ///< End bit error / write no CRC interrupt masked status
|
||||
uint32_t sdio: 16; ///< SDIO interrupt masked status
|
||||
};
|
||||
uint32_t val;
|
||||
} mintsts;
|
||||
|
||||
union {
|
||||
struct {
|
||||
uint32_t cd: 1; ///< Card detect raw interrupt status
|
||||
uint32_t re: 1; ///< Response error raw interrupt status
|
||||
uint32_t cmd_done: 1; ///< Command done raw interrupt status
|
||||
uint32_t dto: 1; ///< Data transfer over raw interrupt status
|
||||
uint32_t txdr: 1; ///< Transmit FIFO data request raw interrupt status
|
||||
uint32_t rxdr: 1; ///< Receive FIFO data request raw interrupt status
|
||||
uint32_t rcrc: 1; ///< Response CRC error raw interrupt status
|
||||
uint32_t dcrc: 1; ///< Data CRC error raw interrupt status
|
||||
uint32_t rto: 1; ///< Response timeout raw interrupt status
|
||||
uint32_t drto: 1; ///< Data read timeout raw interrupt status
|
||||
uint32_t hto: 1; ///< Data starvation-by-host timeout raw interrupt status
|
||||
uint32_t frun: 1; ///< FIFO underrun/overrun error raw interrupt status
|
||||
uint32_t hle: 1; ///< Hardware locked write error raw interrupt status
|
||||
uint32_t sbi_bci: 1; ///< Start bit error / busy clear raw interrupt status
|
||||
uint32_t acd: 1; ///< Auto command done raw interrupt status
|
||||
uint32_t ebe: 1; ///< End bit error / write no CRC raw interrupt status
|
||||
uint32_t sdio: 16; ///< SDIO raw interrupt status
|
||||
};
|
||||
uint32_t val;
|
||||
} rintsts; ///< interrupts can be cleared by writing this register
|
||||
|
||||
union {
|
||||
struct {
|
||||
uint32_t fifo_rx_watermark: 1; ///< FIFO reached receive watermark level
|
||||
uint32_t fifo_tx_watermark: 1; ///< FIFO reached transmit watermark level
|
||||
uint32_t fifo_empty: 1; ///< FIFO is empty
|
||||
uint32_t fifo_full: 1; ///< FIFO is full
|
||||
uint32_t cmd_fsm_state: 4; ///< command FSM state
|
||||
uint32_t data3_status: 1; ///< this bit reads 1 if card is present
|
||||
uint32_t data_busy: 1; ///< this bit reads 1 if card is busy
|
||||
uint32_t data_fsm_busy: 1; ///< this bit reads 1 if transmit/receive FSM is busy
|
||||
uint32_t response_index: 6; ///< index of the previous response
|
||||
uint32_t fifo_count: 13; ///< number of filled locations in the FIFO
|
||||
uint32_t dma_ack: 1; ///< DMA acknowledge signal
|
||||
uint32_t dma_req: 1; ///< DMA request signal
|
||||
};
|
||||
uint32_t val;
|
||||
} status;
|
||||
|
||||
union {
|
||||
struct {
|
||||
uint32_t tx_watermark: 12; ///< FIFO TX watermark level
|
||||
uint32_t reserved1: 4;
|
||||
uint32_t rx_watermark: 12; ///< FIFO RX watermark level
|
||||
uint32_t dw_dma_mts: 3;
|
||||
uint32_t reserved2: 1;
|
||||
};
|
||||
uint32_t val;
|
||||
} fifoth;
|
||||
|
||||
union {
|
||||
struct {
|
||||
uint32_t cards: 2; ///< bit N reads 1 if card N is present
|
||||
uint32_t reserved: 30;
|
||||
};
|
||||
uint32_t val;
|
||||
} cdetect;
|
||||
|
||||
union {
|
||||
struct {
|
||||
uint32_t card0: 2; ///< bit N reads 1 if card N is write protected
|
||||
uint32_t reserved: 30;
|
||||
};
|
||||
uint32_t val;
|
||||
} wrtprt;
|
||||
|
||||
uint32_t gpio; ///< unused
|
||||
uint32_t tcbcnt; ///< transferred (to card) byte count
|
||||
uint32_t tbbcnt; ///< transferred from host to FIFO byte count
|
||||
|
||||
union {
|
||||
struct {
|
||||
uint32_t debounce_count: 24; ///< number of host cycles used by debounce filter, typical time should be 5-25ms
|
||||
uint32_t reserved: 8;
|
||||
};
|
||||
} debnce;
|
||||
|
||||
uint32_t usrid; ///< user ID
|
||||
uint32_t verid; ///< IP block version
|
||||
uint32_t hcon; ///< compile-time IP configuration
|
||||
uint32_t uhs; ///< TBD
|
||||
|
||||
union {
|
||||
struct {
|
||||
uint32_t cards: 2; ///< bit N resets card N, active low
|
||||
uint32_t reserved: 30;
|
||||
};
|
||||
} rst_n;
|
||||
|
||||
uint32_t reserved_7c;
|
||||
|
||||
union {
|
||||
struct {
|
||||
uint32_t sw_reset: 1; ///< set to reset DMA controller
|
||||
uint32_t fb: 1; ///< set if AHB master performs fixed burst transfers
|
||||
uint32_t dsl: 5; ///< descriptor skip length: number of words to skip between two unchained descriptors
|
||||
uint32_t enable: 1; ///< set to enable IDMAC
|
||||
uint32_t pbl: 3; ///< programmable burst length
|
||||
uint32_t reserved: 21;
|
||||
};
|
||||
uint32_t val;
|
||||
} bmod;
|
||||
|
||||
uint32_t pldmnd; ///< set any bit to resume IDMAC FSM from suspended state
|
||||
sdmmc_desc_t* dbaddr; ///< descriptor list base
|
||||
|
||||
union {
|
||||
struct {
|
||||
uint32_t ti: 1; ///< transmit interrupt status
|
||||
uint32_t ri: 1; ///< receive interrupt status
|
||||
uint32_t fbe: 1; ///< fatal bus error
|
||||
uint32_t reserved1: 1;
|
||||
uint32_t du: 1; ///< descriptor unavailable
|
||||
uint32_t ces: 1; ///< card error summary
|
||||
uint32_t reserved2: 2;
|
||||
uint32_t nis: 1; ///< normal interrupt summary
|
||||
uint32_t fbe_code: 3; ///< code of fatal bus error
|
||||
uint32_t fsm: 4; ///< DMAC FSM state
|
||||
uint32_t reserved3: 15;
|
||||
};
|
||||
uint32_t val;
|
||||
} idsts;
|
||||
|
||||
union {
|
||||
struct {
|
||||
uint32_t ti: 1; ///< transmit interrupt enable
|
||||
uint32_t ri: 1; ///< receive interrupt enable
|
||||
uint32_t fbe: 1; ///< fatal bus error interrupt enable
|
||||
uint32_t reserved1: 1;
|
||||
uint32_t du: 1; ///< descriptor unavailable interrupt enable
|
||||
uint32_t ces: 1; ///< card error interrupt enable
|
||||
uint32_t reserved2: 2;
|
||||
uint32_t ni: 1; ///< normal interrupt interrupt enable
|
||||
uint32_t ai: 1; ///< abnormal interrupt enable
|
||||
uint32_t reserved3: 22;
|
||||
};
|
||||
uint32_t val;
|
||||
} idinten;
|
||||
|
||||
uint32_t dscaddr; ///< current host descriptor address
|
||||
uint32_t dscaddrl; ///< unused
|
||||
uint32_t dscaddru; ///< unused
|
||||
uint32_t bufaddrl; ///< unused
|
||||
uint32_t bufaddru; ///< unused
|
||||
uint32_t reserved_a8[22];
|
||||
uint32_t cardthrctl;
|
||||
uint32_t back_end_power;
|
||||
uint32_t uhs_reg_ext;
|
||||
uint32_t emmc_ddr_reg;
|
||||
uint32_t enable_shift;
|
||||
uint32_t reserved_114[443];
|
||||
union {
|
||||
struct {
|
||||
uint32_t phase_dout: 3; ///< phase of data output clock (0x0: 0, 0x1: 90, 0x4: 180, 0x6: 270)
|
||||
uint32_t phase_din: 3; ///< phase of data input clock
|
||||
uint32_t phase_core: 3; ///< phase of the clock to SDMMC peripheral
|
||||
uint32_t div_factor_p: 4; ///< controls clock period; it will be (div_factor_p + 1) / 160MHz
|
||||
uint32_t div_factor_h: 4; ///< controls length of high pulse; it will be (div_factor_h + 1) / 160MHz
|
||||
uint32_t div_factor_m: 4; ///< should be equal to div_factor_p
|
||||
};
|
||||
uint32_t val;
|
||||
} clock;
|
||||
} sdmmc_dev_t;
|
||||
extern sdmmc_dev_t SDMMC;
|
||||
|
||||
_Static_assert(sizeof(sdmmc_dev_t) == 0x804, "invalid size of sdmmc_dev_t structure");
|
||||
|
||||
|
||||
|
||||
#endif //_SOC_SDMMC_STRUCT_H_
|
File diff suppressed because it is too large
Load Diff
@ -1,322 +0,0 @@
|
||||
// Copyright 2010-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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef _ESP32_SOC_H_
|
||||
#define _ESP32_SOC_H_
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
//Register Bits{{
|
||||
#define BIT31 0x80000000
|
||||
#define BIT30 0x40000000
|
||||
#define BIT29 0x20000000
|
||||
#define BIT28 0x10000000
|
||||
#define BIT27 0x08000000
|
||||
#define BIT26 0x04000000
|
||||
#define BIT25 0x02000000
|
||||
#define BIT24 0x01000000
|
||||
#define BIT23 0x00800000
|
||||
#define BIT22 0x00400000
|
||||
#define BIT21 0x00200000
|
||||
#define BIT20 0x00100000
|
||||
#define BIT19 0x00080000
|
||||
#define BIT18 0x00040000
|
||||
#define BIT17 0x00020000
|
||||
#define BIT16 0x00010000
|
||||
#define BIT15 0x00008000
|
||||
#define BIT14 0x00004000
|
||||
#define BIT13 0x00002000
|
||||
#define BIT12 0x00001000
|
||||
#define BIT11 0x00000800
|
||||
#define BIT10 0x00000400
|
||||
#define BIT9 0x00000200
|
||||
#define BIT8 0x00000100
|
||||
#define BIT7 0x00000080
|
||||
#define BIT6 0x00000040
|
||||
#define BIT5 0x00000020
|
||||
#define BIT4 0x00000010
|
||||
#define BIT3 0x00000008
|
||||
#define BIT2 0x00000004
|
||||
#define BIT1 0x00000002
|
||||
#define BIT0 0x00000001
|
||||
//}}
|
||||
|
||||
#define PRO_CPU_NUM (0)
|
||||
#define APP_CPU_NUM (1)
|
||||
|
||||
//Registers Operation {{
|
||||
#define ETS_UNCACHED_ADDR(addr) (addr)
|
||||
#define ETS_CACHED_ADDR(addr) (addr)
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
#define BIT(nr) (1UL << (nr))
|
||||
#else
|
||||
#define BIT(nr) (1 << (nr))
|
||||
#endif //__ASSEMBLER__
|
||||
|
||||
//write value to register
|
||||
#define REG_WRITE(_r, _v) (*(volatile uint32_t *)(_r)) = (_v)
|
||||
|
||||
//read value from register
|
||||
#define REG_READ(_r) (*(volatile uint32_t *)(_r))
|
||||
|
||||
//get bit or get bits from register
|
||||
#define REG_GET_BIT(_r, _b) (*(volatile uint32_t*)(_r) & (_b))
|
||||
|
||||
//set bit or set bits to register
|
||||
#define REG_SET_BIT(_r, _b) (*(volatile uint32_t*)(_r) |= (_b))
|
||||
|
||||
//clear bit or clear bits of register
|
||||
#define REG_CLR_BIT(_r, _b) (*(volatile uint32_t*)(_r) &= ~(_b))
|
||||
|
||||
//set bits of register controlled by mask
|
||||
#define REG_SET_BITS(_r, _b, _m) (*(volatile uint32_t*)(_r) = (*(volatile uint32_t*)(_r) & ~(_m)) | ((_b) & (_m)))
|
||||
|
||||
//get field from register, uses field _S & _V to determine mask
|
||||
#define REG_GET_FIELD(_r, _f) ((REG_READ(_r) >> (_f##_S)) & (_f##_V))
|
||||
|
||||
//set field to register, used when _f is not left shifted by _f##_S
|
||||
#define REG_SET_FIELD(_r, _f, _v) (REG_WRITE((_r),((REG_READ(_r) & ~((_f) << (_f##_S)))|(((_v) & (_f))<<(_f##_S)))))
|
||||
|
||||
//get field value from a variable, used when _f is not left shifted by _f##_S
|
||||
#define VALUE_GET_FIELD(_r, _f) (((_r) >> (_f##_S)) & (_f))
|
||||
|
||||
//get field value from a variable, used when _f is left shifted by _f##_S
|
||||
#define VALUE_GET_FIELD2(_r, _f) (((_r) & (_f))>> (_f##_S))
|
||||
|
||||
//set field value to a variable, used when _f is not left shifted by _f##_S
|
||||
#define VALUE_SET_FIELD(_r, _f, _v) ((_r)=(((_r) & ~((_f) << (_f##_S)))|((_v)<<(_f##_S))))
|
||||
|
||||
//set field value to a variable, used when _f is left shifted by _f##_S
|
||||
#define VALUE_SET_FIELD2(_r, _f, _v) ((_r)=(((_r) & ~(_f))|((_v)<<(_f##_S))))
|
||||
|
||||
//generate a value from a field value, used when _f is not left shifted by _f##_S
|
||||
#define FIELD_TO_VALUE(_f, _v) (((_v)&(_f))<<_f##_S)
|
||||
|
||||
//generate a value from a field value, used when _f is left shifted by _f##_S
|
||||
#define FIELD_TO_VALUE2(_f, _v) (((_v)<<_f##_S) & (_f))
|
||||
|
||||
//read value from register
|
||||
#define READ_PERI_REG(addr) (*((volatile uint32_t *)ETS_UNCACHED_ADDR(addr)))
|
||||
|
||||
//write value to register
|
||||
#define WRITE_PERI_REG(addr, val) (*((volatile uint32_t *)ETS_UNCACHED_ADDR(addr))) = (uint32_t)(val)
|
||||
|
||||
//clear bits of register controlled by mask
|
||||
#define CLEAR_PERI_REG_MASK(reg, mask) WRITE_PERI_REG((reg), (READ_PERI_REG(reg)&(~(mask))))
|
||||
|
||||
//set bits of register controlled by mask
|
||||
#define SET_PERI_REG_MASK(reg, mask) WRITE_PERI_REG((reg), (READ_PERI_REG(reg)|(mask)))
|
||||
|
||||
//get bits of register controlled by mask
|
||||
#define GET_PERI_REG_MASK(reg, mask) (READ_PERI_REG(reg) & (mask))
|
||||
|
||||
//get bits of register controlled by highest bit and lowest bit
|
||||
#define GET_PERI_REG_BITS(reg, hipos,lowpos) ((READ_PERI_REG(reg)>>(lowpos))&((1<<((hipos)-(lowpos)+1))-1))
|
||||
|
||||
//set bits of register controlled by mask and shift
|
||||
#define SET_PERI_REG_BITS(reg,bit_map,value,shift) (WRITE_PERI_REG((reg),(READ_PERI_REG(reg)&(~((bit_map)<<(shift))))|(((value) & bit_map)<<(shift)) ))
|
||||
|
||||
//get field of register
|
||||
#define GET_PERI_REG_BITS2(reg, mask,shift) ((READ_PERI_REG(reg)>>(shift))&(mask))
|
||||
//}}
|
||||
|
||||
//Periheral Clock {{
|
||||
#define APB_CLK_FREQ_ROM ( 26*1000000 )
|
||||
#define CPU_CLK_FREQ_ROM APB_CLK_FREQ_ROM
|
||||
#define CPU_CLK_FREQ APB_CLK_FREQ
|
||||
#define APB_CLK_FREQ ( 80*1000000 ) //unit: Hz
|
||||
#define UART_CLK_FREQ APB_CLK_FREQ
|
||||
#define WDT_CLK_FREQ APB_CLK_FREQ
|
||||
#define TIMER_CLK_FREQ (80000000>>4) //80MHz divided by 16
|
||||
#define SPI_CLK_DIV 4
|
||||
#define TICKS_PER_US_ROM 26 // CPU is 80MHz
|
||||
//}}
|
||||
|
||||
#define DR_REG_DPORT_BASE 0x3ff00000
|
||||
#define DR_REG_RSA_BASE 0x3ff02000
|
||||
#define DR_REG_SHA_BASE 0x3ff03000
|
||||
#define DR_REG_UART_BASE 0x3ff40000
|
||||
#define DR_REG_SPI1_BASE 0x3ff42000
|
||||
#define DR_REG_SPI0_BASE 0x3ff43000
|
||||
#define DR_REG_GPIO_BASE 0x3ff44000
|
||||
#define DR_REG_GPIO_SD_BASE 0x3ff44f00
|
||||
#define DR_REG_FE2_BASE 0x3ff45000
|
||||
#define DR_REG_FE_BASE 0x3ff46000
|
||||
#define DR_REG_FRC_TIMER_BASE 0x3ff47000
|
||||
#define DR_REG_RTCCNTL_BASE 0x3ff48000
|
||||
#define DR_REG_RTCIO_BASE 0x3ff48400
|
||||
#define DR_REG_SENS_BASE 0x3ff48800
|
||||
#define DR_REG_IO_MUX_BASE 0x3ff49000
|
||||
#define DR_REG_RTCMEM0_BASE 0x3ff61000
|
||||
#define DR_REG_RTCMEM1_BASE 0x3ff62000
|
||||
#define DR_REG_RTCMEM2_BASE 0x3ff63000
|
||||
#define DR_REG_SYSCON_BASE 0x3ff66000
|
||||
#define DR_REG_HINF_BASE 0x3ff4B000
|
||||
#define DR_REG_UHCI1_BASE 0x3ff4C000
|
||||
#define DR_REG_I2S_BASE 0x3ff4F000
|
||||
#define DR_REG_UART1_BASE 0x3ff50000
|
||||
#define DR_REG_BT_BASE 0x3ff51000
|
||||
#define DR_REG_I2C_EXT_BASE 0x3ff53000
|
||||
#define DR_REG_UHCI0_BASE 0x3ff54000
|
||||
#define DR_REG_SLCHOST_BASE 0x3ff55000
|
||||
#define DR_REG_RMT_BASE 0x3ff56000
|
||||
#define DR_REG_PCNT_BASE 0x3ff57000
|
||||
#define DR_REG_SLC_BASE 0x3ff58000
|
||||
#define DR_REG_LEDC_BASE 0x3ff59000
|
||||
#define DR_REG_EFUSE_BASE 0x3ff5A000
|
||||
#define DR_REG_SPI_ENCRYPT_BASE 0x3ff5B000
|
||||
#define DR_REG_PWM_BASE 0x3ff5E000
|
||||
#define DR_REG_TIMERGROUP0_BASE 0x3ff5F000
|
||||
#define DR_REG_TIMERGROUP1_BASE 0x3ff60000
|
||||
#define DR_REG_SPI2_BASE 0x3ff64000
|
||||
#define DR_REG_SPI3_BASE 0x3ff65000
|
||||
#define DR_REG_I2C1_EXT_BASE 0x3ff67000
|
||||
#define DR_REG_SDMMC_BASE 0x3ff68000
|
||||
#define DR_REG_EMAC_BASE 0x3ff69000
|
||||
#define DR_REG_PWM1_BASE 0x3ff6C000
|
||||
#define DR_REG_I2S1_BASE 0x3ff6D000
|
||||
#define DR_REG_UART2_BASE 0x3ff6E000
|
||||
#define DR_REG_PWM2_BASE 0x3ff6F000
|
||||
#define DR_REG_PWM3_BASE 0x3ff70000
|
||||
#define PERIPHS_SPI_ENCRYPT_BASEADDR DR_REG_SPI_ENCRYPT_BASE
|
||||
|
||||
//Interrupt hardware source table
|
||||
//This table is decided by hardware, don't touch this.
|
||||
#define ETS_WIFI_MAC_INTR_SOURCE 0/**< interrupt of WiFi MAC, level*/
|
||||
#define ETS_WIFI_MAC_NMI_SOURCE 1/**< interrupt of WiFi MAC, NMI, use if MAC have bug to fix in NMI*/
|
||||
#define ETS_WIFI_BB_INTR_SOURCE 2/**< interrupt of WiFi BB, level, we can do some calibartion*/
|
||||
#define ETS_BT_MAC_INTR_SOURCE 3/**< will be cancelled*/
|
||||
#define ETS_BT_BB_INTR_SOURCE 4/**< interrupt of BT BB, level*/
|
||||
#define ETS_BT_BB_NMI_SOURCE 5/**< interrupt of BT BB, NMI, use if BB have bug to fix in NMI*/
|
||||
#define ETS_RWBT_INTR_SOURCE 6/**< interrupt of RWBT, level*/
|
||||
#define ETS_RWBLE_INTR_SOURCE 7/**< interrupt of RWBLE, level*/
|
||||
#define ETS_RWBT_NMI_SOURCE 8/**< interrupt of RWBT, NMI, use if RWBT have bug to fix in NMI*/
|
||||
#define ETS_RWBLE_NMI_SOURCE 9/**< interrupt of RWBLE, NMI, use if RWBT have bug to fix in NMI*/
|
||||
#define ETS_SLC0_INTR_SOURCE 10/**< interrupt of SLC0, level*/
|
||||
#define ETS_SLC1_INTR_SOURCE 11/**< interrupt of SLC1, level*/
|
||||
#define ETS_UHCI0_INTR_SOURCE 12/**< interrupt of UHCI0, level*/
|
||||
#define ETS_UHCI1_INTR_SOURCE 13/**< interrupt of UHCI1, level*/
|
||||
#define ETS_TG0_T0_LEVEL_INTR_SOURCE 14/**< interrupt of TIMER_GROUP0, TIMER0, level, we would like use EDGE for timer if permission*/
|
||||
#define ETS_TG0_T1_LEVEL_INTR_SOURCE 15/**< interrupt of TIMER_GROUP0, TIMER1, level, we would like use EDGE for timer if permission*/
|
||||
#define ETS_TG0_WDT_LEVEL_INTR_SOURCE 16/**< interrupt of TIMER_GROUP0, WATCHDOG, level*/
|
||||
#define ETS_TG0_LACT_LEVEL_INTR_SOURCE 17/**< interrupt of TIMER_GROUP0, LACT, level*/
|
||||
#define ETS_TG1_T0_LEVEL_INTR_SOURCE 18/**< interrupt of TIMER_GROUP1, TIMER0, level, we would like use EDGE for timer if permission*/
|
||||
#define ETS_TG1_T1_LEVEL_INTR_SOURCE 19/**< interrupt of TIMER_GROUP1, TIMER1, level, we would like use EDGE for timer if permission*/
|
||||
#define ETS_TG1_WDT_LEVEL_INTR_SOURCE 20/**< interrupt of TIMER_GROUP1, WATCHDOG, level*/
|
||||
#define ETS_TG1_LACT_LEVEL_INTR_SOURCE 21/**< interrupt of TIMER_GROUP1, LACT, level*/
|
||||
#define ETS_GPIO_INTR_SOURCE 22/**< interrupt of GPIO, level*/
|
||||
#define ETS_GPIO_NMI_SOURCE 23/**< interrupt of GPIO, NMI*/
|
||||
#define ETS_FROM_CPU_INTR0_SOURCE 24/**< interrupt0 generated from a CPU, level*/ /* Used for FreeRTOS */
|
||||
#define ETS_FROM_CPU_INTR1_SOURCE 25/**< interrupt1 generated from a CPU, level*/ /* Used for FreeRTOS */
|
||||
#define ETS_FROM_CPU_INTR2_SOURCE 26/**< interrupt2 generated from a CPU, level*/ /* Used for VHCI */
|
||||
#define ETS_FROM_CPU_INTR3_SOURCE 27/**< interrupt3 generated from a CPU, level*/ /* Reserved */
|
||||
#define ETS_SPI0_INTR_SOURCE 28/**< interrupt of SPI0, level, SPI0 is for Cache Access, do not use this*/
|
||||
#define ETS_SPI1_INTR_SOURCE 29/**< interrupt of SPI1, level, SPI1 is for flash read/write, do not use this*/
|
||||
#define ETS_SPI2_INTR_SOURCE 30/**< interrupt of SPI2, level*/
|
||||
#define ETS_SPI3_INTR_SOURCE 31/**< interrupt of SPI3, level*/
|
||||
#define ETS_I2S0_INTR_SOURCE 32/**< interrupt of I2S0, level*/
|
||||
#define ETS_I2S1_INTR_SOURCE 33/**< interrupt of I2S1, level*/
|
||||
#define ETS_UART0_INTR_SOURCE 34/**< interrupt of UART0, level*/
|
||||
#define ETS_UART1_INTR_SOURCE 35/**< interrupt of UART1, level*/
|
||||
#define ETS_UART2_INTR_SOURCE 36/**< interrupt of UART2, level*/
|
||||
#define ETS_SDIO_HOST_INTR_SOURCE 37/**< interrupt of SD/SDIO/MMC HOST, level*/
|
||||
#define ETS_ETH_MAC_INTR_SOURCE 38/**< interrupt of ethernet mac, level*/
|
||||
#define ETS_PWM0_INTR_SOURCE 39/**< interrupt of PWM0, level, Reserved*/
|
||||
#define ETS_PWM1_INTR_SOURCE 40/**< interrupt of PWM1, level, Reserved*/
|
||||
#define ETS_PWM2_INTR_SOURCE 41/**< interrupt of PWM2, level*/
|
||||
#define ETS_PWM3_INTR_SOURCE 42/**< interruot of PWM3, level*/
|
||||
#define ETS_LEDC_INTR_SOURCE 43/**< interrupt of LED PWM, level*/
|
||||
#define ETS_EFUSE_INTR_SOURCE 44/**< interrupt of efuse, level, not likely to use*/
|
||||
#define ETS_CAN_INTR_SOURCE 45/**< interrupt of can, level*/
|
||||
#define ETS_RTC_CORE_INTR_SOURCE 46/**< interrupt of rtc core, level, include rtc watchdog*/
|
||||
#define ETS_RMT_INTR_SOURCE 47/**< interrupt of remote controller, level*/
|
||||
#define ETS_PCNT_INTR_SOURCE 48/**< interrupt of pluse count, level*/
|
||||
#define ETS_I2C_EXT0_INTR_SOURCE 49/**< interrupt of I2C controller1, level*/
|
||||
#define ETS_I2C_EXT1_INTR_SOURCE 50/**< interrupt of I2C controller0, level*/
|
||||
#define ETS_RSA_INTR_SOURCE 51/**< interrupt of RSA accelerator, level*/
|
||||
#define ETS_SPI1_DMA_INTR_SOURCE 52/**< interrupt of SPI1 DMA, SPI1 is for flash read/write, do not use this*/
|
||||
#define ETS_SPI2_DMA_INTR_SOURCE 53/**< interrupt of SPI2 DMA, level*/
|
||||
#define ETS_SPI3_DMA_INTR_SOURCE 54/**< interrupt of SPI3 DMA, level*/
|
||||
#define ETS_WDT_INTR_SOURCE 55/**< will be cancelled*/
|
||||
#define ETS_TIMER1_INTR_SOURCE 56/**< will be cancelled*/
|
||||
#define ETS_TIMER2_INTR_SOURCE 57/**< will be cancelled*/
|
||||
#define ETS_TG0_T0_EDGE_INTR_SOURCE 58/**< interrupt of TIMER_GROUP0, TIMER0, EDGE*/
|
||||
#define ETS_TG0_T1_EDGE_INTR_SOURCE 59/**< interrupt of TIMER_GROUP0, TIMER1, EDGE*/
|
||||
#define ETS_TG0_WDT_EDGE_INTR_SOURCE 60/**< interrupt of TIMER_GROUP0, WATCH DOG, EDGE*/
|
||||
#define ETS_TG0_LACT_EDGE_INTR_SOURCE 61/**< interrupt of TIMER_GROUP0, LACT, EDGE*/
|
||||
#define ETS_TG1_T0_EDGE_INTR_SOURCE 62/**< interrupt of TIMER_GROUP1, TIMER0, EDGE*/
|
||||
#define ETS_TG1_T1_EDGE_INTR_SOURCE 63/**< interrupt of TIMER_GROUP1, TIMER1, EDGE*/
|
||||
#define ETS_TG1_WDT_EDGE_INTR_SOURCE 64/**< interrupt of TIMER_GROUP1, WATCHDOG, EDGE*/
|
||||
#define ETS_TG1_LACT_EDGE_INTR_SOURCE 65/**< interrupt of TIMER_GROUP0, LACT, EDGE*/
|
||||
#define ETS_MMU_IA_INTR_SOURCE 66/**< interrupt of MMU Invalid Access, LEVEL*/
|
||||
#define ETS_MPU_IA_INTR_SOURCE 67/**< interrupt of MPU Invalid Access, LEVEL*/
|
||||
#define ETS_CACHE_IA_INTR_SOURCE 68/**< interrupt of Cache Invalied Access, LEVEL*/
|
||||
|
||||
//interrupt cpu using table, Please see the core-isa.h
|
||||
/*************************************************************************************************************
|
||||
* Intr num Level Type PRO CPU usage APP CPU uasge
|
||||
* 0 1 extern level WMAC Reserved
|
||||
* 1 1 extern level BT/BLE Host VHCI Reserved
|
||||
* 2 1 extern level
|
||||
* 3 1 extern level
|
||||
* 4 1 extern level WBB
|
||||
* 5 1 extern level BT/BLE Controller
|
||||
* 6 1 timer FreeRTOS Tick(L1) FreeRTOS Tick(L1)
|
||||
* 7 1 software Reserved Reserved
|
||||
* 8 1 extern level BT/BLE BB(RX/TX)
|
||||
* 9 1 extern level
|
||||
* 10 1 extern edge Internal Timer
|
||||
* 11 3 profiling
|
||||
* 12 1 extern level
|
||||
* 13 1 extern level
|
||||
* 14 7 nmi Reserved Reserved
|
||||
* 15 3 timer FreeRTOS Tick(L3) FreeRTOS Tick(L3)
|
||||
* 16 5 timer
|
||||
* 17 1 extern level
|
||||
* 18 1 extern level
|
||||
* 19 2 extern level
|
||||
* 20 2 extern level
|
||||
* 21 2 extern level
|
||||
* 22 3 extern edge FRC1 timer
|
||||
* 23 3 extern level
|
||||
* 24 4 extern level TG1_WDT
|
||||
* 25 4 extern level Reserved Reserved
|
||||
* 26 5 extern level Reserved Reserved
|
||||
* 27 3 extern level Reserved Reserved
|
||||
* 28 4 extern edge
|
||||
* 29 3 software Reserved Reserved
|
||||
* 30 4 extern edge Reserved Reserved
|
||||
* 31 5 extern level Reserved Reserved
|
||||
*************************************************************************************************************
|
||||
*/
|
||||
|
||||
//CPU0 Interrupt number reserved, not touch this.
|
||||
#define ETS_WMAC_INUM 0
|
||||
#define ETS_BT_HOST_INUM 1
|
||||
#define ETS_WBB_INUM 4
|
||||
#define ETS_TG0_T1_INUM 10 /**< use edge interrupt*/
|
||||
#define ETS_FRC1_INUM 22
|
||||
#define ETS_T1_WDT_INUM 24
|
||||
|
||||
//CPU0 Interrupt number used in ROM, should be cancelled in SDK
|
||||
#define ETS_SLC_INUM 1
|
||||
#define ETS_UART0_INUM 5
|
||||
#define ETS_UART1_INUM 5
|
||||
//Other interrupt number should be managed by the user
|
||||
|
||||
|
||||
#endif /* _ESP32_SOC_H_ */
|
@ -1,46 +0,0 @@
|
||||
// Copyright 2010-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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#pragma once
|
||||
|
||||
// This file contains various convenience macros to be used in ULP programs.
|
||||
|
||||
// Helper macros to calculate bit field width from mask, using the preprocessor.
|
||||
// Used later in READ_RTC_FIELD and WRITE_RTC_FIELD.
|
||||
#define IS_BIT_SET(m, i) (((m) >> (i)) & 1)
|
||||
#define MASK_TO_WIDTH_HELPER1(m, i) IS_BIT_SET(m, i)
|
||||
#define MASK_TO_WIDTH_HELPER2(m, i) (MASK_TO_WIDTH_HELPER1(m, i) + MASK_TO_WIDTH_HELPER1(m, i + 1))
|
||||
#define MASK_TO_WIDTH_HELPER4(m, i) (MASK_TO_WIDTH_HELPER2(m, i) + MASK_TO_WIDTH_HELPER2(m, i + 2))
|
||||
#define MASK_TO_WIDTH_HELPER8(m, i) (MASK_TO_WIDTH_HELPER4(m, i) + MASK_TO_WIDTH_HELPER4(m, i + 4))
|
||||
#define MASK_TO_WIDTH_HELPER16(m, i) (MASK_TO_WIDTH_HELPER8(m, i) + MASK_TO_WIDTH_HELPER8(m, i + 8))
|
||||
#define MASK_TO_WIDTH_HELPER32(m, i) (MASK_TO_WIDTH_HELPER16(m, i) + MASK_TO_WIDTH_HELPER16(m, i + 16))
|
||||
|
||||
// Peripheral register access macros, build around REG_RD and REG_WR instructions.
|
||||
// Registers defined in rtc_cntl_reg.h, rtc_io_reg.h, and sens_reg.h are usable with these macros.
|
||||
|
||||
// Read from rtc_reg[low_bit + bit_width - 1 : low_bit] into R0, bit_width <= 16
|
||||
#define READ_RTC_REG(rtc_reg, low_bit, bit_width) \
|
||||
REG_RD (((rtc_reg) - DR_REG_RTCCNTL_BASE) / 4), ((low_bit) + (bit_width) - 1), (low_bit)
|
||||
|
||||
// Write immediate value into rtc_reg[low_bit + bit_width - 1 : low_bit], bit_width <= 8
|
||||
#define WRITE_RTC_REG(rtc_reg, low_bit, bit_width, value) \
|
||||
REG_WR (((rtc_reg) - DR_REG_RTCCNTL_BASE) / 4), ((low_bit) + (bit_width) - 1), (low_bit), ((value) & 0xff)
|
||||
|
||||
// Read from a field in rtc_reg into R0, up to 16 bits
|
||||
#define READ_RTC_FIELD(rtc_reg, field) \
|
||||
READ_RTC_REG(rtc_reg, field ## _S, MASK_TO_WIDTH_HELPER16(field ## _V, 0))
|
||||
|
||||
// Write immediate value into a field in rtc_reg, up to 8 bits
|
||||
#define WRITE_RTC_FIELD(rtc_reg, field, value) \
|
||||
WRITE_RTC_REG(rtc_reg, field ## _S, MASK_TO_WIDTH_HELPER8(field ## _V, 0), ((value) & field ## _V))
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,676 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_SPI_STRUCT_H_
|
||||
#define _SOC_SPI_STRUCT_H_
|
||||
typedef volatile struct {
|
||||
union {
|
||||
struct {
|
||||
uint32_t reserved0: 16; /*reserved*/
|
||||
uint32_t flash_per: 1; /*program erase resume bit program erase suspend operation will be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/
|
||||
uint32_t flash_pes: 1; /*program erase suspend bit program erase suspend operation will be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/
|
||||
uint32_t usr: 1; /*User define command enable. An operation will be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/
|
||||
uint32_t flash_hpm: 1; /*Drive Flash into high performance mode. The bit will be cleared once the operation done.1: enable 0: disable.*/
|
||||
uint32_t flash_res: 1; /*This bit combined with reg_resandres bit releases Flash from the power-down state or high performance mode and obtains the devices ID. The bit will be cleared once the operation done.1: enable 0: disable.*/
|
||||
uint32_t flash_dp: 1; /*Drive Flash into power down. An operation will be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/
|
||||
uint32_t flash_ce: 1; /*Chip erase enable. Chip erase operation will be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/
|
||||
uint32_t flash_be: 1; /*Block erase enable(32KB) . Block erase operation will be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/
|
||||
uint32_t flash_se: 1; /*Sector erase enable(4KB). Sector erase operation will be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/
|
||||
uint32_t flash_pp: 1; /*Page program enable(1 byte ~256 bytes data to be programmed). Page program operation will be triggered when the bit is set. The bit will be cleared once the operation done .1: enable 0: disable.*/
|
||||
uint32_t flash_wrsr: 1; /*Write status register enable. Write status operation will be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/
|
||||
uint32_t flash_rdsr: 1; /*Read status register-1. Read status operation will be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/
|
||||
uint32_t flash_rdid: 1; /*Read JEDEC ID . Read ID command will be sent when the bit is set. The bit will be cleared once the operation done. 1: enable 0: disable.*/
|
||||
uint32_t flash_wrdi: 1; /*Write flash disable. Write disable command will be sent when the bit is set. The bit will be cleared once the operation done. 1: enable 0: disable.*/
|
||||
uint32_t flash_wren: 1; /*Write flash enable. Write enable command will be sent when the bit is set. The bit will be cleared once the operation done. 1: enable 0: disable.*/
|
||||
uint32_t flash_read: 1; /*Read flash enable. Read flash operation will be triggered when the bit is set. The bit will be cleared once the operation done. 1: enable 0: disable.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} cmd;
|
||||
uint32_t addr; /*addr to slave / from master */
|
||||
union {
|
||||
struct {
|
||||
uint32_t reserved0: 10; /*reserved*/
|
||||
uint32_t fcs_crc_en: 1; /*For SPI1 initialize crc32 module before writing encrypted data to flash. Active low.*/
|
||||
uint32_t tx_crc_en: 1; /*For SPI1 enable crc32 when writing encrypted data to flash. 1: enable 0:disable*/
|
||||
uint32_t wait_flash_idle_en: 1; /*wait flash idle when program flash or erase flash. 1: enable 0: disable.*/
|
||||
uint32_t fastrd_mode: 1; /*This bit enable the bits: spi_fread_qio spi_fread_dio spi_fread_qout and spi_fread_dout. 1: enable 0: disable.*/
|
||||
uint32_t fread_dual: 1; /*In the read operations read-data phase apply 2 signals. 1: enable 0: disable.*/
|
||||
uint32_t resandres: 1; /*The Device ID is read out to SPI_RD_STATUS register, this bit combine with spi_flash_res bit. 1: enable 0: disable.*/
|
||||
uint32_t reserved16: 4; /*reserved*/
|
||||
uint32_t fread_quad: 1; /*In the read operations read-data phase apply 4 signals. 1: enable 0: disable.*/
|
||||
uint32_t wp: 1; /*Write protect signal output when SPI is idle. 1: output high 0: output low.*/
|
||||
uint32_t wrsr_2b: 1; /*two bytes data will be written to status register when it is set. 1: enable 0: disable.*/
|
||||
uint32_t fread_dio: 1; /*In the read operations address phase and read-data phase apply 2 signals. 1: enable 0: disable.*/
|
||||
uint32_t fread_qio: 1; /*In the read operations address phase and read-data phase apply 4 signals. 1: enable 0: disable.*/
|
||||
uint32_t rd_bit_order: 1; /*In read-data (MISO) phase 1: LSB first 0: MSB first*/
|
||||
uint32_t wr_bit_order: 1; /*In command address write-data (MOSI) phases 1: LSB firs 0: MSB first*/
|
||||
uint32_t reserved27: 5; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} ctrl;
|
||||
union {
|
||||
struct {
|
||||
uint32_t reserved0: 16; /*reserved*/
|
||||
uint32_t cs_hold_delay_res:12; /*Delay cycles of resume Flash when resume Flash is enable by spi clock.*/
|
||||
uint32_t cs_hold_delay: 4; /*SPI cs signal is delayed by spi clock cycles*/
|
||||
};
|
||||
uint32_t val;
|
||||
} ctrl1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t status: 16; /*In the slave mode, it is the status for master to read out.*/
|
||||
uint32_t wb_mode: 8; /*Mode bits in the flash fast read mode, it is combined with spi_fastrd_mode bit.*/
|
||||
uint32_t status_ext: 8; /*In the slave mode,it is the status for master to read out.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} rd_status;
|
||||
union {
|
||||
struct {
|
||||
uint32_t setup_time: 4; /*(cycles-1) of ,prepare, phase by spi clock, this bits combined with spi_cs_setup bit.*/
|
||||
uint32_t hold_time: 4; /*delay cycles of cs pin by spi clock, this bits combined with spi_cs_hold bit.*/
|
||||
uint32_t ck_out_low_mode: 4; /*modify spi clock duty ratio when the value is lager than 8, the bits are combined with spi_clkcnt_N bits and spi_clkcnt_L bits.*/
|
||||
uint32_t ck_out_high_mode: 4; /*modify spi clock duty ratio when the value is lager than 8, the bits are combined with spi_clkcnt_N bits and spi_clkcnt_H bits.*/
|
||||
uint32_t miso_delay_mode: 2; /*MISO signals are delayed by spi_clk. 0: zero 1: if spi_ck_out_edge or spi_ck_i_edge is set 1 delayed by half cycle else delayed by one cycle 2: if spi_ck_out_edge or spi_ck_i_edge is set 1 delayed by one cycle else delayed by half cycle 3: delayed one cycle*/
|
||||
uint32_t miso_delay_num: 3; /*MISO signals are delayed by system clock cycles*/
|
||||
uint32_t mosi_delay_mode: 2; /*MOSI signals are delayed by spi_clk. 0: zero 1: if spi_ck_out_edge or spi_ck_i_edge is set 1 delayed by half cycle else delayed by one cycle 2: if spi_ck_out_edge or spi_ck_i_edge is set 1 delayed by one cycle else delayed by half cycle 3: delayed one cycle*/
|
||||
uint32_t mosi_delay_num: 3; /*MOSI signals are delayed by system clock cycles*/
|
||||
uint32_t cs_delay_mode: 2; /*spi_cs signal is delayed by spi_clk . 0: zero 1: if spi_ck_out_edge or spi_ck_i_edge is set 1 delayed by half cycle else delayed by one cycle 2: if spi_ck_out_edge or spi_ck_i_edge is set 1 delayed by one cycle else delayed by half cycle 3: delayed one cycle*/
|
||||
uint32_t cs_delay_num: 4; /*spi_cs signal is delayed by system clock cycles*/
|
||||
};
|
||||
uint32_t val;
|
||||
} ctrl2;
|
||||
union {
|
||||
struct {
|
||||
uint32_t clkcnt_l: 6; /*In the master mode it must be equal to spi_clkcnt_N. In the slave mode it must be 0.*/
|
||||
uint32_t clkcnt_h: 6; /*In the master mode it must be floor((spi_clkcnt_N+1)/2-1). In the slave mode it must be 0.*/
|
||||
uint32_t clkcnt_n: 6; /*In the master mode it is the divider of spi_clk. So spi_clk frequency is system/(spi_clkdiv_pre+1)/(spi_clkcnt_N+1)*/
|
||||
uint32_t clkdiv_pre: 13; /*In the master mode it is pre-divider of spi_clk.*/
|
||||
uint32_t clk_equ_sysclk: 1; /*In the master mode 1: spi_clk is eqaul to system 0: spi_clk is divided from system clock.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} clock;
|
||||
union {
|
||||
struct {
|
||||
uint32_t doutdin: 1; /*Set the bit to enable full duplex communication. 1: enable 0: disable.*/
|
||||
uint32_t reserved1: 3; /*reserved*/
|
||||
uint32_t cs_hold: 1; /*spi cs keep low when spi is in ,done, phase. 1: enable 0: disable.*/
|
||||
uint32_t cs_setup: 1; /*spi cs is enable when spi is in ,prepare, phase. 1: enable 0: disable.*/
|
||||
uint32_t ck_i_edge: 1; /*In the slave mode the bit is same as spi_ck_out_edge in master mode. It is combined with spi_miso_delay_mode bits.*/
|
||||
uint32_t ck_out_edge: 1; /*the bit combined with spi_mosi_delay_mode bits to set mosi signal delay mode.*/
|
||||
uint32_t reserved8: 2; /*reserved*/
|
||||
uint32_t rd_byte_order: 1; /*In read-data (MISO) phase 1: big-endian 0: little_endian*/
|
||||
uint32_t wr_byte_order: 1; /*In command address write-data (MOSI) phases 1: big-endian 0: litte_endian*/
|
||||
uint32_t fwrite_dual: 1; /*In the write operations read-data phase apply 2 signals*/
|
||||
uint32_t fwrite_quad: 1; /*In the write operations read-data phase apply 4 signals*/
|
||||
uint32_t fwrite_dio: 1; /*In the write operations address phase and read-data phase apply 2 signals.*/
|
||||
uint32_t fwrite_qio: 1; /*In the write operations address phase and read-data phase apply 4 signals.*/
|
||||
uint32_t sio: 1; /*Set the bit to enable 3-line half duplex communication mosi and miso signals share the same pin. 1: enable 0: disable.*/
|
||||
uint32_t usr_hold_pol: 1; /*It is combined with hold bits to set the polarity of spi hold line 1: spi will be held when spi hold line is high 0: spi will be held when spi hold line is low*/
|
||||
uint32_t usr_dout_hold: 1; /*spi is hold at data out state the bit combined with spi_usr_hold_pol bit.*/
|
||||
uint32_t usr_din_hold: 1; /*spi is hold at data in state the bit combined with spi_usr_hold_pol bit.*/
|
||||
uint32_t usr_dummy_hold: 1; /*spi is hold at dummy state the bit combined with spi_usr_hold_pol bit.*/
|
||||
uint32_t usr_addr_hold: 1; /*spi is hold at address state the bit combined with spi_usr_hold_pol bit.*/
|
||||
uint32_t usr_cmd_hold: 1; /*spi is hold at command state the bit combined with spi_usr_hold_pol bit.*/
|
||||
uint32_t usr_prep_hold: 1; /*spi is hold at prepare state the bit combined with spi_usr_hold_pol bit.*/
|
||||
uint32_t usr_miso_highpart: 1; /*read-data phase only access to high-part of the buffer spi_w8~spi_w15. 1: enable 0: disable.*/
|
||||
uint32_t usr_mosi_highpart: 1; /*write-data phase only access to high-part of the buffer spi_w8~spi_w15. 1: enable 0: disable.*/
|
||||
uint32_t usr_dummy_idle: 1; /*spi clock is disable in dummy phase when the bit is enable.*/
|
||||
uint32_t usr_mosi: 1; /*This bit enable the write-data phase of an operation.*/
|
||||
uint32_t usr_miso: 1; /*This bit enable the read-data phase of an operation.*/
|
||||
uint32_t usr_dummy: 1; /*This bit enable the dummy phase of an operation.*/
|
||||
uint32_t usr_addr: 1; /*This bit enable the address phase of an operation.*/
|
||||
uint32_t usr_command: 1; /*This bit enable the command phase of an operation.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} user;
|
||||
union {
|
||||
struct {
|
||||
uint32_t usr_dummy_cyclelen: 8; /*The length in spi_clk cycles of dummy phase. The register value shall be (cycle_num-1).*/
|
||||
uint32_t reserved8: 18; /*reserved*/
|
||||
uint32_t usr_addr_bitlen: 6; /*The length in bits of address phase. The register value shall be (bit_num-1).*/
|
||||
};
|
||||
uint32_t val;
|
||||
} user1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t usr_command_value: 16; /*The value of command.*/
|
||||
uint32_t reserved16: 12; /*reserved*/
|
||||
uint32_t usr_command_bitlen: 4; /*The length in bits of command phase. The register value shall be (bit_num-1)*/
|
||||
};
|
||||
uint32_t val;
|
||||
} user2;
|
||||
union {
|
||||
struct {
|
||||
uint32_t usr_mosi_dbitlen:24; /*The length in bits of write-data. The register value shall be (bit_num-1).*/
|
||||
uint32_t reserved24: 8; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} mosi_dlen;
|
||||
union {
|
||||
struct {
|
||||
uint32_t usr_miso_dbitlen:24; /*The length in bits of read-data. The register value shall be (bit_num-1).*/
|
||||
uint32_t reserved24: 8; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} miso_dlen;
|
||||
uint32_t slv_wr_status; /*In the slave mode this register are the status register for the master to write into. In the master mode this register are the higher 32bits in the 64 bits address condition.*/
|
||||
union {
|
||||
struct {
|
||||
uint32_t cs0_dis: 1; /*SPI CS0 pin enable, 1: disable CS0, 0: spi_cs0 signal is from/to CS0 pin*/
|
||||
uint32_t cs1_dis: 1; /*SPI CS1 pin enable, 1: disable CS1, 0: spi_cs1 signal is from/to CS1 pin*/
|
||||
uint32_t cs2_dis: 1; /*SPI CS2 pin enable, 1: disable CS2, 0: spi_cs2 signal is from/to CS2 pin*/
|
||||
uint32_t reserved3: 2; /*reserved*/
|
||||
uint32_t ck_dis: 1; /*1: spi clk out disable 0: spi clk out enable*/
|
||||
uint32_t master_cs_pol: 3; /*In the master mode the bits are the polarity of spi cs line the value is equivalent to spi_cs ^ spi_master_cs_pol.*/
|
||||
uint32_t reserved9: 2; /*reserved*/
|
||||
uint32_t master_ck_sel: 3; /*In the master mode spi cs line is enable as spi clk it is combined with spi_cs0_dis spi_cs1_dis spi_cs2_dis.*/
|
||||
uint32_t reserved14: 15; /*reserved*/
|
||||
uint32_t ck_idle_edge: 1; /*1: spi clk line is high when idle 0: spi clk line is low when idle*/
|
||||
uint32_t cs_keep_active: 1; /*spi cs line keep low when the bit is set.*/
|
||||
uint32_t reserved31: 1; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} pin;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rd_buf_done: 1; /*The interrupt raw bit for the completion of read-buffer operation in the slave mode.*/
|
||||
uint32_t wr_buf_done: 1; /*The interrupt raw bit for the completion of write-buffer operation in the slave mode.*/
|
||||
uint32_t rd_sta_done: 1; /*The interrupt raw bit for the completion of read-status operation in the slave mode.*/
|
||||
uint32_t wr_sta_done: 1; /*The interrupt raw bit for the completion of write-status operation in the slave mode.*/
|
||||
uint32_t trans_done: 1; /*The interrupt raw bit for the completion of any operation in both the master mode and the slave mode.*/
|
||||
uint32_t rd_buf_inten: 1; /*The interrupt enable bit for the completion of read-buffer operation in the slave mode.*/
|
||||
uint32_t wr_buf_inten: 1; /*The interrupt enable bit for the completion of write-buffer operation in the slave mode.*/
|
||||
uint32_t rd_sta_inten: 1; /*The interrupt enable bit for the completion of read-status operation in the slave mode.*/
|
||||
uint32_t wr_sta_inten: 1; /*The interrupt enable bit for the completion of write-status operation in the slave mode.*/
|
||||
uint32_t trans_inten: 1; /*The interrupt enable bit for the completion of any operation in both the master mode and the slave mode.*/
|
||||
uint32_t cs_i_mode: 2; /*In the slave mode this bits used to synchronize the input spi cs signal and eliminate spi cs jitter.*/
|
||||
uint32_t reserved12: 5; /*reserved*/
|
||||
uint32_t last_command: 3; /*In the slave mode it is the value of command.*/
|
||||
uint32_t last_state: 3; /*In the slave mode it is the state of spi state machine.*/
|
||||
uint32_t trans_cnt: 4; /*The operations counter in both the master mode and the slave mode. 4: read-status*/
|
||||
uint32_t cmd_define: 1; /*1: slave mode commands are defined in SPI_SLAVE3. 0: slave mode commands are fixed as: 1: write-status 2: write-buffer and 3: read-buffer.*/
|
||||
uint32_t wr_rd_sta_en: 1; /*write and read status enable in the slave mode*/
|
||||
uint32_t wr_rd_buf_en: 1; /*write and read buffer enable in the slave mode*/
|
||||
uint32_t slave_mode: 1; /*1: slave mode 0: master mode.*/
|
||||
uint32_t sync_reset: 1; /*Software reset enable, reset the spi clock line cs line and data lines.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} slave;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rdbuf_dummy_en: 1; /*In the slave mode it is the enable bit of dummy phase for read-buffer operations.*/
|
||||
uint32_t wrbuf_dummy_en: 1; /*In the slave mode it is the enable bit of dummy phase for write-buffer operations.*/
|
||||
uint32_t rdsta_dummy_en: 1; /*In the slave mode it is the enable bit of dummy phase for read-status operations.*/
|
||||
uint32_t wrsta_dummy_en: 1; /*In the slave mode it is the enable bit of dummy phase for write-status operations.*/
|
||||
uint32_t wr_addr_bitlen: 6; /*In the slave mode it is the address length in bits for write-buffer operation. The register value shall be (bit_num-1).*/
|
||||
uint32_t rd_addr_bitlen: 6; /*In the slave mode it is the address length in bits for read-buffer operation. The register value shall be (bit_num-1).*/
|
||||
uint32_t reserved16: 9; /*reserved*/
|
||||
uint32_t status_readback: 1; /*In the slave mode 1:read register of SPI_SLV_WR_STATUS 0: read register of SPI_RD_STATUS.*/
|
||||
uint32_t status_fast_en: 1; /*In the slave mode enable fast read status.*/
|
||||
uint32_t status_bitlen: 5; /*In the slave mode it is the length of status bit.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} slave1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rdsta_dummy_cyclelen: 8; /*In the slave mode it is the length in spi_clk cycles of dummy phase for read-status operations. The register value shall be (cycle_num-1).*/
|
||||
uint32_t wrsta_dummy_cyclelen: 8; /*In the slave mode it is the length in spi_clk cycles of dummy phase for write-status operations. The register value shall be (cycle_num-1).*/
|
||||
uint32_t rdbuf_dummy_cyclelen: 8; /*In the slave mode it is the length in spi_clk cycles of dummy phase for read-buffer operations. The register value shall be (cycle_num-1).*/
|
||||
uint32_t wrbuf_dummy_cyclelen: 8; /*In the slave mode it is the length in spi_clk cycles of dummy phase for write-buffer operations. The register value shall be (cycle_num-1).*/
|
||||
};
|
||||
uint32_t val;
|
||||
} slave2;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rdbuf_cmd_value: 8; /*In the slave mode it is the value of read-buffer command.*/
|
||||
uint32_t wrbuf_cmd_value: 8; /*In the slave mode it is the value of write-buffer command.*/
|
||||
uint32_t rdsta_cmd_value: 8; /*In the slave mode it is the value of read-status command.*/
|
||||
uint32_t wrsta_cmd_value: 8; /*In the slave mode it is the value of write-status command.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} slave3;
|
||||
union {
|
||||
struct {
|
||||
uint32_t bit_len: 24; /*In the slave mode it is the length in bits for write-buffer operations. The register value shall be (bit_num-1).*/
|
||||
uint32_t reserved24: 8; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} slv_wrbuf_dlen;
|
||||
union {
|
||||
struct {
|
||||
uint32_t bit_len: 24; /*In the slave mode it is the length in bits for read-buffer operations. The register value shall be (bit_num-1).*/
|
||||
uint32_t reserved24: 8; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} slv_rdbuf_dlen;
|
||||
union {
|
||||
struct {
|
||||
uint32_t req_en: 1; /*For SPI0 Cache access enable 1: enable 0:disable.*/
|
||||
uint32_t usr_cmd_4byte: 1; /*For SPI0 cache read flash with 4 bytes command 1: enable 0:disable.*/
|
||||
uint32_t flash_usr_cmd: 1; /*For SPI0 cache read flash for user define command 1: enable 0:disable.*/
|
||||
uint32_t flash_pes_en: 1; /*For SPI0 spi1 send suspend command before cache read flash 1: enable 0:disable.*/
|
||||
uint32_t reserved4: 28; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} cache_fctrl;
|
||||
union {
|
||||
struct {
|
||||
uint32_t reserved0: 1; /*reserved*/
|
||||
uint32_t usr_sram_dio: 1; /*For SPI0 In the spi sram mode spi dual I/O mode enable 1: enable 0:disable*/
|
||||
uint32_t usr_sram_qio: 1; /*For SPI0 In the spi sram mode spi quad I/O mode enable 1: enable 0:disable*/
|
||||
uint32_t usr_wr_sram_dummy: 1; /*For SPI0 In the spi sram mode it is the enable bit of dummy phase for write operations.*/
|
||||
uint32_t usr_rd_sram_dummy: 1; /*For SPI0 In the spi sram mode it is the enable bit of dummy phase for read operations.*/
|
||||
uint32_t cache_sram_usr_rcmd: 1; /*For SPI0 In the spi sram mode cache read sram for user define command.*/
|
||||
uint32_t sram_bytes_len: 8; /*For SPI0 In the sram mode it is the byte length of spi read sram data.*/
|
||||
uint32_t sram_dummy_cyclelen: 8; /*For SPI0 In the sram mode it is the length in bits of address phase. The register value shall be (bit_num-1).*/
|
||||
uint32_t sram_addr_bitlen: 6; /*For SPI0 In the sram mode it is the length in bits of address phase. The register value shall be (bit_num-1).*/
|
||||
uint32_t cache_sram_usr_wcmd: 1; /*For SPI0 In the spi sram mode cache write sram for user define command*/
|
||||
uint32_t reserved29: 3; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} cache_sctrl;
|
||||
union {
|
||||
struct {
|
||||
uint32_t dio: 1; /*For SPI0 SRAM DIO mode enable . SRAM DIO enable command will be send when the bit is set. The bit will be cleared once the operation done.*/
|
||||
uint32_t qio: 1; /*For SPI0 SRAM QIO mode enable . SRAM QIO enable command will be send when the bit is set. The bit will be cleared once the operation done.*/
|
||||
uint32_t reserved2: 2; /*For SPI0 SRAM write enable . SRAM write operation will be triggered when the bit is set. The bit will be cleared once the operation done.*/
|
||||
uint32_t rst_io: 1; /*For SPI0 SRAM IO mode reset enable. SRAM IO mode reset operation will be triggered when the bit is set. The bit will be cleared once the operation done*/
|
||||
uint32_t reserved5:27; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} sram_cmd;
|
||||
union {
|
||||
struct {
|
||||
uint32_t usr_rd_cmd_value: 16; /*For SPI0 When cache mode is enable it is the read command value of command phase for SRAM.*/
|
||||
uint32_t reserved16: 12; /*reserved*/
|
||||
uint32_t usr_rd_cmd_bitlen: 4; /*For SPI0 When cache mode is enable it is the length in bits of command phase for SRAM. The register value shall be (bit_num-1).*/
|
||||
};
|
||||
uint32_t val;
|
||||
} sram_drd_cmd;
|
||||
union {
|
||||
struct {
|
||||
uint32_t usr_wr_cmd_value: 16; /*For SPI0 When cache mode is enable it is the write command value of command phase for SRAM.*/
|
||||
uint32_t reserved16: 12; /*reserved*/
|
||||
uint32_t usr_wr_cmd_bitlen: 4; /*For SPI0 When cache mode is enable it is the in bits of command phase for SRAM. The register value shall be (bit_num-1).*/
|
||||
};
|
||||
uint32_t val;
|
||||
} sram_dwr_cmd;
|
||||
union {
|
||||
struct {
|
||||
uint32_t slv_rdata_bit:24; /*In the slave mode it is the bit length of read data. The value is the length - 1.*/
|
||||
uint32_t reserved24: 8; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} slv_rd_bit;
|
||||
uint32_t reserved_68;
|
||||
uint32_t reserved_6c;
|
||||
uint32_t reserved_70;
|
||||
uint32_t reserved_74;
|
||||
uint32_t reserved_78;
|
||||
uint32_t reserved_7c;
|
||||
uint32_t data_buf[16]; /*data buffer*/
|
||||
uint32_t tx_crc; /*For SPI1 the value of crc32 for 256 bits data.*/
|
||||
uint32_t reserved_c4;
|
||||
uint32_t reserved_c8;
|
||||
uint32_t reserved_cc;
|
||||
uint32_t reserved_d0;
|
||||
uint32_t reserved_d4;
|
||||
uint32_t reserved_d8;
|
||||
uint32_t reserved_dc;
|
||||
uint32_t reserved_e0;
|
||||
uint32_t reserved_e4;
|
||||
uint32_t reserved_e8;
|
||||
uint32_t reserved_ec;
|
||||
union {
|
||||
struct {
|
||||
uint32_t t_pp_time: 12; /*page program delay time by system clock.*/
|
||||
uint32_t reserved12: 4; /*reserved*/
|
||||
uint32_t t_pp_shift: 4; /*page program delay time shift .*/
|
||||
uint32_t reserved20:11; /*reserved*/
|
||||
uint32_t t_pp_ena: 1; /*page program delay enable.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} ext0;
|
||||
union {
|
||||
struct {
|
||||
uint32_t t_erase_time: 12; /*erase flash delay time by system clock.*/
|
||||
uint32_t reserved12: 4; /*reserved*/
|
||||
uint32_t t_erase_shift: 4; /*erase flash delay time shift.*/
|
||||
uint32_t reserved20: 11; /*reserved*/
|
||||
uint32_t t_erase_ena: 1; /*erase flash delay enable.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} ext1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t st: 3; /*The status of spi state machine .*/
|
||||
uint32_t reserved3: 29; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} ext2;
|
||||
union {
|
||||
struct {
|
||||
uint32_t int_hold_ena: 2; /*This register is for two SPI masters to share the same cs clock and data signals. The bits of one SPI are set if the other SPI is busy the SPI will be hold. 1(3): hold at ,idle, phase 2: hold at ,prepare, phase.*/
|
||||
uint32_t reserved2: 30; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} ext3;
|
||||
union {
|
||||
struct {
|
||||
uint32_t reserved0: 2; /*reserved*/
|
||||
uint32_t in_rst: 1; /*The bit is used to reset in dma fsm and in data fifo pointer.*/
|
||||
uint32_t out_rst: 1; /*The bit is used to reset out dma fsm and out data fifo pointer.*/
|
||||
uint32_t ahbm_fifo_rst: 1; /*reset spi dma ahb master fifo pointer.*/
|
||||
uint32_t ahbm_rst: 1; /*reset spi dma ahb master.*/
|
||||
uint32_t in_loop_test: 1; /*Set bit to test in link.*/
|
||||
uint32_t out_loop_test: 1; /*Set bit to test out link.*/
|
||||
uint32_t out_auto_wrback: 1; /*when the link is empty jump to next automatically.*/
|
||||
uint32_t out_eof_mode: 1; /*out eof flag generation mode . 1: when dma pop all data from fifo 0:when ahb push all data to fifo.*/
|
||||
uint32_t outdscr_burst_en: 1; /*read descriptor use burst mode when read data for memory.*/
|
||||
uint32_t indscr_burst_en: 1; /*read descriptor use burst mode when write data to memory.*/
|
||||
uint32_t out_data_burst_en: 1; /*spi dma read data from memory in burst mode.*/
|
||||
uint32_t reserved13: 1; /*reserved*/
|
||||
uint32_t dma_rx_stop: 1; /*spi dma read data stop when in continue tx/rx mode.*/
|
||||
uint32_t dma_tx_stop: 1; /*spi dma write data stop when in continue tx/rx mode.*/
|
||||
uint32_t dma_continue: 1; /*spi dma continue tx/rx data.*/
|
||||
uint32_t reserved17: 15; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} dma_conf;
|
||||
union {
|
||||
struct {
|
||||
uint32_t addr: 20; /*The address of the first outlink descriptor.*/
|
||||
uint32_t reserved20: 8; /*reserved*/
|
||||
uint32_t stop: 1; /*Set the bit to stop to use outlink descriptor.*/
|
||||
uint32_t start: 1; /*Set the bit to start to use outlink descriptor.*/
|
||||
uint32_t restart: 1; /*Set the bit to mount on new outlink descriptors.*/
|
||||
uint32_t reserved31: 1; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} dma_out_link;
|
||||
union {
|
||||
struct {
|
||||
uint32_t addr: 20; /*The address of the first inlink descriptor.*/
|
||||
uint32_t auto_ret: 1; /*when the bit is set inlink descriptor returns to the next descriptor while a packet is wrong*/
|
||||
uint32_t reserved21: 7; /*reserved*/
|
||||
uint32_t stop: 1; /*Set the bit to stop to use inlink descriptor.*/
|
||||
uint32_t start: 1; /*Set the bit to start to use inlink descriptor.*/
|
||||
uint32_t restart: 1; /*Set the bit to mount on new inlink descriptors.*/
|
||||
uint32_t reserved31: 1; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} dma_in_link;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rx_en: 1; /*spi dma read data status bit.*/
|
||||
uint32_t tx_en: 1; /*spi dma write data status bit.*/
|
||||
uint32_t reserved2: 30; /*spi dma read data from memory count.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} dma_status;
|
||||
union {
|
||||
struct {
|
||||
uint32_t inlink_dscr_empty: 1; /*The enable bit for lack of enough inlink descriptors.*/
|
||||
uint32_t outlink_dscr_error: 1; /*The enable bit for outlink descriptor error.*/
|
||||
uint32_t inlink_dscr_error: 1; /*The enable bit for inlink descriptor error.*/
|
||||
uint32_t in_done: 1; /*The enable bit for completing usage of a inlink descriptor.*/
|
||||
uint32_t in_err_eof: 1; /*The enable bit for receiving error.*/
|
||||
uint32_t in_suc_eof: 1; /*The enable bit for completing receiving all the packets from host.*/
|
||||
uint32_t out_done: 1; /*The enable bit for completing usage of a outlink descriptor .*/
|
||||
uint32_t out_eof: 1; /*The enable bit for sending a packet to host done.*/
|
||||
uint32_t out_total_eof: 1; /*The enable bit for sending all the packets to host done.*/
|
||||
uint32_t reserved9: 23; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} dma_int_ena;
|
||||
union {
|
||||
struct {
|
||||
uint32_t inlink_dscr_empty: 1; /*The raw bit for lack of enough inlink descriptors.*/
|
||||
uint32_t outlink_dscr_error: 1; /*The raw bit for outlink descriptor error.*/
|
||||
uint32_t inlink_dscr_error: 1; /*The raw bit for inlink descriptor error.*/
|
||||
uint32_t in_done: 1; /*The raw bit for completing usage of a inlink descriptor.*/
|
||||
uint32_t in_err_eof: 1; /*The raw bit for receiving error.*/
|
||||
uint32_t in_suc_eof: 1; /*The raw bit for completing receiving all the packets from host.*/
|
||||
uint32_t out_done: 1; /*The raw bit for completing usage of a outlink descriptor.*/
|
||||
uint32_t out_eof: 1; /*The raw bit for sending a packet to host done.*/
|
||||
uint32_t out_total_eof: 1; /*The raw bit for sending all the packets to host done.*/
|
||||
uint32_t reserved9: 23; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} dma_int_raw;
|
||||
union {
|
||||
struct {
|
||||
uint32_t inlink_dscr_empty: 1; /*The status bit for lack of enough inlink descriptors.*/
|
||||
uint32_t outlink_dscr_error: 1; /*The status bit for outlink descriptor error.*/
|
||||
uint32_t inlink_dscr_error: 1; /*The status bit for inlink descriptor error.*/
|
||||
uint32_t in_done: 1; /*The status bit for completing usage of a inlink descriptor.*/
|
||||
uint32_t in_err_eof: 1; /*The status bit for receiving error.*/
|
||||
uint32_t in_suc_eof: 1; /*The status bit for completing receiving all the packets from host.*/
|
||||
uint32_t out_done: 1; /*The status bit for completing usage of a outlink descriptor.*/
|
||||
uint32_t out_eof: 1; /*The status bit for sending a packet to host done.*/
|
||||
uint32_t out_total_eof: 1; /*The status bit for sending all the packets to host done.*/
|
||||
uint32_t reserved9: 23; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} dma_int_st;
|
||||
union {
|
||||
struct {
|
||||
uint32_t inlink_dscr_empty: 1; /*The clear bit for lack of enough inlink descriptors.*/
|
||||
uint32_t outlink_dscr_error: 1; /*The clear bit for outlink descriptor error.*/
|
||||
uint32_t inlink_dscr_error: 1; /*The clear bit for inlink descriptor error.*/
|
||||
uint32_t in_done: 1; /*The clear bit for completing usage of a inlink descriptor.*/
|
||||
uint32_t in_err_eof: 1; /*The clear bit for receiving error.*/
|
||||
uint32_t in_suc_eof: 1; /*The clear bit for completing receiving all the packets from host.*/
|
||||
uint32_t out_done: 1; /*The clear bit for completing usage of a outlink descriptor.*/
|
||||
uint32_t out_eof: 1; /*The clear bit for sending a packet to host done.*/
|
||||
uint32_t out_total_eof: 1; /*The clear bit for sending all the packets to host done.*/
|
||||
uint32_t reserved9: 23; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} dma_int_clr;
|
||||
uint32_t dma_in_err_eof_des_addr; /*The inlink descriptor address when spi dma produce receiving error.*/
|
||||
uint32_t dma_in_suc_eof_des_addr; /*The last inlink descriptor address when spi dma produce from_suc_eof.*/
|
||||
uint32_t dma_inlink_dscr; /*The content of current in descriptor pointer.*/
|
||||
uint32_t dma_inlink_dscr_bf0; /*The content of next in descriptor pointer.*/
|
||||
uint32_t dma_inlink_dscr_bf1; /*The content of current in descriptor data buffer pointer.*/
|
||||
uint32_t dma_out_eof_bfr_des_addr; /*The address of buffer relative to the outlink descriptor that produce eof.*/
|
||||
uint32_t dma_out_eof_des_addr; /*The last outlink descriptor address when spi dma produce to_eof.*/
|
||||
uint32_t dma_outlink_dscr; /*The content of current out descriptor pointer.*/
|
||||
uint32_t dma_outlink_dscr_bf0; /*The content of next out descriptor pointer.*/
|
||||
uint32_t dma_outlink_dscr_bf1; /*The content of current out descriptor data buffer pointer.*/
|
||||
uint32_t dma_rx_status; /*spi dma read data from memory status.*/
|
||||
uint32_t dma_tx_status; /*spi dma write data to memory status.*/
|
||||
uint32_t reserved_150;
|
||||
uint32_t reserved_154;
|
||||
uint32_t reserved_158;
|
||||
uint32_t reserved_15c;
|
||||
uint32_t reserved_160;
|
||||
uint32_t reserved_164;
|
||||
uint32_t reserved_168;
|
||||
uint32_t reserved_16c;
|
||||
uint32_t reserved_170;
|
||||
uint32_t reserved_174;
|
||||
uint32_t reserved_178;
|
||||
uint32_t reserved_17c;
|
||||
uint32_t reserved_180;
|
||||
uint32_t reserved_184;
|
||||
uint32_t reserved_188;
|
||||
uint32_t reserved_18c;
|
||||
uint32_t reserved_190;
|
||||
uint32_t reserved_194;
|
||||
uint32_t reserved_198;
|
||||
uint32_t reserved_19c;
|
||||
uint32_t reserved_1a0;
|
||||
uint32_t reserved_1a4;
|
||||
uint32_t reserved_1a8;
|
||||
uint32_t reserved_1ac;
|
||||
uint32_t reserved_1b0;
|
||||
uint32_t reserved_1b4;
|
||||
uint32_t reserved_1b8;
|
||||
uint32_t reserved_1bc;
|
||||
uint32_t reserved_1c0;
|
||||
uint32_t reserved_1c4;
|
||||
uint32_t reserved_1c8;
|
||||
uint32_t reserved_1cc;
|
||||
uint32_t reserved_1d0;
|
||||
uint32_t reserved_1d4;
|
||||
uint32_t reserved_1d8;
|
||||
uint32_t reserved_1dc;
|
||||
uint32_t reserved_1e0;
|
||||
uint32_t reserved_1e4;
|
||||
uint32_t reserved_1e8;
|
||||
uint32_t reserved_1ec;
|
||||
uint32_t reserved_1f0;
|
||||
uint32_t reserved_1f4;
|
||||
uint32_t reserved_1f8;
|
||||
uint32_t reserved_1fc;
|
||||
uint32_t reserved_200;
|
||||
uint32_t reserved_204;
|
||||
uint32_t reserved_208;
|
||||
uint32_t reserved_20c;
|
||||
uint32_t reserved_210;
|
||||
uint32_t reserved_214;
|
||||
uint32_t reserved_218;
|
||||
uint32_t reserved_21c;
|
||||
uint32_t reserved_220;
|
||||
uint32_t reserved_224;
|
||||
uint32_t reserved_228;
|
||||
uint32_t reserved_22c;
|
||||
uint32_t reserved_230;
|
||||
uint32_t reserved_234;
|
||||
uint32_t reserved_238;
|
||||
uint32_t reserved_23c;
|
||||
uint32_t reserved_240;
|
||||
uint32_t reserved_244;
|
||||
uint32_t reserved_248;
|
||||
uint32_t reserved_24c;
|
||||
uint32_t reserved_250;
|
||||
uint32_t reserved_254;
|
||||
uint32_t reserved_258;
|
||||
uint32_t reserved_25c;
|
||||
uint32_t reserved_260;
|
||||
uint32_t reserved_264;
|
||||
uint32_t reserved_268;
|
||||
uint32_t reserved_26c;
|
||||
uint32_t reserved_270;
|
||||
uint32_t reserved_274;
|
||||
uint32_t reserved_278;
|
||||
uint32_t reserved_27c;
|
||||
uint32_t reserved_280;
|
||||
uint32_t reserved_284;
|
||||
uint32_t reserved_288;
|
||||
uint32_t reserved_28c;
|
||||
uint32_t reserved_290;
|
||||
uint32_t reserved_294;
|
||||
uint32_t reserved_298;
|
||||
uint32_t reserved_29c;
|
||||
uint32_t reserved_2a0;
|
||||
uint32_t reserved_2a4;
|
||||
uint32_t reserved_2a8;
|
||||
uint32_t reserved_2ac;
|
||||
uint32_t reserved_2b0;
|
||||
uint32_t reserved_2b4;
|
||||
uint32_t reserved_2b8;
|
||||
uint32_t reserved_2bc;
|
||||
uint32_t reserved_2c0;
|
||||
uint32_t reserved_2c4;
|
||||
uint32_t reserved_2c8;
|
||||
uint32_t reserved_2cc;
|
||||
uint32_t reserved_2d0;
|
||||
uint32_t reserved_2d4;
|
||||
uint32_t reserved_2d8;
|
||||
uint32_t reserved_2dc;
|
||||
uint32_t reserved_2e0;
|
||||
uint32_t reserved_2e4;
|
||||
uint32_t reserved_2e8;
|
||||
uint32_t reserved_2ec;
|
||||
uint32_t reserved_2f0;
|
||||
uint32_t reserved_2f4;
|
||||
uint32_t reserved_2f8;
|
||||
uint32_t reserved_2fc;
|
||||
uint32_t reserved_300;
|
||||
uint32_t reserved_304;
|
||||
uint32_t reserved_308;
|
||||
uint32_t reserved_30c;
|
||||
uint32_t reserved_310;
|
||||
uint32_t reserved_314;
|
||||
uint32_t reserved_318;
|
||||
uint32_t reserved_31c;
|
||||
uint32_t reserved_320;
|
||||
uint32_t reserved_324;
|
||||
uint32_t reserved_328;
|
||||
uint32_t reserved_32c;
|
||||
uint32_t reserved_330;
|
||||
uint32_t reserved_334;
|
||||
uint32_t reserved_338;
|
||||
uint32_t reserved_33c;
|
||||
uint32_t reserved_340;
|
||||
uint32_t reserved_344;
|
||||
uint32_t reserved_348;
|
||||
uint32_t reserved_34c;
|
||||
uint32_t reserved_350;
|
||||
uint32_t reserved_354;
|
||||
uint32_t reserved_358;
|
||||
uint32_t reserved_35c;
|
||||
uint32_t reserved_360;
|
||||
uint32_t reserved_364;
|
||||
uint32_t reserved_368;
|
||||
uint32_t reserved_36c;
|
||||
uint32_t reserved_370;
|
||||
uint32_t reserved_374;
|
||||
uint32_t reserved_378;
|
||||
uint32_t reserved_37c;
|
||||
uint32_t reserved_380;
|
||||
uint32_t reserved_384;
|
||||
uint32_t reserved_388;
|
||||
uint32_t reserved_38c;
|
||||
uint32_t reserved_390;
|
||||
uint32_t reserved_394;
|
||||
uint32_t reserved_398;
|
||||
uint32_t reserved_39c;
|
||||
uint32_t reserved_3a0;
|
||||
uint32_t reserved_3a4;
|
||||
uint32_t reserved_3a8;
|
||||
uint32_t reserved_3ac;
|
||||
uint32_t reserved_3b0;
|
||||
uint32_t reserved_3b4;
|
||||
uint32_t reserved_3b8;
|
||||
uint32_t reserved_3bc;
|
||||
uint32_t reserved_3c0;
|
||||
uint32_t reserved_3c4;
|
||||
uint32_t reserved_3c8;
|
||||
uint32_t reserved_3cc;
|
||||
uint32_t reserved_3d0;
|
||||
uint32_t reserved_3d4;
|
||||
uint32_t reserved_3d8;
|
||||
uint32_t reserved_3dc;
|
||||
uint32_t reserved_3e0;
|
||||
uint32_t reserved_3e4;
|
||||
uint32_t reserved_3e8;
|
||||
uint32_t reserved_3ec;
|
||||
uint32_t reserved_3f0;
|
||||
uint32_t reserved_3f4;
|
||||
uint32_t reserved_3f8;
|
||||
union {
|
||||
struct {
|
||||
uint32_t date: 28; /*SPI register version.*/
|
||||
uint32_t reserved28: 4; /*reserved*/
|
||||
};
|
||||
uint32_t val;
|
||||
} date;
|
||||
} spi_dev_t;
|
||||
extern spi_dev_t SPI0; /* SPI0 IS FOR INTERNAL USE*/
|
||||
extern spi_dev_t SPI1;
|
||||
extern spi_dev_t SPI2;
|
||||
extern spi_dev_t SPI3;
|
||||
#endif /* _SOC_SPI_STRUCT_H_ */
|
@ -1,294 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_SYSCON_REG_H_
|
||||
#define _SOC_SYSCON_REG_H_
|
||||
|
||||
#include "soc.h"
|
||||
#define SYSCON_SYSCLK_CONF_REG (DR_REG_SYSCON_BASE + 0x0)
|
||||
/* SYSCON_QUICK_CLK_CHNG : R/W ;bitpos:[13] ;default: 1'b1 ; */
|
||||
/*description: */
|
||||
#define SYSCON_QUICK_CLK_CHNG (BIT(13))
|
||||
#define SYSCON_QUICK_CLK_CHNG_M (BIT(13))
|
||||
#define SYSCON_QUICK_CLK_CHNG_V 0x1
|
||||
#define SYSCON_QUICK_CLK_CHNG_S 13
|
||||
/* SYSCON_RST_TICK_CNT : R/W ;bitpos:[12] ;default: 1'b0 ; */
|
||||
/*description: */
|
||||
#define SYSCON_RST_TICK_CNT (BIT(12))
|
||||
#define SYSCON_RST_TICK_CNT_M (BIT(12))
|
||||
#define SYSCON_RST_TICK_CNT_V 0x1
|
||||
#define SYSCON_RST_TICK_CNT_S 12
|
||||
/* SYSCON_CLK_EN : R/W ;bitpos:[11] ;default: 1'b0 ; */
|
||||
/*description: */
|
||||
#define SYSCON_CLK_EN (BIT(11))
|
||||
#define SYSCON_CLK_EN_M (BIT(11))
|
||||
#define SYSCON_CLK_EN_V 0x1
|
||||
#define SYSCON_CLK_EN_S 11
|
||||
/* SYSCON_CLK_320M_EN : R/W ;bitpos:[10] ;default: 1'b0 ; */
|
||||
/*description: */
|
||||
#define SYSCON_CLK_320M_EN (BIT(10))
|
||||
#define SYSCON_CLK_320M_EN_M (BIT(10))
|
||||
#define SYSCON_CLK_320M_EN_V 0x1
|
||||
#define SYSCON_CLK_320M_EN_S 10
|
||||
/* SYSCON_PRE_DIV_CNT : R/W ;bitpos:[9:0] ;default: 10'h0 ; */
|
||||
/*description: */
|
||||
#define SYSCON_PRE_DIV_CNT 0x000003FF
|
||||
#define SYSCON_PRE_DIV_CNT_M ((SYSCON_PRE_DIV_CNT_V)<<(SYSCON_PRE_DIV_CNT_S))
|
||||
#define SYSCON_PRE_DIV_CNT_V 0x3FF
|
||||
#define SYSCON_PRE_DIV_CNT_S 0
|
||||
|
||||
#define SYSCON_XTAL_TICK_CONF_REG (DR_REG_SYSCON_BASE + 0x4)
|
||||
/* SYSCON_XTAL_TICK_NUM : R/W ;bitpos:[7:0] ;default: 8'd39 ; */
|
||||
/*description: */
|
||||
#define SYSCON_XTAL_TICK_NUM 0x000000FF
|
||||
#define SYSCON_XTAL_TICK_NUM_M ((SYSCON_XTAL_TICK_NUM_V)<<(SYSCON_XTAL_TICK_NUM_S))
|
||||
#define SYSCON_XTAL_TICK_NUM_V 0xFF
|
||||
#define SYSCON_XTAL_TICK_NUM_S 0
|
||||
|
||||
#define SYSCON_PLL_TICK_CONF_REG (DR_REG_SYSCON_BASE + 0x8)
|
||||
/* SYSCON_PLL_TICK_NUM : R/W ;bitpos:[7:0] ;default: 8'd79 ; */
|
||||
/*description: */
|
||||
#define SYSCON_PLL_TICK_NUM 0x000000FF
|
||||
#define SYSCON_PLL_TICK_NUM_M ((SYSCON_PLL_TICK_NUM_V)<<(SYSCON_PLL_TICK_NUM_S))
|
||||
#define SYSCON_PLL_TICK_NUM_V 0xFF
|
||||
#define SYSCON_PLL_TICK_NUM_S 0
|
||||
|
||||
#define SYSCON_CK8M_TICK_CONF_REG (DR_REG_SYSCON_BASE + 0xC)
|
||||
/* SYSCON_CK8M_TICK_NUM : R/W ;bitpos:[7:0] ;default: 8'd11 ; */
|
||||
/*description: */
|
||||
#define SYSCON_CK8M_TICK_NUM 0x000000FF
|
||||
#define SYSCON_CK8M_TICK_NUM_M ((SYSCON_CK8M_TICK_NUM_V)<<(SYSCON_CK8M_TICK_NUM_S))
|
||||
#define SYSCON_CK8M_TICK_NUM_V 0xFF
|
||||
#define SYSCON_CK8M_TICK_NUM_S 0
|
||||
|
||||
#define SYSCON_SARADC_CTRL_REG (DR_REG_SYSCON_BASE + 0x10)
|
||||
/* SYSCON_SARADC_DATA_TO_I2S : R/W ;bitpos:[26] ;default: 1'b0 ; */
|
||||
/*description: 1: I2S input data is from SAR ADC (for DMA) 0: I2S input data
|
||||
is from GPIO matrix*/
|
||||
#define SYSCON_SARADC_DATA_TO_I2S (BIT(26))
|
||||
#define SYSCON_SARADC_DATA_TO_I2S_M (BIT(26))
|
||||
#define SYSCON_SARADC_DATA_TO_I2S_V 0x1
|
||||
#define SYSCON_SARADC_DATA_TO_I2S_S 26
|
||||
/* SYSCON_SARADC_DATA_SAR_SEL : R/W ;bitpos:[25] ;default: 1'b0 ; */
|
||||
/*description: 1: sar_sel will be coded by the MSB of the 16-bit output data
|
||||
in this case the resolution should not be larger than 11 bits.*/
|
||||
#define SYSCON_SARADC_DATA_SAR_SEL (BIT(25))
|
||||
#define SYSCON_SARADC_DATA_SAR_SEL_M (BIT(25))
|
||||
#define SYSCON_SARADC_DATA_SAR_SEL_V 0x1
|
||||
#define SYSCON_SARADC_DATA_SAR_SEL_S 25
|
||||
/* SYSCON_SARADC_SAR2_PATT_P_CLEAR : R/W ;bitpos:[24] ;default: 1'd0 ; */
|
||||
/*description: clear the pointer of pattern table for DIG ADC2 CTRL*/
|
||||
#define SYSCON_SARADC_SAR2_PATT_P_CLEAR (BIT(24))
|
||||
#define SYSCON_SARADC_SAR2_PATT_P_CLEAR_M (BIT(24))
|
||||
#define SYSCON_SARADC_SAR2_PATT_P_CLEAR_V 0x1
|
||||
#define SYSCON_SARADC_SAR2_PATT_P_CLEAR_S 24
|
||||
/* SYSCON_SARADC_SAR1_PATT_P_CLEAR : R/W ;bitpos:[23] ;default: 1'd0 ; */
|
||||
/*description: clear the pointer of pattern table for DIG ADC1 CTRL*/
|
||||
#define SYSCON_SARADC_SAR1_PATT_P_CLEAR (BIT(23))
|
||||
#define SYSCON_SARADC_SAR1_PATT_P_CLEAR_M (BIT(23))
|
||||
#define SYSCON_SARADC_SAR1_PATT_P_CLEAR_V 0x1
|
||||
#define SYSCON_SARADC_SAR1_PATT_P_CLEAR_S 23
|
||||
/* SYSCON_SARADC_SAR2_PATT_LEN : R/W ;bitpos:[22:19] ;default: 4'd15 ; */
|
||||
/*description: 0 ~ 15 means length 1 ~ 16*/
|
||||
#define SYSCON_SARADC_SAR2_PATT_LEN 0x0000000F
|
||||
#define SYSCON_SARADC_SAR2_PATT_LEN_M ((SYSCON_SARADC_SAR2_PATT_LEN_V)<<(SYSCON_SARADC_SAR2_PATT_LEN_S))
|
||||
#define SYSCON_SARADC_SAR2_PATT_LEN_V 0xF
|
||||
#define SYSCON_SARADC_SAR2_PATT_LEN_S 19
|
||||
/* SYSCON_SARADC_SAR1_PATT_LEN : R/W ;bitpos:[18:15] ;default: 4'd15 ; */
|
||||
/*description: 0 ~ 15 means length 1 ~ 16*/
|
||||
#define SYSCON_SARADC_SAR1_PATT_LEN 0x0000000F
|
||||
#define SYSCON_SARADC_SAR1_PATT_LEN_M ((SYSCON_SARADC_SAR1_PATT_LEN_V)<<(SYSCON_SARADC_SAR1_PATT_LEN_S))
|
||||
#define SYSCON_SARADC_SAR1_PATT_LEN_V 0xF
|
||||
#define SYSCON_SARADC_SAR1_PATT_LEN_S 15
|
||||
/* SYSCON_SARADC_SAR_CLK_DIV : R/W ;bitpos:[14:7] ;default: 8'd4 ; */
|
||||
/*description: SAR clock divider*/
|
||||
#define SYSCON_SARADC_SAR_CLK_DIV 0x000000FF
|
||||
#define SYSCON_SARADC_SAR_CLK_DIV_M ((SYSCON_SARADC_SAR_CLK_DIV_V)<<(SYSCON_SARADC_SAR_CLK_DIV_S))
|
||||
#define SYSCON_SARADC_SAR_CLK_DIV_V 0xFF
|
||||
#define SYSCON_SARADC_SAR_CLK_DIV_S 7
|
||||
/* SYSCON_SARADC_SAR_CLK_GATED : R/W ;bitpos:[6] ;default: 1'b1 ; */
|
||||
/*description: */
|
||||
#define SYSCON_SARADC_SAR_CLK_GATED (BIT(6))
|
||||
#define SYSCON_SARADC_SAR_CLK_GATED_M (BIT(6))
|
||||
#define SYSCON_SARADC_SAR_CLK_GATED_V 0x1
|
||||
#define SYSCON_SARADC_SAR_CLK_GATED_S 6
|
||||
/* SYSCON_SARADC_SAR_SEL : R/W ;bitpos:[5] ;default: 1'd0 ; */
|
||||
/*description: 0: SAR1 1: SAR2 only work for single SAR mode*/
|
||||
#define SYSCON_SARADC_SAR_SEL (BIT(5))
|
||||
#define SYSCON_SARADC_SAR_SEL_M (BIT(5))
|
||||
#define SYSCON_SARADC_SAR_SEL_V 0x1
|
||||
#define SYSCON_SARADC_SAR_SEL_S 5
|
||||
/* SYSCON_SARADC_WORK_MODE : R/W ;bitpos:[4:3] ;default: 2'd0 ; */
|
||||
/*description: 0: single mode 1: double mode 2: alternate mode*/
|
||||
#define SYSCON_SARADC_WORK_MODE 0x00000003
|
||||
#define SYSCON_SARADC_WORK_MODE_M ((SYSCON_SARADC_WORK_MODE_V)<<(SYSCON_SARADC_WORK_MODE_S))
|
||||
#define SYSCON_SARADC_WORK_MODE_V 0x3
|
||||
#define SYSCON_SARADC_WORK_MODE_S 3
|
||||
/* SYSCON_SARADC_SAR2_MUX : R/W ;bitpos:[2] ;default: 1'd0 ; */
|
||||
/*description: 1: SAR ADC2 is controlled by DIG ADC2 CTRL 0: SAR ADC2 is controlled
|
||||
by PWDET CTRL*/
|
||||
#define SYSCON_SARADC_SAR2_MUX (BIT(2))
|
||||
#define SYSCON_SARADC_SAR2_MUX_M (BIT(2))
|
||||
#define SYSCON_SARADC_SAR2_MUX_V 0x1
|
||||
#define SYSCON_SARADC_SAR2_MUX_S 2
|
||||
/* SYSCON_SARADC_START : R/W ;bitpos:[1] ;default: 1'd0 ; */
|
||||
/*description: */
|
||||
#define SYSCON_SARADC_START (BIT(1))
|
||||
#define SYSCON_SARADC_START_M (BIT(1))
|
||||
#define SYSCON_SARADC_START_V 0x1
|
||||
#define SYSCON_SARADC_START_S 1
|
||||
/* SYSCON_SARADC_START_FORCE : R/W ;bitpos:[0] ;default: 1'd0 ; */
|
||||
/*description: */
|
||||
#define SYSCON_SARADC_START_FORCE (BIT(0))
|
||||
#define SYSCON_SARADC_START_FORCE_M (BIT(0))
|
||||
#define SYSCON_SARADC_START_FORCE_V 0x1
|
||||
#define SYSCON_SARADC_START_FORCE_S 0
|
||||
|
||||
#define SYSCON_SARADC_CTRL2_REG (DR_REG_SYSCON_BASE + 0x14)
|
||||
/* SYSCON_SARADC_SAR2_INV : R/W ;bitpos:[10] ;default: 1'd0 ; */
|
||||
/*description: 1: data to DIG ADC2 CTRL is inverted otherwise not*/
|
||||
#define SYSCON_SARADC_SAR2_INV (BIT(10))
|
||||
#define SYSCON_SARADC_SAR2_INV_M (BIT(10))
|
||||
#define SYSCON_SARADC_SAR2_INV_V 0x1
|
||||
#define SYSCON_SARADC_SAR2_INV_S 10
|
||||
/* SYSCON_SARADC_SAR1_INV : R/W ;bitpos:[9] ;default: 1'd0 ; */
|
||||
/*description: 1: data to DIG ADC1 CTRL is inverted otherwise not*/
|
||||
#define SYSCON_SARADC_SAR1_INV (BIT(9))
|
||||
#define SYSCON_SARADC_SAR1_INV_M (BIT(9))
|
||||
#define SYSCON_SARADC_SAR1_INV_V 0x1
|
||||
#define SYSCON_SARADC_SAR1_INV_S 9
|
||||
/* SYSCON_SARADC_MAX_MEAS_NUM : R/W ;bitpos:[8:1] ;default: 8'd255 ; */
|
||||
/*description: max conversion number*/
|
||||
#define SYSCON_SARADC_MAX_MEAS_NUM 0x000000FF
|
||||
#define SYSCON_SARADC_MAX_MEAS_NUM_M ((SYSCON_SARADC_MAX_MEAS_NUM_V)<<(SYSCON_SARADC_MAX_MEAS_NUM_S))
|
||||
#define SYSCON_SARADC_MAX_MEAS_NUM_V 0xFF
|
||||
#define SYSCON_SARADC_MAX_MEAS_NUM_S 1
|
||||
/* SYSCON_SARADC_MEAS_NUM_LIMIT : R/W ;bitpos:[0] ;default: 1'd0 ; */
|
||||
/*description: */
|
||||
#define SYSCON_SARADC_MEAS_NUM_LIMIT (BIT(0))
|
||||
#define SYSCON_SARADC_MEAS_NUM_LIMIT_M (BIT(0))
|
||||
#define SYSCON_SARADC_MEAS_NUM_LIMIT_V 0x1
|
||||
#define SYSCON_SARADC_MEAS_NUM_LIMIT_S 0
|
||||
|
||||
#define SYSCON_SARADC_FSM_REG (DR_REG_SYSCON_BASE + 0x18)
|
||||
/* SYSCON_SARADC_SAMPLE_CYCLE : R/W ;bitpos:[31:24] ;default: 8'd2 ; */
|
||||
/*description: sample cycles*/
|
||||
#define SYSCON_SARADC_SAMPLE_CYCLE 0x000000FF
|
||||
#define SYSCON_SARADC_SAMPLE_CYCLE_M ((SYSCON_SARADC_SAMPLE_CYCLE_V)<<(SYSCON_SARADC_SAMPLE_CYCLE_S))
|
||||
#define SYSCON_SARADC_SAMPLE_CYCLE_V 0xFF
|
||||
#define SYSCON_SARADC_SAMPLE_CYCLE_S 24
|
||||
/* SYSCON_SARADC_START_WAIT : R/W ;bitpos:[23:16] ;default: 8'd8 ; */
|
||||
/*description: */
|
||||
#define SYSCON_SARADC_START_WAIT 0x000000FF
|
||||
#define SYSCON_SARADC_START_WAIT_M ((SYSCON_SARADC_START_WAIT_V)<<(SYSCON_SARADC_START_WAIT_S))
|
||||
#define SYSCON_SARADC_START_WAIT_V 0xFF
|
||||
#define SYSCON_SARADC_START_WAIT_S 16
|
||||
/* SYSCON_SARADC_STANDBY_WAIT : R/W ;bitpos:[15:8] ;default: 8'd255 ; */
|
||||
/*description: */
|
||||
#define SYSCON_SARADC_STANDBY_WAIT 0x000000FF
|
||||
#define SYSCON_SARADC_STANDBY_WAIT_M ((SYSCON_SARADC_STANDBY_WAIT_V)<<(SYSCON_SARADC_STANDBY_WAIT_S))
|
||||
#define SYSCON_SARADC_STANDBY_WAIT_V 0xFF
|
||||
#define SYSCON_SARADC_STANDBY_WAIT_S 8
|
||||
/* SYSCON_SARADC_RSTB_WAIT : R/W ;bitpos:[7:0] ;default: 8'd8 ; */
|
||||
/*description: */
|
||||
#define SYSCON_SARADC_RSTB_WAIT 0x000000FF
|
||||
#define SYSCON_SARADC_RSTB_WAIT_M ((SYSCON_SARADC_RSTB_WAIT_V)<<(SYSCON_SARADC_RSTB_WAIT_S))
|
||||
#define SYSCON_SARADC_RSTB_WAIT_V 0xFF
|
||||
#define SYSCON_SARADC_RSTB_WAIT_S 0
|
||||
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB1_REG (DR_REG_SYSCON_BASE + 0x1C)
|
||||
/* SYSCON_SARADC_SAR1_PATT_TAB1 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */
|
||||
/*description: item 0 ~ 3 for pattern table 1 (each item one byte)*/
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB1 0xFFFFFFFF
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB1_M ((SYSCON_SARADC_SAR1_PATT_TAB1_V)<<(SYSCON_SARADC_SAR1_PATT_TAB1_S))
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB1_V 0xFFFFFFFF
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB1_S 0
|
||||
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB2_REG (DR_REG_SYSCON_BASE + 0x20)
|
||||
/* SYSCON_SARADC_SAR1_PATT_TAB2 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */
|
||||
/*description: Item 4 ~ 7 for pattern table 1 (each item one byte)*/
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB2 0xFFFFFFFF
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB2_M ((SYSCON_SARADC_SAR1_PATT_TAB2_V)<<(SYSCON_SARADC_SAR1_PATT_TAB2_S))
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB2_V 0xFFFFFFFF
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB2_S 0
|
||||
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB3_REG (DR_REG_SYSCON_BASE + 0x24)
|
||||
/* SYSCON_SARADC_SAR1_PATT_TAB3 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */
|
||||
/*description: Item 8 ~ 11 for pattern table 1 (each item one byte)*/
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB3 0xFFFFFFFF
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB3_M ((SYSCON_SARADC_SAR1_PATT_TAB3_V)<<(SYSCON_SARADC_SAR1_PATT_TAB3_S))
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB3_V 0xFFFFFFFF
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB3_S 0
|
||||
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB4_REG (DR_REG_SYSCON_BASE + 0x28)
|
||||
/* SYSCON_SARADC_SAR1_PATT_TAB4 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */
|
||||
/*description: Item 12 ~ 15 for pattern table 1 (each item one byte)*/
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB4 0xFFFFFFFF
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB4_M ((SYSCON_SARADC_SAR1_PATT_TAB4_V)<<(SYSCON_SARADC_SAR1_PATT_TAB4_S))
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB4_V 0xFFFFFFFF
|
||||
#define SYSCON_SARADC_SAR1_PATT_TAB4_S 0
|
||||
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB1_REG (DR_REG_SYSCON_BASE + 0x2C)
|
||||
/* SYSCON_SARADC_SAR2_PATT_TAB1 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */
|
||||
/*description: item 0 ~ 3 for pattern table 2 (each item one byte)*/
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB1 0xFFFFFFFF
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB1_M ((SYSCON_SARADC_SAR2_PATT_TAB1_V)<<(SYSCON_SARADC_SAR2_PATT_TAB1_S))
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB1_V 0xFFFFFFFF
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB1_S 0
|
||||
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB2_REG (DR_REG_SYSCON_BASE + 0x30)
|
||||
/* SYSCON_SARADC_SAR2_PATT_TAB2 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */
|
||||
/*description: Item 4 ~ 7 for pattern table 2 (each item one byte)*/
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB2 0xFFFFFFFF
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB2_M ((SYSCON_SARADC_SAR2_PATT_TAB2_V)<<(SYSCON_SARADC_SAR2_PATT_TAB2_S))
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB2_V 0xFFFFFFFF
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB2_S 0
|
||||
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB3_REG (DR_REG_SYSCON_BASE + 0x34)
|
||||
/* SYSCON_SARADC_SAR2_PATT_TAB3 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */
|
||||
/*description: Item 8 ~ 11 for pattern table 2 (each item one byte)*/
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB3 0xFFFFFFFF
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB3_M ((SYSCON_SARADC_SAR2_PATT_TAB3_V)<<(SYSCON_SARADC_SAR2_PATT_TAB3_S))
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB3_V 0xFFFFFFFF
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB3_S 0
|
||||
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB4_REG (DR_REG_SYSCON_BASE + 0x38)
|
||||
/* SYSCON_SARADC_SAR2_PATT_TAB4 : R/W ;bitpos:[31:0] ;default: 32'hf0f0f0f ; */
|
||||
/*description: Item 12 ~ 15 for pattern table 2 (each item one byte)*/
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB4 0xFFFFFFFF
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB4_M ((SYSCON_SARADC_SAR2_PATT_TAB4_V)<<(SYSCON_SARADC_SAR2_PATT_TAB4_S))
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB4_V 0xFFFFFFFF
|
||||
#define SYSCON_SARADC_SAR2_PATT_TAB4_S 0
|
||||
|
||||
#define SYSCON_APLL_TICK_CONF_REG (DR_REG_SYSCON_BASE + 0x3C)
|
||||
/* SYSCON_APLL_TICK_NUM : R/W ;bitpos:[7:0] ;default: 8'd99 ; */
|
||||
/*description: */
|
||||
#define SYSCON_APLL_TICK_NUM 0x000000FF
|
||||
#define SYSCON_APLL_TICK_NUM_M ((SYSCON_APLL_TICK_NUM_V)<<(SYSCON_APLL_TICK_NUM_S))
|
||||
#define SYSCON_APLL_TICK_NUM_V 0xFF
|
||||
#define SYSCON_APLL_TICK_NUM_S 0
|
||||
|
||||
#define SYSCON_DATE_REG (DR_REG_SYSCON_BASE + 0x7C)
|
||||
/* SYSCON_DATE : R/W ;bitpos:[31:0] ;default: 32'h16042000 ; */
|
||||
/*description: */
|
||||
#define SYSCON_DATE 0xFFFFFFFF
|
||||
#define SYSCON_DATE_M ((SYSCON_DATE_V)<<(SYSCON_DATE_S))
|
||||
#define SYSCON_DATE_V 0xFFFFFFFF
|
||||
#define SYSCON_DATE_S 0
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /*_SOC_SYSCON_REG_H_ */
|
||||
|
||||
|
@ -1,120 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_SYSCON_STRUCT_H_
|
||||
#define _SOC_SYSCON_STRUCT_H_
|
||||
typedef struct {
|
||||
union {
|
||||
struct {
|
||||
volatile uint32_t pre_div: 10;
|
||||
volatile uint32_t clk_320m_en: 1;
|
||||
volatile uint32_t clk_en: 1;
|
||||
volatile uint32_t rst_tick: 1;
|
||||
volatile uint32_t quick_clk_chng: 1;
|
||||
volatile uint32_t reserved14: 18;
|
||||
};
|
||||
volatile uint32_t val;
|
||||
}clk_conf;
|
||||
union {
|
||||
struct {
|
||||
volatile uint32_t xtal_tick: 8;
|
||||
volatile uint32_t reserved8: 24;
|
||||
};
|
||||
volatile uint32_t val;
|
||||
}xtal_tick_conf;
|
||||
union {
|
||||
struct {
|
||||
volatile uint32_t pll_tick: 8;
|
||||
volatile uint32_t reserved8: 24;
|
||||
};
|
||||
volatile uint32_t val;
|
||||
}pll_tick_conf;
|
||||
union {
|
||||
struct {
|
||||
volatile uint32_t ck8m_tick: 8;
|
||||
volatile uint32_t reserved8: 24;
|
||||
};
|
||||
volatile uint32_t val;
|
||||
}ck8m_tick_conf;
|
||||
union {
|
||||
struct {
|
||||
volatile uint32_t start_force: 1;
|
||||
volatile uint32_t start: 1;
|
||||
volatile uint32_t sar2_mux: 1; /*1: SAR ADC2 is controlled by DIG ADC2 CTRL 0: SAR ADC2 is controlled by PWDET CTRL*/
|
||||
volatile uint32_t work_mode: 2; /*0: single mode 1: double mode 2: alternate mode*/
|
||||
volatile uint32_t sar_sel: 1; /*0: SAR1 1: SAR2 only work for single SAR mode*/
|
||||
volatile uint32_t sar_clk_gated: 1;
|
||||
volatile uint32_t sar_clk_div: 8; /*SAR clock divider*/
|
||||
volatile uint32_t sar1_patt_len: 4; /*0 ~ 15 means length 1 ~ 16*/
|
||||
volatile uint32_t sar2_patt_len: 4; /*0 ~ 15 means length 1 ~ 16*/
|
||||
volatile uint32_t sar1_patt_p_clear: 1; /*clear the pointer of pattern table for DIG ADC1 CTRL*/
|
||||
volatile uint32_t sar2_patt_p_clear: 1; /*clear the pointer of pattern table for DIG ADC2 CTRL*/
|
||||
volatile uint32_t data_sar_sel: 1; /*1: sar_sel will be coded by the MSB of the 16-bit output data in this case the resolution should not be larger than 11 bits.*/
|
||||
volatile uint32_t data_to_i2s: 1; /*1: I2S input data is from SAR ADC (for DMA) 0: I2S input data is from GPIO matrix*/
|
||||
volatile uint32_t reserved27: 5;
|
||||
};
|
||||
volatile uint32_t val;
|
||||
}saradc_ctrl;
|
||||
union {
|
||||
struct {
|
||||
volatile uint32_t meas_num_limit: 1;
|
||||
volatile uint32_t max_meas_num: 8; /*max conversion number*/
|
||||
volatile uint32_t sar1_inv: 1; /*1: data to DIG ADC1 CTRL is inverted otherwise not*/
|
||||
volatile uint32_t sar2_inv: 1; /*1: data to DIG ADC2 CTRL is inverted otherwise not*/
|
||||
volatile uint32_t reserved11: 21;
|
||||
};
|
||||
volatile uint32_t val;
|
||||
}saradc_ctrl2;
|
||||
union {
|
||||
struct {
|
||||
volatile uint32_t rstb_wait: 8;
|
||||
volatile uint32_t standby_wait: 8;
|
||||
volatile uint32_t start_wait: 8;
|
||||
volatile uint32_t sample_cycle: 8; /*sample cycles*/
|
||||
};
|
||||
volatile uint32_t val;
|
||||
}saradc_fsm;
|
||||
volatile uint32_t saradc_sar1_patt_tab1; /*item 0 ~ 3 for pattern table 1 (each item one byte)*/
|
||||
volatile uint32_t saradc_sar1_patt_tab2; /*Item 4 ~ 7 for pattern table 1 (each item one byte)*/
|
||||
volatile uint32_t saradc_sar1_patt_tab3; /*Item 8 ~ 11 for pattern table 1 (each item one byte)*/
|
||||
volatile uint32_t saradc_sar1_patt_tab4; /*Item 12 ~ 15 for pattern table 1 (each item one byte)*/
|
||||
volatile uint32_t saradc_sar2_patt_tab1; /*item 0 ~ 3 for pattern table 2 (each item one byte)*/
|
||||
volatile uint32_t saradc_sar2_patt_tab2; /*Item 4 ~ 7 for pattern table 2 (each item one byte)*/
|
||||
volatile uint32_t saradc_sar2_patt_tab3; /*Item 8 ~ 11 for pattern table 2 (each item one byte)*/
|
||||
volatile uint32_t saradc_sar2_patt_tab4; /*Item 12 ~ 15 for pattern table 2 (each item one byte)*/
|
||||
union {
|
||||
struct {
|
||||
volatile uint32_t apll_tick: 8;
|
||||
volatile uint32_t reserved8: 24;
|
||||
};
|
||||
volatile uint32_t val;
|
||||
}apll_tick_conf;
|
||||
volatile uint32_t reserved_40;
|
||||
volatile uint32_t reserved_44;
|
||||
volatile uint32_t reserved_48;
|
||||
volatile uint32_t reserved_4c;
|
||||
volatile uint32_t reserved_50;
|
||||
volatile uint32_t reserved_54;
|
||||
volatile uint32_t reserved_58;
|
||||
volatile uint32_t reserved_5c;
|
||||
volatile uint32_t reserved_60;
|
||||
volatile uint32_t reserved_64;
|
||||
volatile uint32_t reserved_68;
|
||||
volatile uint32_t reserved_6c;
|
||||
volatile uint32_t reserved_70;
|
||||
volatile uint32_t reserved_74;
|
||||
volatile uint32_t reserved_78;
|
||||
volatile uint32_t date; /**/
|
||||
} syscon_dev_t;
|
||||
|
||||
#endif /* _SOC_SYSCON_STRUCT_H_ */
|
@ -1,668 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef __TIMG_REG_H__
|
||||
#define __TIMG_REG_H__
|
||||
#include "soc.h"
|
||||
|
||||
/* The value that needs to be written to TIMG_WDT_WKEY to write-enable the wdt registers */
|
||||
#define TIMG_WDT_WKEY_VALUE 0x50D83AA1
|
||||
|
||||
/* Possible values for TIMG_WDT_STGx */
|
||||
#define TIMG_WDT_STG_SEL_OFF 0
|
||||
#define TIMG_WDT_STG_SEL_INT 1
|
||||
#define TIMG_WDT_STG_SEL_RESET_CPU 2
|
||||
#define TIMG_WDT_STG_SEL_RESET_SYSTEM 3
|
||||
|
||||
|
||||
#define REG_TIMG_BASE(i) (DR_REG_TIMERGROUP0_BASE + i*0x1000)
|
||||
#define TIMG_T0CONFIG_REG(i) (REG_TIMG_BASE(i) + 0x0000)
|
||||
/* TIMG_T0_EN : R/W ;bitpos:[31] ;default: 1'h0 ; */
|
||||
/*description: When set timer 0 time-base counter is enabled*/
|
||||
#define TIMG_T0_EN (BIT(31))
|
||||
#define TIMG_T0_EN_M (BIT(31))
|
||||
#define TIMG_T0_EN_V 0x1
|
||||
#define TIMG_T0_EN_S 31
|
||||
/* TIMG_T0_INCREASE : R/W ;bitpos:[30] ;default: 1'h1 ; */
|
||||
/*description: When set timer 0 time-base counter increment. When cleared timer
|
||||
0 time-base counter decrement.*/
|
||||
#define TIMG_T0_INCREASE (BIT(30))
|
||||
#define TIMG_T0_INCREASE_M (BIT(30))
|
||||
#define TIMG_T0_INCREASE_V 0x1
|
||||
#define TIMG_T0_INCREASE_S 30
|
||||
/* TIMG_T0_AUTORELOAD : R/W ;bitpos:[29] ;default: 1'h1 ; */
|
||||
/*description: When set timer 0 auto-reload at alarming is enabled*/
|
||||
#define TIMG_T0_AUTORELOAD (BIT(29))
|
||||
#define TIMG_T0_AUTORELOAD_M (BIT(29))
|
||||
#define TIMG_T0_AUTORELOAD_V 0x1
|
||||
#define TIMG_T0_AUTORELOAD_S 29
|
||||
/* TIMG_T0_DIVIDER : R/W ;bitpos:[28:13] ;default: 16'h1 ; */
|
||||
/*description: Timer 0 clock (T0_clk) prescale value.*/
|
||||
#define TIMG_T0_DIVIDER 0x0000FFFF
|
||||
#define TIMG_T0_DIVIDER_M ((TIMG_T0_DIVIDER_V)<<(TIMG_T0_DIVIDER_S))
|
||||
#define TIMG_T0_DIVIDER_V 0xFFFF
|
||||
#define TIMG_T0_DIVIDER_S 13
|
||||
/* TIMG_T0_EDGE_INT_EN : R/W ;bitpos:[12] ;default: 1'h0 ; */
|
||||
/*description: When set edge type interrupt will be generated during alarm*/
|
||||
#define TIMG_T0_EDGE_INT_EN (BIT(12))
|
||||
#define TIMG_T0_EDGE_INT_EN_M (BIT(12))
|
||||
#define TIMG_T0_EDGE_INT_EN_V 0x1
|
||||
#define TIMG_T0_EDGE_INT_EN_S 12
|
||||
/* TIMG_T0_LEVEL_INT_EN : R/W ;bitpos:[11] ;default: 1'h0 ; */
|
||||
/*description: When set level type interrupt will be generated during alarm*/
|
||||
#define TIMG_T0_LEVEL_INT_EN (BIT(11))
|
||||
#define TIMG_T0_LEVEL_INT_EN_M (BIT(11))
|
||||
#define TIMG_T0_LEVEL_INT_EN_V 0x1
|
||||
#define TIMG_T0_LEVEL_INT_EN_S 11
|
||||
/* TIMG_T0_ALARM_EN : R/W ;bitpos:[10] ;default: 1'h0 ; */
|
||||
/*description: When set alarm is enabled*/
|
||||
#define TIMG_T0_ALARM_EN (BIT(10))
|
||||
#define TIMG_T0_ALARM_EN_M (BIT(10))
|
||||
#define TIMG_T0_ALARM_EN_V 0x1
|
||||
#define TIMG_T0_ALARM_EN_S 10
|
||||
|
||||
#define TIMG_T0LO_REG(i) (REG_TIMG_BASE(i) + 0x0004)
|
||||
/* TIMG_T0_LO : RO ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: Register to store timer 0 time-base counter current value lower 32 bits.*/
|
||||
#define TIMG_T0_LO 0xFFFFFFFF
|
||||
#define TIMG_T0_LO_M ((TIMG_T0_LO_V)<<(TIMG_T0_LO_S))
|
||||
#define TIMG_T0_LO_V 0xFFFFFFFF
|
||||
#define TIMG_T0_LO_S 0
|
||||
|
||||
#define TIMG_T0HI_REG(i) (REG_TIMG_BASE(i) + 0x0008)
|
||||
/* TIMG_T0_HI : RO ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: Register to store timer 0 time-base counter current value higher 32 bits.*/
|
||||
#define TIMG_T0_HI 0xFFFFFFFF
|
||||
#define TIMG_T0_HI_M ((TIMG_T0_HI_V)<<(TIMG_T0_HI_S))
|
||||
#define TIMG_T0_HI_V 0xFFFFFFFF
|
||||
#define TIMG_T0_HI_S 0
|
||||
|
||||
#define TIMG_T0UPDATE_REG(i) (REG_TIMG_BASE(i) + 0x000c)
|
||||
/* TIMG_T0_UPDATE : WO ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: Write any value will trigger a timer 0 time-base counter value
|
||||
update (timer 0 current value will be stored in registers above)*/
|
||||
#define TIMG_T0_UPDATE 0xFFFFFFFF
|
||||
#define TIMG_T0_UPDATE_M ((TIMG_T0_UPDATE_V)<<(TIMG_T0_UPDATE_S))
|
||||
#define TIMG_T0_UPDATE_V 0xFFFFFFFF
|
||||
#define TIMG_T0_UPDATE_S 0
|
||||
|
||||
#define TIMG_T0ALARMLO_REG(i) (REG_TIMG_BASE(i) + 0x0010)
|
||||
/* TIMG_T0_ALARM_LO : R/W ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: Timer 0 time-base counter value lower 32 bits that will trigger the alarm*/
|
||||
#define TIMG_T0_ALARM_LO 0xFFFFFFFF
|
||||
#define TIMG_T0_ALARM_LO_M ((TIMG_T0_ALARM_LO_V)<<(TIMG_T0_ALARM_LO_S))
|
||||
#define TIMG_T0_ALARM_LO_V 0xFFFFFFFF
|
||||
#define TIMG_T0_ALARM_LO_S 0
|
||||
|
||||
#define TIMG_T0ALARMHI_REG(i) (REG_TIMG_BASE(i) + 0x0014)
|
||||
/* TIMG_T0_ALARM_HI : R/W ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: Timer 0 time-base counter value higher 32 bits that will trigger the alarm*/
|
||||
#define TIMG_T0_ALARM_HI 0xFFFFFFFF
|
||||
#define TIMG_T0_ALARM_HI_M ((TIMG_T0_ALARM_HI_V)<<(TIMG_T0_ALARM_HI_S))
|
||||
#define TIMG_T0_ALARM_HI_V 0xFFFFFFFF
|
||||
#define TIMG_T0_ALARM_HI_S 0
|
||||
|
||||
#define TIMG_T0LOADLO_REG(i) (REG_TIMG_BASE(i) + 0x0018)
|
||||
/* TIMG_T0_LOAD_LO : R/W ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: Lower 32 bits of the value that will load into timer 0 time-base counter*/
|
||||
#define TIMG_T0_LOAD_LO 0xFFFFFFFF
|
||||
#define TIMG_T0_LOAD_LO_M ((TIMG_T0_LOAD_LO_V)<<(TIMG_T0_LOAD_LO_S))
|
||||
#define TIMG_T0_LOAD_LO_V 0xFFFFFFFF
|
||||
#define TIMG_T0_LOAD_LO_S 0
|
||||
|
||||
#define TIMG_T0LOADHI_REG(i) (REG_TIMG_BASE(i) + 0x001c)
|
||||
/* TIMG_T0_LOAD_HI : R/W ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: higher 32 bits of the value that will load into timer 0 time-base counter*/
|
||||
#define TIMG_T0_LOAD_HI 0xFFFFFFFF
|
||||
#define TIMG_T0_LOAD_HI_M ((TIMG_T0_LOAD_HI_V)<<(TIMG_T0_LOAD_HI_S))
|
||||
#define TIMG_T0_LOAD_HI_V 0xFFFFFFFF
|
||||
#define TIMG_T0_LOAD_HI_S 0
|
||||
|
||||
#define TIMG_T0LOAD_REG(i) (REG_TIMG_BASE(i) + 0x0020)
|
||||
/* TIMG_T0_LOAD : WO ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: Write any value will trigger timer 0 time-base counter reload*/
|
||||
#define TIMG_T0_LOAD 0xFFFFFFFF
|
||||
#define TIMG_T0_LOAD_M ((TIMG_T0_LOAD_V)<<(TIMG_T0_LOAD_S))
|
||||
#define TIMG_T0_LOAD_V 0xFFFFFFFF
|
||||
#define TIMG_T0_LOAD_S 0
|
||||
|
||||
#define TIMG_T1CONFIG_REG(i) (REG_TIMG_BASE(i) + 0x0024)
|
||||
/* TIMG_T1_EN : R/W ;bitpos:[31] ;default: 1'h0 ; */
|
||||
/*description: When set timer 1 time-base counter is enabled*/
|
||||
#define TIMG_T1_EN (BIT(31))
|
||||
#define TIMG_T1_EN_M (BIT(31))
|
||||
#define TIMG_T1_EN_V 0x1
|
||||
#define TIMG_T1_EN_S 31
|
||||
/* TIMG_T1_INCREASE : R/W ;bitpos:[30] ;default: 1'h1 ; */
|
||||
/*description: When set timer 1 time-base counter increment. When cleared timer
|
||||
1 time-base counter decrement.*/
|
||||
#define TIMG_T1_INCREASE (BIT(30))
|
||||
#define TIMG_T1_INCREASE_M (BIT(30))
|
||||
#define TIMG_T1_INCREASE_V 0x1
|
||||
#define TIMG_T1_INCREASE_S 30
|
||||
/* TIMG_T1_AUTORELOAD : R/W ;bitpos:[29] ;default: 1'h1 ; */
|
||||
/*description: When set timer 1 auto-reload at alarming is enabled*/
|
||||
#define TIMG_T1_AUTORELOAD (BIT(29))
|
||||
#define TIMG_T1_AUTORELOAD_M (BIT(29))
|
||||
#define TIMG_T1_AUTORELOAD_V 0x1
|
||||
#define TIMG_T1_AUTORELOAD_S 29
|
||||
/* TIMG_T1_DIVIDER : R/W ;bitpos:[28:13] ;default: 16'h1 ; */
|
||||
/*description: Timer 1 clock (T1_clk) prescale value.*/
|
||||
#define TIMG_T1_DIVIDER 0x0000FFFF
|
||||
#define TIMG_T1_DIVIDER_M ((TIMG_T1_DIVIDER_V)<<(TIMG_T1_DIVIDER_S))
|
||||
#define TIMG_T1_DIVIDER_V 0xFFFF
|
||||
#define TIMG_T1_DIVIDER_S 13
|
||||
/* TIMG_T1_EDGE_INT_EN : R/W ;bitpos:[12] ;default: 1'h0 ; */
|
||||
/*description: When set edge type interrupt will be generated during alarm*/
|
||||
#define TIMG_T1_EDGE_INT_EN (BIT(12))
|
||||
#define TIMG_T1_EDGE_INT_EN_M (BIT(12))
|
||||
#define TIMG_T1_EDGE_INT_EN_V 0x1
|
||||
#define TIMG_T1_EDGE_INT_EN_S 12
|
||||
/* TIMG_T1_LEVEL_INT_EN : R/W ;bitpos:[11] ;default: 1'h0 ; */
|
||||
/*description: When set level type interrupt will be generated during alarm*/
|
||||
#define TIMG_T1_LEVEL_INT_EN (BIT(11))
|
||||
#define TIMG_T1_LEVEL_INT_EN_M (BIT(11))
|
||||
#define TIMG_T1_LEVEL_INT_EN_V 0x1
|
||||
#define TIMG_T1_LEVEL_INT_EN_S 11
|
||||
/* TIMG_T1_ALARM_EN : R/W ;bitpos:[10] ;default: 1'h0 ; */
|
||||
/*description: When set alarm is enabled*/
|
||||
#define TIMG_T1_ALARM_EN (BIT(10))
|
||||
#define TIMG_T1_ALARM_EN_M (BIT(10))
|
||||
#define TIMG_T1_ALARM_EN_V 0x1
|
||||
#define TIMG_T1_ALARM_EN_S 10
|
||||
|
||||
#define TIMG_T1LO_REG(i) (REG_TIMG_BASE(i) + 0x0028)
|
||||
/* TIMG_T1_LO : RO ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: Register to store timer 1 time-base counter current value lower 32 bits.*/
|
||||
#define TIMG_T1_LO 0xFFFFFFFF
|
||||
#define TIMG_T1_LO_M ((TIMG_T1_LO_V)<<(TIMG_T1_LO_S))
|
||||
#define TIMG_T1_LO_V 0xFFFFFFFF
|
||||
#define TIMG_T1_LO_S 0
|
||||
|
||||
#define TIMG_T1HI_REG(i) (REG_TIMG_BASE(i) + 0x002c)
|
||||
/* TIMG_T1_HI : RO ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: Register to store timer 1 time-base counter current value higher 32 bits.*/
|
||||
#define TIMG_T1_HI 0xFFFFFFFF
|
||||
#define TIMG_T1_HI_M ((TIMG_T1_HI_V)<<(TIMG_T1_HI_S))
|
||||
#define TIMG_T1_HI_V 0xFFFFFFFF
|
||||
#define TIMG_T1_HI_S 0
|
||||
|
||||
#define TIMG_T1UPDATE_REG(i) (REG_TIMG_BASE(i) + 0x0030)
|
||||
/* TIMG_T1_UPDATE : WO ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: Write any value will trigger a timer 1 time-base counter value
|
||||
update (timer 1 current value will be stored in registers above)*/
|
||||
#define TIMG_T1_UPDATE 0xFFFFFFFF
|
||||
#define TIMG_T1_UPDATE_M ((TIMG_T1_UPDATE_V)<<(TIMG_T1_UPDATE_S))
|
||||
#define TIMG_T1_UPDATE_V 0xFFFFFFFF
|
||||
#define TIMG_T1_UPDATE_S 0
|
||||
|
||||
#define TIMG_T1ALARMLO_REG(i) (REG_TIMG_BASE(i) + 0x0034)
|
||||
/* TIMG_T1_ALARM_LO : R/W ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: Timer 1 time-base counter value lower 32 bits that will trigger the alarm*/
|
||||
#define TIMG_T1_ALARM_LO 0xFFFFFFFF
|
||||
#define TIMG_T1_ALARM_LO_M ((TIMG_T1_ALARM_LO_V)<<(TIMG_T1_ALARM_LO_S))
|
||||
#define TIMG_T1_ALARM_LO_V 0xFFFFFFFF
|
||||
#define TIMG_T1_ALARM_LO_S 0
|
||||
|
||||
#define TIMG_T1ALARMHI_REG(i) (REG_TIMG_BASE(i) + 0x0038)
|
||||
/* TIMG_T1_ALARM_HI : R/W ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: Timer 1 time-base counter value higher 32 bits that will trigger the alarm*/
|
||||
#define TIMG_T1_ALARM_HI 0xFFFFFFFF
|
||||
#define TIMG_T1_ALARM_HI_M ((TIMG_T1_ALARM_HI_V)<<(TIMG_T1_ALARM_HI_S))
|
||||
#define TIMG_T1_ALARM_HI_V 0xFFFFFFFF
|
||||
#define TIMG_T1_ALARM_HI_S 0
|
||||
|
||||
#define TIMG_T1LOADLO_REG(i) (REG_TIMG_BASE(i) + 0x003c)
|
||||
/* TIMG_T1_LOAD_LO : R/W ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: Lower 32 bits of the value that will load into timer 1 time-base counter*/
|
||||
#define TIMG_T1_LOAD_LO 0xFFFFFFFF
|
||||
#define TIMG_T1_LOAD_LO_M ((TIMG_T1_LOAD_LO_V)<<(TIMG_T1_LOAD_LO_S))
|
||||
#define TIMG_T1_LOAD_LO_V 0xFFFFFFFF
|
||||
#define TIMG_T1_LOAD_LO_S 0
|
||||
|
||||
#define TIMG_T1LOADHI_REG(i) (REG_TIMG_BASE(i) + 0x0040)
|
||||
/* TIMG_T1_LOAD_HI : R/W ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: higher 32 bits of the value that will load into timer 1 time-base counter*/
|
||||
#define TIMG_T1_LOAD_HI 0xFFFFFFFF
|
||||
#define TIMG_T1_LOAD_HI_M ((TIMG_T1_LOAD_HI_V)<<(TIMG_T1_LOAD_HI_S))
|
||||
#define TIMG_T1_LOAD_HI_V 0xFFFFFFFF
|
||||
#define TIMG_T1_LOAD_HI_S 0
|
||||
|
||||
#define TIMG_T1LOAD_REG(i) (REG_TIMG_BASE(i) + 0x0044)
|
||||
/* TIMG_T1_LOAD : WO ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: Write any value will trigger timer 1 time-base counter reload*/
|
||||
#define TIMG_T1_LOAD 0xFFFFFFFF
|
||||
#define TIMG_T1_LOAD_M ((TIMG_T1_LOAD_V)<<(TIMG_T1_LOAD_S))
|
||||
#define TIMG_T1_LOAD_V 0xFFFFFFFF
|
||||
#define TIMG_T1_LOAD_S 0
|
||||
|
||||
#define TIMG_WDTCONFIG0_REG(i) (REG_TIMG_BASE(i) + 0x0048)
|
||||
/* TIMG_WDT_EN : R/W ;bitpos:[31] ;default: 1'h0 ; */
|
||||
/*description: When set SWDT is enabled*/
|
||||
#define TIMG_WDT_EN (BIT(31))
|
||||
#define TIMG_WDT_EN_M (BIT(31))
|
||||
#define TIMG_WDT_EN_V 0x1
|
||||
#define TIMG_WDT_EN_S 31
|
||||
/* TIMG_WDT_STG0 : R/W ;bitpos:[30:29] ;default: 1'd0 ; */
|
||||
/*description: Stage 0 configuration. 0: off 1: interrupt 2: reset CPU 3: reset system*/
|
||||
#define TIMG_WDT_STG0 0x00000003
|
||||
#define TIMG_WDT_STG0_M ((TIMG_WDT_STG0_V)<<(TIMG_WDT_STG0_S))
|
||||
#define TIMG_WDT_STG0_V 0x3
|
||||
#define TIMG_WDT_STG0_S 29
|
||||
/* TIMG_WDT_STG1 : R/W ;bitpos:[28:27] ;default: 1'd0 ; */
|
||||
/*description: Stage 1 configuration. 0: off 1: interrupt 2: reset CPU 3: reset system*/
|
||||
#define TIMG_WDT_STG1 0x00000003
|
||||
#define TIMG_WDT_STG1_M ((TIMG_WDT_STG1_V)<<(TIMG_WDT_STG1_S))
|
||||
#define TIMG_WDT_STG1_V 0x3
|
||||
#define TIMG_WDT_STG1_S 27
|
||||
/* TIMG_WDT_STG2 : R/W ;bitpos:[26:25] ;default: 1'd0 ; */
|
||||
/*description: Stage 2 configuration. 0: off 1: interrupt 2: reset CPU 3: reset system*/
|
||||
#define TIMG_WDT_STG2 0x00000003
|
||||
#define TIMG_WDT_STG2_M ((TIMG_WDT_STG2_V)<<(TIMG_WDT_STG2_S))
|
||||
#define TIMG_WDT_STG2_V 0x3
|
||||
#define TIMG_WDT_STG2_S 25
|
||||
/* TIMG_WDT_STG3 : R/W ;bitpos:[24:23] ;default: 1'd0 ; */
|
||||
/*description: Stage 3 configuration. 0: off 1: interrupt 2: reset CPU 3: reset system*/
|
||||
#define TIMG_WDT_STG3 0x00000003
|
||||
#define TIMG_WDT_STG3_M ((TIMG_WDT_STG3_V)<<(TIMG_WDT_STG3_S))
|
||||
#define TIMG_WDT_STG3_V 0x3
|
||||
#define TIMG_WDT_STG3_S 23
|
||||
/* TIMG_WDT_EDGE_INT_EN : R/W ;bitpos:[22] ;default: 1'h0 ; */
|
||||
/*description: When set edge type interrupt generation is enabled*/
|
||||
#define TIMG_WDT_EDGE_INT_EN (BIT(22))
|
||||
#define TIMG_WDT_EDGE_INT_EN_M (BIT(22))
|
||||
#define TIMG_WDT_EDGE_INT_EN_V 0x1
|
||||
#define TIMG_WDT_EDGE_INT_EN_S 22
|
||||
/* TIMG_WDT_LEVEL_INT_EN : R/W ;bitpos:[21] ;default: 1'h0 ; */
|
||||
/*description: When set level type interrupt generation is enabled*/
|
||||
#define TIMG_WDT_LEVEL_INT_EN (BIT(21))
|
||||
#define TIMG_WDT_LEVEL_INT_EN_M (BIT(21))
|
||||
#define TIMG_WDT_LEVEL_INT_EN_V 0x1
|
||||
#define TIMG_WDT_LEVEL_INT_EN_S 21
|
||||
/* TIMG_WDT_CPU_RESET_LENGTH : R/W ;bitpos:[20:18] ;default: 3'h1 ; */
|
||||
/*description: length of CPU reset selection. 0: 100ns 1: 200ns 2: 300ns
|
||||
3: 400ns 4: 500ns 5: 800ns 6: 1.6us 7: 3.2us*/
|
||||
#define TIMG_WDT_CPU_RESET_LENGTH 0x00000007
|
||||
#define TIMG_WDT_CPU_RESET_LENGTH_M ((TIMG_WDT_CPU_RESET_LENGTH_V)<<(TIMG_WDT_CPU_RESET_LENGTH_S))
|
||||
#define TIMG_WDT_CPU_RESET_LENGTH_V 0x7
|
||||
#define TIMG_WDT_CPU_RESET_LENGTH_S 18
|
||||
/* TIMG_WDT_SYS_RESET_LENGTH : R/W ;bitpos:[17:15] ;default: 3'h1 ; */
|
||||
/*description: length of system reset selection. 0: 100ns 1: 200ns 2: 300ns
|
||||
3: 400ns 4: 500ns 5: 800ns 6: 1.6us 7: 3.2us*/
|
||||
#define TIMG_WDT_SYS_RESET_LENGTH 0x00000007
|
||||
#define TIMG_WDT_SYS_RESET_LENGTH_M ((TIMG_WDT_SYS_RESET_LENGTH_V)<<(TIMG_WDT_SYS_RESET_LENGTH_S))
|
||||
#define TIMG_WDT_SYS_RESET_LENGTH_V 0x7
|
||||
#define TIMG_WDT_SYS_RESET_LENGTH_S 15
|
||||
/* TIMG_WDT_FLASHBOOT_MOD_EN : R/W ;bitpos:[14] ;default: 1'h1 ; */
|
||||
/*description: When set flash boot protection is enabled*/
|
||||
#define TIMG_WDT_FLASHBOOT_MOD_EN (BIT(14))
|
||||
#define TIMG_WDT_FLASHBOOT_MOD_EN_M (BIT(14))
|
||||
#define TIMG_WDT_FLASHBOOT_MOD_EN_V 0x1
|
||||
#define TIMG_WDT_FLASHBOOT_MOD_EN_S 14
|
||||
|
||||
#define TIMG_WDTCONFIG1_REG(i) (REG_TIMG_BASE(i) + 0x004c)
|
||||
/* TIMG_WDT_CLK_PRESCALE : R/W ;bitpos:[31:16] ;default: 16'h1 ; */
|
||||
/*description: SWDT clock prescale value. Period = 12.5ns * value stored in this register*/
|
||||
#define TIMG_WDT_CLK_PRESCALE 0x0000FFFF
|
||||
#define TIMG_WDT_CLK_PRESCALE_M ((TIMG_WDT_CLK_PRESCALE_V)<<(TIMG_WDT_CLK_PRESCALE_S))
|
||||
#define TIMG_WDT_CLK_PRESCALE_V 0xFFFF
|
||||
#define TIMG_WDT_CLK_PRESCALE_S 16
|
||||
|
||||
#define TIMG_WDTCONFIG2_REG(i) (REG_TIMG_BASE(i) + 0x0050)
|
||||
/* TIMG_WDT_STG0_HOLD : R/W ;bitpos:[31:0] ;default: 32'd26000000 ; */
|
||||
/*description: Stage 0 timeout value in SWDT clock cycles*/
|
||||
#define TIMG_WDT_STG0_HOLD 0xFFFFFFFF
|
||||
#define TIMG_WDT_STG0_HOLD_M ((TIMG_WDT_STG0_HOLD_V)<<(TIMG_WDT_STG0_HOLD_S))
|
||||
#define TIMG_WDT_STG0_HOLD_V 0xFFFFFFFF
|
||||
#define TIMG_WDT_STG0_HOLD_S 0
|
||||
|
||||
#define TIMG_WDTCONFIG3_REG(i) (REG_TIMG_BASE(i) + 0x0054)
|
||||
/* TIMG_WDT_STG1_HOLD : R/W ;bitpos:[31:0] ;default: 32'h7ffffff ; */
|
||||
/*description: Stage 1 timeout value in SWDT clock cycles*/
|
||||
#define TIMG_WDT_STG1_HOLD 0xFFFFFFFF
|
||||
#define TIMG_WDT_STG1_HOLD_M ((TIMG_WDT_STG1_HOLD_V)<<(TIMG_WDT_STG1_HOLD_S))
|
||||
#define TIMG_WDT_STG1_HOLD_V 0xFFFFFFFF
|
||||
#define TIMG_WDT_STG1_HOLD_S 0
|
||||
|
||||
#define TIMG_WDTCONFIG4_REG(i) (REG_TIMG_BASE(i) + 0x0058)
|
||||
/* TIMG_WDT_STG2_HOLD : R/W ;bitpos:[31:0] ;default: 32'hfffff ; */
|
||||
/*description: Stage 2 timeout value in SWDT clock cycles*/
|
||||
#define TIMG_WDT_STG2_HOLD 0xFFFFFFFF
|
||||
#define TIMG_WDT_STG2_HOLD_M ((TIMG_WDT_STG2_HOLD_V)<<(TIMG_WDT_STG2_HOLD_S))
|
||||
#define TIMG_WDT_STG2_HOLD_V 0xFFFFFFFF
|
||||
#define TIMG_WDT_STG2_HOLD_S 0
|
||||
|
||||
#define TIMG_WDTCONFIG5_REG(i) (REG_TIMG_BASE(i) + 0x005c)
|
||||
/* TIMG_WDT_STG3_HOLD : R/W ;bitpos:[31:0] ;default: 32'hfffff ; */
|
||||
/*description: Stage 3 timeout value in SWDT clock cycles*/
|
||||
#define TIMG_WDT_STG3_HOLD 0xFFFFFFFF
|
||||
#define TIMG_WDT_STG3_HOLD_M ((TIMG_WDT_STG3_HOLD_V)<<(TIMG_WDT_STG3_HOLD_S))
|
||||
#define TIMG_WDT_STG3_HOLD_V 0xFFFFFFFF
|
||||
#define TIMG_WDT_STG3_HOLD_S 0
|
||||
|
||||
#define TIMG_WDTFEED_REG(i) (REG_TIMG_BASE(i) + 0x0060)
|
||||
/* TIMG_WDT_FEED : WO ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: Write any value will feed SWDT*/
|
||||
#define TIMG_WDT_FEED 0xFFFFFFFF
|
||||
#define TIMG_WDT_FEED_M ((TIMG_WDT_FEED_V)<<(TIMG_WDT_FEED_S))
|
||||
#define TIMG_WDT_FEED_V 0xFFFFFFFF
|
||||
#define TIMG_WDT_FEED_S 0
|
||||
|
||||
#define TIMG_WDTWPROTECT_REG(i) (REG_TIMG_BASE(i) + 0x0064)
|
||||
/* TIMG_WDT_WKEY : R/W ;bitpos:[31:0] ;default: 32'h50d83aa1 ; */
|
||||
/*description: If change its value from default then write protection is on.*/
|
||||
#define TIMG_WDT_WKEY 0xFFFFFFFF
|
||||
#define TIMG_WDT_WKEY_M ((TIMG_WDT_WKEY_V)<<(TIMG_WDT_WKEY_S))
|
||||
#define TIMG_WDT_WKEY_V 0xFFFFFFFF
|
||||
#define TIMG_WDT_WKEY_S 0
|
||||
|
||||
#define TIMG_RTCCALICFG_REG(i) (REG_TIMG_BASE(i) + 0x0068)
|
||||
/* TIMG_RTC_CALI_START : R/W ;bitpos:[31] ;default: 1'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_RTC_CALI_START (BIT(31))
|
||||
#define TIMG_RTC_CALI_START_M (BIT(31))
|
||||
#define TIMG_RTC_CALI_START_V 0x1
|
||||
#define TIMG_RTC_CALI_START_S 31
|
||||
/* TIMG_RTC_CALI_MAX : R/W ;bitpos:[30:16] ;default: 15'h1 ; */
|
||||
/*description: */
|
||||
#define TIMG_RTC_CALI_MAX 0x00007FFF
|
||||
#define TIMG_RTC_CALI_MAX_M ((TIMG_RTC_CALI_MAX_V)<<(TIMG_RTC_CALI_MAX_S))
|
||||
#define TIMG_RTC_CALI_MAX_V 0x7FFF
|
||||
#define TIMG_RTC_CALI_MAX_S 16
|
||||
/* TIMG_RTC_CALI_RDY : RO ;bitpos:[15] ;default: 1'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_RTC_CALI_RDY (BIT(15))
|
||||
#define TIMG_RTC_CALI_RDY_M (BIT(15))
|
||||
#define TIMG_RTC_CALI_RDY_V 0x1
|
||||
#define TIMG_RTC_CALI_RDY_S 15
|
||||
/* TIMG_RTC_CALI_CLK_SEL : R/W ;bitpos:[14:13] ;default: 2'h1 ; */
|
||||
/*description: */
|
||||
#define TIMG_RTC_CALI_CLK_SEL 0x00000003
|
||||
#define TIMG_RTC_CALI_CLK_SEL_M ((TIMG_RTC_CALI_CLK_SEL_V)<<(TIMG_RTC_CALI_CLK_SEL_S))
|
||||
#define TIMG_RTC_CALI_CLK_SEL_V 0x3
|
||||
#define TIMG_RTC_CALI_CLK_SEL_S 13
|
||||
/* TIMG_RTC_CALI_START_CYCLING : R/W ;bitpos:[12] ;default: 1'd1 ; */
|
||||
/*description: */
|
||||
#define TIMG_RTC_CALI_START_CYCLING (BIT(12))
|
||||
#define TIMG_RTC_CALI_START_CYCLING_M (BIT(12))
|
||||
#define TIMG_RTC_CALI_START_CYCLING_V 0x1
|
||||
#define TIMG_RTC_CALI_START_CYCLING_S 12
|
||||
|
||||
#define TIMG_RTCCALICFG1_REG(i) (REG_TIMG_BASE(i) + 0x006c)
|
||||
/* TIMG_RTC_CALI_VALUE : RO ;bitpos:[31:7] ;default: 25'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_RTC_CALI_VALUE 0x01FFFFFF
|
||||
#define TIMG_RTC_CALI_VALUE_M ((TIMG_RTC_CALI_VALUE_V)<<(TIMG_RTC_CALI_VALUE_S))
|
||||
#define TIMG_RTC_CALI_VALUE_V 0x1FFFFFF
|
||||
#define TIMG_RTC_CALI_VALUE_S 7
|
||||
|
||||
#define TIMG_LACTCONFIG_REG(i) (REG_TIMG_BASE(i) + 0x0070)
|
||||
/* TIMG_LACT_EN : R/W ;bitpos:[31] ;default: 1'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_EN (BIT(31))
|
||||
#define TIMG_LACT_EN_M (BIT(31))
|
||||
#define TIMG_LACT_EN_V 0x1
|
||||
#define TIMG_LACT_EN_S 31
|
||||
/* TIMG_LACT_INCREASE : R/W ;bitpos:[30] ;default: 1'h1 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_INCREASE (BIT(30))
|
||||
#define TIMG_LACT_INCREASE_M (BIT(30))
|
||||
#define TIMG_LACT_INCREASE_V 0x1
|
||||
#define TIMG_LACT_INCREASE_S 30
|
||||
/* TIMG_LACT_AUTORELOAD : R/W ;bitpos:[29] ;default: 1'h1 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_AUTORELOAD (BIT(29))
|
||||
#define TIMG_LACT_AUTORELOAD_M (BIT(29))
|
||||
#define TIMG_LACT_AUTORELOAD_V 0x1
|
||||
#define TIMG_LACT_AUTORELOAD_S 29
|
||||
/* TIMG_LACT_DIVIDER : R/W ;bitpos:[28:13] ;default: 16'h1 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_DIVIDER 0x0000FFFF
|
||||
#define TIMG_LACT_DIVIDER_M ((TIMG_LACT_DIVIDER_V)<<(TIMG_LACT_DIVIDER_S))
|
||||
#define TIMG_LACT_DIVIDER_V 0xFFFF
|
||||
#define TIMG_LACT_DIVIDER_S 13
|
||||
/* TIMG_LACT_EDGE_INT_EN : R/W ;bitpos:[12] ;default: 1'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_EDGE_INT_EN (BIT(12))
|
||||
#define TIMG_LACT_EDGE_INT_EN_M (BIT(12))
|
||||
#define TIMG_LACT_EDGE_INT_EN_V 0x1
|
||||
#define TIMG_LACT_EDGE_INT_EN_S 12
|
||||
/* TIMG_LACT_LEVEL_INT_EN : R/W ;bitpos:[11] ;default: 1'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_LEVEL_INT_EN (BIT(11))
|
||||
#define TIMG_LACT_LEVEL_INT_EN_M (BIT(11))
|
||||
#define TIMG_LACT_LEVEL_INT_EN_V 0x1
|
||||
#define TIMG_LACT_LEVEL_INT_EN_S 11
|
||||
/* TIMG_LACT_ALARM_EN : R/W ;bitpos:[10] ;default: 1'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_ALARM_EN (BIT(10))
|
||||
#define TIMG_LACT_ALARM_EN_M (BIT(10))
|
||||
#define TIMG_LACT_ALARM_EN_V 0x1
|
||||
#define TIMG_LACT_ALARM_EN_S 10
|
||||
/* TIMG_LACT_LAC_EN : R/W ;bitpos:[9] ;default: 1'h1 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_LAC_EN (BIT(9))
|
||||
#define TIMG_LACT_LAC_EN_M (BIT(9))
|
||||
#define TIMG_LACT_LAC_EN_V 0x1
|
||||
#define TIMG_LACT_LAC_EN_S 9
|
||||
/* TIMG_LACT_CPST_EN : R/W ;bitpos:[8] ;default: 1'h1 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_CPST_EN (BIT(8))
|
||||
#define TIMG_LACT_CPST_EN_M (BIT(8))
|
||||
#define TIMG_LACT_CPST_EN_V 0x1
|
||||
#define TIMG_LACT_CPST_EN_S 8
|
||||
/* TIMG_LACT_RTC_ONLY : R/W ;bitpos:[7] ;default: 1'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_RTC_ONLY (BIT(7))
|
||||
#define TIMG_LACT_RTC_ONLY_M (BIT(7))
|
||||
#define TIMG_LACT_RTC_ONLY_V 0x1
|
||||
#define TIMG_LACT_RTC_ONLY_S 7
|
||||
|
||||
#define TIMG_LACTRTC_REG(i) (REG_TIMG_BASE(i) + 0x0074)
|
||||
/* TIMG_LACT_RTC_STEP_LEN : R/W ;bitpos:[31:6] ;default: 26'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_RTC_STEP_LEN 0x03FFFFFF
|
||||
#define TIMG_LACT_RTC_STEP_LEN_M ((TIMG_LACT_RTC_STEP_LEN_V)<<(TIMG_LACT_RTC_STEP_LEN_S))
|
||||
#define TIMG_LACT_RTC_STEP_LEN_V 0x3FFFFFF
|
||||
#define TIMG_LACT_RTC_STEP_LEN_S 6
|
||||
|
||||
#define TIMG_LACTLO_REG(i) (REG_TIMG_BASE(i) + 0x0078)
|
||||
/* TIMG_LACT_LO : RO ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_LO 0xFFFFFFFF
|
||||
#define TIMG_LACT_LO_M ((TIMG_LACT_LO_V)<<(TIMG_LACT_LO_S))
|
||||
#define TIMG_LACT_LO_V 0xFFFFFFFF
|
||||
#define TIMG_LACT_LO_S 0
|
||||
|
||||
#define TIMG_LACTHI_REG(i) (REG_TIMG_BASE(i) + 0x007c)
|
||||
/* TIMG_LACT_HI : RO ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_HI 0xFFFFFFFF
|
||||
#define TIMG_LACT_HI_M ((TIMG_LACT_HI_V)<<(TIMG_LACT_HI_S))
|
||||
#define TIMG_LACT_HI_V 0xFFFFFFFF
|
||||
#define TIMG_LACT_HI_S 0
|
||||
|
||||
#define TIMG_LACTUPDATE_REG(i) (REG_TIMG_BASE(i) + 0x0080)
|
||||
/* TIMG_LACT_UPDATE : WO ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_UPDATE 0xFFFFFFFF
|
||||
#define TIMG_LACT_UPDATE_M ((TIMG_LACT_UPDATE_V)<<(TIMG_LACT_UPDATE_S))
|
||||
#define TIMG_LACT_UPDATE_V 0xFFFFFFFF
|
||||
#define TIMG_LACT_UPDATE_S 0
|
||||
|
||||
#define TIMG_LACTALARMLO_REG(i) (REG_TIMG_BASE(i) + 0x0084)
|
||||
/* TIMG_LACT_ALARM_LO : R/W ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_ALARM_LO 0xFFFFFFFF
|
||||
#define TIMG_LACT_ALARM_LO_M ((TIMG_LACT_ALARM_LO_V)<<(TIMG_LACT_ALARM_LO_S))
|
||||
#define TIMG_LACT_ALARM_LO_V 0xFFFFFFFF
|
||||
#define TIMG_LACT_ALARM_LO_S 0
|
||||
|
||||
#define TIMG_LACTALARMHI_REG(i) (REG_TIMG_BASE(i) + 0x0088)
|
||||
/* TIMG_LACT_ALARM_HI : R/W ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_ALARM_HI 0xFFFFFFFF
|
||||
#define TIMG_LACT_ALARM_HI_M ((TIMG_LACT_ALARM_HI_V)<<(TIMG_LACT_ALARM_HI_S))
|
||||
#define TIMG_LACT_ALARM_HI_V 0xFFFFFFFF
|
||||
#define TIMG_LACT_ALARM_HI_S 0
|
||||
|
||||
#define TIMG_LACTLOADLO_REG(i) (REG_TIMG_BASE(i) + 0x008c)
|
||||
/* TIMG_LACT_LOAD_LO : R/W ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_LOAD_LO 0xFFFFFFFF
|
||||
#define TIMG_LACT_LOAD_LO_M ((TIMG_LACT_LOAD_LO_V)<<(TIMG_LACT_LOAD_LO_S))
|
||||
#define TIMG_LACT_LOAD_LO_V 0xFFFFFFFF
|
||||
#define TIMG_LACT_LOAD_LO_S 0
|
||||
|
||||
#define TIMG_LACTLOADHI_REG(i) (REG_TIMG_BASE(i) + 0x0090)
|
||||
/* TIMG_LACT_LOAD_HI : R/W ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_LOAD_HI 0xFFFFFFFF
|
||||
#define TIMG_LACT_LOAD_HI_M ((TIMG_LACT_LOAD_HI_V)<<(TIMG_LACT_LOAD_HI_S))
|
||||
#define TIMG_LACT_LOAD_HI_V 0xFFFFFFFF
|
||||
#define TIMG_LACT_LOAD_HI_S 0
|
||||
|
||||
#define TIMG_LACTLOAD_REG(i) (REG_TIMG_BASE(i) + 0x0094)
|
||||
/* TIMG_LACT_LOAD : WO ;bitpos:[31:0] ;default: 32'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_LOAD 0xFFFFFFFF
|
||||
#define TIMG_LACT_LOAD_M ((TIMG_LACT_LOAD_V)<<(TIMG_LACT_LOAD_S))
|
||||
#define TIMG_LACT_LOAD_V 0xFFFFFFFF
|
||||
#define TIMG_LACT_LOAD_S 0
|
||||
|
||||
#define TIMG_INT_ENA_TIMERS_REG(i) (REG_TIMG_BASE(i) + 0x0098)
|
||||
/* TIMG_LACT_INT_ENA : R/W ;bitpos:[3] ;default: 1'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_INT_ENA (BIT(3))
|
||||
#define TIMG_LACT_INT_ENA_M (BIT(3))
|
||||
#define TIMG_LACT_INT_ENA_V 0x1
|
||||
#define TIMG_LACT_INT_ENA_S 3
|
||||
/* TIMG_WDT_INT_ENA : R/W ;bitpos:[2] ;default: 1'h0 ; */
|
||||
/*description: Interrupt when an interrupt stage timeout*/
|
||||
#define TIMG_WDT_INT_ENA (BIT(2))
|
||||
#define TIMG_WDT_INT_ENA_M (BIT(2))
|
||||
#define TIMG_WDT_INT_ENA_V 0x1
|
||||
#define TIMG_WDT_INT_ENA_S 2
|
||||
/* TIMG_T1_INT_ENA : R/W ;bitpos:[1] ;default: 1'h0 ; */
|
||||
/*description: interrupt when timer1 alarm*/
|
||||
#define TIMG_T1_INT_ENA (BIT(1))
|
||||
#define TIMG_T1_INT_ENA_M (BIT(1))
|
||||
#define TIMG_T1_INT_ENA_V 0x1
|
||||
#define TIMG_T1_INT_ENA_S 1
|
||||
/* TIMG_T0_INT_ENA : R/W ;bitpos:[0] ;default: 1'h0 ; */
|
||||
/*description: interrupt when timer0 alarm*/
|
||||
#define TIMG_T0_INT_ENA (BIT(0))
|
||||
#define TIMG_T0_INT_ENA_M (BIT(0))
|
||||
#define TIMG_T0_INT_ENA_V 0x1
|
||||
#define TIMG_T0_INT_ENA_S 0
|
||||
|
||||
#define TIMG_INT_RAW_TIMERS_REG(i) (REG_TIMG_BASE(i) + 0x009c)
|
||||
/* TIMG_LACT_INT_RAW : RO ;bitpos:[3] ;default: 1'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_INT_RAW (BIT(3))
|
||||
#define TIMG_LACT_INT_RAW_M (BIT(3))
|
||||
#define TIMG_LACT_INT_RAW_V 0x1
|
||||
#define TIMG_LACT_INT_RAW_S 3
|
||||
/* TIMG_WDT_INT_RAW : RO ;bitpos:[2] ;default: 1'h0 ; */
|
||||
/*description: Interrupt when an interrupt stage timeout*/
|
||||
#define TIMG_WDT_INT_RAW (BIT(2))
|
||||
#define TIMG_WDT_INT_RAW_M (BIT(2))
|
||||
#define TIMG_WDT_INT_RAW_V 0x1
|
||||
#define TIMG_WDT_INT_RAW_S 2
|
||||
/* TIMG_T1_INT_RAW : RO ;bitpos:[1] ;default: 1'h0 ; */
|
||||
/*description: interrupt when timer1 alarm*/
|
||||
#define TIMG_T1_INT_RAW (BIT(1))
|
||||
#define TIMG_T1_INT_RAW_M (BIT(1))
|
||||
#define TIMG_T1_INT_RAW_V 0x1
|
||||
#define TIMG_T1_INT_RAW_S 1
|
||||
/* TIMG_T0_INT_RAW : RO ;bitpos:[0] ;default: 1'h0 ; */
|
||||
/*description: interrupt when timer0 alarm*/
|
||||
#define TIMG_T0_INT_RAW (BIT(0))
|
||||
#define TIMG_T0_INT_RAW_M (BIT(0))
|
||||
#define TIMG_T0_INT_RAW_V 0x1
|
||||
#define TIMG_T0_INT_RAW_S 0
|
||||
|
||||
#define TIMG_INT_ST_TIMERS_REG(i) (REG_TIMG_BASE(i) + 0x00a0)
|
||||
/* TIMG_LACT_INT_ST : RO ;bitpos:[3] ;default: 1'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_INT_ST (BIT(3))
|
||||
#define TIMG_LACT_INT_ST_M (BIT(3))
|
||||
#define TIMG_LACT_INT_ST_V 0x1
|
||||
#define TIMG_LACT_INT_ST_S 3
|
||||
/* TIMG_WDT_INT_ST : RO ;bitpos:[2] ;default: 1'h0 ; */
|
||||
/*description: Interrupt when an interrupt stage timeout*/
|
||||
#define TIMG_WDT_INT_ST (BIT(2))
|
||||
#define TIMG_WDT_INT_ST_M (BIT(2))
|
||||
#define TIMG_WDT_INT_ST_V 0x1
|
||||
#define TIMG_WDT_INT_ST_S 2
|
||||
/* TIMG_T1_INT_ST : RO ;bitpos:[1] ;default: 1'h0 ; */
|
||||
/*description: interrupt when timer1 alarm*/
|
||||
#define TIMG_T1_INT_ST (BIT(1))
|
||||
#define TIMG_T1_INT_ST_M (BIT(1))
|
||||
#define TIMG_T1_INT_ST_V 0x1
|
||||
#define TIMG_T1_INT_ST_S 1
|
||||
/* TIMG_T0_INT_ST : RO ;bitpos:[0] ;default: 1'h0 ; */
|
||||
/*description: interrupt when timer0 alarm*/
|
||||
#define TIMG_T0_INT_ST (BIT(0))
|
||||
#define TIMG_T0_INT_ST_M (BIT(0))
|
||||
#define TIMG_T0_INT_ST_V 0x1
|
||||
#define TIMG_T0_INT_ST_S 0
|
||||
|
||||
#define TIMG_INT_CLR_TIMERS_REG(i) (REG_TIMG_BASE(i) + 0x00a4)
|
||||
/* TIMG_LACT_INT_CLR : WO ;bitpos:[3] ;default: 1'h0 ; */
|
||||
/*description: */
|
||||
#define TIMG_LACT_INT_CLR (BIT(3))
|
||||
#define TIMG_LACT_INT_CLR_M (BIT(3))
|
||||
#define TIMG_LACT_INT_CLR_V 0x1
|
||||
#define TIMG_LACT_INT_CLR_S 3
|
||||
/* TIMG_WDT_INT_CLR : WO ;bitpos:[2] ;default: 1'h0 ; */
|
||||
/*description: Interrupt when an interrupt stage timeout*/
|
||||
#define TIMG_WDT_INT_CLR (BIT(2))
|
||||
#define TIMG_WDT_INT_CLR_M (BIT(2))
|
||||
#define TIMG_WDT_INT_CLR_V 0x1
|
||||
#define TIMG_WDT_INT_CLR_S 2
|
||||
/* TIMG_T1_INT_CLR : WO ;bitpos:[1] ;default: 1'h0 ; */
|
||||
/*description: interrupt when timer1 alarm*/
|
||||
#define TIMG_T1_INT_CLR (BIT(1))
|
||||
#define TIMG_T1_INT_CLR_M (BIT(1))
|
||||
#define TIMG_T1_INT_CLR_V 0x1
|
||||
#define TIMG_T1_INT_CLR_S 1
|
||||
/* TIMG_T0_INT_CLR : WO ;bitpos:[0] ;default: 1'h0 ; */
|
||||
/*description: interrupt when timer0 alarm*/
|
||||
#define TIMG_T0_INT_CLR (BIT(0))
|
||||
#define TIMG_T0_INT_CLR_M (BIT(0))
|
||||
#define TIMG_T0_INT_CLR_V 0x1
|
||||
#define TIMG_T0_INT_CLR_S 0
|
||||
|
||||
#define TIMG_NTIMERS_DATE_REG(i) (REG_TIMG_BASE(i) + 0x00f8)
|
||||
/* TIMG_NTIMERS_DATE : R/W ;bitpos:[27:0] ;default: 28'h1604290 ; */
|
||||
/*description: Version of this regfile*/
|
||||
#define TIMG_NTIMERS_DATE 0x0FFFFFFF
|
||||
#define TIMG_NTIMERS_DATE_M ((TIMG_NTIMERS_DATE_V)<<(TIMG_NTIMERS_DATE_S))
|
||||
#define TIMG_NTIMERS_DATE_V 0xFFFFFFF
|
||||
#define TIMG_NTIMERS_DATE_S 0
|
||||
|
||||
#define TIMGCLK_REG(i) (REG_TIMG_BASE(i) + 0x00fc)
|
||||
/* TIMG_CLK_EN : R/W ;bitpos:[31] ;default: 1'h0 ; */
|
||||
/*description: Force clock enable for this regfile*/
|
||||
#define TIMG_CLK_EN (BIT(31))
|
||||
#define TIMG_CLK_EN_M (BIT(31))
|
||||
#define TIMG_CLK_EN_V 0x1
|
||||
#define TIMG_CLK_EN_S 31
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /*__TIMG_REG_H__ */
|
||||
|
||||
|
@ -1,195 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_TIMG_STRUCT_H_
|
||||
#define _SOC_TIMG_STRUCT_H_
|
||||
typedef volatile struct {
|
||||
struct{
|
||||
union {
|
||||
struct {
|
||||
uint32_t reserved0: 10;
|
||||
uint32_t alarm_en: 1; /*When set alarm is enabled*/
|
||||
uint32_t level_int_en: 1; /*When set level type interrupt will be generated during alarm*/
|
||||
uint32_t edge_int_en: 1; /*When set edge type interrupt will be generated during alarm*/
|
||||
uint32_t divider: 16; /*Timer clock (T0/1_clk) pre-scale value.*/
|
||||
uint32_t autoreload: 1; /*When set timer 0/1 auto-reload at alarming is enabled*/
|
||||
uint32_t increase: 1; /*When set timer 0/1 time-base counter increment. When cleared timer 0 time-base counter decrement.*/
|
||||
uint32_t enable: 1; /*When set timer 0/1 time-base counter is enabled*/
|
||||
};
|
||||
uint32_t val;
|
||||
} config;
|
||||
uint32_t cnt_low; /*Register to store timer 0/1 time-base counter current value lower 32 bits.*/
|
||||
uint32_t cnt_high; /*Register to store timer 0 time-base counter current value higher 32 bits.*/
|
||||
uint32_t update; /*Write any value will trigger a timer 0 time-base counter value update (timer 0 current value will be stored in registers above)*/
|
||||
uint32_t alarm_low; /*Timer 0 time-base counter value lower 32 bits that will trigger the alarm*/
|
||||
uint32_t alarm_high; /*Timer 0 time-base counter value higher 32 bits that will trigger the alarm*/
|
||||
uint32_t load_low; /*Lower 32 bits of the value that will load into timer 0 time-base counter*/
|
||||
uint32_t load_high; /*higher 32 bits of the value that will load into timer 0 time-base counter*/
|
||||
uint32_t reload; /*Write any value will trigger timer 0 time-base counter reload*/
|
||||
} hw_timer[2];
|
||||
union {
|
||||
struct {
|
||||
uint32_t reserved0: 14;
|
||||
uint32_t flashboot_mod_en: 1; /*When set flash boot protection is enabled*/
|
||||
uint32_t sys_reset_length: 3; /*length of system reset selection. 0: 100ns 1: 200ns 2: 300ns 3: 400ns 4: 500ns 5: 800ns 6: 1.6us 7: 3.2us*/
|
||||
uint32_t cpu_reset_length: 3; /*length of CPU reset selection. 0: 100ns 1: 200ns 2: 300ns 3: 400ns 4: 500ns 5: 800ns 6: 1.6us 7: 3.2us*/
|
||||
uint32_t level_int_en: 1; /*When set level type interrupt generation is enabled*/
|
||||
uint32_t edge_int_en: 1; /*When set edge type interrupt generation is enabled*/
|
||||
uint32_t stg3: 2; /*Stage 3 configuration. 0: off 1: interrupt 2: reset CPU 3: reset system*/
|
||||
uint32_t stg2: 2; /*Stage 2 configuration. 0: off 1: interrupt 2: reset CPU 3: reset system*/
|
||||
uint32_t stg1: 2; /*Stage 1 configuration. 0: off 1: interrupt 2: reset CPU 3: reset system*/
|
||||
uint32_t stg0: 2; /*Stage 0 configuration. 0: off 1: interrupt 2: reset CPU 3: reset system*/
|
||||
uint32_t en: 1; /*When set SWDT is enabled*/
|
||||
};
|
||||
uint32_t val;
|
||||
} wdt_config0;
|
||||
union {
|
||||
struct {
|
||||
uint32_t reserved0: 16;
|
||||
uint32_t clk_prescale:16; /*SWDT clock prescale value. Period = 12.5ns * value stored in this register*/
|
||||
};
|
||||
uint32_t val;
|
||||
} wdt_config1;
|
||||
uint32_t wdt_config2; /*Stage 0 timeout value in SWDT clock cycles*/
|
||||
uint32_t wdt_config3; /*Stage 1 timeout value in SWDT clock cycles*/
|
||||
uint32_t wdt_config4; /*Stage 2 timeout value in SWDT clock cycles*/
|
||||
uint32_t wdt_config5; /*Stage 3 timeout value in SWDT clock cycles*/
|
||||
uint32_t wdt_feed; /*Write any value will feed SWDT*/
|
||||
uint32_t wdt_wprotect; /*If change its value from default then write protection is on.*/
|
||||
union {
|
||||
struct {
|
||||
uint32_t reserved0: 12;
|
||||
uint32_t start_cycling: 1;
|
||||
uint32_t clk_sel: 2;
|
||||
uint32_t rdy: 1;
|
||||
uint32_t max: 15;
|
||||
uint32_t start: 1;
|
||||
};
|
||||
uint32_t val;
|
||||
} rtc_cali_cfg;
|
||||
union {
|
||||
struct {
|
||||
uint32_t reserved0: 7;
|
||||
uint32_t value:25;
|
||||
};
|
||||
uint32_t val;
|
||||
} rtc_cali_cfg1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t reserved0: 7;
|
||||
uint32_t rtc_only: 1;
|
||||
uint32_t cpst_en: 1;
|
||||
uint32_t lac_en: 1;
|
||||
uint32_t alarm_en: 1;
|
||||
uint32_t level_int_en: 1;
|
||||
uint32_t edge_int_en: 1;
|
||||
uint32_t divider: 16;
|
||||
uint32_t autoreload: 1;
|
||||
uint32_t increase: 1;
|
||||
uint32_t en: 1;
|
||||
};
|
||||
uint32_t val;
|
||||
} lactconfig;
|
||||
union {
|
||||
struct {
|
||||
uint32_t reserved0: 6;
|
||||
uint32_t step_len:26;
|
||||
};
|
||||
uint32_t val;
|
||||
} lactrtc;
|
||||
uint32_t lactlo; /**/
|
||||
uint32_t lacthi; /**/
|
||||
uint32_t lactupdate; /**/
|
||||
uint32_t lactalarmlo; /**/
|
||||
uint32_t lactalarmhi; /**/
|
||||
uint32_t lactloadlo; /**/
|
||||
uint32_t lactloadhi; /**/
|
||||
uint32_t lactload; /**/
|
||||
union {
|
||||
struct {
|
||||
uint32_t t0: 1; /*interrupt when timer0 alarm*/
|
||||
uint32_t t1: 1; /*interrupt when timer1 alarm*/
|
||||
uint32_t wdt: 1; /*Interrupt when an interrupt stage timeout*/
|
||||
uint32_t lact: 1;
|
||||
uint32_t reserved4: 28;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_ena;
|
||||
union {
|
||||
struct {
|
||||
uint32_t t0: 1; /*interrupt when timer0 alarm*/
|
||||
uint32_t t1: 1; /*interrupt when timer1 alarm*/
|
||||
uint32_t wdt: 1; /*Interrupt when an interrupt stage timeout*/
|
||||
uint32_t lact: 1;
|
||||
uint32_t reserved4:28;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_raw;
|
||||
union {
|
||||
struct {
|
||||
uint32_t t0: 1; /*interrupt when timer0 alarm*/
|
||||
uint32_t t1: 1; /*interrupt when timer1 alarm*/
|
||||
uint32_t wdt: 1; /*Interrupt when an interrupt stage timeout*/
|
||||
uint32_t lact: 1;
|
||||
uint32_t reserved4: 28;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_st_timers;
|
||||
union {
|
||||
struct {
|
||||
uint32_t t0: 1; /*interrupt when timer0 alarm*/
|
||||
uint32_t t1: 1; /*interrupt when timer1 alarm*/
|
||||
uint32_t wdt: 1; /*Interrupt when an interrupt stage timeout*/
|
||||
uint32_t lact: 1;
|
||||
uint32_t reserved4: 28;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_clr_timers;
|
||||
uint32_t reserved_a8;
|
||||
uint32_t reserved_ac;
|
||||
uint32_t reserved_b0;
|
||||
uint32_t reserved_b4;
|
||||
uint32_t reserved_b8;
|
||||
uint32_t reserved_bc;
|
||||
uint32_t reserved_c0;
|
||||
uint32_t reserved_c4;
|
||||
uint32_t reserved_c8;
|
||||
uint32_t reserved_cc;
|
||||
uint32_t reserved_d0;
|
||||
uint32_t reserved_d4;
|
||||
uint32_t reserved_d8;
|
||||
uint32_t reserved_dc;
|
||||
uint32_t reserved_e0;
|
||||
uint32_t reserved_e4;
|
||||
uint32_t reserved_e8;
|
||||
uint32_t reserved_ec;
|
||||
uint32_t reserved_f0;
|
||||
uint32_t reserved_f4;
|
||||
union {
|
||||
struct {
|
||||
uint32_t date:28; /*Version of this regfile*/
|
||||
uint32_t reserved28: 4;
|
||||
};
|
||||
uint32_t val;
|
||||
} timg_date;
|
||||
union {
|
||||
struct {
|
||||
uint32_t reserved0: 31;
|
||||
uint32_t en: 1; /*Force clock enable for this regfile*/
|
||||
};
|
||||
uint32_t val;
|
||||
} clk;
|
||||
} timg_dev_t;
|
||||
extern timg_dev_t TIMERG0;
|
||||
extern timg_dev_t TIMERG1;
|
||||
#endif /* _SOC_TIMG_STRUCT_H_ */
|
File diff suppressed because it is too large
Load Diff
@ -1,365 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_UART_STRUCT_H_
|
||||
#define _SOC_UART_STRUCT_H_
|
||||
typedef volatile struct {
|
||||
union {
|
||||
struct {
|
||||
uint8_t rw_byte; /*This register stores one byte data read by rx fifo.*/
|
||||
uint8_t reserved[3];
|
||||
};
|
||||
uint32_t val;
|
||||
} fifo;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rxfifo_full: 1; /*This interrupt raw bit turns to high level when receiver receives more data than (rx_flow_thrhd_h3 rx_flow_thrhd).*/
|
||||
uint32_t txfifo_empty: 1; /*This interrupt raw bit turns to high level when the amount of data in transmitter's fifo is less than ((tx_mem_cnttxfifo_cnt) .*/
|
||||
uint32_t parity_err: 1; /*This interrupt raw bit turns to high level when receiver detects the parity error of data.*/
|
||||
uint32_t frm_err: 1; /*This interrupt raw bit turns to high level when receiver detects data's frame error .*/
|
||||
uint32_t rxfifo_ovf: 1; /*This interrupt raw bit turns to high level when receiver receives more data than the fifo can store.*/
|
||||
uint32_t dsr_chg: 1; /*This interrupt raw bit turns to high level when receiver detects the edge change of dsrn signal.*/
|
||||
uint32_t cts_chg: 1; /*This interrupt raw bit turns to high level when receiver detects the edge change of ctsn signal.*/
|
||||
uint32_t brk_det: 1; /*This interrupt raw bit turns to high level when receiver detects the 0 after the stop bit.*/
|
||||
uint32_t rxfifo_tout: 1; /*This interrupt raw bit turns to high level when receiver takes more time than rx_tout_thrhd to receive a byte.*/
|
||||
uint32_t sw_xon: 1; /*This interrupt raw bit turns to high level when receiver receives xoff char with uart_sw_flow_con_en is set to 1.*/
|
||||
uint32_t sw_xoff: 1; /*This interrupt raw bit turns to high level when receiver receives xon char with uart_sw_flow_con_en is set to 1.*/
|
||||
uint32_t glitch_det: 1; /*This interrupt raw bit turns to high level when receiver detects the start bit.*/
|
||||
uint32_t tx_brk_done: 1; /*This interrupt raw bit turns to high level when transmitter completes sending 0 after all the data in transmitter's fifo are send.*/
|
||||
uint32_t tx_brk_idle_done: 1; /*This interrupt raw bit turns to high level when transmitter has kept the shortest duration after the last data has been send.*/
|
||||
uint32_t tx_done: 1; /*This interrupt raw bit turns to high level when transmitter has send all the data in fifo.*/
|
||||
uint32_t rs485_parity_err: 1; /*This interrupt raw bit turns to high level when rs485 detects the parity error.*/
|
||||
uint32_t rs485_frm_err: 1; /*This interrupt raw bit turns to high level when rs485 detects the data frame error.*/
|
||||
uint32_t rs485_clash: 1; /*This interrupt raw bit turns to high level when rs485 detects the clash between transmitter and receiver.*/
|
||||
uint32_t at_cmd_char_det: 1; /*This interrupt raw bit turns to high level when receiver detects the configured at_cmd chars.*/
|
||||
uint32_t reserved19: 13;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_raw;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rxfifo_full: 1; /*This is the status bit for rxfifo_full_int_raw when rxfifo_full_int_ena is set to 1.*/
|
||||
uint32_t txfifo_empty: 1; /*This is the status bit for txfifo_empty_int_raw when txfifo_empty_int_ena is set to 1.*/
|
||||
uint32_t parity_err: 1; /*This is the status bit for parity_err_int_raw when parity_err_int_ena is set to 1.*/
|
||||
uint32_t frm_err: 1; /*This is the status bit for frm_err_int_raw when fm_err_int_ena is set to 1.*/
|
||||
uint32_t rxfifo_ovf: 1; /*This is the status bit for rxfifo_ovf_int_raw when rxfifo_ovf_int_ena is set to 1.*/
|
||||
uint32_t dsr_chg: 1; /*This is the status bit for dsr_chg_int_raw when dsr_chg_int_ena is set to 1.*/
|
||||
uint32_t cts_chg: 1; /*This is the status bit for cts_chg_int_raw when cts_chg_int_ena is set to 1.*/
|
||||
uint32_t brk_det: 1; /*This is the status bit for brk_det_int_raw when brk_det_int_ena is set to 1.*/
|
||||
uint32_t rxfifo_tout: 1; /*This is the status bit for rxfifo_tout_int_raw when rxfifo_tout_int_ena is set to 1.*/
|
||||
uint32_t sw_xon: 1; /*This is the status bit for sw_xon_int_raw when sw_xon_int_ena is set to 1.*/
|
||||
uint32_t sw_xoff: 1; /*This is the status bit for sw_xoff_int_raw when sw_xoff_int_ena is set to 1.*/
|
||||
uint32_t glitch_det: 1; /*This is the status bit for glitch_det_int_raw when glitch_det_int_ena is set to 1.*/
|
||||
uint32_t tx_brk_done: 1; /*This is the status bit for tx_brk_done_int_raw when tx_brk_done_int_ena is set to 1.*/
|
||||
uint32_t tx_brk_idle_done: 1; /*This is the status bit for tx_brk_idle_done_int_raw when tx_brk_idle_done_int_ena is set to 1.*/
|
||||
uint32_t tx_done: 1; /*This is the status bit for tx_done_int_raw when tx_done_int_ena is set to 1.*/
|
||||
uint32_t rs485_parity_err: 1; /*This is the status bit for rs485_parity_err_int_raw when rs485_parity_int_ena is set to 1.*/
|
||||
uint32_t rs485_frm_err: 1; /*This is the status bit for rs485_fm_err_int_raw when rs485_fm_err_int_ena is set to 1.*/
|
||||
uint32_t rs485_clash: 1; /*This is the status bit for rs485_clash_int_raw when rs485_clash_int_ena is set to 1.*/
|
||||
uint32_t at_cmd_char_det: 1; /*This is the status bit for at_cmd_det_int_raw when at_cmd_char_det_int_ena is set to 1.*/
|
||||
uint32_t reserved19: 13;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_st;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rxfifo_full: 1; /*This is the enable bit for rxfifo_full_int_st register.*/
|
||||
uint32_t txfifo_empty: 1; /*This is the enable bit for rxfifo_full_int_st register.*/
|
||||
uint32_t parity_err: 1; /*This is the enable bit for parity_err_int_st register.*/
|
||||
uint32_t frm_err: 1; /*This is the enable bit for frm_err_int_st register.*/
|
||||
uint32_t rxfifo_ovf: 1; /*This is the enable bit for rxfifo_ovf_int_st register.*/
|
||||
uint32_t dsr_chg: 1; /*This is the enable bit for dsr_chg_int_st register.*/
|
||||
uint32_t cts_chg: 1; /*This is the enable bit for cts_chg_int_st register.*/
|
||||
uint32_t brk_det: 1; /*This is the enable bit for brk_det_int_st register.*/
|
||||
uint32_t rxfifo_tout: 1; /*This is the enable bit for rxfifo_tout_int_st register.*/
|
||||
uint32_t sw_xon: 1; /*This is the enable bit for sw_xon_int_st register.*/
|
||||
uint32_t sw_xoff: 1; /*This is the enable bit for sw_xoff_int_st register.*/
|
||||
uint32_t glitch_det: 1; /*This is the enable bit for glitch_det_int_st register.*/
|
||||
uint32_t tx_brk_done: 1; /*This is the enable bit for tx_brk_done_int_st register.*/
|
||||
uint32_t tx_brk_idle_done: 1; /*This is the enable bit for tx_brk_idle_done_int_st register.*/
|
||||
uint32_t tx_done: 1; /*This is the enable bit for tx_done_int_st register.*/
|
||||
uint32_t rs485_parity_err: 1; /*This is the enable bit for rs485_parity_err_int_st register.*/
|
||||
uint32_t rs485_frm_err: 1; /*This is the enable bit for rs485_parity_err_int_st register.*/
|
||||
uint32_t rs485_clash: 1; /*This is the enable bit for rs485_clash_int_st register.*/
|
||||
uint32_t at_cmd_char_det: 1; /*This is the enable bit for at_cmd_char_det_int_st register.*/
|
||||
uint32_t reserved19: 13;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_ena;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rxfifo_full: 1; /*Set this bit to clear the rxfifo_full_int_raw interrupt.*/
|
||||
uint32_t txfifo_empty: 1; /*Set this bit to clear txfifo_empty_int_raw interrupt.*/
|
||||
uint32_t parity_err: 1; /*Set this bit to clear parity_err_int_raw interrupt.*/
|
||||
uint32_t frm_err: 1; /*Set this bit to clear frm_err_int_raw interrupt.*/
|
||||
uint32_t rxfifo_ovf: 1; /*Set this bit to clear rxfifo_ovf_int_raw interrupt.*/
|
||||
uint32_t dsr_chg: 1; /*Set this bit to clear the dsr_chg_int_raw interrupt.*/
|
||||
uint32_t cts_chg: 1; /*Set this bit to clear the cts_chg_int_raw interrupt.*/
|
||||
uint32_t brk_det: 1; /*Set this bit to clear the brk_det_int_raw interrupt.*/
|
||||
uint32_t rxfifo_tout: 1; /*Set this bit to clear the rxfifo_tout_int_raw interrupt.*/
|
||||
uint32_t sw_xon: 1; /*Set this bit to clear the sw_xon_int_raw interrupt.*/
|
||||
uint32_t sw_xoff: 1; /*Set this bit to clear the sw_xon_int_raw interrupt.*/
|
||||
uint32_t glitch_det: 1; /*Set this bit to clear the glitch_det_int_raw interrupt.*/
|
||||
uint32_t tx_brk_done: 1; /*Set this bit to clear the tx_brk_done_int_raw interrupt..*/
|
||||
uint32_t tx_brk_idle_done: 1; /*Set this bit to clear the tx_brk_idle_done_int_raw interrupt.*/
|
||||
uint32_t tx_done: 1; /*Set this bit to clear the tx_done_int_raw interrupt.*/
|
||||
uint32_t rs485_parity_err: 1; /*Set this bit to clear the rs485_parity_err_int_raw interrupt.*/
|
||||
uint32_t rs485_frm_err: 1; /*Set this bit to clear the rs485_frm_err_int_raw interrupt.*/
|
||||
uint32_t rs485_clash: 1; /*Set this bit to clear the rs485_clash_int_raw interrupt.*/
|
||||
uint32_t at_cmd_char_det: 1; /*Set this bit to clear the at_cmd_char_det_int_raw interrupt.*/
|
||||
uint32_t reserved19: 13;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_clr;
|
||||
union {
|
||||
struct {
|
||||
uint32_t div_int: 20; /*The register value is the integer part of the frequency divider's factor.*/
|
||||
uint32_t div_frag: 4; /*The register value is the decimal part of the frequency divider's factor.*/
|
||||
uint32_t reserved24: 8;
|
||||
};
|
||||
uint32_t val;
|
||||
} clk_div;
|
||||
union {
|
||||
struct {
|
||||
uint32_t en: 1; /*This is the enable bit for detecting baudrate.*/
|
||||
uint32_t reserved1: 7;
|
||||
uint32_t glitch_filt: 8; /*when input pulse width is lower then this value ignore this pulse.this register is used in auto-baud detect process.*/
|
||||
uint32_t reserved16: 16;
|
||||
};
|
||||
uint32_t val;
|
||||
} auto_baud;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rxfifo_cnt: 8; /*(rx_mem_cnt rxfifo_cnt) stores the byte number of valid data in receiver's fifo. rx_mem_cnt register stores the 3 most significant bits rxfifo_cnt stores the 8 least significant bits.*/
|
||||
uint32_t st_urx_out: 4; /*This register stores the value of receiver's finite state machine. 0:RX_IDLE 1:RX_STRT 2:RX_DAT0 3:RX_DAT1 4:RX_DAT2 5:RX_DAT3 6:RX_DAT4 7:RX_DAT5 8:RX_DAT6 9:RX_DAT7 10:RX_PRTY 11:RX_STP1 12:RX_STP2 13:RX_DL1*/
|
||||
uint32_t reserved12: 1;
|
||||
uint32_t dsrn: 1; /*This register stores the level value of the internal uart dsr signal.*/
|
||||
uint32_t ctsn: 1; /*This register stores the level value of the internal uart cts signal.*/
|
||||
uint32_t rxd: 1; /*This register stores the level value of the internal uart rxd signal.*/
|
||||
uint32_t txfifo_cnt: 8; /*(tx_mem_cnt txfifo_cnt) stores the byte number of valid data in transmitter's fifo.tx_mem_cnt stores the 3 most significant bits txfifo_cnt stores the 8 least significant bits.*/
|
||||
uint32_t st_utx_out: 4; /*This register stores the value of transmitter's finite state machine. 0:TX_IDLE 1:TX_STRT 2:TX_DAT0 3:TX_DAT1 4:TX_DAT2 5:TX_DAT3 6:TX_DAT4 7:TX_DAT5 8:TX_DAT6 9:TX_DAT7 10:TX_PRTY 11:TX_STP1 12:TX_STP2 13:TX_DL0 14:TX_DL1*/
|
||||
uint32_t reserved28: 1;
|
||||
uint32_t dtrn: 1; /*The register represent the level value of the internal uart dsr signal.*/
|
||||
uint32_t rtsn: 1; /*This register represent the level value of the internal uart cts signal.*/
|
||||
uint32_t txd: 1; /*This register represent the level value of the internal uart rxd signal.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} status;
|
||||
union {
|
||||
struct {
|
||||
uint32_t parity: 1; /*This register is used to configure the parity check mode. 0:even 1:odd*/
|
||||
uint32_t parity_en: 1; /*Set this bit to enable uart parity check.*/
|
||||
uint32_t bit_num: 2; /*This register is used to set the length of data: 0:5bits 1:6bits 2:7bits 3:8bits*/
|
||||
uint32_t stop_bit_num: 2; /*This register is used to set the length of stop bit. 1:1bit 2:1.5bits 3:2bits*/
|
||||
uint32_t sw_rts: 1; /*This register is used to configure the software rts signal which is used in software flow control.*/
|
||||
uint32_t sw_dtr: 1; /*This register is used to configure the software dtr signal which is used in software flow control..*/
|
||||
uint32_t txd_brk: 1; /*Set this bit to enable transmitter to send 0 when the process of sending data is done.*/
|
||||
uint32_t irda_dplx: 1; /*Set this bit to enable irda loop-back mode.*/
|
||||
uint32_t irda_tx_en: 1; /*This is the start enable bit for irda transmitter.*/
|
||||
uint32_t irda_wctl: 1; /*1:the irda transmitter's 11th bit is the same to the 10th bit. 0:set irda transmitter's 11th bit to 0.*/
|
||||
uint32_t irda_tx_inv: 1; /*Set this bit to inverse the level value of irda transmitter's level.*/
|
||||
uint32_t irda_rx_inv: 1; /*Set this bit to inverse the level value of irda receiver's level.*/
|
||||
uint32_t loopback: 1; /*Set this bit to enable uart loop-back test mode.*/
|
||||
uint32_t tx_flow_en: 1; /*Set this bit to enable transmitter's flow control function.*/
|
||||
uint32_t irda_en: 1; /*Set this bit to enable irda protocol.*/
|
||||
uint32_t rxfifo_rst: 1; /*Set this bit to reset uart receiver's fifo.*/
|
||||
uint32_t txfifo_rst: 1; /*Set this bit to reset uart transmitter's fifo.*/
|
||||
uint32_t rxd_inv: 1; /*Set this bit to inverse the level value of uart rxd signal.*/
|
||||
uint32_t cts_inv: 1; /*Set this bit to inverse the level value of uart cts signal.*/
|
||||
uint32_t dsr_inv: 1; /*Set this bit to inverse the level value of uart dsr signal.*/
|
||||
uint32_t txd_inv: 1; /*Set this bit to inverse the level value of uart txd signal.*/
|
||||
uint32_t rts_inv: 1; /*Set this bit to inverse the level value of uart rts signal.*/
|
||||
uint32_t dtr_inv: 1; /*Set this bit to inverse the level value of uart dtr signal.*/
|
||||
uint32_t clk_en: 1; /*1:force clock on for registers:support clock only when write registers*/
|
||||
uint32_t err_wr_mask: 1; /*1:receiver stops storing data int fifo when data is wrong. 0:receiver stores the data even if the received data is wrong.*/
|
||||
uint32_t tick_ref_always_on: 1; /*This register is used to select the clock.1:apb clock:ref_tick*/
|
||||
uint32_t reserved28: 4;
|
||||
};
|
||||
uint32_t val;
|
||||
} conf0;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rxfifo_full_thrhd: 7; /*When receiver receives more data than its threshold value,receiver will produce rxfifo_full_int_raw interrupt.the threshold value is (rx_flow_thrhd_h3 rxfifo_full_thrhd).*/
|
||||
uint32_t reserved7: 1;
|
||||
uint32_t txfifo_empty_thrhd: 7; /*when the data amount in transmitter fifo is less than its threshold value, it will produce txfifo_empty_int_raw interrupt. the threshold value is (tx_mem_empty_thrhd txfifo_empty_thrhd)*/
|
||||
uint32_t reserved15: 1;
|
||||
uint32_t rx_flow_thrhd: 7; /*when receiver receives more data than its threshold value, receiver produce signal to tell the transmitter stop transferring data. the threshold value is (rx_flow_thrhd_h3 rx_flow_thrhd).*/
|
||||
uint32_t rx_flow_en: 1; /*This is the flow enable bit for uart receiver. 1:choose software flow control with configuring sw_rts signal*/
|
||||
uint32_t rx_tout_thrhd: 7; /*This register is used to configure the timeout value for uart receiver receiving a byte.*/
|
||||
uint32_t rx_tout_en: 1; /*This is the enable bit for uart receiver's timeout function.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} conf1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t min_cnt: 20; /*This register stores the value of the minimum duration time for the low level pulse, it is used in baudrate-detect process.*/
|
||||
uint32_t reserved20: 12;
|
||||
};
|
||||
uint32_t val;
|
||||
} lowpulse;
|
||||
union {
|
||||
struct {
|
||||
uint32_t min_cnt: 20; /*This register stores the value of the maximum duration time for the high level pulse, it is used in baudrate-detect process.*/
|
||||
uint32_t reserved20: 12;
|
||||
};
|
||||
uint32_t val;
|
||||
} highpulse;
|
||||
union {
|
||||
struct {
|
||||
uint32_t edge_cnt: 10; /*This register stores the count of rxd edge change, it is used in baudrate-detect process.*/
|
||||
uint32_t reserved10: 22;
|
||||
};
|
||||
uint32_t val;
|
||||
} rxd_cnt;
|
||||
union {
|
||||
struct {
|
||||
uint32_t sw_flow_con_en: 1; /*Set this bit to enable software flow control. it is used with register sw_xon or sw_xoff .*/
|
||||
uint32_t xonoff_del: 1; /*Set this bit to remove flow control char from the received data.*/
|
||||
uint32_t force_xon: 1; /*Set this bit to clear ctsn to stop the transmitter from sending data.*/
|
||||
uint32_t force_xoff: 1; /*Set this bit to set ctsn to enable the transmitter to go on sending data.*/
|
||||
uint32_t send_xon: 1; /*Set this bit to send xon char, it is cleared by hardware automatically.*/
|
||||
uint32_t send_xoff: 1; /*Set this bit to send xoff char, it is cleared by hardware automatically.*/
|
||||
uint32_t reserved6: 26;
|
||||
};
|
||||
uint32_t val;
|
||||
} flow_conf;
|
||||
union {
|
||||
struct {
|
||||
uint32_t active_threshold:10; /*When the input rxd edge changes more than this register value, the uart is active from light sleeping mode.*/
|
||||
uint32_t reserved10: 22;
|
||||
};
|
||||
uint32_t val;
|
||||
} sleep_conf;
|
||||
union {
|
||||
struct {
|
||||
uint32_t xon_threshold: 8; /*when the data amount in receiver's fifo is more than this register value, it will send a xoff char with uart_sw_flow_con_en set to 1.*/
|
||||
uint32_t xoff_threshold: 8; /*When the data amount in receiver's fifo is less than this register value, it will send a xon char with uart_sw_flow_con_en set to 1.*/
|
||||
uint32_t xon_char: 8; /*This register stores the xon flow control char.*/
|
||||
uint32_t xoff_char: 8; /*This register stores the xoff flow control char.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} swfc_conf;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rx_idle_thrhd:10; /*when receiver takes more time than this register value to receive a byte data, it will produce frame end signal for uhci to stop receiving data.*/
|
||||
uint32_t tx_idle_num: 10; /*This register is used to configure the duration time between transfers.*/
|
||||
uint32_t tx_brk_num: 8; /*This register is used to configure the number of 0 send after the process of sending data is done. it is active when txd_brk is set to 1.*/
|
||||
uint32_t reserved28: 4;
|
||||
};
|
||||
uint32_t val;
|
||||
} idle_conf;
|
||||
union {
|
||||
struct {
|
||||
uint32_t en: 1; /*Set this bit to choose rs485 mode.*/
|
||||
uint32_t dl0_en: 1; /*Set this bit to delay the stop bit by 1 bit.*/
|
||||
uint32_t dl1_en: 1; /*Set this bit to delay the stop bit by 1 bit.*/
|
||||
uint32_t tx_rx_en: 1; /*Set this bit to enable loop-back transmitter's output data signal to receiver's input data signal.*/
|
||||
uint32_t rx_busy_tx_en: 1; /*1: enable rs485's transmitter to send data when rs485's receiver is busy. 0:rs485's transmitter should not send data when its receiver is busy.*/
|
||||
uint32_t rx_dly_num: 1; /*This register is used to delay the receiver's internal data signal.*/
|
||||
uint32_t tx_dly_num: 4; /*This register is used to delay the transmitter's internal data signal.*/
|
||||
uint32_t reserved10: 22;
|
||||
};
|
||||
uint32_t val;
|
||||
} rs485_conf;
|
||||
union {
|
||||
struct {
|
||||
uint32_t pre_idle_num:24; /*This register is used to configure the idle duration time before the first at_cmd is received by receiver, when the the duration is less than this register value it will not take the next data received as at_cmd char.*/
|
||||
uint32_t reserved24: 8;
|
||||
};
|
||||
uint32_t val;
|
||||
} at_cmd_precnt;
|
||||
union {
|
||||
struct {
|
||||
uint32_t post_idle_num:24; /*This register is used to configure the duration time between the last at_cmd and the next data, when the duration is less than this register value it will not take the previous data as at_cmd char.*/
|
||||
uint32_t reserved24: 8;
|
||||
};
|
||||
uint32_t val;
|
||||
} at_cmd_postcnt;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rx_gap_tout:24; /*This register is used to configure the duration time between the at_cmd chars, when the duration time is less than this register value it will not take the data as continous at_cmd chars.*/
|
||||
uint32_t reserved24: 8;
|
||||
};
|
||||
uint32_t val;
|
||||
} at_cmd_gaptout;
|
||||
union {
|
||||
struct {
|
||||
uint32_t data: 8; /*This register is used to configure the content of at_cmd char.*/
|
||||
uint32_t char_num: 8; /*This register is used to configure the number of continuous at_cmd chars received by receiver.*/
|
||||
uint32_t reserved16: 16;
|
||||
};
|
||||
uint32_t val;
|
||||
} at_cmd_char;
|
||||
union {
|
||||
struct {
|
||||
uint32_t mem_pd: 1; /*Set this bit to power down memory,when reg_mem_pd registers in the 3 uarts are all set to 1 memory will enter low power mode.*/
|
||||
uint32_t reserved1: 1;
|
||||
uint32_t reserved2: 1;
|
||||
uint32_t rx_size: 4; /*This register is used to configure the amount of mem allocated to receiver's fifo. the default byte num is 128.*/
|
||||
uint32_t tx_size: 4; /*This register is used to configure the amount of mem allocated to transmitter's fifo.the default byte num is 128.*/
|
||||
uint32_t reserved11: 4;
|
||||
uint32_t rx_flow_thrhd_h3: 3; /*refer to the rx_flow_thrhd's description.*/
|
||||
uint32_t rx_tout_thrhd_h3: 3; /*refer to the rx_tout_thrhd's description.*/
|
||||
uint32_t xon_threshold_h2: 2; /*refer to the uart_xon_threshold's description.*/
|
||||
uint32_t xoff_threshold_h2: 2; /*refer to the uart_xoff_threshold's description.*/
|
||||
uint32_t rx_mem_full_thrhd: 3; /*refer to the rxfifo_full_thrhd's description.*/
|
||||
uint32_t tx_mem_empty_thrhd: 3; /*refer to txfifo_empty_thrhd 's description.*/
|
||||
uint32_t reserved31: 1;
|
||||
};
|
||||
uint32_t val;
|
||||
} mem_conf;
|
||||
union {
|
||||
struct {
|
||||
uint32_t status:24;
|
||||
uint32_t reserved24: 8;
|
||||
};
|
||||
uint32_t val;
|
||||
} mem_tx_status;
|
||||
union {
|
||||
struct {
|
||||
uint32_t status:24;
|
||||
uint32_t reserved24: 8;
|
||||
};
|
||||
uint32_t val;
|
||||
} mem_rx_status;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rx_cnt: 3; /*refer to the rxfifo_cnt's description.*/
|
||||
uint32_t tx_cnt: 3; /*refer to the txfifo_cnt's description.*/
|
||||
uint32_t reserved6: 26;
|
||||
};
|
||||
uint32_t val;
|
||||
} mem_cnt_status;
|
||||
union {
|
||||
struct {
|
||||
uint32_t min_cnt: 20; /*This register stores the count of rxd pos-edge edge, it is used in baudrate-detect process.*/
|
||||
uint32_t reserved20: 12;
|
||||
};
|
||||
uint32_t val;
|
||||
} pospulse;
|
||||
union {
|
||||
struct {
|
||||
uint32_t min_cnt: 20; /*This register stores the count of rxd neg-edge edge, it is used in baudrate-detect process.*/
|
||||
uint32_t reserved20: 12;
|
||||
};
|
||||
uint32_t val;
|
||||
} negpulse;
|
||||
uint32_t reserved_70;
|
||||
uint32_t reserved_74;
|
||||
uint32_t date; /**/
|
||||
uint32_t id; /**/
|
||||
} uart_dev_t;
|
||||
extern uart_dev_t UART0;
|
||||
extern uart_dev_t UART1;
|
||||
extern uart_dev_t UART2;
|
||||
#endif /* _SOC_UART_STRUCT_H_ */
|
File diff suppressed because it is too large
Load Diff
@ -1,337 +0,0 @@
|
||||
// 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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#ifndef _SOC_UHCI_STRUCT_H_
|
||||
#define _SOC_UHCI_STRUCT_H_
|
||||
typedef volatile struct {
|
||||
union {
|
||||
struct {
|
||||
uint32_t in_rst: 1; /*Set this bit to reset in link operations.*/
|
||||
uint32_t out_rst: 1; /*Set this bit to reset out link operations.*/
|
||||
uint32_t ahbm_fifo_rst: 1; /*Set this bit to reset dma ahb fifo.*/
|
||||
uint32_t ahbm_rst: 1; /*Set this bit to reset dma ahb interface.*/
|
||||
uint32_t in_loop_test: 1; /*Set this bit to enable loop test for in links.*/
|
||||
uint32_t out_loop_test: 1; /*Set this bit to enable loop test for out links.*/
|
||||
uint32_t out_auto_wrback: 1; /*when in link's length is 0 go on to use the next in link automatically.*/
|
||||
uint32_t out_no_restart_clr: 1; /*don't use*/
|
||||
uint32_t out_eof_mode: 1; /*Set this bit to produce eof after DMA pops all data clear this bit to produce eof after DMA pushes all data*/
|
||||
uint32_t uart0_ce: 1; /*Set this bit to use UART to transmit or receive data.*/
|
||||
uint32_t uart1_ce: 1; /*Set this bit to use UART1 to transmit or receive data.*/
|
||||
uint32_t uart2_ce: 1; /*Set this bit to use UART2 to transmit or receive data.*/
|
||||
uint32_t outdscr_burst_en: 1; /*Set this bit to enable DMA in links to use burst mode.*/
|
||||
uint32_t indscr_burst_en: 1; /*Set this bit to enable DMA out links to use burst mode.*/
|
||||
uint32_t out_data_burst_en: 1; /*Set this bit to enable DMA burst MODE*/
|
||||
uint32_t mem_trans_en: 1;
|
||||
uint32_t seper_en: 1; /*Set this bit to use special char to separate the data frame.*/
|
||||
uint32_t head_en: 1; /*Set this bit to enable to use head packet before the data frame.*/
|
||||
uint32_t crc_rec_en: 1; /*Set this bit to enable receiver''s ability of crc calculation when crc_en bit in head packet is 1 then there will be crc bytes after data_frame*/
|
||||
uint32_t uart_idle_eof_en: 1; /*Set this bit to enable to use idle time when the idle time after data frame is satisfied this means the end of a data frame.*/
|
||||
uint32_t len_eof_en: 1; /*Set this bit to enable to use packet_len in packet head when the received data is equal to packet_len this means the end of a data frame.*/
|
||||
uint32_t encode_crc_en: 1; /*Set this bit to enable crc calculation for data frame when bit6 in the head packet is 1.*/
|
||||
uint32_t clk_en: 1; /*Set this bit to enable clock-gating for read or write registers.*/
|
||||
uint32_t uart_rx_brk_eof_en: 1; /*Set this bit to enable to use brk char as the end of a data frame.*/
|
||||
uint32_t reserved24: 8;
|
||||
};
|
||||
uint32_t val;
|
||||
} conf0;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rx_start: 1; /*when a separator char has been send it will produce uhci_rx_start_int interrupt.*/
|
||||
uint32_t tx_start: 1; /*when DMA detects a separator char it will produce uhci_tx_start_int interrupt.*/
|
||||
uint32_t rx_hung: 1; /*when DMA takes a lot of time to receive a data it will produce uhci_rx_hung_int interrupt.*/
|
||||
uint32_t tx_hung: 1; /*when DMA takes a lot of time to read a data from RAM it will produce uhci_tx_hung_int interrupt.*/
|
||||
uint32_t in_done: 1; /*when a in link descriptor has been completed it will produce uhci_in_done_int interrupt.*/
|
||||
uint32_t in_suc_eof: 1; /*when a data packet has been received it will produce uhci_in_suc_eof_int interrupt.*/
|
||||
uint32_t in_err_eof: 1; /*when there are some errors about eof in in link descriptor it will produce uhci_in_err_eof_int interrupt.*/
|
||||
uint32_t out_done: 1; /*when a out link descriptor is completed it will produce uhci_out_done_int interrupt.*/
|
||||
uint32_t out_eof: 1; /*when the current descriptor's eof bit is 1 it will produce uhci_out_eof_int interrupt.*/
|
||||
uint32_t in_dscr_err: 1; /*when there are some errors about the out link descriptor it will produce uhci_in_dscr_err_int interrupt.*/
|
||||
uint32_t out_dscr_err: 1; /*when there are some errors about the in link descriptor it will produce uhci_out_dscr_err_int interrupt.*/
|
||||
uint32_t in_dscr_empty: 1; /*when there are not enough in links for DMA it will produce uhci_in_dscr_err_int interrupt.*/
|
||||
uint32_t outlink_eof_err: 1; /*when there are some errors about eof in outlink descriptor it will produce uhci_outlink_eof_err_int interrupt.*/
|
||||
uint32_t out_total_eof: 1; /*When all data have been send it will produce uhci_out_total_eof_int interrupt.*/
|
||||
uint32_t send_s_q: 1; /*When use single send registers to send a short packets it will produce this interrupt when dma has send the short packet.*/
|
||||
uint32_t send_a_q: 1; /*When use always_send registers to send a series of short packets it will produce this interrupt when dma has send the short packet.*/
|
||||
uint32_t dma_in_fifo_full_wm: 1;
|
||||
uint32_t reserved17: 15;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_raw;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rx_start: 1;
|
||||
uint32_t tx_start: 1;
|
||||
uint32_t rx_hung: 1;
|
||||
uint32_t tx_hung: 1;
|
||||
uint32_t in_done: 1;
|
||||
uint32_t in_suc_eof: 1;
|
||||
uint32_t in_err_eof: 1;
|
||||
uint32_t out_done: 1;
|
||||
uint32_t out_eof: 1;
|
||||
uint32_t in_dscr_err: 1;
|
||||
uint32_t out_dscr_err: 1;
|
||||
uint32_t in_dscr_empty: 1;
|
||||
uint32_t outlink_eof_err: 1;
|
||||
uint32_t out_total_eof: 1;
|
||||
uint32_t send_s_q: 1;
|
||||
uint32_t send_a_q: 1;
|
||||
uint32_t dma_in_fifo_full_wm: 1;
|
||||
uint32_t reserved17: 15;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_st;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rx_start: 1;
|
||||
uint32_t tx_start: 1;
|
||||
uint32_t rx_hung: 1;
|
||||
uint32_t tx_hung: 1;
|
||||
uint32_t in_done: 1;
|
||||
uint32_t in_suc_eof: 1;
|
||||
uint32_t in_err_eof: 1;
|
||||
uint32_t out_done: 1;
|
||||
uint32_t out_eof: 1;
|
||||
uint32_t in_dscr_err: 1;
|
||||
uint32_t out_dscr_err: 1;
|
||||
uint32_t in_dscr_empty: 1;
|
||||
uint32_t outlink_eof_err: 1;
|
||||
uint32_t out_total_eof: 1;
|
||||
uint32_t send_s_q: 1;
|
||||
uint32_t send_a_q: 1;
|
||||
uint32_t dma_in_fifo_full_wm: 1;
|
||||
uint32_t reserved17: 15;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_ena;
|
||||
union {
|
||||
struct {
|
||||
uint32_t rx_start: 1;
|
||||
uint32_t tx_start: 1;
|
||||
uint32_t rx_hung: 1;
|
||||
uint32_t tx_hung: 1;
|
||||
uint32_t in_done: 1;
|
||||
uint32_t in_suc_eof: 1;
|
||||
uint32_t in_err_eof: 1;
|
||||
uint32_t out_done: 1;
|
||||
uint32_t out_eof: 1;
|
||||
uint32_t in_dscr_err: 1;
|
||||
uint32_t out_dscr_err: 1;
|
||||
uint32_t in_dscr_empty: 1;
|
||||
uint32_t outlink_eof_err: 1;
|
||||
uint32_t out_total_eof: 1;
|
||||
uint32_t send_s_q: 1;
|
||||
uint32_t send_a_q: 1;
|
||||
uint32_t dma_in_fifo_full_wm: 1;
|
||||
uint32_t reserved17: 15;
|
||||
};
|
||||
uint32_t val;
|
||||
} int_clr;
|
||||
union {
|
||||
struct {
|
||||
uint32_t full: 1; /*1:DMA out link descriptor's fifo is full.*/
|
||||
uint32_t empty: 1; /*1:DMA in link descriptor's fifo is empty.*/
|
||||
uint32_t reserved2: 30;
|
||||
};
|
||||
uint32_t val;
|
||||
} dma_out_status;
|
||||
union {
|
||||
struct {
|
||||
uint32_t fifo_wdata: 9; /*This is the data need to be pushed into out link descriptor's fifo.*/
|
||||
uint32_t reserved9: 7;
|
||||
uint32_t fifo_push: 1; /*Set this bit to push data in out link descriptor's fifo.*/
|
||||
uint32_t reserved17:15;
|
||||
};
|
||||
uint32_t val;
|
||||
} dma_out_push;
|
||||
union {
|
||||
struct {
|
||||
uint32_t full: 1;
|
||||
uint32_t empty: 1;
|
||||
uint32_t reserved2: 2;
|
||||
uint32_t rx_err_cause: 3; /*This register stores the errors caused in out link descriptor's data packet.*/
|
||||
uint32_t reserved7: 25;
|
||||
};
|
||||
uint32_t val;
|
||||
} dma_in_status;
|
||||
union {
|
||||
struct {
|
||||
uint32_t fifo_rdata: 12; /*This register stores the data pop from in link descriptor's fifo.*/
|
||||
uint32_t reserved12: 4;
|
||||
uint32_t fifo_pop: 1; /*Set this bit to pop data in in link descriptor's fifo.*/
|
||||
uint32_t reserved17: 15;
|
||||
};
|
||||
uint32_t val;
|
||||
} dma_in_pop;
|
||||
union {
|
||||
struct {
|
||||
uint32_t addr: 20; /*This register stores the least 20 bits of the first out link descriptor's address.*/
|
||||
uint32_t reserved20: 8;
|
||||
uint32_t stop: 1; /*Set this bit to stop dealing with the out link descriptors.*/
|
||||
uint32_t start: 1; /*Set this bit to start dealing with the out link descriptors.*/
|
||||
uint32_t restart: 1; /*Set this bit to mount on new out link descriptors*/
|
||||
uint32_t park: 1; /*1: the out link descriptor's fsm is in idle state. 0:the out link descriptor's fsm is working.*/
|
||||
};
|
||||
uint32_t val;
|
||||
} dma_out_link;
|
||||
union {
|
||||
struct {
|
||||
uint32_t addr: 20; /*This register stores the least 20 bits of the first in link descriptor's address.*/
|
||||
uint32_t auto_ret: 1; /*1:when a packet is wrong in link descriptor returns to the descriptor which is lately used.*/
|
||||
uint32_t reserved21: 7;
|
||||
uint32_t stop: 1; /*Set this bit to stop dealing with the in link descriptors.*/
|
||||
uint32_t start: 1; /*Set this bit to start dealing with the in link descriptors.*/
|
||||
uint32_t restart: 1; /*Set this bit to mount on new in link descriptors*/
|
||||
uint32_t park: 1; /*1:the in link descriptor's fsm is in idle state. 0:the in link descriptor's fsm is working*/
|
||||
};
|
||||
uint32_t val;
|
||||
} dma_in_link;
|
||||
union {
|
||||
struct {
|
||||
uint32_t check_sum_en: 1; /*Set this bit to enable decoder to check check_sum in packet header.*/
|
||||
uint32_t check_seq_en: 1; /*Set this bit to enable decoder to check seq num in packet header.*/
|
||||
uint32_t crc_disable: 1; /*Set this bit to disable crc calculation.*/
|
||||
uint32_t save_head: 1; /*Set this bit to save packet header .*/
|
||||
uint32_t tx_check_sum_re: 1; /*Set this bit to enable hardware replace check_sum in packet header automatically.*/
|
||||
uint32_t tx_ack_num_re: 1; /*Set this bit to enable hardware replace ack num in packet header automatically.*/
|
||||
uint32_t check_owner: 1; /*Set this bit to check the owner bit in link descriptor.*/
|
||||
uint32_t wait_sw_start: 1; /*Set this bit to enable software way to add packet header.*/
|
||||
uint32_t sw_start: 1; /*Set this bit to start inserting the packet header.*/
|
||||
uint32_t dma_in_fifo_full_thrs:12; /*when data amount in link descriptor's fifo is more than this register value it will produce uhci_dma_in_fifo_full_wm_int interrupt.*/
|
||||
uint32_t reserved21: 11;
|
||||
};
|
||||
uint32_t val;
|
||||
} conf1;
|
||||
uint32_t state0; /**/
|
||||
uint32_t state1; /**/
|
||||
uint32_t dma_out_eof_des_addr; /*This register stores the address of out link description when eof bit in this descriptor is 1.*/
|
||||
uint32_t dma_in_suc_eof_des_addr; /*This register stores the address of in link descriptor when eof bit in this descriptor is 1.*/
|
||||
uint32_t dma_in_err_eof_des_addr; /*This register stores the address of in link descriptor when there are some errors in this descriptor.*/
|
||||
uint32_t dma_out_eof_bfr_des_addr; /*This register stores the address of out link descriptor when there are some errors in this descriptor.*/
|
||||
union {
|
||||
struct {
|
||||
uint32_t test_mode: 3; /*bit2 is ahb bus test enable ,bit1 is used to choose write(1) or read(0) mode. bit0 is used to choose test only once(1) or continue(0)*/
|
||||
uint32_t reserved3: 1;
|
||||
uint32_t test_addr: 2; /*The two bits represent ahb bus address bit[20:19]*/
|
||||
uint32_t reserved6: 26;
|
||||
};
|
||||
uint32_t val;
|
||||
} ahb_test;
|
||||
uint32_t dma_in_dscr; /*The content of current in link descriptor's third dword*/
|
||||
uint32_t dma_in_dscr_bf0; /*The content of current in link descriptor's first dword*/
|
||||
uint32_t dma_in_dscr_bf1; /*The content of current in link descriptor's second dword*/
|
||||
uint32_t dma_out_dscr; /*The content of current out link descriptor's third dword*/
|
||||
uint32_t dma_out_dscr_bf0; /*The content of current out link descriptor's first dword*/
|
||||
uint32_t dma_out_dscr_bf1; /*The content of current out link descriptor's second dword*/
|
||||
union {
|
||||
struct {
|
||||
uint32_t tx_c0_esc_en: 1; /*Set this bit to enable 0xc0 char decode when DMA receives data.*/
|
||||
uint32_t tx_db_esc_en: 1; /*Set this bit to enable 0xdb char decode when DMA receives data.*/
|
||||
uint32_t tx_11_esc_en: 1; /*Set this bit to enable flow control char 0x11 decode when DMA receives data.*/
|
||||
uint32_t tx_13_esc_en: 1; /*Set this bit to enable flow control char 0x13 decode when DMA receives data.*/
|
||||
uint32_t rx_c0_esc_en: 1; /*Set this bit to enable 0xc0 char replace when DMA sends data.*/
|
||||
uint32_t rx_db_esc_en: 1; /*Set this bit to enable 0xdb char replace when DMA sends data.*/
|
||||
uint32_t rx_11_esc_en: 1; /*Set this bit to enable flow control char 0x11 replace when DMA sends data.*/
|
||||
uint32_t rx_13_esc_en: 1; /*Set this bit to enable flow control char 0x13 replace when DMA sends data.*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} escape_conf;
|
||||
union {
|
||||
struct {
|
||||
uint32_t txfifo_timeout: 8; /*This register stores the timeout value.when DMA takes more time than this register value to receive a data it will produce uhci_tx_hung_int interrupt.*/
|
||||
uint32_t txfifo_timeout_shift: 3; /*The tick count is cleared when its value >=(17'd8000>>reg_txfifo_timeout_shift)*/
|
||||
uint32_t txfifo_timeout_ena: 1; /*The enable bit for tx fifo receive data timeout*/
|
||||
uint32_t rxfifo_timeout: 8; /*This register stores the timeout value.when DMA takes more time than this register value to read a data from RAM it will produce uhci_rx_hung_int interrupt.*/
|
||||
uint32_t rxfifo_timeout_shift: 3; /*The tick count is cleared when its value >=(17'd8000>>reg_rxfifo_timeout_shift)*/
|
||||
uint32_t rxfifo_timeout_ena: 1; /*This is the enable bit for DMA send data timeout*/
|
||||
uint32_t reserved24: 8;
|
||||
};
|
||||
uint32_t val;
|
||||
} hung_conf;
|
||||
uint32_t ack_num; /**/
|
||||
uint32_t rx_head; /*This register stores the packet header received by DMA*/
|
||||
union {
|
||||
struct {
|
||||
uint32_t single_send_num: 3; /*The bits are used to choose which short packet*/
|
||||
uint32_t single_send_en: 1; /*Set this bit to enable send a short packet*/
|
||||
uint32_t always_send_num: 3; /*The bits are used to choose which short packet*/
|
||||
uint32_t always_send_en: 1; /*Set this bit to enable continuously send the same short packet*/
|
||||
uint32_t reserved8: 24;
|
||||
};
|
||||
uint32_t val;
|
||||
} quick_sent;
|
||||
struct{
|
||||
uint32_t w_data[2]; /*This register stores the content of short packet's dword*/
|
||||
} q_data[7];
|
||||
union {
|
||||
struct {
|
||||
uint32_t seper_char: 8; /*This register stores the separator char separator char is used to separate the data frame.*/
|
||||
uint32_t seper_esc_char0: 8; /*This register stores the first char used to replace separator char in data.*/
|
||||
uint32_t seper_esc_char1: 8; /*This register stores the second char used to replace separator char in data . 0xdc 0xdb replace 0xc0 by default.*/
|
||||
uint32_t reserved24: 8;
|
||||
};
|
||||
uint32_t val;
|
||||
} esc_conf0;
|
||||
union {
|
||||
struct {
|
||||
uint32_t seq0: 8; /*This register stores the first substitute char used to replace the separate char.*/
|
||||
uint32_t seq0_char0: 8; /*This register stores the first char used to replace reg_esc_seq0 in data.*/
|
||||
uint32_t seq0_char1: 8; /*This register stores the second char used to replace the reg_esc_seq0 in data*/
|
||||
uint32_t reserved24: 8;
|
||||
};
|
||||
uint32_t val;
|
||||
} esc_conf1;
|
||||
union {
|
||||
struct {
|
||||
uint32_t seq1: 8; /*This register stores the flow control char to turn on the flow_control*/
|
||||
uint32_t seq1_char0: 8; /*This register stores the first char used to replace the reg_esc_seq1 in data.*/
|
||||
uint32_t seq1_char1: 8; /*This register stores the second char used to replace the reg_esc_seq1 in data.*/
|
||||
uint32_t reserved24: 8;
|
||||
};
|
||||
uint32_t val;
|
||||
} esc_conf2;
|
||||
union {
|
||||
struct {
|
||||
uint32_t seq2: 8; /*This register stores the flow_control char to turn off the flow_control*/
|
||||
uint32_t seq2_char0: 8; /*This register stores the first char used to replace the reg_esc_seq2 in data.*/
|
||||
uint32_t seq2_char1: 8; /*This register stores the second char used to replace the reg_esc_seq2 in data.*/
|
||||
uint32_t reserved24: 8;
|
||||
};
|
||||
uint32_t val;
|
||||
} esc_conf3;
|
||||
union {
|
||||
struct {
|
||||
uint32_t thrs: 13; /*when the amount of packet payload is larger than this value the process of receiving data is done.*/
|
||||
uint32_t reserved13:19;
|
||||
};
|
||||
uint32_t val;
|
||||
} pkt_thres;
|
||||
uint32_t reserved_c4;
|
||||
uint32_t reserved_c8;
|
||||
uint32_t reserved_cc;
|
||||
uint32_t reserved_d0;
|
||||
uint32_t reserved_d4;
|
||||
uint32_t reserved_d8;
|
||||
uint32_t reserved_dc;
|
||||
uint32_t reserved_e0;
|
||||
uint32_t reserved_e4;
|
||||
uint32_t reserved_e8;
|
||||
uint32_t reserved_ec;
|
||||
uint32_t reserved_f0;
|
||||
uint32_t reserved_f4;
|
||||
uint32_t reserved_f8;
|
||||
uint32_t date; /*version information*/
|
||||
} uhci_dev_t;
|
||||
extern uhci_dev_t UHCI0;
|
||||
extern uhci_dev_t UHCI1;
|
||||
#endif /* _SOC_UHCI_STRUCT_H_ */
|
@ -1,20 +0,0 @@
|
||||
// Copyright 2010-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 applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "soc.h"
|
||||
|
||||
/* Hardware random number generator register */
|
||||
#define WDEV_RND_REG 0x60035144
|
Reference in New Issue
Block a user