HAL SRAM Functions ¶
Initialization and de-initialization functions ¶
- group SRAM_Exported_Functions_Group1
-
This subsection provides a set of functions allowing to initialize and de-initialize the SRAM driver :
-
The HAL_SRAM_Init() API : allows to initialize the SRAM handle and enable the peripheral clock when USE_FMC_CLK_ENABLE_MODEL is different from HAL_CLK_ENABLE_NO.
-
The HAL_SRAM_DeInit() API : allows to de-init the HAL SRAM driver for the given handle and disable the write protection and the corresponding SRAM sub-bank.
Functions
-
hal_status_t
HAL_SRAM_Init
(
hal_sram_handle_t
*
hsram
,
hal_sram_t
instance
)
¶
-
Initialize the SRAM handle field and associate a physical instance.
Note
The FMC clock can be activated within the HAL_SRAM_Init() function by setting the USE_FMC_CLK_ENABLE_MODEL flag to HAL_CLK_ENABLE_PERIPH_ONLY in the configuration file stm32u5xx_hal_conf.h or by explicitly calling the HAL_RCC_FSMC_EnableClock() API within the application when the USE_FMC_CLK_ENABLE_MODEL is not defined or defined to flag HAL_CLK_ENABLE_NO
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
instance – hal_sram_t enumerated type variable to be set according to the physical instance.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when the SRAM handle is NULL.
-
HAL_OK – The HAL SRAM driver is initialized according to the given handle and instance.
-
-
void
HAL_SRAM_DeInit
(
hal_sram_handle_t
*
hsram
)
¶
-
De-init the HAL SRAM driver for the given handle and disable the write protection and the corresponding SRAM sub-bank.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
-
- group SRAM_Exported_Functions_Group1
-
This subsection provides a set of functions allowing to initialize and de-initialize the SRAM driver :
-
The HAL_SRAM_Init() API : allows to initialize the SRAM handle and enable the peripheral clock when USE_FMC_CLK_ENABLE_MODEL is different from HAL_CLK_ENABLE_NO.
-
The HAL_SRAM_DeInit() API : allows to de-init the HAL SRAM driver for the given handle and disable the write protection and the corresponding SRAM sub-bank.
Functions
-
hal_status_t
HAL_SRAM_Init
(
hal_sram_handle_t
*
hsram
,
hal_sram_t
instance
)
-
Initialize the SRAM handle field and associate a physical instance.
Note
The FMC clock can be activated within the HAL_SRAM_Init() function by setting the USE_FMC_CLK_ENABLE_MODEL flag to HAL_CLK_ENABLE_PERIPH_ONLY in the configuration file stm32u5xx_hal_conf.h or by explicitly calling the HAL_RCC_FSMC_EnableClock() API within the application when the USE_FMC_CLK_ENABLE_MODEL is not defined or defined to flag HAL_CLK_ENABLE_NO
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
instance – hal_sram_t enumerated type variable to be set according to the physical instance.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when the SRAM handle is NULL.
-
HAL_OK – The HAL SRAM driver is initialized according to the given handle and instance.
-
-
void
HAL_SRAM_DeInit
(
hal_sram_handle_t
*
hsram
)
-
De-init the HAL SRAM driver for the given handle and disable the write protection and the corresponding SRAM sub-bank.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
-
Configuration functions ¶
- group SRAM_Exported_Functions_Group2
-
This subsection provides a set of functions allowing to configure the the FMC SRAM sub-banks and to retrieve the current configuration.
The full configuration is done through three steps and following the order below :
-
Step 1 (Static configuration of FMC peripheral) :
-
HAL_SRAM_SetConfig() : used to apply the user static configuration of FMC peripheral specified within hal_sram_config_t structure.
-
-
Step 2 (Memory configuration) : Depending on the external device, one of these APIs is called :
-
HAL_SRAM_SetConfigRdWrAsyncMemory() : used to apply the user memory configuration for memories with asynchronous read and asynchronous write access mode within hal_sram_rd_wr_async_memory_config_t structure.
-
HAL_SRAM_SetWrAsyncTimings() : used to apply a different timing configuration for write transactions, for memories with asynchronous read and asynchronous write access mode within hal_sram_wr_async_timings_t structure.
-
HAL_SRAM_SetConfigRdWrSyncMemory() : used to apply the user memory configuration for memories with synchronous read and synchronous write access mode within hal_sram_rd_wr_sync_memory_config_t structure.
-
HAL_SRAM_SetConfigRdSyncWrAsyncMemory() : used to apply the user memory configuration for memories with synchronous read and asynchronous write access mode within hal_sram_rd_sync_wr_async_memory_config_t structure.
-
HAL_SRAM_SetConfigRdAsyncWrSyncMemory() : used to apply the user memory configuration for memories with asynchronous read and synchronous write access mode within hal_sram_rd_async_wr_sync_memory_config_t structure.
-
-
Step 3 (Memory enable/disable) :
-
HAL_SRAM_EnableMemory() : used to enable the SRAM sub-bank and make it accessible for read and write operations.
-
HAL_SRAM_DisableMemory() : used to disable the SRAM sub-bank which is useful when memory configuration adjustments are needed.
-
The configuration parameters are retrieved through these APIs :
-
Static configuration of FMC peripheral :
-
HAL_SRAM_GetConfig() : used to retrieve the FMC configuration and to fill it into hal_sram_config_t structure.
-
-
Memory configuration :
-
HAL_SRAM_GetConfigRdWrAsyncMemory() : used to retrieve the user memory configuration for memories with asynchronous read and asynchronous write access mode and to fill it into hal_sram_rd_wr_async_memory_config_t structure.
-
HAL_SRAM_GetWrAsyncTimings() : used to retrieve the user timing configuration for write operations, when the memory with asynchronous read and asynchronous write access mode has a different timing configuration for write transactions and to fill it into hal_sram_wr_async_timings_t structure.
-
HAL_SRAM_GetConfigRdWrSyncMemory() : used to retrieve the user memory configuration for memories with synchronous read and synchronous write access mode and to fill it into hal_sram_rd_wr_sync_memory_config_t structure.
-
HAL_SRAM_GetConfigRdSyncWrAsyncMemory() : used to retrieve the user memory configuration for memories with synchronous read and asynchronous write access mode and to fill it into hal_sram_rd_sync_wr_async_memory_config_t structure.
-
HAL_SRAM_GetConfigRdAsyncWrSyncMemory() : used to retrieve the user memory configuration for memories with asynchronous read and synchronous write access mode and to fill it into hal_sram_rd_async_wr_sync_memory_config_t structure.
-
Note
when separate timing configuration for read and write transactions is needed, the HAL_SRAM_SetWrAsyncTimings() API must be called after HAL_SRAM_SetConfigRdWrAsyncMemory() , to set the write timing parameters. In this case, the HAL_SRAM_SetConfigRdWrAsyncMemory() function sets timing only for read accesses.
Functions
-
hal_status_t
HAL_SRAM_SetConfig
(
hal_sram_handle_t
*
hsram
,
const
hal_sram_config_t
*
p_config
)
¶
-
Set the static configuration of FMC peripheral.
Note
This API is the first API to call once the HAL SRAM driver is initialized.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_config_t structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when the configuration structure pointer is NULL.
-
HAL_OK – The static FMC configuration is successfully configured.
-
-
void
HAL_SRAM_GetConfig
(
const
hal_sram_handle_t
*
hsram
,
hal_sram_config_t
*
p_config
)
¶
-
Retrieve the static configuration of FMC peripheral.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_config_t structure filled with the retrieved static FMC peripheral configuration.
-
-
hal_status_t
HAL_SRAM_SetConfigRdWrAsyncMemory
(
hal_sram_handle_t
*
hsram
,
const
hal_sram_rd_wr_async_memory_config_t
*
p_config
)
¶
-
Set the memory configuration for memories with asynchronous read and asynchronous write access mode.
Note
The first use of this API must be done after calling HAL_SRAM_SetConfig() API for SRAM, PSRAM and CRAM memories then, it can be reused multi-time to adjust memory configuration when needed.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_rd_wr_async_memory_config_t structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when the memory configuration structure pointer is NULL.
-
HAL_OK – The memory is successfully configured.
-
-
void
HAL_SRAM_GetConfigRdWrAsyncMemory
(
const
hal_sram_handle_t
*
hsram
,
hal_sram_rd_wr_async_memory_config_t
*
p_config
)
¶
-
Retrieve the memory configuration for memories with asynchronous read and asynchronous write access mode.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_rd_wr_async_memory_config_t structure filled with the retrieved memory configuration.
-
-
hal_status_t
HAL_SRAM_SetWrAsyncTimings
(
hal_sram_handle_t
*
hsram
,
const
hal_sram_wr_async_timings_t
*
p_timings
)
¶
-
Set the timing configuration for asynchronous write transactions.
Note
When separate timing configuration for read and write transactions is needed, this API must be called after HAL_SRAM_SetConfigRdWrAsyncMemory() , to set the write timing parameters, it can be reused multi-time to adjust timings for write transactions when needed.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_timings – Pointer to a hal_sram_wr_async_timings_t structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when the timing configuration structure pointer is NULL.
-
HAL_OK – The timing is successfully configured.
-
-
void
HAL_SRAM_GetWrAsyncTimings
(
const
hal_sram_handle_t
*
hsram
,
hal_sram_wr_async_timings_t
*
p_timings
)
¶
-
Retrieve the timing configuration for asynchronous write transactions.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_timings – Pointer to a hal_sram_wr_async_timings_t structure.
-
-
hal_status_t
HAL_SRAM_SetConfigRdWrSyncMemory
(
hal_sram_handle_t
*
hsram
,
const
hal_sram_rd_wr_sync_memory_config_t
*
p_config
)
¶
-
Set the memory configuration for memories with synchronous read and synchronous write access mode.
Note
The first use of this API must be done after calling HAL_SRAM_SetConfig() API for PSRAM and CRAM memories then, it can be reused multi-time to adjust memory configuration when needed.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_rd_wr_sync_memory_config_t structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when the memory configuration structure pointer is NULL.
-
HAL_OK – The memory is successfully configured.
-
-
void
HAL_SRAM_GetConfigRdWrSyncMemory
(
const
hal_sram_handle_t
*
hsram
,
hal_sram_rd_wr_sync_memory_config_t
*
p_config
)
¶
-
Retrieve the memory configuration for memories with synchronous read and synchronous write access mode.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_rd_wr_sync_memory_config_t structure filled with the retrieved memory configuration.
-
-
hal_status_t
HAL_SRAM_SetConfigRdSyncWrAsyncMemory
(
hal_sram_handle_t
*
hsram
,
const
hal_sram_rd_sync_wr_async_memory_config_t
*
p_config
)
¶
-
Set the memory configuration for memories with synchronous read and asynchronous write access mode.
Note
The first use of this API must be done after calling HAL_SRAM_SetConfig() API for PSRAM and CRAM memories then, it can be reused multi-time to adjust memory configuration when needed.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_rd_sync_wr_async_memory_config_t structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when the memory configuration structure pointer is NULL.
-
HAL_OK – The memory is successfully configured.
-
-
void
HAL_SRAM_GetConfigRdSyncWrAsyncMemory
(
const
hal_sram_handle_t
*
hsram
,
hal_sram_rd_sync_wr_async_memory_config_t
*
p_config
)
¶
-
Retrieve the memory configuration for memories with synchronous read and asynchronous write access mode.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_rd_sync_wr_async_memory_config_t structure filled with the retrieved memory configuration.
-
-
hal_status_t
HAL_SRAM_SetConfigRdAsyncWrSyncMemory
(
hal_sram_handle_t
*
hsram
,
const
hal_sram_rd_async_wr_sync_memory_config_t
*
p_config
)
¶
-
Set the memory configuration for memories with asynchronous read and synchronous write access mode.
Note
The first use of this API must be done after calling HAL_SRAM_SetConfig() API for PSRAM and CRAM memories then, it can be reused multi-time to adjust memory configuration when needed.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_rd_async_wr_sync_memory_config_t structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when the memory configuration structure pointer is NULL.
-
HAL_OK – The memory is successfully configured.
-
-
void
HAL_SRAM_GetConfigRdAsyncWrSyncMemory
(
const
hal_sram_handle_t
*
hsram
,
hal_sram_rd_async_wr_sync_memory_config_t
*
p_config
)
¶
-
Retrieve the memory configuration for memories with asynchronous read and synchronous write access mode.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_rd_async_wr_sync_memory_config_t structure filled with the retrieved memory configuration.
-
-
hal_status_t
HAL_SRAM_EnableMemory
(
hal_sram_handle_t
*
hsram
)
¶
-
Enable the corresponding SRAM device.
Note
This API can be used once the SRAM is fully configured.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
HAL_OK – The SRAM is successfully enabled.
-
hal_status_t
HAL_SRAM_DisableMemory
(
hal_sram_handle_t
*
hsram
)
¶
-
Disable the corresponding SRAM device.
Note
This API must be called when a memory configuration adjustment is needed.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
HAL_OK – The SRAM is successfully disabled.
-
- group SRAM_Exported_Functions_Group2
-
This subsection provides a set of functions allowing to configure the the FMC SRAM sub-banks and to retrieve the current configuration.
The full configuration is done through three steps and following the order below :
-
Step 1 (Static configuration of FMC peripheral) :
-
HAL_SRAM_SetConfig() : used to apply the user static configuration of FMC peripheral specified within hal_sram_config_t structure.
-
-
Step 2 (Memory configuration) : Depending on the external device, one of these APIs is called :
-
HAL_SRAM_SetConfigRdWrAsyncMemory() : used to apply the user memory configuration for memories with asynchronous read and asynchronous write access mode within hal_sram_rd_wr_async_memory_config_t structure.
-
HAL_SRAM_SetWrAsyncTimings() : used to apply a different timing configuration for write transactions, for memories with asynchronous read and asynchronous write access mode within hal_sram_wr_async_timings_t structure.
-
HAL_SRAM_SetConfigRdWrSyncMemory() : used to apply the user memory configuration for memories with synchronous read and synchronous write access mode within hal_sram_rd_wr_sync_memory_config_t structure.
-
HAL_SRAM_SetConfigRdSyncWrAsyncMemory() : used to apply the user memory configuration for memories with synchronous read and asynchronous write access mode within hal_sram_rd_sync_wr_async_memory_config_t structure.
-
HAL_SRAM_SetConfigRdAsyncWrSyncMemory() : used to apply the user memory configuration for memories with asynchronous read and synchronous write access mode within hal_sram_rd_async_wr_sync_memory_config_t structure.
-
-
Step 3 (Memory enable/disable) :
-
HAL_SRAM_EnableMemory() : used to enable the SRAM sub-bank and make it accessible for read and write operations.
-
HAL_SRAM_DisableMemory() : used to disable the SRAM sub-bank which is useful when memory configuration adjustments are needed.
-
The configuration parameters are retrieved through these APIs :
-
Static configuration of FMC peripheral :
-
HAL_SRAM_GetConfig() : used to retrieve the FMC configuration and to fill it into hal_sram_config_t structure.
-
-
Memory configuration :
-
HAL_SRAM_GetConfigRdWrAsyncMemory() : used to retrieve the user memory configuration for memories with asynchronous read and asynchronous write access mode and to fill it into hal_sram_rd_wr_async_memory_config_t structure.
-
HAL_SRAM_GetWrAsyncTimings() : used to retrieve the user timing configuration for write operations, when the memory with asynchronous read and asynchronous write access mode has a different timing configuration for write transactions and to fill it into hal_sram_wr_async_timings_t structure.
-
HAL_SRAM_GetConfigRdWrSyncMemory() : used to retrieve the user memory configuration for memories with synchronous read and synchronous write access mode and to fill it into hal_sram_rd_wr_sync_memory_config_t structure.
-
HAL_SRAM_GetConfigRdSyncWrAsyncMemory() : used to retrieve the user memory configuration for memories with synchronous read and asynchronous write access mode and to fill it into hal_sram_rd_sync_wr_async_memory_config_t structure.
-
HAL_SRAM_GetConfigRdAsyncWrSyncMemory() : used to retrieve the user memory configuration for memories with asynchronous read and synchronous write access mode and to fill it into hal_sram_rd_async_wr_sync_memory_config_t structure.
-
Note
when separate timing configuration for read and write transactions is needed, the HAL_SRAM_SetWrAsyncTimings() API must be called after HAL_SRAM_SetConfigRdWrAsyncMemory() , to set the write timing parameters. In this case, the HAL_SRAM_SetConfigRdWrAsyncMemory() function sets timing only for read accesses.
Functions
-
hal_status_t
HAL_SRAM_SetConfig
(
hal_sram_handle_t
*
hsram
,
const
hal_sram_config_t
*
p_config
)
-
Set the static configuration of FMC peripheral.
Note
This API is the first API to call once the HAL SRAM driver is initialized.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_config_t structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when the configuration structure pointer is NULL.
-
HAL_OK – The static FMC configuration is successfully configured.
-
-
void
HAL_SRAM_GetConfig
(
const
hal_sram_handle_t
*
hsram
,
hal_sram_config_t
*
p_config
)
-
Retrieve the static configuration of FMC peripheral.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_config_t structure filled with the retrieved static FMC peripheral configuration.
-
-
hal_status_t
HAL_SRAM_SetConfigRdWrAsyncMemory
(
hal_sram_handle_t
*
hsram
,
const
hal_sram_rd_wr_async_memory_config_t
*
p_config
)
-
Set the memory configuration for memories with asynchronous read and asynchronous write access mode.
Note
The first use of this API must be done after calling HAL_SRAM_SetConfig() API for SRAM, PSRAM and CRAM memories then, it can be reused multi-time to adjust memory configuration when needed.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_rd_wr_async_memory_config_t structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when the memory configuration structure pointer is NULL.
-
HAL_OK – The memory is successfully configured.
-
-
void
HAL_SRAM_GetConfigRdWrAsyncMemory
(
const
hal_sram_handle_t
*
hsram
,
hal_sram_rd_wr_async_memory_config_t
*
p_config
)
-
Retrieve the memory configuration for memories with asynchronous read and asynchronous write access mode.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_rd_wr_async_memory_config_t structure filled with the retrieved memory configuration.
-
-
hal_status_t
HAL_SRAM_SetWrAsyncTimings
(
hal_sram_handle_t
*
hsram
,
const
hal_sram_wr_async_timings_t
*
p_timings
)
-
Set the timing configuration for asynchronous write transactions.
Note
When separate timing configuration for read and write transactions is needed, this API must be called after HAL_SRAM_SetConfigRdWrAsyncMemory() , to set the write timing parameters, it can be reused multi-time to adjust timings for write transactions when needed.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_timings – Pointer to a hal_sram_wr_async_timings_t structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when the timing configuration structure pointer is NULL.
-
HAL_OK – The timing is successfully configured.
-
-
void
HAL_SRAM_GetWrAsyncTimings
(
const
hal_sram_handle_t
*
hsram
,
hal_sram_wr_async_timings_t
*
p_timings
)
-
Retrieve the timing configuration for asynchronous write transactions.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_timings – Pointer to a hal_sram_wr_async_timings_t structure.
-
-
hal_status_t
HAL_SRAM_SetConfigRdWrSyncMemory
(
hal_sram_handle_t
*
hsram
,
const
hal_sram_rd_wr_sync_memory_config_t
*
p_config
)
-
Set the memory configuration for memories with synchronous read and synchronous write access mode.
Note
The first use of this API must be done after calling HAL_SRAM_SetConfig() API for PSRAM and CRAM memories then, it can be reused multi-time to adjust memory configuration when needed.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_rd_wr_sync_memory_config_t structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when the memory configuration structure pointer is NULL.
-
HAL_OK – The memory is successfully configured.
-
-
void
HAL_SRAM_GetConfigRdWrSyncMemory
(
const
hal_sram_handle_t
*
hsram
,
hal_sram_rd_wr_sync_memory_config_t
*
p_config
)
-
Retrieve the memory configuration for memories with synchronous read and synchronous write access mode.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_rd_wr_sync_memory_config_t structure filled with the retrieved memory configuration.
-
-
hal_status_t
HAL_SRAM_SetConfigRdSyncWrAsyncMemory
(
hal_sram_handle_t
*
hsram
,
const
hal_sram_rd_sync_wr_async_memory_config_t
*
p_config
)
-
Set the memory configuration for memories with synchronous read and asynchronous write access mode.
Note
The first use of this API must be done after calling HAL_SRAM_SetConfig() API for PSRAM and CRAM memories then, it can be reused multi-time to adjust memory configuration when needed.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_rd_sync_wr_async_memory_config_t structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when the memory configuration structure pointer is NULL.
-
HAL_OK – The memory is successfully configured.
-
-
void
HAL_SRAM_GetConfigRdSyncWrAsyncMemory
(
const
hal_sram_handle_t
*
hsram
,
hal_sram_rd_sync_wr_async_memory_config_t
*
p_config
)
-
Retrieve the memory configuration for memories with synchronous read and asynchronous write access mode.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_rd_sync_wr_async_memory_config_t structure filled with the retrieved memory configuration.
-
-
hal_status_t
HAL_SRAM_SetConfigRdAsyncWrSyncMemory
(
hal_sram_handle_t
*
hsram
,
const
hal_sram_rd_async_wr_sync_memory_config_t
*
p_config
)
-
Set the memory configuration for memories with asynchronous read and synchronous write access mode.
Note
The first use of this API must be done after calling HAL_SRAM_SetConfig() API for PSRAM and CRAM memories then, it can be reused multi-time to adjust memory configuration when needed.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_rd_async_wr_sync_memory_config_t structure.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter return when the memory configuration structure pointer is NULL.
-
HAL_OK – The memory is successfully configured.
-
-
void
HAL_SRAM_GetConfigRdAsyncWrSyncMemory
(
const
hal_sram_handle_t
*
hsram
,
hal_sram_rd_async_wr_sync_memory_config_t
*
p_config
)
-
Retrieve the memory configuration for memories with asynchronous read and synchronous write access mode.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_config – Pointer to a hal_sram_rd_async_wr_sync_memory_config_t structure filled with the retrieved memory configuration.
-
-
hal_status_t
HAL_SRAM_EnableMemory
(
hal_sram_handle_t
*
hsram
)
-
Enable the corresponding SRAM device.
Note
This API can be used once the SRAM is fully configured.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
HAL_OK – The SRAM is successfully enabled.
-
hal_status_t
HAL_SRAM_DisableMemory
(
hal_sram_handle_t
*
hsram
)
-
Disable the corresponding SRAM device.
Note
This API must be called when a memory configuration adjustment is needed.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
HAL_OK – The SRAM is successfully disabled.
-
Control functions ¶
- group SRAM_Exported_Functions_Group3
-
This subsection provides a set of functions allowing to control the SRAM device :
-
HAL_SRAM_EnableWriteProtection() : used to enable the write protection of the corresponding SRAM device.
-
HAL_SRAM_DisableWriteProtection() : used to disable the write protection of the corresponding SRAM device.
-
HAL_SRAM_IsEnabledWriteProtection() : used to get the corresponding SRAM device write protection status.
-
HAL_SRAM_Enable() : used to enable the corresponding SRAM device.
-
HAL_SRAM_Disable() : used to disable the corresponding SRAM device.
-
HAL_SRAM_IsEnabled() : used to get the corresponding SRAM device status.
Functions
-
hal_status_t
HAL_SRAM_EnableWriteProtection
(
hal_sram_handle_t
*
hsram
)
¶
-
Enable the corresponding SRAM device write protection.
Note
This API can be used once the SRAM is fully configured and ready to use.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
HAL_OK – The write protection is successfully enabled.
-
hal_status_t
HAL_SRAM_DisableWriteProtection
(
hal_sram_handle_t
*
hsram
)
¶
-
Disable the corresponding SRAM device write protection.
Note
This API can be used once the SRAM is fully configured and ready to use.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
HAL_OK – The write protection is successfully disabled.
-
hal_sram_wr_protection_status_t
HAL_SRAM_IsEnabledWriteProtection
(
const
hal_sram_handle_t
*
hsram
)
¶
-
Get the corresponding SRAM device write protection status.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
-
HAL_SRAM_WR_NOT_PROTECTED – The SRAM write protection is disabled.
-
HAL_SRAM_WR_PROTECTED – The SRAM write protection is enabled.
-
-
hal_status_t
HAL_SRAM_Enable
(
hal_sram_handle_t
*
hsram
)
¶
-
Enable the corresponding SRAM device.
Note
This API can be used once the SRAM is fully configured and ready to use.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
HAL_OK – The SRAM is successfully enabled.
-
hal_status_t
HAL_SRAM_Disable
(
hal_sram_handle_t
*
hsram
)
¶
-
Disable the corresponding SRAM device.
Note
This API can be used once the SRAM is fully configured and ready to use. In case no write or read access is running, this API can be called to save power and maintain the current configuration instead of calling HAL_SRAM_DeInit() API then resuming the configuration sequence.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
HAL_OK – The SRAM is successfully disabled.
-
hal_sram_status_t
HAL_SRAM_IsEnabled
(
const
hal_sram_handle_t
*
hsram
)
¶
-
Get the corresponding SRAM device status.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
-
HAL_SRAM_DISABLED – The SRAM is disabled.
-
HAL_SRAM_ENABLED – The SRAM is enabled.
-
-
- group SRAM_Exported_Functions_Group3
-
This subsection provides a set of functions allowing to control the SRAM device :
-
HAL_SRAM_EnableWriteProtection() : used to enable the write protection of the corresponding SRAM device.
-
HAL_SRAM_DisableWriteProtection() : used to disable the write protection of the corresponding SRAM device.
-
HAL_SRAM_IsEnabledWriteProtection() : used to get the corresponding SRAM device write protection status.
-
HAL_SRAM_Enable() : used to enable the corresponding SRAM device.
-
HAL_SRAM_Disable() : used to disable the corresponding SRAM device.
-
HAL_SRAM_IsEnabled() : used to get the corresponding SRAM device status.
Functions
-
hal_status_t
HAL_SRAM_EnableWriteProtection
(
hal_sram_handle_t
*
hsram
)
-
Enable the corresponding SRAM device write protection.
Note
This API can be used once the SRAM is fully configured and ready to use.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
HAL_OK – The write protection is successfully enabled.
-
hal_status_t
HAL_SRAM_DisableWriteProtection
(
hal_sram_handle_t
*
hsram
)
-
Disable the corresponding SRAM device write protection.
Note
This API can be used once the SRAM is fully configured and ready to use.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
HAL_OK – The write protection is successfully disabled.
-
hal_sram_wr_protection_status_t
HAL_SRAM_IsEnabledWriteProtection
(
const
hal_sram_handle_t
*
hsram
)
-
Get the corresponding SRAM device write protection status.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
-
HAL_SRAM_WR_NOT_PROTECTED – The SRAM write protection is disabled.
-
HAL_SRAM_WR_PROTECTED – The SRAM write protection is enabled.
-
-
hal_status_t
HAL_SRAM_Enable
(
hal_sram_handle_t
*
hsram
)
-
Enable the corresponding SRAM device.
Note
This API can be used once the SRAM is fully configured and ready to use.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
HAL_OK – The SRAM is successfully enabled.
-
hal_status_t
HAL_SRAM_Disable
(
hal_sram_handle_t
*
hsram
)
-
Disable the corresponding SRAM device.
Note
This API can be used once the SRAM is fully configured and ready to use. In case no write or read access is running, this API can be called to save power and maintain the current configuration instead of calling HAL_SRAM_DeInit() API then resuming the configuration sequence.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
HAL_OK – The SRAM is successfully disabled.
-
hal_sram_status_t
HAL_SRAM_IsEnabled
(
const
hal_sram_handle_t
*
hsram
)
-
Get the corresponding SRAM device status.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
-
HAL_SRAM_DISABLED – The SRAM is disabled.
-
HAL_SRAM_ENABLED – The SRAM is enabled.
-
-
User data functions ¶
- group SRAM_Exported_Functions_Group4
-
This subsection provides a set of functions allowing to set and retrieve user specific data :
-
The HAL_SRAM_SetUserData() API : used to store user data pointer into the handle.
-
The HAL_SRAM_GetUserData() API : used to retrieve user data pointer from the handle.
Functions
-
void
HAL_SRAM_SetUserData
(
hal_sram_handle_t
*
hsram
,
const
void
*
p_user_data
)
¶
-
Store user data pointer into the handle.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_user_data – Pointer to the user data.
-
-
const
void
*
HAL_SRAM_GetUserData
(
const
hal_sram_handle_t
*
hsram
)
¶
-
Retrieve user data pointer from the handle.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
Pointer – to the user data.
-
- group SRAM_Exported_Functions_Group4
-
This subsection provides a set of functions allowing to set and retrieve user specific data :
-
The HAL_SRAM_SetUserData() API : used to store user data pointer into the handle.
-
The HAL_SRAM_GetUserData() API : used to retrieve user data pointer from the handle.
Functions
-
void
HAL_SRAM_SetUserData
(
hal_sram_handle_t
*
hsram
,
const
void
*
p_user_data
)
-
Store user data pointer into the handle.
- Parameters :
-
-
hsram – Pointer to a hal_sram_handle_t structure.
-
p_user_data – Pointer to the user data.
-
-
const
void
*
HAL_SRAM_GetUserData
(
const
hal_sram_handle_t
*
hsram
)
-
Retrieve user data pointer from the handle.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
Pointer – to the user data.
-
Peripheral state functions, Clock Frequency ¶
- group SRAM_Exported_Functions_Group5
-
This subsection provides a set of functions allowing to retrieve the SRAM global state and the clock frequency :
-
HAL_SRAM_GetClockFreq() : used to retrieve clock frequency.
-
HAL_SRAM_GetState() : used to retrieve current global state.
Functions
-
uint32_t
HAL_SRAM_GetClockFreq
(
const
hal_sram_handle_t
*
hsram
)
¶
-
Get the clock frequency.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
uint32_t – Frequency in Hz.
-
hal_sram_state_t
HAL_SRAM_GetState
(
const
hal_sram_handle_t
*
hsram
)
¶
-
Get the current global state.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
-
HAL_SRAM_STATE_RESET – The SRAM not yet initialized.
-
HAL_SRAM_STATE_INIT – The SRAM initialized but not yet configured.
-
HAL_SRAM_STATE_CONFIGURED – The SRAM initialized, FMC peripheral configured but not yet ready to use.
-
HAL_SRAM_STATE_MEMORY_CONFIGURED – The SRAM initialized, FMC, memory configured but not yet ready to use.
-
HAL_SRAM_STATE_IDLE – The SRAM initialized, FMC, memory configured, SRAM is enabled and ready to use.
-
-
- group SRAM_Exported_Functions_Group5
-
This subsection provides a set of functions allowing to retrieve the SRAM global state and the clock frequency :
-
HAL_SRAM_GetClockFreq() : used to retrieve clock frequency.
-
HAL_SRAM_GetState() : used to retrieve current global state.
Functions
-
uint32_t
HAL_SRAM_GetClockFreq
(
const
hal_sram_handle_t
*
hsram
)
-
Get the clock frequency.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
uint32_t – Frequency in Hz.
-
hal_sram_state_t
HAL_SRAM_GetState
(
const
hal_sram_handle_t
*
hsram
)
-
Get the current global state.
- Parameters :
-
hsram – Pointer to a hal_sram_handle_t structure.
- Return values :
-
-
HAL_SRAM_STATE_RESET – The SRAM not yet initialized.
-
HAL_SRAM_STATE_INIT – The SRAM initialized but not yet configured.
-
HAL_SRAM_STATE_CONFIGURED – The SRAM initialized, FMC peripheral configured but not yet ready to use.
-
HAL_SRAM_STATE_MEMORY_CONFIGURED – The SRAM initialized, FMC, memory configured but not yet ready to use.
-
HAL_SRAM_STATE_IDLE – The SRAM initialized, FMC, memory configured, SRAM is enabled and ready to use.
-
-