FreeRTOS port on GAP8/RISC-V
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
octospi_internal.c File Reference

Macros

#define UDMA_DATA_MAX_SIZE
 

Functions

void __pi_octospi_0_irq_handler (void)
 
void __pi_octospi_1_irq_handler (void)
 
static void __pi_octospi_handler (void *arg)
 
void __pi_octospi_irq_handler (uint8_t octospi_id)
 
static void __pi_octospi_clk_div_get (struct octospi_cs_data_s *cs_data, uint32_t baudrate)
 
static void __pi_octospi_device_settings_set (struct octospi_cs_data_s *cs_data, uint32_t cs_max)
 
static void __pi_octospi_ospi_config_set (struct octospi_cs_data_s *cs_data, pi_octospi_op_conf_t *op, uint8_t is_xip)
 
static void __pi_octospi_2d_copy_exec (struct octospi_itf_data_s *driver_data, pi_task_t *task, int32_t hw_buff_idx)
 
void __pi_octospi_conf_init (struct pi_octospi_conf *conf)
 Init octospi configuration structure. More...
 
int32_t __pi_octospi_open (struct pi_octospi_conf *conf, struct octospi_cs_data_s **device_data)
 Open octospi device. More...
 
void __pi_octospi_close (struct octospi_cs_data_s *cs_data)
 Close octospi device. More...
 
int32_t __pi_octospi_ioctl (struct octospi_cs_data_s *cs_data, uint32_t cmd, void *arg)
 Ioctl function. More...
 
void __pi_octospi_2d_copy (struct octospi_cs_data_s *cs_data, uint32_t ext_addr, void *addr, uint32_t size, uint32_t stride, uint32_t length, pi_octospi_op_conf_t *op, udma_channel_e channel, pi_task_t *task)
 Enqueue 2D transfer. More...
 

Variables

static struct octospi_itf_data_sg_octospi_itf_data [UDMA_NB_HYPER]
 

Macro Definition Documentation

#define UDMA_DATA_MAX_SIZE

Function Documentation

void __pi_octospi_0_irq_handler ( void  )

Referenced by __pi_octospi_open().

void __pi_octospi_1_irq_handler ( void  )

Referenced by __pi_octospi_open().

void __pi_octospi_2d_copy ( struct octospi_cs_data_s cs_data,
uint32_t  ext_addr,
void *  addr,
uint32_t  size,
uint32_t  stride,
uint32_t  length,
pi_octospi_op_conf_t *  op,
udma_channel_e  channel,
pi_task_t task 
)
Parameters
cs_dataPointer to ospi device data.
ext_addrExternal address.
addrL2 buffer address.
sizeSize of data to transfer.
stride2D stride value, 0 if 1D.
length2D length value, 0 if 1D.
opOSPI operation.
channelType of transfer(RX or TX).
taskEvent task attached to the transfer.

References __pi_octospi_2d_copy_exec(), pi_task_t::data, octospi_cs_data_s::device_id, octospi_itf_data_s::device_id, disable_irq(), pi_task_t::next, OSPI_TRACE, pi_udma_fifo_hw_buffer_empty(), pi_udma_fifo_sw_fifo_task_enqueue(), restore_irq(), octospi_itf_data_s::udma_chan, and udma_chan_str.

Referenced by pi_octospi_read(), pi_octospi_read_2d(), pi_octospi_read_2d_async(), pi_octospi_read_async(), pi_octospi_write(), pi_octospi_write_2d(), pi_octospi_write_2d_async(), and pi_octospi_write_async().

static void __pi_octospi_clk_div_get ( struct octospi_cs_data_s cs_data,
uint32_t  baudrate 
)
inlinestatic
void __pi_octospi_conf_init ( struct pi_octospi_conf *  conf)
Parameters
confPointer to octospi conf.

Referenced by pi_octospi_conf_init().

static void __pi_octospi_handler ( void *  arg)
static
int32_t __pi_octospi_ioctl ( struct octospi_cs_data_s cs_data,
uint32_t  cmd,
void *  arg 
)
Parameters
cs_dataPointer to ospi device data.
cmdIoctl command ID.
argIoctl command arg.
Return values
-1Unknown command.
RETVALIoctl function return value.

References __pi_octospi_ospi_config_set(), disable_irq(), and restore_irq().

Referenced by pi_octospi_ioctl().

Variable Documentation

struct octospi_itf_data_s* g_octospi_itf_data[UDMA_NB_HYPER]
static