|
1 | 1 | /* |
2 | | - * SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD |
| 2 | + * SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD |
3 | 3 | * |
4 | 4 | * SPDX-License-Identifier: Apache-2.0 |
5 | 5 | */ |
@@ -717,6 +717,78 @@ static inline void spimem_flash_ll_set_common_command_register_info(spi_mem_dev_ |
717 | 717 | dev->user2.val = user2_reg; |
718 | 718 | } |
719 | 719 |
|
| 720 | +#define SPIMEM_FLASH_LL_SUSPEND_END_INTR SPI_MEM_PES_END_INT_ENA_M |
| 721 | +#define SPIMEM_FLASH_LL_INTERRUPT_SOURCE ETS_SPI1_INTR_SOURCE |
| 722 | + |
| 723 | +/** |
| 724 | + * @brief Get the address of the interrupt status register. |
| 725 | + * |
| 726 | + * This function returns a pointer to the interrupt status register of the SPI memory device. |
| 727 | + * |
| 728 | + * @param[in] dev Pointer to the SPI memory device structure. |
| 729 | + * @return volatile void* Pointer to the interrupt status register. |
| 730 | + */ |
| 731 | +static inline volatile void *spimem_flash_ll_get_interrupt_status_reg(spi_mem_dev_t *dev) |
| 732 | +{ |
| 733 | + return &dev->int_st; |
| 734 | +} |
| 735 | + |
| 736 | +/** |
| 737 | + * @brief Clear specific interrupt status bits. |
| 738 | + * |
| 739 | + * This function clears the specified interrupt bits in the interrupt clear register of the SPI memory device. |
| 740 | + * |
| 741 | + * @param[in] dev Pointer to the SPI memory device structure. |
| 742 | + * @param[in] mask Bitmask specifying which interrupt bits to clear. |
| 743 | + */ |
| 744 | +__attribute__((always_inline)) |
| 745 | +static inline void spimem_flash_ll_clear_intr_mask(spi_mem_dev_t *dev, uint32_t mask) |
| 746 | +{ |
| 747 | + dev->int_clr.val = mask; |
| 748 | +} |
| 749 | + |
| 750 | +/** |
| 751 | + * @brief Enable specific interrupt bits. |
| 752 | + * |
| 753 | + * This function enables the specified interrupts in the interrupt enable register of the SPI memory device. |
| 754 | + * |
| 755 | + * @param[in] dev Pointer to the SPI memory device structure. |
| 756 | + * @param[in] mask Bitmask specifying which interrupt bits to enable. |
| 757 | + */ |
| 758 | +__attribute__((always_inline)) |
| 759 | +static inline void spimem_flash_ll_enable_intr_mask(spi_mem_dev_t *dev, uint32_t mask) |
| 760 | +{ |
| 761 | + dev->int_ena.val |= mask; |
| 762 | +} |
| 763 | + |
| 764 | +/** |
| 765 | + * @brief Disable specific interrupt bits. |
| 766 | + * |
| 767 | + * This function disables the specified interrupts in the interrupt enable register of the SPI memory device. |
| 768 | + * |
| 769 | + * @param[in] dev Pointer to the SPI memory device structure. |
| 770 | + * @param[in] mask Bitmask specifying which interrupt bits to disable. |
| 771 | + */ |
| 772 | +__attribute__((always_inline)) |
| 773 | +static inline void spimem_flash_ll_disable_intr_mask(spi_mem_dev_t *dev, uint32_t mask) |
| 774 | +{ |
| 775 | + dev->int_ena.val &= (~mask); |
| 776 | +} |
| 777 | + |
| 778 | +/** |
| 779 | + * @brief Get the current interrupt status. |
| 780 | + * |
| 781 | + * This function retrieves the current interrupt status from the interrupt status register of the SPI memory device. |
| 782 | + * |
| 783 | + * @param[in] dev Pointer to the SPI memory device structure. |
| 784 | + * @param[out] intr_status Pointer to a variable where the interrupt status will be stored. |
| 785 | + */ |
| 786 | +__attribute__((always_inline)) |
| 787 | +static inline void spimem_flash_ll_get_intr_mask(spi_mem_dev_t *dev, uint32_t *intr_status) |
| 788 | +{ |
| 789 | + *intr_status = dev->int_st.val; |
| 790 | +} |
| 791 | + |
720 | 792 | #ifdef __cplusplus |
721 | 793 | } |
722 | 794 | #endif |
0 commit comments