bf0_hal_facc.h

Defines

FACC_MAX_FIFO_SIZE
FACC_FIR_STATE_SIZE
FACC_IIR_STATE_SIZE
HAL_FACC_SetCoeffFir(facc, coff, len)
HAL_FACC_SetCoeffFirReverse(facc, coff, len)
HAL_FACC_SetConvKernel(facc, kernel, len)

Typedefs

typedef struct __FACC_HandleTypeDef FACC_HandleTypeDef

FACC handle structure definition

Enums

enum HAL_FACC_StateTypeDef

HAL ACC State structures definition.

Values:

enumerator HAL_FACC_STATE_RESET

FACC not yet initialized or disabled

enumerator HAL_FACC_STATE_READY

Peripheral Initialized and ready for use

enumerator HAL_FACC_STATE_BUSY

An internal process is ongoing

enumerator HAL_FACC_STATE_ERROR

FACC state error

Functions

HAL_StatusTypeDef HAL_FACC_Init(FACC_HandleTypeDef *facc)

Init FACC Accelerator.

返回值:

status, HAL_OK – if successful, otherwise failed

HAL_StatusTypeDef HAL_FACC_Config(FACC_HandleTypeDef *facc, FACC_ConfigTypeDef *config)

Init FACC Accelerator.

参数:
  • facc – FACC handle

  • config – FACC configuration

返回值:

status, HAL_OK – if successful, otherwise failed

HAL_StatusTypeDef HAL_FACC_Reset(FACC_HandleTypeDef *facc)

Reset FACC Accelerator.

参数:
  • facc – FACC handle

返回值:

status, HAL_OK – if successful, otherwise failed

HAL_StatusTypeDef HAL_FACC_SetCoeff(FACC_HandleTypeDef *facc, uint8_t *coff_b, uint16_t len_b, uint8_t *coff_a, uint16_t len_a, uint8_t reverse)

Set IIR filter co-efficients.

参数:
  • facc – FACC handle

  • coff_b – coefficent array b

  • len_b – coefficent array b length in bytes

  • coff_a – coefficent array a

  • len_a – coefficent array a length in bytes

  • reverse – array in reverse order

返回值:

status, HAL_OK – if successful, otherwise failed

HAL_StatusTypeDef HAL_FACC_Buffer_Enable(FACC_HandleTypeDef *facc, uint8_t *buf_addr)

Enable FACC buffer mode, used in FIR/IIR suspend/resume calculation.

参数:
  • facc – FACC handle

  • buf_addr – Buffer address

返回值:

status, HAL_OK – if successful, otherwise failed

HAL_StatusTypeDef HAL_FACC_DeInit(FACC_HandleTypeDef *facc)

DeInit FACC Accelerator.

返回值:

status, HAL_OK – if successful, otherwise failed

HAL_StatusTypeDef HAL_FACC_Start(FACC_HandleTypeDef *facc, uint8_t *input, uint8_t *output, uint32_t len)

Start FACC in synchronous mode.

备注

Ouput buffer length need to be 8 bytes aligned in Lite, 4 bytes aligned in PRO.

参数:
  • facc[in] FACC handle

  • input[in] Input data

  • output[out] Output data,

  • len[in] length of input data in bytes

返回值:

status, HAL_OK – if successful, otherwise failed

HAL_StatusTypeDef HAL_FACC_Start_IT(FACC_HandleTypeDef *facc, uint8_t *input, uint8_t *output, uint32_t len)

Start FACC in asynchronous mode.

CpltCallback is called after complete

备注

Ouput buffer length need to be 8 bytes aligned in Lite, 4 bytes aligned in PRO.

参数:
  • facc[in] FACC handle

  • input[in] Input data

  • output[out] Output data

  • len[in] length of input data in bytes

返回值:

status, HAL_OK – if successful, otherwise failed

HAL_StatusTypeDef HAL_FACC_IRQHandler(FACC_HandleTypeDef *facc)

FACC Interrupt process.

参数:
  • facc[in] FACC handle

返回值:

status, HAL_OK – if successful, otherwise failed

struct FACC_ConfigTypeDef

Public Members

uint32_t gain

facc gain

uint32_t last_sel

0:other data block, 1:last data block, only used in conv

uint32_t reserved2

Reserved

uint32_t mod_sel

0: fir, 1: iir

uint32_t sym_sel

0:normal, 1:symmetric(only support fir mod)

uint32_t fp_sel

0: 16bit, 1: 8bit

uint32_t conv_sel

0: filter, 1: convolution(only support fir mod)

uint32_t even_sel

when syn_sel=1, this bit is effective, 0: odd, 1: even

uint32_t buf_sel

when buf_sel=1, buffer mode is enabled, temporary state will save/restored by buffer.

uint32_t anti

when sym_sel=1, bit effective, 1: Andi-sym 0:normal,

uint32_t reserved
struct __FACC_HandleTypeDef
#include <bf0_hal_facc.h>

FACC handle structure definition

Public Members

FACC_TypeDef *Instance

FACC register base address.

void (*CpltCallback)(struct __FACC_HandleTypeDef *facc)

FACC processing complete callback.

FACC_ConfigTypeDef config

FACC parameter config.

HAL_FACC_StateTypeDef State

FACC state.