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

Macros

#define PRINTF(...)
 
#define SPIM_GAP_ADDR_ID
 
#define PREALLOC_TASK_VALID_ID
 
#define SPIM_LEN_ID
 
#define TR_TYPE_ID
 
#define SPIM_DEV_ADDR_ID
 
#define SPIM_STRIDE_ID
 
#define SPIM_LENGTH_ID
 
#define SPI_TRANSFER_TYPE_COPY_2D
 
#define SPI_TRANSFER_TYPE_COPY
 
#define SPI_TRANSFER_TYPE_SEND
 
#define SPI_TRANSFER_TYPE_READ
 

Functions

static void __spi_cpy_read_aligned (struct spim_cs_data *cs_data, uint32_t addr, void *data, size_t len, pi_spi_flags_e flags, pi_task_t *task)
 
static void __spi_cpy_send_aligned (struct spim_cs_data *cs_data, uint32_t addr, void *data, size_t len, pi_spi_flags_e flags, pi_task_t *task)
 
static void __spi_cpy_read_misaligned (struct spim_cs_data *cs_data, uint32_t addr, void *data, size_t len, pi_spi_flags_e flags, pi_task_t *task)
 
static void __spi_cpy_send_misaligned (struct spim_cs_data *cs_data, uint32_t addr, void *data, size_t len, pi_spi_flags_e flags, pi_task_t *task)
 
static uint32_t __pi_spi_clk_div_get (uint32_t spi_freq)
 
void pi_spi_conf_init (struct pi_spi_conf *conf)
 
void __pi_spim_execute_callback (void *arg)
 
static void __pi_spim_exec_next_transfer (pi_task_t *task)
 
static void __pi_spim_exec_post_transfer (pi_task_t *task)
 
static void __spim_handle_end_of_transfer (pi_task_t *task)
 
static void __spim_handle_first_byte_copy (struct spim_driver_data *drv_data)
 
static void __spim_handle_last_byte_copy (struct spim_driver_data *drv_data)
 
static void __spim_exec_2d_transfer (pi_task_t *task)
 
void spim_eot_handler (void *arg)
 
void spim_tx_handler (void *arg)
 
void spim_rx_handler (void *arg)
 
int __pi_spi_open (struct spim_cs_data **cs_data, struct pi_spi_conf *conf)
 
int __pi_spi_close (struct spim_cs_data *cs_data)
 
void __pi_spi_freq_cb (void *args)
 
void __pi_spi_receive_async (struct spim_cs_data *cs_data, void *data, size_t len, pi_spi_flags_e flags, pi_task_t *task)
 
void __pi_spi_receive_async_with_ucode (struct spim_cs_data *cs_data, void *data, size_t len, pi_spi_flags_e flags, int ucode_size, void *ucode, pi_task_t *task)
 
void __pi_spi_send_async_with_ucode (struct spim_cs_data *cs_data, void *data, size_t len, pi_spi_flags_e flags, int ucode_size, void *ucode, pi_task_t *task)
 
void __pi_spi_send_async (struct spim_cs_data *cs_data, void *data, size_t len, pi_spi_flags_e flags, pi_task_t *task)
 
void __pi_spi_xfer_async (struct spim_cs_data *cs_data, void *tx_data, void *rx_data, size_t len, pi_spi_flags_e flags, pi_task_t *task)
 
void __pi_spi_copy_async (struct spim_cs_data *cs_data, uint32_t addr, void *data, size_t len, pi_spi_flags_e flags, pi_task_t *task)
 
void __pi_spi_copy_async_2d (struct spim_cs_data *cs_data, uint32_t addr, void *data, size_t len, size_t stride, size_t length, pi_spi_flags_e flags, pi_task_t *task)
 
void __pi_spi_send_ucode_set_addr_info (struct spim_cs_data *cs_data, void *addr, size_t size)
 
uint8_t * __pi_spi_send_ucode_set (struct spim_cs_data *cs_data, uint8_t *ucode, size_t size)
 
void __pi_spi_receive_ucode_set_addr_info (struct spim_cs_data *cs_data, void *addr, size_t size)
 
uint8_t * __pi_spi_receive_ucode_set (struct spim_cs_data *cs_data, uint8_t *ucode, size_t size)
 
void __ucode_patch (struct spim_cs_data *cs_data, uint32_t addr, int is_rx)
 

Variables

struct spim_driver_data__g_spim_drv_data [UDMA_NB_SPIM]
 
struct pmsis_event_kernel_wrap * default_sched
 

Macro Definition Documentation

#define SPI_TRANSFER_TYPE_COPY_2D
#define SPI_TRANSFER_TYPE_READ
#define SPI_TRANSFER_TYPE_SEND
#define SPIM_DEV_ADDR_ID
#define SPIM_GAP_ADDR_ID
#define SPIM_LEN_ID

Referenced by __spim_exec_2d_transfer().

#define SPIM_LENGTH_ID
#define SPIM_STRIDE_ID
#define TR_TYPE_ID

Function Documentation

static uint32_t __pi_spi_clk_div_get ( uint32_t  spi_freq)
static

References pi_freq_get().

Referenced by __pi_spi_freq_cb(), and __pi_spi_open().

void __pi_spi_copy_async ( struct spim_cs_data cs_data,
uint32_t  addr,
void *  data,
size_t  len,
pi_spi_flags_e  flags,
pi_task_t task 
)
uint8_t* __pi_spi_receive_ucode_set ( struct spim_cs_data cs_data,
uint8_t *  ucode,
size_t  size 
)
void __pi_spi_receive_ucode_set_addr_info ( struct spim_cs_data cs_data,
void *  addr,
size_t  size 
)
uint8_t* __pi_spi_send_ucode_set ( struct spim_cs_data cs_data,
uint8_t *  ucode,
size_t  size 
)
void __pi_spi_send_ucode_set_addr_info ( struct spim_cs_data cs_data,
void *  addr,
size_t  size 
)
static void __pi_spim_exec_post_transfer ( pi_task_t task)
inlinestatic
void __pi_spim_execute_callback ( void *  arg)
static void __spi_cpy_read_misaligned ( struct spim_cs_data cs_data,
uint32_t  addr,
void *  data,
size_t  len,
pi_spi_flags_e  flags,
pi_task_t task 
)
inlinestatic
static void __spi_cpy_send_aligned ( struct spim_cs_data cs_data,
uint32_t  addr,
void *  data,
size_t  len,
pi_spi_flags_e  flags,
pi_task_t task 
)
inlinestatic
static void __spi_cpy_send_misaligned ( struct spim_cs_data cs_data,
uint32_t  addr,
void *  data,
size_t  len,
pi_spi_flags_e  flags,
pi_task_t task 
)
inlinestatic
static void __spim_exec_2d_transfer ( pi_task_t task)
inlinestatic
static void __spim_handle_end_of_transfer ( pi_task_t task)
inlinestatic
static void __spim_handle_first_byte_copy ( struct spim_driver_data drv_data)
inlinestatic
static void __spim_handle_last_byte_copy ( struct spim_driver_data drv_data)
inlinestatic
void pi_spi_conf_init ( struct pi_spi_conf *  conf)

Variable Documentation

struct spim_driver_data* __g_spim_drv_data[UDMA_NB_SPIM]
struct pmsis_event_kernel_wrap* default_sched