35 #ifndef __HAL_CACHE_H__ 36 #define __HAL_CACHE_H__ 37 #include "hal_platform.h" 39 #ifdef HAL_CACHE_MODULE_ENABLED 382 #define HAL_CACHE_LINE_SIZE (32) 385 #ifdef HAL_CACHE_WITH_REMAP_FEATURE 390 #define HAL_CACHE_VIRTUAL_TO_PHYSICAL(address) (address & (~VRAM_BASE)) 396 #define HAL_CACHE_PHYSICAL_TO_VIRTUAL(address) (address | VRAM_BASE) CACHE region 5.
Definition: hal_cache.h:192
hal_cache_status_t hal_cache_init(void)
This function initializes the CACHE, sets the default cacheable attribute for the project memory layo...
CACHE region 1.
Definition: hal_cache.h:188
CACHE region 2.
Definition: hal_cache.h:189
No CACHE.
Definition: hal_cache.h:177
The total number of CACHE regions (invalid region).
Definition: hal_cache.h:203
hal_cache_region_t
This enum defines the CACHE region number.
Definition: hal_cache.h:186
hal_cache_status_t hal_cache_region_config(hal_cache_region_t region, const hal_cache_region_config_t *region_config)
This function configures the CACHE.
CACHE region 15.
Definition: hal_cache.h:202
CACHE region 14.
Definition: hal_cache.h:201
CACHE region 7.
Definition: hal_cache.h:194
CACHE size is 8kB.
Definition: hal_cache.h:178
hal_cache_status_t hal_cache_region_enable(hal_cache_region_t region)
This function enables a single CACHE region.
hal_cache_status_t hal_cache_region_disable(hal_cache_region_t region)
This function disables a single CACHE region.
uint32_t cache_region_address
Starting address of the CACHE region.
Definition: hal_cache.h:220
CACHE region 10.
Definition: hal_cache.h:197
CACHE size is 32kB.
Definition: hal_cache.h:180
CACHE is busy.
Definition: hal_cache.h:165
bool hal_cache_is_cacheable(uint32_t address)
This function checks whether the memory is cacheable.
CACHE region error, CACHE region is not a value of type hal_cache_region_t.
Definition: hal_cache.h:167
CACHE size is invalid, total CACHE size is not a value of type hal_cache_size_t.
Definition: hal_cache.h:166
CACHE API call returns successfully.
Definition: hal_cache.h:171
CACHE region enable error, CACHE region is not set at the time the region is being enabled...
Definition: hal_cache.h:170
CACHE region size error, CACHE region size is not a multiple of 4kB.
Definition: hal_cache.h:169
hal_cache_status_t hal_cache_invalidate_multiple_cache_lines(uint32_t address, uint32_t length)
This function invalidates the CACHE lines by address and length.
hal_cache_status_t hal_cache_deinit(void)
This function deinitializes the CACHE, returning the CACHE module to its default state.
CACHE region 13.
Definition: hal_cache.h:200
hal_cache_size_t
This enum defines the CACHE size.
Definition: hal_cache.h:176
hal_cache_status_t hal_cache_flush_multiple_cache_lines(uint32_t address, uint32_t length)
This function flushes the CACHE lines by address and length.
CACHE region 12.
Definition: hal_cache.h:199
CACHE size is 16kB.
Definition: hal_cache.h:179
hal_cache_status_t hal_cache_invalidate_one_cache_line(uint32_t address)
This function invalidates a CACHE line at a given address.
hal_cache_status_t hal_cache_invalidate_all_cache_lines(void)
This function invalidates the whole CACHE.
CACHE region 9.
Definition: hal_cache.h:196
Invalid parameter.
Definition: hal_cache.h:164
CACHE region 3.
Definition: hal_cache.h:190
CACHE region address error, CACHE region address is not 4kB aligned.
Definition: hal_cache.h:168
uint32_t cache_region_size
The CACHE region size.
Definition: hal_cache.h:221
CACHE region 11.
Definition: hal_cache.h:198
CACHE region 8.
Definition: hal_cache.h:195
CACHE region 4.
Definition: hal_cache.h:191
hal_cache_status_t hal_cache_disable(void)
This function disables the CACHE controller.
CACHE region 6.
Definition: hal_cache.h:193
hal_cache_status_t hal_cache_enable(void)
This function enables the CACHE controller.
CACHE region 0.
Definition: hal_cache.h:187
hal_cache_status_t hal_cache_flush_all_cache_lines(void)
This function flushes the whole CACHE.
The total number of CACHE sizes (invalid size).
Definition: hal_cache.h:181
hal_cache_status_t hal_cache_set_size(hal_cache_size_t cache_size)
This function sets the total size of the CACHE.
hal_cache_status_t hal_cache_flush_one_cache_line(uint32_t address)
This function flushes one CACHE line by address.
hal_cache_status_t
This enum defines the CACHE API return status.
Definition: hal_cache.h:163
The CACHE region configuration structure that contains the start address and the size of the region...
Definition: hal_cache.h:219