Kestrel Interface
Loading...
Searching...
No Matches
kest_fpga_io.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  kest_fpga_transfer_batch

Macros

#define KEST_FPGA_SAMPLE_RATE   44100
#define COMMAND_BEGIN_PROGRAM   1
#define COMMAND_WRITE_BLOCK_INSTR   2
#define COMMAND_WRITE_BLOCK_REG_0   3
#define COMMAND_WRITE_BLOCK_REG_1   4
#define COMMAND_ALLOC_DELAY   5
#define COMMAND_END_PROGRAM   10
#define COMMAND_SET_INPUT_GAIN   11
#define COMMAND_SET_OUTPUT_GAIN   12
#define COMMAND_UPDATE_BLOCK_REG_0   13
#define COMMAND_UPDATE_BLOCK_REG_1   14
#define COMMAND_COMMIT_REG_UPDATES   15
#define COMMAND_ALLOC_FILTER   16
#define COMMAND_WRITE_FILTER_COEF   17
#define COMMAND_UPDATE_FILTER_COEF   18
#define COMMAND_COMMIT_FILTER_COEF   19
#define SPI_RESPONSE_OK   0
#define SPI_RESPONSE_INITIALISING   1
#define SPI_RESPONSE_PROGRAMMING   2
#define SPI_RESPONSE_REJECTED   3
#define SPI_RESPONSE_TIMEOUT   4
#define KEST_FPGA_N_BLOCKS   256
#define KEST_FPGA_BLOCK_ADDR_BYTES   1
#define KEST_FPGA_DATA_WIDTH   16
#define KEST_FPGA_FILTER_WIDTH   18
#define KEST_FPGA_DATA_BYTES   (KEST_FPGA_DATA_WIDTH / 8)

Typedefs

typedef uint8_t kest_fpga_block_addr_t
typedef int16_t kest_fpga_sample_t

Functions

kest_fpga_transfer_batch kest_new_fpga_transfer_batch ()
void kest_free_fpga_transfer_batch (kest_fpga_transfer_batch batch)
int kest_send_bytes_to_fpga (uint8_t *buf, int n)
int kest_send_byte_to_fpga (uint8_t byte)
int kest_fpga_send_byte (uint8_t byte)
uint8_t kest_fpga_read_byte ()
void kest_fpga_set_input_gain (float gain_db)
void kest_fpga_set_output_gain (float gain_db)
void kest_fpga_commit_reg_updates ()
int kest_fpga_batch_append (kest_fpga_transfer_batch *seq, uint8_t x)
int kest_fpga_batch_append_16 (kest_fpga_transfer_batch *seq, uint16_t x)
int kest_fpga_batch_append_24 (kest_fpga_transfer_batch *seq, uint32_t x)
int kest_fpga_batch_append_32 (kest_fpga_transfer_batch *seq, uint32_t x)
int kest_fpga_transfer_batch_send (kest_fpga_transfer_batch batch)
int kest_fpga_spi_init ()
char * kest_fpga_command_to_string (int command)

Macro Definition Documentation

◆ COMMAND_ALLOC_DELAY

#define COMMAND_ALLOC_DELAY   5

◆ COMMAND_ALLOC_FILTER

#define COMMAND_ALLOC_FILTER   16

Definition at line 19 of file kest_fpga_io.h.

Referenced by kest_fpga_batch_append_resource(), and kest_fpga_batch_print().

◆ COMMAND_BEGIN_PROGRAM

#define COMMAND_BEGIN_PROGRAM   1

◆ COMMAND_COMMIT_FILTER_COEF

#define COMMAND_COMMIT_FILTER_COEF   19

Definition at line 22 of file kest_fpga_io.h.

◆ COMMAND_COMMIT_REG_UPDATES

#define COMMAND_COMMIT_REG_UPDATES   15

◆ COMMAND_END_PROGRAM

#define COMMAND_END_PROGRAM   10

◆ COMMAND_SET_INPUT_GAIN

#define COMMAND_SET_INPUT_GAIN   11

◆ COMMAND_SET_OUTPUT_GAIN

#define COMMAND_SET_OUTPUT_GAIN   12

◆ COMMAND_UPDATE_BLOCK_REG_0

#define COMMAND_UPDATE_BLOCK_REG_0   13

◆ COMMAND_UPDATE_BLOCK_REG_1

#define COMMAND_UPDATE_BLOCK_REG_1   14

◆ COMMAND_UPDATE_FILTER_COEF

#define COMMAND_UPDATE_FILTER_COEF   18

Definition at line 21 of file kest_fpga_io.h.

◆ COMMAND_WRITE_BLOCK_INSTR

#define COMMAND_WRITE_BLOCK_INSTR   2

◆ COMMAND_WRITE_BLOCK_REG_0

#define COMMAND_WRITE_BLOCK_REG_0   3

◆ COMMAND_WRITE_BLOCK_REG_1

#define COMMAND_WRITE_BLOCK_REG_1   4

◆ COMMAND_WRITE_FILTER_COEF

#define COMMAND_WRITE_FILTER_COEF   17

Definition at line 20 of file kest_fpga_io.h.

Referenced by kest_fpga_batch_append_resource(), and kest_fpga_batch_print().

◆ KEST_FPGA_BLOCK_ADDR_BYTES

#define KEST_FPGA_BLOCK_ADDR_BYTES   1

Definition at line 36 of file kest_fpga_io.h.

Referenced by kest_fpga_batch_print().

◆ KEST_FPGA_DATA_BYTES

#define KEST_FPGA_DATA_BYTES   (KEST_FPGA_DATA_WIDTH / 8)

Definition at line 42 of file kest_fpga_io.h.

Referenced by kest_fpga_batch_print().

◆ KEST_FPGA_DATA_WIDTH

#define KEST_FPGA_DATA_WIDTH   16

Definition at line 40 of file kest_fpga_io.h.

Referenced by float_to_q_nminus1(), and kest_compute_register_formats().

◆ KEST_FPGA_FILTER_WIDTH

#define KEST_FPGA_FILTER_WIDTH   18

Definition at line 41 of file kest_fpga_io.h.

Referenced by kest_filter_compute_format(), and kest_fpga_batch_append_resource().

◆ KEST_FPGA_N_BLOCKS

#define KEST_FPGA_N_BLOCKS   256

◆ KEST_FPGA_SAMPLE_RATE

#define KEST_FPGA_SAMPLE_RATE   44100

Definition at line 4 of file kest_fpga_io.h.

Referenced by kest_fpga_batch_append_resource().

◆ SPI_RESPONSE_INITIALISING

#define SPI_RESPONSE_INITIALISING   1

Definition at line 25 of file kest_fpga_io.h.

◆ SPI_RESPONSE_OK

#define SPI_RESPONSE_OK   0

Definition at line 24 of file kest_fpga_io.h.

Referenced by kest_fpga_comms_task().

◆ SPI_RESPONSE_PROGRAMMING

#define SPI_RESPONSE_PROGRAMMING   2

Definition at line 26 of file kest_fpga_io.h.

◆ SPI_RESPONSE_REJECTED

#define SPI_RESPONSE_REJECTED   3

Definition at line 27 of file kest_fpga_io.h.

◆ SPI_RESPONSE_TIMEOUT

#define SPI_RESPONSE_TIMEOUT   4

Definition at line 28 of file kest_fpga_io.h.

Typedef Documentation

◆ kest_fpga_block_addr_t

typedef uint8_t kest_fpga_block_addr_t

Definition at line 37 of file kest_fpga_io.h.

◆ kest_fpga_sample_t

typedef int16_t kest_fpga_sample_t

Definition at line 45 of file kest_fpga_io.h.

Function Documentation

◆ kest_fpga_batch_append()

int kest_fpga_batch_append ( kest_fpga_transfer_batch * seq,
uint8_t x )

Definition at line 126 of file kest_fpga_io.c.

Referenced by kest_fpga_batch_append_16(), kest_fpga_batch_append_24(), kest_fpga_batch_append_32(), kest_fpga_batch_append_block_instr(), kest_fpga_batch_append_block_number(), kest_fpga_batch_append_block_register_updates(), kest_fpga_batch_append_block_regs(), kest_fpga_batch_append_resource(), and kest_pipeline_create_fpga_transfer_batch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_fpga_batch_append_16()

int kest_fpga_batch_append_16 ( kest_fpga_transfer_batch * seq,
uint16_t x )

Definition at line 148 of file kest_fpga_io.c.

Referenced by kest_fpga_batch_append_block_number(), kest_fpga_batch_append_block_register_updates(), kest_fpga_batch_append_block_regs(), and kest_fpga_batch_append_resource().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_fpga_batch_append_24()

int kest_fpga_batch_append_24 ( kest_fpga_transfer_batch * seq,
uint32_t x )

Definition at line 164 of file kest_fpga_io.c.

Referenced by kest_fpga_batch_append_resource().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_fpga_batch_append_32()

int kest_fpga_batch_append_32 ( kest_fpga_transfer_batch * seq,
uint32_t x )

Definition at line 181 of file kest_fpga_io.c.

Referenced by kest_fpga_batch_append_block_instr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_fpga_command_to_string()

char * kest_fpga_command_to_string ( int command)

Definition at line 271 of file kest_fpga_io.c.

Referenced by kest_fpga_comms_task().

Here is the caller graph for this function:

◆ kest_fpga_commit_reg_updates()

void kest_fpga_commit_reg_updates ( )

Definition at line 266 of file kest_fpga_io.c.

Here is the call graph for this function:

◆ kest_fpga_read_byte()

uint8_t kest_fpga_read_byte ( )

Definition at line 101 of file kest_fpga_io.c.

Referenced by kest_fpga_comms_task().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_fpga_send_byte()

int kest_fpga_send_byte ( uint8_t byte)

Definition at line 96 of file kest_fpga_io.c.

Referenced by kest_fpga_commit_reg_updates(), kest_fpga_comms_task(), kest_fpga_set_input_gain(), and kest_fpga_set_output_gain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_fpga_set_input_gain()

void kest_fpga_set_input_gain ( float gain_db)

Definition at line 245 of file kest_fpga_io.c.

Referenced by kest_fpga_comms_task().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_fpga_set_output_gain()

void kest_fpga_set_output_gain ( float gain_db)

Definition at line 255 of file kest_fpga_io.c.

Referenced by kest_fpga_comms_task().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_fpga_spi_init()

int kest_fpga_spi_init ( )

Definition at line 20 of file kest_fpga_io.c.

Referenced by kest_fpga_comms_task().

Here is the caller graph for this function:

◆ kest_fpga_transfer_batch_send()

int kest_fpga_transfer_batch_send ( kest_fpga_transfer_batch batch)

Definition at line 240 of file kest_fpga_io.c.

Referenced by kest_fpga_comms_task().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_free_fpga_transfer_batch()

void kest_free_fpga_transfer_batch ( kest_fpga_transfer_batch batch)

Definition at line 121 of file kest_fpga_io.c.

Referenced by kest_fpga_comms_task(), and kest_pipeline_create_fpga_transfer_batch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_new_fpga_transfer_batch()

kest_fpga_transfer_batch kest_new_fpga_transfer_batch ( )

Definition at line 109 of file kest_fpga_io.c.

Referenced by kest_effect_update_fpga_registers(), and kest_pipeline_create_fpga_transfer_batch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kest_send_byte_to_fpga()

int kest_send_byte_to_fpga ( uint8_t byte)

◆ kest_send_bytes_to_fpga()

int kest_send_bytes_to_fpga ( uint8_t * buf,
int n )