app_graphics_ospi.h File Reference

Header file containing functions prototypes of OSPI app library. More...

#include "gr55xx.h"
#include "gr55xx_ll_ospi_x.h"
#include "stdbool.h"
#include "app_drv_error.h"
#include "app_drv_config.h"

Go to the source code of this file.

Classes

struct  app_graphics_ospi_params_t
 Define init params for OSPI. More...
 

Macros

#define OSPI_PSRAM_DEVICE_ID   0x13
 
#define OSPI_PSRAM_MIN_XIP_ADDRESS   OSPI0_XIP_BASE
 
#define OSPI_PSRAM_MAX_XIP_ADDRESS   (OSPI0_XIP_BASE + 0x7FFFFF)
 
#define OSPI_PSRAM_BYTE_SIZE   (0x800000)
 
#define PSRAM_INIT_PARAMS_Default
 PSRAM init parameter definition. More...
 

Typedefs

typedef void(* ospi_irq_handler) (void)
 Define IRQ handler for OSPI. More...
 
typedef void(* psram_reload_func_t) (void)
 Define PSRAM reload function for OSPI. More...
 

Enumerations

enum  app_ospi_clock_freq_e {
  OSPI_CLOCK_FREQ_48MHz = 0x00,
  OSPI_CLOCK_FREQ_32MHz = 0x01,
  OSPI_CLOCK_FREQ_24MHz = 0x02,
  OSPI_CLOCK_FREQ_16MHz = 0x03
}
 OSPI Clock Frequency Enumerations definition. More...
 
enum  app_ospi_phy_delay_e {
  OSPI_PHY_DELAY_TAP_2 = 0x01,
  OSPI_PHY_DELAY_TAP_3 = 0x02,
  OSPI_PHY_DELAY_TAP_4 = 0x03
}
 OSPI PHY Delay Value Enumerations definition. More...
 
enum  app_ospi_psram_drv_strength_e {
  OSPI_PSRAM_DRV_STR_FULL = 0x00,
  OSPI_PSRAM_DRV_STR_HALF = 0x01,
  OSPI_PSRAM_DRV_STR_ONE_FORTH = 0x02,
  OSPI_PSRAM_DRV_STR_ONE_EIGHTH = 0x03
}
 PSRAM Drive Strength Enumerations definition. More...
 
enum  app_ospi_psram_rd_latency_e {
  OSPI_PSRAM_RD_LATENCY_3 = 0x00,
  OSPI_PSRAM_RD_LATENCY_4 = 0x01,
  OSPI_PSRAM_RD_LATENCY_5 = 0x02,
  OSPI_PSRAM_RD_LATENCY_6 = 0x03,
  OSPI_PSRAM_RD_LATENCY_7 = 0x04
}
 PSRAM Read Latency Enumerations definition. More...
 
enum  app_ospi_psram_wr_latency_e {
  OSPI_PSRAM_WR_LATENCY_3 = 0x00,
  OSPI_PSRAM_WR_LATENCY_4 = 0x04,
  OSPI_PSRAM_WR_LATENCY_5 = 0x02,
  OSPI_PSRAM_WR_LATENCY_6 = 0x06,
  OSPI_PSRAM_WR_LATENCY_7 = 0x01
}
 PSRAM Write Latency Enumerations definition. More...
 
enum  app_ospi_access_mode_e {
  OSPI_ACCESS_MEMORY = 0,
  OSPI_ACCESS_REGISTER,
  OSPI_ACCESS_UNSET
}
 PSRAM Access Mode Enumerations definition. More...
 
enum  app_ospi_work_state_e {
  OSPI_STATE_DEEP_SLEEP = 0,
  OSPI_STATE_HALF_SLEEP = 1,
  OSPI_STATE_ACTIVE = 2
}
 PSRAM Work Mode Enumerations definition. More...
 
enum  app_ospi_pasr_e {
  OSPI_PASR_FULL = 0x00,
  OSPI_PASR_BOTTOM_4MB = 0x01,
  OSPI_PASR_BOTTOM_2MB = 0x02,
  OSPI_PASR_BOTTOM_1MB = 0x03,
  OSPI_PASR_NONE = 0x04,
  OSPI_PASR_TOP_4MB = 0x05,
  OSPI_PASR_TOP_2MB = 0x06,
  OSPI_PASR_TOP_1MB = 0x07,
  OSPI_PASR_MAX
}
 PSRAM Partial Array Refresh Enumerations definition. More...
 

Functions

uint16_t app_graphics_ospi_init (app_graphics_ospi_params_t *p_params)
 Initialize the APP OSPI DRIVER according to the specified parameters. More...
 
void app_graphics_ospi_deinit (void)
 De-Initialize the APP OSPI DRIVER . More...
 
void app_graphics_ospi_reset (void)
 Reset the OSPI Controller. More...
 
void app_graphics_ospi_register_psram_reload_func (psram_reload_func_t psram_reload_func)
 Register the OSPI reload function for PSRAM recovery after deep sleep. More...
 
void app_graphics_ospi_set_sleep_state (app_ospi_work_state_e state)
 Set the OSPI low power state for system sleep. More...
 
app_ospi_work_state_e app_graphics_ospi_get_sleep_state (void)
 Get the OSPI low power state for system sleep. More...
 
uint32_t app_graphics_ospi_get_base_address (void)
 Get the OSPI.PSRAM Base Address. More...
 
void app_graphics_ospi_set_pasr (app_ospi_pasr_e area)
 Set Partial Refresh Array for OSPI PSRAM. More...
 
void app_graphics_ospi_pasr_update (uint32_t psram_addr)
 Set Partial Refresh Array for OSPI PSRAM with PSRAM used address. More...
 
__STATIC_INLINE bool app_graphics_is_ospi_address (uint32_t address)
 Check address is located at ospi.psram or not. More...
 
__STATIC_INLINE void app_graphics_ospi_set_read_prefetch (bool enable)
 Enable/Disable read prefetch of OSPI PSRAM. More...
 
__STATIC_INLINE bool app_graphics_ospi_get_read_prefetch (void)
 Get read prefetch state of OSPI PSRAM. More...
 
uint32_t app_graphics_ospi_get_byte_size (void)
 Get the OSPI.PSRAM Size in Bytes. More...
 
void app_graphics_ospi_set_power_state (app_ospi_work_state_e state)
 Set the OSPI work state. More...
 

Detailed Description

Header file containing functions prototypes of OSPI app library.

Author
BLE Driver Team
Attention
#####Copyright (c) 2021 GOODIX All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file app_graphics_ospi.h.