RZT Flexible Software Package Documentation
Release v2.2.0
|
|
Functions | |
fsp_err_t | R_XSPI_HYPER_Open (hyperbus_ctrl_t *p_ctrl, hyperbus_cfg_t const *const p_cfg) |
fsp_err_t | R_XSPI_HYPER_Close (hyperbus_ctrl_t *p_ctrl) |
fsp_err_t | R_XSPI_HYPER_BurstTypeSet (hyperbus_ctrl_t *p_ctrl, hyperbus_burst_type_t burst_type) |
fsp_err_t | R_XSPI_HYPER_AccessSpaceSet (hyperbus_ctrl_t *p_ctrl, hyperbus_space_select_t access_space) |
fsp_err_t | R_XSPI_HYPER_Write (hyperbus_ctrl_t *p_ctrl, uint8_t const *const p_src, uint8_t *const p_dest, uint32_t byte_count) |
fsp_err_t | R_XSPI_HYPER_Erase (hyperbus_ctrl_t *p_ctrl, uint8_t *const p_device_address, uint32_t byte_count) |
fsp_err_t | R_XSPI_HYPER_StatusGet (hyperbus_ctrl_t *p_ctrl, hyperbus_status_t *const p_status) |
fsp_err_t | R_XSPI_HYPER_AutoCalibrate (hyperbus_ctrl_t *p_ctrl) |
Driver for the xSPI peripheral on RZ microprocessor. This module implements the HyperBus Interface.
The HyperBus peripheral interfaces with an external HyperRAM device to perform data I/O Operations.
The xSPI Hyper driver has the following key features to support the HyperRAM device:
Configuration | Options | Default | Description |
---|---|---|---|
Custom Address Space > Unit0 > CS0 > Start Address | MCU Specific Options | Start address of xSPI Unit0 CS0 in memory mapping mode. | |
Custom Address Space > Unit0 > CS0 > End Address | Address should be within xspi unit0 external address space | 0x600FFFFF | End address of xSPI Unit0 CS1 in memory mapping mode. |
Custom Address Space > Unit0 > CS1 > Start Address | Address should be within xspi unit0 external address space | 0x64000000 | Start address of xSPI Unit0 CS1 in memory mapping mode. |
Custom Address Space > Unit0 > CS1 > End Address | Address should be within xspi unit0 external address space | 0x640FFFFF | End address of xSPI Unit0 CS1 in memory mapping mode. |
Custom Address Space > Unit1 > CS0 > Start Address | MCU Specific Options | Start address of xSPI Unit1 CS0 in memory mapping mode. | |
Custom Address Space > Unit1 > CS0 > End Address | Address should be within xspi unit1 external address space | 0x680FFFFF | End address of xSPI Unit1 CS0 in memory mapping mode. |
Custom Address Space > Unit1 > CS1 > Start Address | Address should be within xspi unit1 external address space | 0x6C000000 | Start address of xSPI Unit1 CS1 in memory mapping mode. |
Custom Address Space > Unit1 > CS1 > End Address | Address should be within xspi unit1 external address space | 0x6C0FFFFF | End address of xSPI Unit1 CS1 in memory mapping mode. |
Custom Address Space > Custom Address Space Enable | MCU Specific Options | When disabled, Custom Address Space is not applied and address space is set according to Flash Size. When enabled, Flash Size is disabled and Custom Address Space settings are applied. | |
Parameter Checking |
| Default (BSP) | If selected code for parameter checking is included in the build. |
Unit 0 Prefetch Function |
| Disable | Enable prefetch function on memory-mapped reads of xSPI Unit 0. |
Unit 1 Prefetch Function |
| Disable | Enable prefetch function on memory-mapped reads of xSPI Unit 1. |
Unit 0 IO voltage | MCU Specific Options | Voltage setting of xSPI Unit0. | |
Unit 1 IO voltage | MCU Specific Options | Voltage setting of xSPI Unit1. |
Configuration | Options | Default | Description |
---|---|---|---|
General > Name | Name must be a valid C symbol | g_hyperbus0 | Module name. |
General > Unit | Unit should be 0 or 1 | 1 | Specify the XSPI unit number. |
General > Chip Select |
| Chip Select 0 | Specify the HyperBus chip select line to use. |
General > RAM Size |
| 8MB | Specify the HyperRAM size. |
General > Initial latency (Read) | Refer to the RZT Configuration tool for available options. | 6 CYCLES | Specify the read latency cycle |
General > Initial latency (Memory Write) | Refer to the RZT Configuration tool for available options. | 6 CYCLES | Specify the write latency cycle in memory write |
General > Initial latency (Register Write) | Refer to the RZT Configuration tool for available options. | 0 CYCLE (No Latency) | Specify the write latency cycle in register write |
HyperBus Transaction Characteristics > Initial Burst Type | Linear burst (Burst type = 1) | Linear burst (Burst type = 1) | Set burst type when driver starts. |
HyperBus Transaction Characteristics > Initial Access Space |
| Memory Space (AS = 0) | Set the Hyper device access address when starting the driver. |
Auto Calibration > Data latching delay | Must be a valid non-negative integer | 0x08 | Set this to 0 to enable auto-calibration. 0x08 is the default value |
Auto Calibration > Auto-Calibration Address | Must be a valid non-negative integer | 0x00 | Set the address of the read/write destination to be performed for auto-calibration. |
Bus Timing > CS minimum idle term | Refer to the RZT Configuration tool for available options. | 7 CYCLES | Define the CS minimum idle term. |
Bus Timing > CS Asserting extension |
| No Extension | Define the CS asserting extension |
Bus Timing > CS Negating extension |
| No Extension | Define the CS negating extension |
The XSPI_CLKn frequencies can be set on the Clocks tab of FSP Configuration editor or by using the CGC Interface at run-time.
The following pins are available to connect to an external Hyper device:
After R_XSPI_HYPER_Open() completes successfully, the HyperRAM device contents are mapped to address 0x60000000 (unit 0) or 0x68000000 (unit 1) based on the unit configured and can be read like on-chip RAM. When not using the cache, access the HyperRAM device via the mirror space 0x40000000 (unit 0) or 0x48000000 (unit 1). Unit 0 and Unit 1 support until 128 MB of address space.
The address map details for the external address space xSPI in RZ/T2M and RZ/T2L is as follows:
Address | Space |
---|---|
0x40000000 to 0x43FFFFFF | unit 0 CS0 mirror space |
0x44000000 to 0x47FFFFFF | unit 0 CS1 mirror space |
0x48000000 to 0x4BFFFFFF | unit 1 CS0 mirror space |
0x4C000000 to 0x4FFFFFFF | unit 1 CS1 mirror space |
0x60000000 to 0x63FFFFFF | unit 0 CS0 |
0x64000000 to 0x67FFFFFF | unit 0 CS1 |
0x68000000 to 0x6BFFFFFF | unit 1 CS0 |
0x6C000000 to 0x6FFFFFFF | unit 1 CS1 |
The address map for the external address space xSPI in RZ/T2ME is as follows:
Address | Space |
---|---|
0x40000000 to 0x47FFFFFF | unit 0 CS0 mirror space + unit 0 CS1 mirror space |
0x48000000 to 0x4FFFFFFF | unit 1 CS0 mirror space + unit 1 CS1 mirror space |
0x60000000 to 0x67FFFFFF | unit 0 CS0 + unit 0 CS1 |
0x68000000 to 0x6FFFFFFF | unit 1 CS0 + unit 1 CS1 |
The address map for the external address space xSPI in RZ/T2H is as follows:
Address | Space |
---|---|
0x40000000 to 0x4FFFFFFF | unit 0 CS0 + unit 0 CS1 |
0x50000000 to 0x5FFFFFFF | unit 1 CS0 + unit 1 CS1 |
This driver allows user to dynamically select whether to access memory space or register space. Call R_XSPI_HYPER_AccessSpaceSet(), and assign HYPERBUS_SPACE_SELECT_MEMORY_SPACE or HYPERBUS_SPACE_SELECT_REGISTER_SPACE to the second argument.
Note that register space access is in limited situations, such as when changing the HyperRAM device-specific configuration.
This is a basic example of minimal use of the HyperBus module in an application.
This is an example of using R_XSPI_HYPER_AccessSpaceSet() to change the address space from memory to register.
This is an example of changing the initial latency of HyperRAM. By register space access, rewrite the value of Confiugration register 0 of HyperRAM device.
The initial latency can be changed by changing the settings of bits [7:4] of CR0. The sample code describes the case of changing from the factory default 6 cycle latency (at a maximum operating frequency of 166 MHz) to 4 cycle latency (at a maximum operating frequency of 100 MHz). Set the latency cycle for the HyperBus controller and HyperRAM according to the specification of the using HyperRAM.
Data Structures | |
struct | xspi_hyper_instance_ctrl_t |
Enumerations | |
enum | xspi_hyper_chip_select_t |
enum | xspi_hyper_device_type_t |
enum | xspi_hyper_memory_size_t |
enum | xspi_hyper_transaction_interval_clocks_t |
enum | xspi_hyper_cs_pulldown_clocks_t |
enum | xspi_hyper_cs_pullup_clocks_t |
enum | xspi_hyper_prefetch_function_t |
enum | xspi_hyper_io_voltage_t |
struct xspi_hyper_instance_ctrl_t |
Instance control block. DO NOT INITIALIZE. Initialization occurs when hyperbus_api_t::open is called
fsp_err_t R_XSPI_HYPER_Open | ( | hyperbus_ctrl_t * | p_ctrl, |
hyperbus_cfg_t const *const | p_cfg | ||
) |
Open the HYPER driver module. After the driver is open, the HyperRAM can be accessed like internal memory.
Implements hyperbus_api_t::open.
FSP_SUCCESS | Configuration was successful. |
FSP_ERR_ASSERTION | The parameter p_ctrl or p_cfg is NULL. |
FSP_ERR_ALREADY_OPEN | Driver has already been opened with the same p_ctrl. |
fsp_err_t R_XSPI_HYPER_Close | ( | hyperbus_ctrl_t * | p_ctrl | ) |
Close the HYPER driver module.
Implements hyperbus_api_t::close.
FSP_SUCCESS | Configuration was successful. |
FSP_ERR_ASSERTION | p_instance_ctrl is NULL. |
FSP_ERR_NOT_OPEN | Driver is not opened. |
fsp_err_t R_XSPI_HYPER_BurstTypeSet | ( | hyperbus_ctrl_t * | p_ctrl, |
hyperbus_burst_type_t | burst_type | ||
) |
Dynamic burst type configuration.
Implements hyperbus_api_t::burstTypeSet
FSP_ERR_UNSUPPORTED | API not supported by Hyper - HyperRAM. (Only can use Linear Burst) |
fsp_err_t R_XSPI_HYPER_AccessSpaceSet | ( | hyperbus_ctrl_t * | p_ctrl, |
hyperbus_space_select_t | access_space | ||
) |
Dynamic access address space configuration.
Implements hyperbus_api_t::accessSpaceSet
FSP_SUCCESS | Address space successfully changed as specified by the argument. |
FSP_ERR_ASSERTION | The parameter p_ctrl is NULL. |
FSP_ERR_NOT_OPEN | Driver is not opened. |
fsp_err_t R_XSPI_HYPER_Write | ( | hyperbus_ctrl_t * | p_ctrl, |
uint8_t const *const | p_src, | ||
uint8_t *const | p_dest, | ||
uint32_t | byte_count | ||
) |
Program a page of data to the flash.
Implements hyperbus_api_t::write.
FSP_ERR_UNSUPPORTED | API not supported by HyperBus - HyperRAM. |
fsp_err_t R_XSPI_HYPER_Erase | ( | hyperbus_ctrl_t * | p_ctrl, |
uint8_t *const | p_device_address, | ||
uint32_t | byte_count | ||
) |
Erase a block or sector of flash. The byte_count must exactly match one of the erase sizes defined in hyperbus_cfg_t. For chip erase, byte_count must be HYPER_FLASH_ERASE_SIZE_CHIP_ERASE.
Implements hyperbus_api_t::erase.
FSP_ERR_UNSUPPORTED | API not supported by HyperBus - HyperRAM. |
fsp_err_t R_XSPI_HYPER_StatusGet | ( | hyperbus_ctrl_t * | p_ctrl, |
hyperbus_status_t *const | p_status | ||
) |
Gets the write or erase status of the flash.
Implements hyperbus_api_t::statusGet.
FSP_ERR_UNSUPPORTED | API not supported by HyperBus - HyperRAM. |
fsp_err_t R_XSPI_HYPER_AutoCalibrate | ( | hyperbus_ctrl_t * | p_ctrl | ) |
Auto-calibrate the HyperRAM device using the preamble pattern.
Implements hyperbus_api_t::autoCalibrate.
FSP_ERR_UNSUPPORTED | API not supported by HyperBus - HyperFlash. (Planned support for FSP v2.1.0 or later.) |