MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Overview

The MCUXpresso SDK provides a peripheral FSP driver for the SYSCON module of MCUXpresso SDK devices.

Typical use case

Example use of FSP API.

void matrix_example(void)
{
uint32_t fsp_cycles, mcu_cycles;
fsp_matrix_instance_t FSP_A; /* Matrix A Instance */
fsp_matrix_instance_t FSP_AT; /* Matrix AT(A transpose) instance */
fsp_matrix_instance_t FSP_ATMA; /* Matrix ATMA( AT multiply with A) instance */
arm_matrix_instance_f32 A; /* Matrix A Instance */
arm_matrix_instance_f32 AT; /* Matrix AT(A transpose) instance */
arm_matrix_instance_f32 ATMA; /* Matrix ATMA( AT multiply with A) instance */
uint32_t srcRows, srcColumns; /* Temporary variables */
START_COUNTING();
/* Initialise A Matrix Instance with numRows, numCols and data array(A_f32) */
srcRows = 4;
srcColumns = 4;
FSP_MatInit(&FSP_A, srcRows, srcColumns, (float32_t *)A_f32);
/* Initialise Matrix Instance AT with numRows, numCols and data array(AT_f32) */
srcRows = 4;
srcColumns = 4;
FSP_MatInit(&FSP_AT, srcRows, srcColumns, AT_f32);
/* calculation of A transpose */
FSP_MatTransF32(DEMO_FSP_BASE, &FSP_A, &FSP_AT);
/* Initialise ATMA Matrix Instance with numRows, numCols and data array(ATMA_f32) */
srcRows = 4;
srcColumns = 4;
FSP_MatInit(&FSP_ATMA, srcRows, srcColumns, ATMA_f32);
/* calculation of AT Multiply with A */
FSP_MatMultF32(DEMO_FSP_BASE, &FSP_AT, &FSP_A, &FSP_ATMA);
fsp_cycles = GET_CYCLES();
START_COUNTING();
/* Initialise A Matrix Instance with numRows, numCols and data array(A_f32) */
srcRows = 4;
srcColumns = 4;
arm_mat_init_f32(&A, srcRows, srcColumns, (float32_t *)A_f32);
/* Initialise Matrix Instance AT with numRows, numCols and data array(AT_f32) */
srcRows = 4;
srcColumns = 4;
arm_mat_init_f32(&AT, srcRows, srcColumns, AT_f32);
/* calculation of A transpose */
arm_mat_trans_f32(&A, &AT);
/* Initialise ATMA Matrix Instance with numRows, numCols and data array(ATMA_f32) */
srcRows = 4;
srcColumns = 4;
arm_mat_init_f32(&ATMA, srcRows, srcColumns, ATMA_f32);
/* calculation of AT Multiply with A */
arm_mat_mult_f32(&AT, &A, &ATMA);
mcu_cycles = GET_CYCLES();
PRINTF("-- matrix example\r\n");
PRINTF("FSP %d cycles, MCU %d cycles\r\n", fsp_cycles, mcu_cycles);
}
/* Sum of the squares of the elements of a floating-point vector */
float32_t power_acc_input[1024];
float32_t power_acc_fsp_output;
float32_t power_acc_mcu_output;
void power_example(void)
{
uint32_t fsp_cycles, mcu_cycles;
for (uint32_t i = 0; i < 256; i++)
power_acc_input[i] = 0.1 * i;
// FSP
START_COUNTING();
FSP_PowerF32(DEMO_FSP_BASE, power_acc_input, 1024, &power_acc_fsp_output);
fsp_cycles = GET_CYCLES();
// MCU
START_COUNTING();
arm_power_f32(power_acc_input, 1024, &power_acc_mcu_output);
mcu_cycles = GET_CYCLES();
PRINTF("-- Sum of the squares of the 1024 elements\r\n");
PRINTF("FSP %d cycles, MCU %d cycles\r\n", fsp_cycles, mcu_cycles);
}
/* Sin */
void sin_example(void)
{
uint32_t fsp_cycles, mcu_cycles;
float32_t sin_input = 3.14159f / 6;
// FSP
START_COUNTING();
FSP_SinF32(DEMO_FSP_BASE, sin_input / 3.14159f);
fsp_cycles = GET_CYCLES();
// MCU
START_COUNTING();
arm_sin_f32(sin_input);
mcu_cycles = GET_CYCLES();
PRINTF("-- sin(3.14159 / 6)\r\n");
PRINTF("FSP %d cycles, MCU %d cycles\r\n", fsp_cycles, mcu_cycles);
}
int main(void)
{
/* Board pin, clock, debug console init */
BOARD_InitHardware();
POWER_DisablePD(kPDRUNCFG_PD_FSP);
POWER_DisablePD(kPDRUNCFG_PD_FIR);
/*Fsp module init*/
FSP_Init(DEMO_FSP_BASE);
fft_example();
matrix_example();
power_example();
sin_example();
STOP_COUNTING();
while (1)
;
}

Modules

 Correlation
 
 Power
 
 Sum
 

Data Structures

struct  fsp_matrix_instance_t
 Instance structure for the matrix. More...
 
struct  fsp_mat_op_instance_t
 Instance structure for the matrix operation. More...
 
struct  fsp_fir_instance_t
 Instance structure for the FIR filter. More...
 

Macros

#define MAT_OP_CONFIG(inv_stop, lu_stop, mat_k, mat_n, mat_m, o_format, i_format, op_mode)
 Macros to config the FSP Matrix operation unit.
 
#define TE_CONFIG(te_point, te_scale, o_format, i_format, io_mode, type)
 Macros to config the FSP transfer engine.
 
#define SE_CONFIG(se_point, o_format, i_format, pwr_en, sum_en, max_idx_en, min_idx_en, max_sel, min_sel)
 Macros to config the FSP statistic engine module.
 
#define CORR_CONFIG(corr_y_len, corr_x_len, o_format, i_format)
 Macros to config the FSP Correlation module.
 
#define FIR_CONFIG(buf_clr_en, num_taps, p_coeffs)
 Macros to config the FSP FIR filter module.
 

Typedefs

typedef int32_t q31_t
 32-bit fractional data type in 1.31 format.
 
typedef float float32_t
 32-bit floating-point type definition.
 

Enumerations

enum  fsp_mou_dout_fp_sel_t {
  kFSP_MouDoutFpSelFloat = 0x0U,
  kFSP_MouDoutFpSelFix = 0x1U
}
 
enum  fsp_mou_din_fp_sel_t {
  kFSP_MouDinFpSelFloat = 0x0U,
  kFSP_MouDinFpSelFix = 0x1U
}
 
enum  fsp_te_dout_fp_sel_t {
  kFSP_TeDoutFpSelFix = 0x0U,
  kFSP_TeDoutFpSelFloat = 0x1U
}
 
enum  fsp_te_din_fp_sel_t {
  kFSP_TeDinFpSelFix = 0x0U,
  kFSP_TeDinFpSelFloat = 0x1U
}
 
enum  fsp_te_pts_t {
  kFSP_TePts64Points = 0x0U,
  kFSP_TePts128Points = 0x1U,
  kFSP_TePts256Points = 0x2U,
  kFSP_TePtsReserved = 0x3U
}
 
enum  fsp_te_io_mode_t {
  kFSP_TeIoModeRealInputComplexOutput = 0x0U,
  kFSP_TeIoModeComplexInputComplexOutput = 0x1U,
  kFSP_TeIoModeRealInputRealOutput = 0x2U,
  kFSP_TeIoModeComplexInputRealOutput = 0x3U
}
 
enum  fsp_te_mode_t {
  kFSP_TeModeFft = 0x0U,
  kFSP_TeModeIfft = 0x1U,
  kFSP_TeModeDct = 0x2U,
  kFSP_TeModeIdct = 0x3U
}
 
enum  fsp_se_dout_fp_sel_t {
  kFSP_SeDoutFpSelFloat = 0x00U,
  kFSP_SeDoutFpSelFix = 0x01U
}
 
enum  fsp_se_din_fp_sel_t {
  kFSP_SeDinFpSelFloat = 0x00U,
  kFSP_SeDinFpSelFix = 0x01U
}
 
enum  fsp_cor_dout_fp_sel_t {
  kFSP_CorDoutFpSelFloat = 0x00U,
  kFSP_CorDoutFpSelFix = 0x01U
}
 
enum  fsp_cor_din_fp_sel_t {
  kFSP_CorDinFpSelFloat = 0x00U,
  kFSP_CorDinFpSelFix = 0x01U
}
 
enum  fir_dout_fp_sel_t {
  kFSP_FirDoutFpSelFloat = 0x0U,
  kFSP_FirDoutFpSelFix = 0x1U
}
 Enum type for the FSP module FIR output data type (float or q31). More...
 
enum  fir_din_fp_sel_t {
  kFSP_FirDinFpSelFloat = 0x0U,
  kFSP_FirDinFpSelFix = 0x1U
}
 Enum type for the FSP module FIR input data type (float or q31). More...
 

Functions

void FSP_Init (FSP_Type *base)
 FSP configuration. More...
 
void FSP_Deinit (FSP_Type *base)
 Disables the FSP and gates the FSP clock. More...
 
static void FSP_EnableInterrupts (FSP_Type *base, uint32_t mask)
 Enables the FSP interrupt. More...
 
static void FSP_DisableInterrupts (FSP_Type *base, uint32_t mask)
 Disables the FSP interrupt. More...
 
static void FSP_ClearStatusFlags (FSP_Type *base, uint32_t mask)
 Clears status flags with the provided mask. More...
 
static uint32_t FSP_GetStatusFlags (FSP_Type *base)
 Get FSP status flags. More...
 
static uint32_t FSP_GetBusyStatusFlags (FSP_Type *base)
 Get FSP busy status flags. More...
 
static float32_t FSP_SinF32 (FSP_Type *base, float32_t x)
 Cordic. More...
 
static float32_t FSP_SinQ31 (FSP_Type *base, q31_t x)
 Fast approximation to the trigonometric sine function for Q31 data. More...
 
static float32_t FSP_CosF32 (FSP_Type *base, float32_t x)
 Fast approximation to the trigonometric sine and cosine function for floating-point data. More...
 
static q31_t FSP_CosQ31 (FSP_Type *base, q31_t x)
 Fast approximation to the trigonometric sine function for Q31 data. More...
 
static float32_t FSP_LnF32 (FSP_Type *base, float32_t x)
 Floating-point log function. More...
 
static q31_t FSP_LnQ31 (FSP_Type *base, q31_t x)
 Q31 log function. More...
 
static float32_t FSP_SqrtF32 (FSP_Type *base, float32_t x)
 Floating-point root function. More...
 
static q31_t FSP_SqrtQ31 (FSP_Type *base, q31_t x)
 Q31 square root function. More...
 
static void FSP_MatOperateStart (FSP_Type *base, const fsp_mat_op_instance_t *ins, const void *p_dat_mat_a, const void *p_dat_mat_b, const void *p_dat_dst)
 Matrix Operation Unit & Transform Engine. More...
 
void FSP_MatInit (fsp_matrix_instance_t *S, uint16_t n_rows, uint16_t n_columns, void *p_data)
 Matrix initialization. More...
 
void FSP_MatInverseF32 (FSP_Type *base, const fsp_matrix_instance_t *p_src, const fsp_matrix_instance_t *p_dst)
 Floating-point matrix inverse. More...
 
void FSP_MatInverseQ31 (FSP_Type *base, const fsp_matrix_instance_t *p_src, const fsp_matrix_instance_t *p_dst)
 q31 matrix inverse. More...
 
void FSP_MatMultF32 (FSP_Type *base, const fsp_matrix_instance_t *p_src_a, const fsp_matrix_instance_t *p_src_b, const fsp_matrix_instance_t *p_dst)
 Floating-point matrix multiplication. More...
 
void FSP_MatMultQ31 (FSP_Type *base, const fsp_matrix_instance_t *p_src_a, const fsp_matrix_instance_t *p_src_b, const fsp_matrix_instance_t *p_dst)
 q31 matrix multiplication More...
 
void FSP_MatDotMultF32 (FSP_Type *base, const fsp_matrix_instance_t *p_src_a, const fsp_matrix_instance_t *p_src_b, const fsp_matrix_instance_t *p_dst)
 Floating-point matrix dot multiplication. More...
 
void FSP_MatDotMultQ31 (FSP_Type *base, const fsp_matrix_instance_t *p_src_a, const fsp_matrix_instance_t *p_src_b, const fsp_matrix_instance_t *p_dst)
 q31 matrix dot multiplication More...
 
void FSP_MatTransF32 (FSP_Type *base, const fsp_matrix_instance_t *p_src, const fsp_matrix_instance_t *p_dst)
 Floating-point matrix transpose. More...
 
void FSP_MatScaleF32 (FSP_Type *base, const fsp_matrix_instance_t *p_src_a, float32_t scale_a, const fsp_matrix_instance_t *p_src_b, float32_t scale_b, const fsp_matrix_instance_t *p_dst)
 Floating-point matrix scaling(a*A + b*B). More...
 
void FSP_MatScaleQ31 (FSP_Type *base, const fsp_matrix_instance_t *p_src_a, float32_t scale_a, const fsp_matrix_instance_t *p_src_b, float32_t scale_b, const fsp_matrix_instance_t *p_dst)
 q31 matrix scaling. More...
 
void FSP_MatAddF32 (FSP_Type *base, const fsp_matrix_instance_t *p_src_a, const fsp_matrix_instance_t *p_src_b, const fsp_matrix_instance_t *p_dst)
 Floating-point matrix addition. More...
 
void FSP_MatAddQ31 (FSP_Type *base, const fsp_matrix_instance_t *p_src_a, const fsp_matrix_instance_t *p_src_b, const fsp_matrix_instance_t *p_dst)
 q31 matrix addition. More...
 
void FSP_MatSubF32 (FSP_Type *base, const fsp_matrix_instance_t *p_src_a, const fsp_matrix_instance_t *p_src_b, const fsp_matrix_instance_t *p_dst)
 Floating-point matrix subtraction. More...
 
void FSP_MatSubQ31 (FSP_Type *base, const fsp_matrix_instance_t *p_src_a, const fsp_matrix_instance_t *p_src_b, const fsp_matrix_instance_t *p_dst)
 q31 matrix subtraction. More...
 
static void FSP_TeStart (FSP_Type *base, uint32_t te_cfg, const void *p_src, const void *p_dst)
 Transfer engine start. More...
 
void FSP_TeIDCTPreProcess (FSP_Type *base, float32_t *p_data)
 Only for IDCT: Convert the input data. More...
 
void FSP_TePostProcess (FSP_Type *base, const fsp_te_instance_t *S, fsp_te_io_mode_t io_mode, fsp_te_mode_t te_mode, float32_t *p_data)
 For FFT/IFFT/CFFT: Make the output of FSP match the ARM's For DCT/IDCT: Convert the output from DCT-II to DCT-IV. More...
 
void FSP_RfftF32 (FSP_Type *base, const fsp_te_instance_t *S, float32_t *p_src, float32_t *p_dst)
 Processing function for the floating-point real FFT. More...
 
void FSP_RifftF32 (FSP_Type *base, const fsp_te_instance_t *S, float32_t *p_src, float32_t *p_dst)
 Processing function for the floating-point real IFFT. More...
 
void FSP_RfftQ31 (FSP_Type *base, const fsp_te_instance_t *S, q31_t *p_src, q31_t *p_dst)
 Processing function for the q31 real FFT. More...
 
void FSP_RifftQ31 (FSP_Type *base, const fsp_te_instance_t *S, q31_t *p_src, q31_t *p_dst)
 Processing function for the q31 real IFFT. More...
 
void FSP_CfftF32 (FSP_Type *base, const fsp_te_instance_t *S, float32_t *p_src, float32_t *p_dst, uint8_t ifft_flag)
 Processing function for the floating-point complex FFT/IFFT. More...
 
void FSP_CfftQ31 (FSP_Type *base, const fsp_te_instance_t *S, q31_t *p_src, q31_t *p_dst, uint8_t ifft_flag)
 Processing function for the q31 complex FFT/IFFT. More...
 
void FSP_DctF32 (FSP_Type *base, const fsp_te_instance_t *S, float32_t *p_src, float32_t *p_dst, uint8_t idct_flag)
 Processing function for the floating-point DCT/IDCT. More...
 
void FSP_DctQ31 (FSP_Type *base, const fsp_te_instance_t *S, q31_t *p_src, q31_t *p_dst, uint8_t idct_flag)
 Processing function for the q31 DCT/IDCT. More...
 
static void FSP_SeStart (FSP_Type *base, uint32_t se_cfg, const void *p_src)
 Statistic engine start. More...
 
void FSP_MaxMinF32 (FSP_Type *base, float32_t *p_src, uint32_t block_size, float32_t *p_max, float32_t *p_min)
 Get Maximum and Minimum values of a floating-point vector. More...
 
static void FSP_MaxMinIntF32 (FSP_Type *base, float32_t *p_src, uint32_t block_size)
 Calculate Maximum and Minimum values of a floating-point vector. More...
 
void FSP_GetMaxMinIntResultF32 (FSP_Type *base, float32_t *p_src, float32_t *p_max, float32_t *p_min)
 Get the Maximum and Minimum values of a floating-point vector. More...
 
void FSP_MaxMinQ31 (FSP_Type *base, q31_t *p_src, uint32_t block_size, q31_t *p_max, q31_t *p_min)
 Get Maximum and Minimum values of a q31 vector. More...
 
static void FSP_MaxMinIntQ31 (FSP_Type *base, q31_t *p_src, uint32_t block_size)
 Calculate Maximum and Minimum values of a q31 vector. More...
 
void FSP_GetMaxMinIntResultQ31 (FSP_Type *base, q31_t *p_src, q31_t *p_max, q31_t *p_min)
 Get the Maximum and Minimum values of a q31 vector vector. More...
 
void FSP_MaxF32 (FSP_Type *base, float32_t *p_src, uint32_t block_size, float32_t *p_result, uint32_t *p_index)
 Maximum value of a floating-point vector. More...
 
static void FSP_MaxIntF32 (FSP_Type *base, float32_t *p_src, uint32_t block_size)
 Calculate Maximum value of a floating-point vector. More...
 
void FSP_GetMaxIntResultF32 (FSP_Type *base, float32_t *p_src, float32_t *p_result, uint32_t *p_index)
 Get the Maximum value of a floating-point vector. More...
 
void FSP_MaxQ31 (FSP_Type *base, q31_t *p_src, uint32_t block_size, q31_t *p_result, uint32_t *p_index)
 Maximum value of a q31 vector. More...
 
static void FSP_MaxIntQ31 (FSP_Type *base, q31_t *p_src, uint32_t block_size)
 Calculate Maximum value of a q31 vector. More...
 
void FSP_GetMaxIntResultQ31 (FSP_Type *base, q31_t *p_src, q31_t *p_result, uint32_t *p_index)
 Get the Maximum value of a q31 vector. More...
 
void FSP_MinF32 (FSP_Type *base, float32_t *p_src, uint32_t block_size, float32_t *p_result, uint32_t *p_index)
 Minimum value of a floating-point vector. More...
 
static void FSP_MinIntF32 (FSP_Type *base, float32_t *p_src, uint32_t block_size)
 Calculate Minimum value of a floating-point vector. More...
 
void FSP_GetMinIntResultF32 (FSP_Type *base, float32_t *p_src, float32_t *p_result, uint32_t *p_index)
 Get the Minimum value of a floating-point vector. More...
 
void FSP_MinQ31 (FSP_Type *base, q31_t *p_src, uint32_t block_size, q31_t *p_result, uint32_t *p_index)
 Minimum value of a q31 vector. More...
 
static void FSP_MinIntQ31 (FSP_Type *base, q31_t *p_src, uint32_t block_size)
 Calculate Minimum value of a q31 vector. More...
 
void FSP_GetMinIntResultQ31 (FSP_Type *base, q31_t *p_src, q31_t *p_result, uint32_t *p_index)
 Get the Minimum value of a q31 vector. More...
 
static void FSP_FirBufferClear (FSP_Type *base, uint32_t ch_idx)
 Clear FIR buffer. More...
 
static void FSP_FirBufferClearAll (FSP_Type *base)
 Clear All FIR buffer. More...
 
void FSP_FirF32 (FSP_Type *base, const fsp_fir_instance_t *S, float32_t *p_src, float32_t *p_dst, uint32_t block_size)
 FIR (Finite Impulse Response) filter function of floating-point sequences. More...
 
void FSP_FirQ31 (FSP_Type *base, const fsp_fir_instance_t *S, q31_t *p_src, q31_t *p_dst, uint32_t block_size)
 FIR (Finite Impulse Response) filter function of q31 sequences. More...
 

Driver version

#define FSL_FSP_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 Fsp driver version 2.0.0. More...
 

Data Structure Documentation

struct fsp_matrix_instance_t

Data Fields

uint8_t num_rows
 
uint8_t num_cols
 
void * p_data
 
struct fsp_mat_op_instance_t

Data Fields

uint32_t mat_op_cfg
 
struct fsp_fir_instance_t

Data Fields

uint8_t ch_idx
 
uint32_t fir_cfg
 

Macro Definition Documentation

#define FSL_FSP_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))

Enumeration Type Documentation

Enumerator
kFSP_MouDoutFpSelFloat 

float

kFSP_MouDoutFpSelFix 

fix

Enumerator
kFSP_MouDinFpSelFloat 

float

kFSP_MouDinFpSelFix 

fix

Enumerator
kFSP_TeDoutFpSelFix 

fix

kFSP_TeDoutFpSelFloat 

float

Enumerator
kFSP_TeDinFpSelFix 

fix

kFSP_TeDinFpSelFloat 

float

Enumerator
kFSP_TePts64Points 

64 points

kFSP_TePts128Points 

128 points

kFSP_TePts256Points 

256 points

kFSP_TePtsReserved 

reserved

Enumerator
kFSP_TeIoModeRealInputComplexOutput 

real input, complex output

kFSP_TeIoModeComplexInputComplexOutput 

complex input, complex output

kFSP_TeIoModeRealInputRealOutput 

real input, real output

kFSP_TeIoModeComplexInputRealOutput 

complex input, real output

Enumerator
kFSP_TeModeFft 

FFT.

kFSP_TeModeIfft 

IFFT.

kFSP_TeModeDct 

DCT.

kFSP_TeModeIdct 

IDCT.

Enumerator
kFSP_SeDoutFpSelFloat 

float

kFSP_SeDoutFpSelFix 

fix

Enumerator
kFSP_SeDinFpSelFloat 

float

kFSP_SeDinFpSelFix 

fix

Enumerator
kFSP_CorDoutFpSelFloat 

float

kFSP_CorDoutFpSelFix 

fix

Enumerator
kFSP_CorDinFpSelFloat 

float

kFSP_CorDinFpSelFix 

fix

Enumerator
kFSP_FirDoutFpSelFloat 

float

kFSP_FirDoutFpSelFix 

fix

Enumerator
kFSP_FirDinFpSelFloat 

float

kFSP_FirDinFpSelFix 

fix

Function Documentation

void FSP_Init ( FSP_Type *  base)
Parameters
baseFSP peripheral base address.s
void FSP_Deinit ( FSP_Type *  base)
Parameters
basepointer to FLEXIO_UART_Type structure
static void FSP_EnableInterrupts ( FSP_Type *  base,
uint32_t  mask 
)
inlinestatic

This function enables the FSP interrupt.

Parameters
baseFSP peripheral base address.
maskinterrupt source.
static void FSP_DisableInterrupts ( FSP_Type *  base,
uint32_t  mask 
)
inlinestatic

This function disables the FSP interrupt.

Parameters
baseFSP peripheral base address.
maskinterrupt source.
static void FSP_ClearStatusFlags ( FSP_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseFSP peripheral base address.
maskThe status flags to be cleared
Return values
None
static uint32_t FSP_GetStatusFlags ( FSP_Type *  base)
inlinestatic
Parameters
baseFSP peripheral base address.
Returns
FSP status flags.
static uint32_t FSP_GetBusyStatusFlags ( FSP_Type *  base)
inlinestatic
Parameters
baseFSP peripheral base address.
Returns
FSP busy status flags.
static float32_t FSP_SinF32 ( FSP_Type *  base,
float32_t  x 
)
inlinestatic

Fast approximation to the trigonometric sine and cosine function for floating-point data.

Parameters
baseFSP peripheral base address
xInput value in radians/pi.
Returns
sin(x) in floating-point format.
static float32_t FSP_SinQ31 ( FSP_Type *  base,
q31_t  x 
)
inlinestatic
Parameters
baseFSP peripheral base address
xInput value in radians/pi.
Returns
sin(x)in Q31 format.
static float32_t FSP_CosF32 ( FSP_Type *  base,
float32_t  x 
)
inlinestatic
Parameters
baseFSP peripheral base address
xInput value in radians/pi.
Returns
cos(x) in floating-point format.
static q31_t FSP_CosQ31 ( FSP_Type *  base,
q31_t  x 
)
inlinestatic
Parameters
baseFSP peripheral base address
xInput value in radians/pi.
Returns
cos(x) in Q31 format.

The Q31 input value is in the range [0 +0.9999] and is mapped to a radian value in the range [0 2*pi).

static float32_t FSP_LnF32 ( FSP_Type *  base,
float32_t  x 
)
inlinestatic
Parameters
baseFSP peripheral base address
xinput value, the range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF.
Returns
return in floating-point format, for negative inputs, the function returns 0.
static q31_t FSP_LnQ31 ( FSP_Type *  base,
q31_t  x 
)
inlinestatic
Parameters
baseFSP peripheral base address
xinput value, the range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF.
Returns
return in Q31 format, for negative inputs, the function returns 0.
static float32_t FSP_SqrtF32 ( FSP_Type *  base,
float32_t  x 
)
inlinestatic
Parameters
baseFSP peripheral base address
xinput value, the range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF.
Returns
return square root of input value in floating-point format, for negative input, the function returns 0.
static q31_t FSP_SqrtQ31 ( FSP_Type *  base,
q31_t  x 
)
inlinestatic
Parameters
baseFSP peripheral base address
xinput value, the range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF.
Returns
return square root of input value in Q31 format, for negative input, the function returns 0.
static void FSP_MatOperateStart ( FSP_Type *  base,
const fsp_mat_op_instance_t ins,
const void *  p_dat_mat_a,
const void *  p_dat_mat_b,
const void *  p_dat_dst 
)
inlinestatic

Processing function for the Matrix operation unit. Matrix operation start.

Parameters
baseFSP peripheral base address
inspoints to the matrix operation structure.
*p_src_mat_apoints to the input matrix A.
*p_src_mat_bpoints to the input matrix B.
*p_dstpoints to output matrix structure.
Returns
none.
void FSP_MatInit ( fsp_matrix_instance_t S,
uint16_t  n_rows,
uint16_t  n_columns,
void *  p_data 
)
Parameters
*Spoints to an instance of the matrix structure.
n_rowsnumber of rows in the matrix.
n_columnsnumber of columns in the matrix.
*p_datapoints to the matrix data array.
Returns
none
void FSP_MatInverseF32 ( FSP_Type *  base,
const fsp_matrix_instance_t p_src,
const fsp_matrix_instance_t p_dst 
)
Parameters
baseFSP peripheral base address
*p_srcpoints to input matrix structure
*p_dstpoints to output matrix structure
Returns
none
void FSP_MatInverseQ31 ( FSP_Type *  base,
const fsp_matrix_instance_t p_src,
const fsp_matrix_instance_t p_dst 
)
Parameters
baseFSP peripheral base address
*p_srcpoints to input matrix structure
*p_dstpoints to output matrix structure
Returns
none
void FSP_MatMultF32 ( FSP_Type *  base,
const fsp_matrix_instance_t p_src_a,
const fsp_matrix_instance_t p_src_b,
const fsp_matrix_instance_t p_dst 
)
Parameters
baseFSP peripheral base address
*p_src_apoints to the first input matrix structure
*p_src_bpoints to the second input matrix structure
*p_dstpoints to output matrix structure
Returns
none
void FSP_MatMultQ31 ( FSP_Type *  base,
const fsp_matrix_instance_t p_src_a,
const fsp_matrix_instance_t p_src_b,
const fsp_matrix_instance_t p_dst 
)
Parameters
baseFSP peripheral base address
*p_src_apoints to the first input matrix structure
*p_src_bpoints to the second input matrix structure
*p_dstpoints to output matrix structure
Returns
none
void FSP_MatDotMultF32 ( FSP_Type *  base,
const fsp_matrix_instance_t p_src_a,
const fsp_matrix_instance_t p_src_b,
const fsp_matrix_instance_t p_dst 
)
Parameters
baseFSP peripheral base address
*p_src_apoints to the first input matrix structure
*p_src_bpoints to the second input matrix structure
*p_dstpoints to output matrix structure
Returns
none
void FSP_MatDotMultQ31 ( FSP_Type *  base,
const fsp_matrix_instance_t p_src_a,
const fsp_matrix_instance_t p_src_b,
const fsp_matrix_instance_t p_dst 
)
Parameters
baseFSP peripheral base address
*p_src_apoints to the first input matrix structure
*p_src_bpoints to the second input matrix structure
*p_dstpoints to output matrix structure
Returns
none
void FSP_MatTransF32 ( FSP_Type *  base,
const fsp_matrix_instance_t p_src,
const fsp_matrix_instance_t p_dst 
)
Parameters
baseFSP peripheral base address
*p_srcpoints to the input matrix
*p_dstpoints to the output matrix
Returns
none
void FSP_MatScaleF32 ( FSP_Type *  base,
const fsp_matrix_instance_t p_src_a,
float32_t  scale_a,
const fsp_matrix_instance_t p_src_b,
float32_t  scale_b,
const fsp_matrix_instance_t p_dst 
)
Parameters
baseFSP peripheral base address
*p_src_apoints to the first input matrix structure
scale_ascale factor of matrix_a to be applied
*p_src_bpoints to the second input matrix structure
scale_bscale factor of matrix_b to be applied
*p_dstpoints to output matrix structure
Returns
None
void FSP_MatScaleQ31 ( FSP_Type *  base,
const fsp_matrix_instance_t p_src_a,
float32_t  scale_a,
const fsp_matrix_instance_t p_src_b,
float32_t  scale_b,
const fsp_matrix_instance_t p_dst 
)
Parameters
baseFSP peripheral base address
*p_src_apoints to the first input matrix structure
scale_ascale factor of matrix_a to be applied
*p_src_bpoints to the second input matrix structure
scale_bscale factor of matrix_b to be applied
*p_dstpoints to output matrix structure
Returns
none
void FSP_MatAddF32 ( FSP_Type *  base,
const fsp_matrix_instance_t p_src_a,
const fsp_matrix_instance_t p_src_b,
const fsp_matrix_instance_t p_dst 
)
Parameters
baseFSP peripheral base address
*p_src_apoints to the first input matrix structure
*p_src_bpoints to the second input matrix structure
*p_dstpoints to output matrix structure
Returns
none
void FSP_MatAddQ31 ( FSP_Type *  base,
const fsp_matrix_instance_t p_src_a,
const fsp_matrix_instance_t p_src_b,
const fsp_matrix_instance_t p_dst 
)
Parameters
baseFSP peripheral base address
*p_src_apoints to the first input matrix structure
*p_src_bpoints to the second input matrix structure
*p_dstpoints to output matrix structure
Returns
none The function uses saturating arithmetic. Results outside of the allowable q31 range [0x80000000 0x7FFFFFFF] will be saturated.
void FSP_MatSubF32 ( FSP_Type *  base,
const fsp_matrix_instance_t p_src_a,
const fsp_matrix_instance_t p_src_b,
const fsp_matrix_instance_t p_dst 
)
Parameters
baseFSP peripheral base address
*p_src_apoints to the first input matrix structure
*p_src_bpoints to the second input matrix structure
*p_dstpoints to output matrix structure
Returns
none
void FSP_MatSubQ31 ( FSP_Type *  base,
const fsp_matrix_instance_t p_src_a,
const fsp_matrix_instance_t p_src_b,
const fsp_matrix_instance_t p_dst 
)
Parameters
baseFSP peripheral base address
*p_src_apoints to the first input matrix structure
*p_src_bpoints to the second input matrix structure
*p_dstpoints to output matrix structure
Returns
none The function uses saturating arithmetic. Results outside of the allowable q31 range [0x80000000 0x7FFFFFFF] will be saturated.
static void FSP_TeStart ( FSP_Type *  base,
uint32_t  te_cfg,
const void *  p_src,
const void *  p_dst 
)
inlinestatic

Processing function for the transfer engine.

Parameters
baseFSP peripheral base address
te_cfgconfig value of the transfer engine.
*p_srcpoints to the input data buffer.
*p_dstpoints to the output data buffer.
Returns
none.
void FSP_TeIDCTPreProcess ( FSP_Type *  base,
float32_t p_data 
)

Pre-processing function for IDCT.

Parameters
baseFSP peripheral base address
*p_datapoints to input and output data.
Returns
none.
void FSP_TePostProcess ( FSP_Type *  base,
const fsp_te_instance_t *  S,
fsp_te_io_mode_t  io_mode,
fsp_te_mode_t  te_mode,
float32_t p_data 
)

Post-processing function for the transfer engine.

Parameters
baseFSP peripheral base address
*Spoints to an instance of the fsp_te_instance_t structure.
io_modeinput and output mode defined by enum
te_modetransfer engine mode defined by enum
*p_datapoints to input and output data.
Returns
none.
void FSP_RfftF32 ( FSP_Type *  base,
const fsp_te_instance_t *  S,
float32_t p_src,
float32_t p_dst 
)
Parameters
baseFSP peripheral base address
*Spoints to an instance of the fsp_te_instance_t structure.
*p_srcpoints to the input buffer.
*p_dstpoints to the output buffer.
Returns
none.
void FSP_RifftF32 ( FSP_Type *  base,
const fsp_te_instance_t *  S,
float32_t p_src,
float32_t p_dst 
)
Parameters
baseFSP peripheral base address
*Spoints to an instance of the fsp_te_instance_t structure.
*p_srcpoints to the input buffer.
*p_dstpoints to the output buffer.
Returns
none.
void FSP_RfftQ31 ( FSP_Type *  base,
const fsp_te_instance_t *  S,
q31_t p_src,
q31_t p_dst 
)
Parameters
baseFSP peripheral base address
*Spoints to an instance of the fsp_te_instance_t structure.
*p_srcpoints to the input buffer.
*p_dstpoints to the output buffer.
Returns
none.
void FSP_RifftQ31 ( FSP_Type *  base,
const fsp_te_instance_t *  S,
q31_t p_src,
q31_t p_dst 
)
Parameters
baseFSP peripheral base address
*Spoints to an instance of the fsp_te_instance_t structure.
*p_srcpoints to the input buffer.
*p_dstpoints to the output buffer.
Returns
none.
void FSP_CfftF32 ( FSP_Type *  base,
const fsp_te_instance_t *  S,
float32_t p_src,
float32_t p_dst,
uint8_t  ifft_flag 
)
Parameters
baseFSP peripheral base address
*Spoints to an instance of the fsp_te_instance_t structure.
*p_srcpoints to the input buffer.
*p_dstpoints to the output buffer.
ifft_flagflag that selects forward (ifft_flag=0) or inverse (ifft_flag=1) transform.
Returns
none.
void FSP_CfftQ31 ( FSP_Type *  base,
const fsp_te_instance_t *  S,
q31_t p_src,
q31_t p_dst,
uint8_t  ifft_flag 
)
Parameters
baseFSP peripheral base address
*Spoints to an instance of the fsp_te_instance_t structure.
*p_srcpoints to the input buffer.
*p_dstpoints to the output buffer.
ifft_flagflag that selects forward (ifft_flag=0) or inverse (ifft_flag=1) transform.
Returns
none.
void FSP_DctF32 ( FSP_Type *  base,
const fsp_te_instance_t *  S,
float32_t p_src,
float32_t p_dst,
uint8_t  idct_flag 
)
Parameters
baseFSP peripheral base address
*Spoints to an instance of the fsp_te_instance_t structure.
*p_srcpoints to the input buffer.
*p_dstpoints to the output buffer.
idct_flagflag that selects forward (idct_flag=0) or inverse (idct_flag=1) transform.
Returns
none.
void FSP_DctQ31 ( FSP_Type *  base,
const fsp_te_instance_t *  S,
q31_t p_src,
q31_t p_dst,
uint8_t  idct_flag 
)
Parameters
baseFSP peripheral base address
*Spoints to an instance of the fsp_te_instance_t structure.
*p_srcpoints to the input buffer.
*p_dstpoints to the output buffer.
idct_flagflag that selects forward (idct_flag=0) or inverse (idct_flag=1) transform.
Returns
none.
static void FSP_SeStart ( FSP_Type *  base,
uint32_t  se_cfg,
const void *  p_src 
)
inlinestatic

Processing function for the statistic engine.

Parameters
baseFSP peripheral base address
*Spoints to an instance of the statistic engine structure.
*p_srcpoints to the input data buffer.
Returns
none.
void FSP_MaxMinF32 ( FSP_Type *  base,
float32_t p_src,
uint32_t  block_size,
float32_t p_max,
float32_t p_min 
)
Parameters
*p_srcpoints to the input vector
block_sizelength of the input vector
*p_maxmaximum value returned here
*p_minMinimum value returned here
Returns
none.
static void FSP_MaxMinIntF32 ( FSP_Type *  base,
float32_t p_src,
uint32_t  block_size 
)
inlinestatic

Interrupt-mode interface

Parameters
*p_srcpoints to the input vector
block_sizelength of the input vector
Returns
none.
void FSP_GetMaxMinIntResultF32 ( FSP_Type *  base,
float32_t p_src,
float32_t p_max,
float32_t p_min 
)

Interrupt-mode interface

Parameters
*p_srcpoints to the input vector
*p_maxmaximum value returned here
*p_minMinimum value returned here
Returns
none.
void FSP_MaxMinQ31 ( FSP_Type *  base,
q31_t p_src,
uint32_t  block_size,
q31_t p_max,
q31_t p_min 
)
Parameters
*p_srcpoints to the input vector
block_sizelength of the input vector
*p_maxmaximum value returned here
*p_minMinimum value returned here
Returns
none.
static void FSP_MaxMinIntQ31 ( FSP_Type *  base,
q31_t p_src,
uint32_t  block_size 
)
inlinestatic

Interrupt-mode interface

Parameters
*p_srcpoints to the input vector
block_sizelength of the input vector
Returns
none.
void FSP_GetMaxMinIntResultQ31 ( FSP_Type *  base,
q31_t p_src,
q31_t p_max,
q31_t p_min 
)

Interrupt-mode interface

Parameters
*p_srcpoints to the input vector
*p_maxmaximum value returned here
*p_minMinimum value returned here
Returns
none.
void FSP_MaxF32 ( FSP_Type *  base,
float32_t p_src,
uint32_t  block_size,
float32_t p_result,
uint32_t *  p_index 
)
Parameters
baseFSP peripheral base address
*p_srcpoints to the input vector
block_sizelength of the input vector
*p_resultmaximum value returned here
*p_indexindex of maximum value returned here
Returns
none.
static void FSP_MaxIntF32 ( FSP_Type *  base,
float32_t p_src,
uint32_t  block_size 
)
inlinestatic

Interrupt-mode interface

Parameters
*p_srcpoints to the input vector
block_sizelength of the input vector
Returns
none.
void FSP_GetMaxIntResultF32 ( FSP_Type *  base,
float32_t p_src,
float32_t p_result,
uint32_t *  p_index 
)

Interrupt-mode interface

Parameters
*p_srcpoints to the input vector
*p_resultmaximum value returned here
*p_indexindex of maximum value returned here
Returns
none.
void FSP_MaxQ31 ( FSP_Type *  base,
q31_t p_src,
uint32_t  block_size,
q31_t p_result,
uint32_t *  p_index 
)
Parameters
baseFSP peripheral base address
*p_srcpoints to the input vector
block_sizelength of the input vector
*p_resultmaximum value returned here
*p_indexindex of maximum value returned here
Returns
none.
static void FSP_MaxIntQ31 ( FSP_Type *  base,
q31_t p_src,
uint32_t  block_size 
)
inlinestatic

Interrupt-mode interface

Parameters
*p_srcpoints to the input vector
block_sizelength of the input vector
Returns
none.
void FSP_GetMaxIntResultQ31 ( FSP_Type *  base,
q31_t p_src,
q31_t p_result,
uint32_t *  p_index 
)

Interrupt-mode interface

Parameters
*p_srcpoints to the input vector
*p_resultmaximum value returned here
*p_indexindex of maximum value returned here
Returns
none.
void FSP_MinF32 ( FSP_Type *  base,
float32_t p_src,
uint32_t  block_size,
float32_t p_result,
uint32_t *  p_index 
)
Parameters
baseFSP peripheral base address
*p_srcpoints to the input vector
block_sizelength of the input vector
*p_resultminimum value returned here
*p_indexindex of minimum value returned here
Returns
none.
static void FSP_MinIntF32 ( FSP_Type *  base,
float32_t p_src,
uint32_t  block_size 
)
inlinestatic

Interrupt-mode interface

Parameters
*p_srcpoints to the input vector
block_sizelength of the input vector
Returns
none.
void FSP_GetMinIntResultF32 ( FSP_Type *  base,
float32_t p_src,
float32_t p_result,
uint32_t *  p_index 
)

Interrupt-mode interface

Parameters
*p_srcpoints to the input vector
*p_resultminimum value returned here
*p_indexindex of minimum value returned here
Returns
none.
void FSP_MinQ31 ( FSP_Type *  base,
q31_t p_src,
uint32_t  block_size,
q31_t p_result,
uint32_t *  p_index 
)
Parameters
baseFSP peripheral base address
*p_srcpoints to the input vector
block_sizelength of the input vector
*p_resultminimum value returned here
*p_indexindex of minimum value returned here
Returns
none.
static void FSP_MinIntQ31 ( FSP_Type *  base,
q31_t p_src,
uint32_t  block_size 
)
inlinestatic

Interrupt-mode interface

Parameters
*p_srcpoints to the input vector
block_sizelength of the input vector
Returns
none.
void FSP_GetMinIntResultQ31 ( FSP_Type *  base,
q31_t p_src,
q31_t p_result,
uint32_t *  p_index 
)

Interrupt-mode interface

Parameters
*p_srcpoints to the input vector
*p_resultminimum value returned here
*p_indexindex of minimum value returned here
Returns
none.
static void FSP_FirBufferClear ( FSP_Type *  base,
uint32_t  ch_idx 
)
inlinestatic
Parameters
idxchannel index.
Returns
none.
static void FSP_FirBufferClearAll ( FSP_Type *  base)
inlinestatic
Returns
none.
void FSP_FirF32 ( FSP_Type *  base,
const fsp_fir_instance_t S,
float32_t p_src,
float32_t p_dst,
uint32_t  block_size 
)
Parameters
baseFSP peripheral base address
*Spoints to an instance of the FIR filter structure.
*p_srcpoints to the block of input floating-point data.
*p_dstpoints to the block of output floating-point data.
block_sizenumber of samples to process per call, this value should bigger than 2.
Returns
none.
void FSP_FirQ31 ( FSP_Type *  base,
const fsp_fir_instance_t S,
q31_t p_src,
q31_t p_dst,
uint32_t  block_size 
)
Parameters
baseFSP peripheral base address
*Spoints to an instance of the FIR filter structure.
*p_srcpoints to the block of input q31 data.
*p_dstpoints to the block of output q31 data.
block_sizenumber of samples to process per call.
Returns
none.