FFT APIs

[English]

重要

The FFT API v1.0 is the lastest stable FFT APIs. All new applications should use FFT API v1.0.

FFT Interface

The BK FFT Driver supports following functional interfaces:

  • FFT function

  • IFFT function

Each function can be operated independently. However both function share the same resources, only one function can exit and work at a time.

E.g. if the FFT function is working, the IFFT funtion can not work. And calling IFFT functional interface will fail when FFT function is working.

FFT API Categories

Most of FFT APIs can be categoried as:

  • Common APIs

    The common APIs are prefixed with bk_fft, the APIs may be common for all functions and interfaces, e.g. bk_fft_driver_init() etc.

  • FFT function APIs.

    The APIs provide support for FFT and IFFT function. e.g. bk_fft_enable() etc.

Common APIs:
FFT function APIs:

API Reference

Header File

Functions

bool bk_fft_is_busy(void)

Get the fft module working status.

返回

  • TRUE: fft is busying

  • FALSE: fft is not busying

bk_err_t bk_fft_enable(fft_input_t *fft_conf)

Enable fft module to process fft/ifft function.

This API process fft/ifft function :

  • Set fft work mode: fft/ifft

  • Configure the fft/ifft parameters

  • start trigger

  • enable interrupts

Usage example:

//init fft driver
bk_fft_driver_init();

fft_conf.inbuf = os_malloc(4*1024);
os_memset(fft_conf.inbuf, 0, 4*1024);

fft_conf.mode = FFT_WORK_MODE_FFT;
fft_conf.size = 1024;

//start fft
bk_fft_enable(&fft_conf);

//wait fft complete
while(fft_busy_flag)
    bk_fft_is_busy(&fft_busy_flag);
CLI_LOGI("fft complete\r\n");
//read output data
bk_fft_output_read(data_proc_i, data_proc_q, 2 * 1024);

参数

fft_conf – fft/ifft parameters

返回

  • BK_OK: succeed

  • others: other errors.

bk_err_t bk_fft_driver_init(void)

Init fft module driver.

This API init fft driver :

  • power on

  • enable interrupts

返回

  • BK_OK: succeed

  • others: other errors.

bk_err_t bk_fft_driver_deinit(void)

Deinit fft module driver.

This API deinit fft driver :

  • Power down clock

  • disable interrupts

返回

  • BK_OK: succeed

  • others: other errors.

bk_err_t bk_fft_output_read(int16_t *i_output, int16_t *q_output, uint32_t size)

Read fft data.

This API read fft data after processing complete

参数
  • i_output – save fft data

  • q_output – save fft data

  • size – read size if i_output

返回

  • BK_OK: succeed

  • others: other errors.

API Typedefs

Header File

Structures

struct fft_int_config_t
struct fft_driver_t
struct fft_status_t

Public Members

bool fft_done

FFT fft process done

bool fir_done

FFT fir process done

bool self_proc_done

FFT self process done

bool start_trigger

FFT start trigger flag

uint32_t bit_ext

FFT fft bit extend

struct fft_int_status
struct fft_input_t
struct fft_fir_input_t

Macros

BK_ERR_FFT_NOT_INIT

FFT driver not init

BK_ERR_FFT_PARAM

FFT parameter invalid

Type Definitions

typedef void (*fft_isr_t)(void *param)

Enumerations

enum fft_work_mode_t

Values:

enumerator FFT_WORK_MODE_FFT

FFT fft work mode

enumerator FFT_WORK_MODE_IFFT

FFT ifft work mode

enumerator FFT_WORK_MODE_MAX
enum fft_mode_t

Values:

enumerator FFT_MODE_NORMAL

FFT normal mode

enumerator FFT_MODE_BK5130

FFT bk5130 mode

enumerator FFT_MODE_MAX
enum fft_ifft_en_t

Values:

enumerator FFT_IFFT_DISABLE

IFFT disable

enumerator FFT_IFFT_ENABLE

IFFT enable

enumerator FFT_IFFT_MAX
enum fft_int_en_t

Values:

enumerator FFT_INT_DISABLE

FFT interrupt disable

enumerator FFT_INT_ENABLE

FFT interrupt enable

enumerator FFT_INT_MAX
enum fft_enable_t

Values:

enumerator FFT_DISABLE

FFT disable

enumerator FFT_ENABLE

FFT enable

enumerator FFT_ENABLE_MAX
enum fft_gat_t

Values:

enumerator FFT_GAT_ON

FFT gat on

enumerator FFT_GAT_OFF

FFT gat off

enumerator FFT_GAT_MAX
enum fft_fir_mode_t

Values:

enumerator FFT_FIR_MODE_SIGNAL

FIR signal mode

enumerator FFT_FIR_MODE_DUAL

FIR dual mode

enumerator FFT_FIR_MODE_MAX
enum fft_fir_int_en_t

Values:

enumerator FFT_FIR_INT_DISABLE

FIR interrupt disable

enumerator FFT_FIR_INT_ENABLE

FIR interrupt enable

enumerator FFT_FIR_INT_MAX
enum fft_fir_en_t

Values:

enumerator FFT_FIR_DISABLE

FIR disable

enumerator FFT_FIR_ENABLE

FIR enable

enumerator FFT_FIR_ENABLE_MAX
enum fft_self_proc_mode_t

Values:

enumerator FFT_SELF_PROC_MODE0

Self process mode1

enumerator FFT_SELF_PROC_MODE1

Self process mode2

enumerator FFT_SELF_PROC_MODE_MAX
enum fft_memory_config_t

Values:

enumerator FFT_SELECT_MEMORY0

FFT select Memroy0

enumerator FFT_SELECT_MEMORY1

FFT select Memroy1

enumerator FFT_SELECT_MEMORY_MAX