Lines Matching refs:ctx

305     essl_spi_context_t *ctx = arg;  in essl_spi_reset_cnt()  local
306 if (ctx) { in essl_spi_reset_cnt()
307 ctx->master_out.sent_buf_num = 0; in essl_spi_reset_cnt()
308 ctx->master_in.received_bytes = 0; in essl_spi_reset_cnt()
315 essl_spi_context_t *ctx = arg; in essl_spi_read_reg() local
317 …uint8_t reserved_1_head = ctx->master_out.tx_sync_reg < ctx->master_in.rx_sync_reg ? ctx->master_o… in essl_spi_read_reg()
319 …uint8_t reserved_2_head = ctx->master_out.tx_sync_reg < ctx->master_in.rx_sync_reg ? ctx->master_i… in essl_spi_read_reg()
323 return essl_spi_rdbuf(ctx->spi, out_value, addr, sizeof(uint8_t), 0); in essl_spi_read_reg()
328 essl_spi_context_t *ctx = arg; in essl_spi_get_rx_data_size() local
329 …G, "slave tx buffer: %d bytes, master has read: %d bytes", ctx->master_in.slave_tx_bytes, ctx->mas… in essl_spi_get_rx_data_size()
330 return ctx->master_in.slave_tx_bytes - ctx->master_in.received_bytes; in essl_spi_get_rx_data_size()
335 essl_spi_context_t *ctx = arg; in essl_spi_update_rx_data_size() local
340 …ret = essl_spi_rdbuf_polling(ctx->spi, (uint8_t *)&previous_size, ctx->master_in.rx_sync_reg, size… in essl_spi_update_rx_data_size()
351 …ret = essl_spi_rdbuf_polling(ctx->spi, (uint8_t *)&updated_size, ctx->master_in.rx_sync_reg, sizeo… in essl_spi_update_rx_data_size()
356 ctx->master_in.slave_tx_bytes = updated_size; in essl_spi_update_rx_data_size()
371 essl_spi_context_t *ctx = arg; in essl_spi_get_packet() local
386 …OGV(TAG, "slave buffer: %d is not enough, %d is required", ctx->master_in.slave_tx_bytes, ctx->mas… in essl_spi_get_packet()
392 ret = essl_spi_rddma_seg(ctx->spi, out_data, size, 0); in essl_spi_get_packet()
396 ctx->master_in.received_bytes += size; in essl_spi_get_packet()
404 essl_spi_context_t *ctx = arg; in essl_spi_write_reg() local
406 …uint8_t reserved_1_head = ctx->master_out.tx_sync_reg < ctx->master_in.rx_sync_reg ? ctx->master_o… in essl_spi_write_reg()
408 …uint8_t reserved_2_head = ctx->master_out.tx_sync_reg < ctx->master_in.rx_sync_reg ? ctx->master_i… in essl_spi_write_reg()
413 return essl_spi_wrbuf(ctx->spi, &value, addr, sizeof(uint8_t), 0); in essl_spi_write_reg()
418 essl_spi_context_t *ctx = arg; in essl_spi_get_tx_buffer_num() local
419 …ESP_LOGV(TAG, "slave rx buffer: %d, master has sent: %d", ctx->master_out.slave_rx_buf_num, ctx->m… in essl_spi_get_tx_buffer_num()
420 return ctx->master_out.slave_rx_buf_num - ctx->master_out.sent_buf_num; in essl_spi_get_tx_buffer_num()
425 essl_spi_context_t *ctx = arg; in essl_spi_update_tx_buffer_num() local
430 …ret = essl_spi_rdbuf_polling(ctx->spi, (uint8_t *)&previous_size, ctx->master_out.tx_sync_reg, siz… in essl_spi_update_tx_buffer_num()
441 …ret = essl_spi_rdbuf_polling(ctx->spi, (uint8_t *)&updated_num, ctx->master_out.tx_sync_reg, sizeo… in essl_spi_update_tx_buffer_num()
446 ctx->master_out.slave_rx_buf_num = updated_num; in essl_spi_update_tx_buffer_num()
461 essl_spi_context_t *ctx = arg; in essl_spi_send_packet() local
463 …uint32_t buf_num_to_use = (size + ctx->master_out.tx_buffer_size - 1) / ctx->master_out.tx_buffer_… in essl_spi_send_packet()
476 …GV(TAG, "slave buffer: %d is not enough, %d is required", ctx->master_out.slave_rx_buf_num, ctx->m… in essl_spi_send_packet()
482 ret = essl_spi_wrdma_seg(ctx->spi, data, size, 0); in essl_spi_send_packet()
486 ctx->master_out.sent_buf_num += buf_num_to_use; in essl_spi_send_packet()
488 return essl_spi_wrdma_done(ctx->spi, 0); in essl_spi_send_packet()