FFT APIs
重要
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:
bk_fft_driver_init()
- init FFTbk_fft_driver_deinit()
- deinit FFTbk_fft_is_busy()
- get FFT work statusbk_fft_output_read()
- get FFT/IFFT output data
- FFT function APIs:
bk_fft_enable()
- start FFT/IFFT function
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.
API Typedefs
Header File
Structures
-
struct fft_int_config_t
-
struct fft_driver_t
-
struct fft_status_t
-
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
-
enumerator FFT_WORK_MODE_FFT
-
enum fft_mode_t
Values:
-
enumerator FFT_MODE_NORMAL
FFT normal mode
-
enumerator FFT_MODE_BK5130
FFT bk5130 mode
-
enumerator FFT_MODE_MAX
-
enumerator FFT_MODE_NORMAL
-
enum fft_ifft_en_t
Values:
-
enumerator FFT_IFFT_DISABLE
IFFT disable
-
enumerator FFT_IFFT_ENABLE
IFFT enable
-
enumerator FFT_IFFT_MAX
-
enumerator FFT_IFFT_DISABLE
-
enum fft_int_en_t
Values:
-
enumerator FFT_INT_DISABLE
FFT interrupt disable
-
enumerator FFT_INT_ENABLE
FFT interrupt enable
-
enumerator FFT_INT_MAX
-
enumerator FFT_INT_DISABLE
-
enum fft_enable_t
Values:
-
enumerator FFT_DISABLE
FFT disable
-
enumerator FFT_ENABLE
FFT enable
-
enumerator FFT_ENABLE_MAX
-
enumerator FFT_DISABLE
-
enum fft_gat_t
Values:
-
enumerator FFT_GAT_ON
FFT gat on
-
enumerator FFT_GAT_OFF
FFT gat off
-
enumerator FFT_GAT_MAX
-
enumerator FFT_GAT_ON
-
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
-
enumerator FFT_FIR_MODE_SIGNAL
-
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
-
enumerator FFT_FIR_INT_DISABLE
-
enum fft_fir_en_t
Values:
-
enumerator FFT_FIR_DISABLE
FIR disable
-
enumerator FFT_FIR_ENABLE
FIR enable
-
enumerator FFT_FIR_ENABLE_MAX
-
enumerator FFT_FIR_DISABLE