1 /* 2 * Copyright (c) 2025 Renesas Electronics Corporation 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef ZEPHYR_DRIVERS_SOC_FLASH_RENESAS_RX_H_ 8 #define ZEPHYR_DRIVERS_SOC_FLASH_RENESAS_RX_H_ 9 10 #include <zephyr/drivers/flash.h> 11 12 enum flash_region { 13 CODE_FLASH, 14 DATA_FLASH, 15 }; 16 17 struct flash_rx_config { 18 struct flash_parameters flash_rx_parameters; 19 }; 20 21 struct flash_rx_event { 22 volatile bool erase_complete; 23 volatile bool write_complete; 24 volatile bool error; 25 }; 26 27 struct flash_rx_data { 28 struct flash_rx_event flash_event; 29 /* Indicates which flash area is being accessed (code or data region). */ 30 enum flash_region FlashRegion; 31 /** 32 * Flash address of FlashRegion 33 * Renesas RX supports two flash regions: CODE and DATA. These regions are 34 * located at different memory addresses and have distinct flash maps. 35 * This field identifies which FlashRegion is in use, allowing 36 * region-specific behavior to be applied 37 */ 38 uint32_t area_address; 39 /* Size of the FlashRegion. */ 40 uint32_t area_size; 41 struct k_sem transfer_sem; 42 }; 43 44 #endif /* ZEPHYR_DRIVERS_SOC_FLASH_RENESAS_RX_H_ */ 45