HAL CORDIC Types

Enumerations

group CORDIC_Exported_Types_Group1

Enums

enum hal_cordic_t

HAL CORDIC instance.

Values:

enumerator HAL_CORDIC

HAL CORDIC Peripheral instance

enum hal_cordic_state_t

CORDIC HAL state structure definition.

Values:

enumerator HAL_CORDIC_STATE_RESET

CORDIC not yet initialized or disabled

enumerator HAL_CORDIC_STATE_INIT

CORDIC initialized but not yet configured

enumerator HAL_CORDIC_STATE_IDLE

CORDIC initialized and a global config applied

enumerator HAL_CORDIC_STATE_ACTIVE

CORDIC internal process is ongoing

enumerator HAL_CORDIC_STATE_ABORT

CORDIC internal process is aborted

enum hal_cordic_function_t

CORDIC Function.

Values:

enumerator HAL_CORDIC_FUNCTION_COSINE

Cosine Cosine

enumerator HAL_CORDIC_FUNCTION_SINE

Sine Sine

enumerator HAL_CORDIC_FUNCTION_PHASE

Phase Phase

enumerator HAL_CORDIC_FUNCTION_MODULUS

Modulus Modulus

enumerator HAL_CORDIC_FUNCTION_ARCTANGENT

Arctangent Arctangent

enumerator HAL_CORDIC_FUNCTION_HCOSINE

Hyperbolic Cosine Hyperbolic Cosine

enumerator HAL_CORDIC_FUNCTION_HSINE

Hyperbolic Sine Hyperbolic Sine

enumerator HAL_CORDIC_FUNCTION_HARCTANGENT

Hyperbolic Arctangent Hyperbolic Arctangent

enumerator HAL_CORDIC_FUNCTION_NATURAL_LOG

Natural Logarithm Natural Logarithm

enumerator HAL_CORDIC_FUNCTION_SQUARE_ROOT

Square Root Square Root

enum hal_cordic_precision_t

CORDIC precision in cycle count (Number of iterations /4).

Values:

enumerator HAL_CORDIC_PRECISION_1_CYCLE

1 cycle 1*4 iterations

enumerator HAL_CORDIC_PRECISION_2_CYCLE

2 cycles 2*4 iterations

enumerator HAL_CORDIC_PRECISION_3_CYCLE

3 cycles 3*4 iterations

enumerator HAL_CORDIC_PRECISION_4_CYCLE

4 cycles 4*4 iterations

enumerator HAL_CORDIC_PRECISION_5_CYCLE

5 cycles 5*4 iterations

enumerator HAL_CORDIC_PRECISION_6_CYCLE

6 cycles 6*4 iterations

enumerator HAL_CORDIC_PRECISION_7_CYCLE

7 cycles 7*4 iterations

enumerator HAL_CORDIC_PRECISION_8_CYCLE

8 cycles 8*4 iterations

enumerator HAL_CORDIC_PRECISION_9_CYCLE

9 cycles 9*4 iterations

enumerator HAL_CORDIC_PRECISION_10_CYCLE

10 cycles 10*4 iterations

enumerator HAL_CORDIC_PRECISION_11_CYCLE

11 cycles 11*4 iterations

enumerator HAL_CORDIC_PRECISION_12_CYCLE

12 cycles 12*4 iterations

enumerator HAL_CORDIC_PRECISION_13_CYCLE

13 cycles 13*4 iterations

enumerator HAL_CORDIC_PRECISION_14_CYCLE

14 cycles 14*4 iterations

enumerator HAL_CORDIC_PRECISION_15_CYCLE

15 cycles 15*4 iterations

enum hal_cordic_scaling_factor_t

CORDIC scaling factor. Scale factor value ‘n’ implies that the input data are multiplied by a factor of 2exp(-n), and/or the output data need to be multiplied by 2exp(n).

Values:

enumerator HAL_CORDIC_SCALING_FACTOR_0

Scaling factor - Arguments * 2^0 Scaling factor - Arguments Multiplied by 2^0

enumerator HAL_CORDIC_SCALING_FACTOR_1

Scaling factor - Arguments * 2^1 Scaling factor - Arguments Multiplied by 2^1

enumerator HAL_CORDIC_SCALING_FACTOR_2

Scaling factor - Arguments * 2^2 Scaling factor - Arguments Multiplied by 2^2

enumerator HAL_CORDIC_SCALING_FACTOR_3

Scaling factor - Arguments * 2^3 Scaling factor - Arguments Multiplied by 2^3

enumerator HAL_CORDIC_SCALING_FACTOR_4

Scaling factor - Arguments * 2^4 Scaling factor - Arguments Multiplied by 2^4

enumerator HAL_CORDIC_SCALING_FACTOR_5

Scaling factor - Arguments * 2^5 Scaling factor - Arguments Multiplied by 2^5

enumerator HAL_CORDIC_SCALING_FACTOR_6

Scaling factor - Arguments * 2^6 Scaling factor - Arguments Multiplied by 2^6

enumerator HAL_CORDIC_SCALING_FACTOR_7

Scaling factor - Arguments * 2^7 Scaling factor - Arguments Multiplied by 2^7

enum hal_cordic_nb_arg_t

CORDIC Number of 32-bit arguments required for one computation.

Values:

enumerator HAL_CORDIC_NB_ARG_1

One 32-bit write containing either only one 32-bit data input (Q1.31 format), or two 16-bit data input (Q1.15 format) packed in one 32-bit Data One 32-bit write for either one data input in q1.31 format or two 16-bit data input in q1.15 format packed in one 32-bit

enumerator HAL_CORDIC_NB_ARG_2

0x00100000 Number of arguments in RDATA register Two 32-bit write containing two 32-bit data input (Q1.31 format) Two 32-bit writes for two data inputs in q1.31 format

enum hal_cordic_nb_result_t

CORDIC number of 32-bit results required after one computation.

Values:

enumerator HAL_CORDIC_NB_RESULT_1

One 32-bit read containing either only one 32-bit data output (Q1.31 format), or two 16-bit data output (Q1.15 format) packed in one 32-bit Data One 32-bit read for either one data output in q1.31 format or two 16-bit data outputs in q1.15 format packed in one 32-bit

enumerator HAL_CORDIC_NB_RESULT_2

0x00080000 Number of results in WDATA register Two 32-bit Data containing two 32-bit data output (Q1.31 format) Two 32-bit reads for two 32-bit data output in q1.31 format

enum hal_cordic_in_width_t

CORDIC input data width.

Values:

enumerator HAL_CORDIC_IN_WIDTH_32_BIT

32-bit input data width (Q1.31 format) 32-bit input data width (q1.31 format)

enumerator HAL_CORDIC_IN_WIDTH_16_BIT

0x00400000 Width of input data 16-bit input data width (Q1.15 format) 16-bit input data width (q1.15 format)

enum hal_cordic_out_width_t

CORDIC output data width.

Values:

enumerator HAL_CORDIC_OUT_WIDTH_32_BIT

32-bit output data width (Q1.31 format) 32-bit output data width (q1.31 format)

enumerator HAL_CORDIC_OUT_WIDTH_16_BIT

0x00200000 Width of output data 16-bit output data width (Q1.15 format) 16-bit output data width (q1.15 format)

CORDIC Configuration Structure

group CORDIC_Exported_Types_Group2
struct hal_cordic_buffer_desc_t
#include <stm32c5xx_hal_cordic.h>

CORDIC data buffer descriptor.

Public Members

int32_t * p_data

data pointer

uint32_t size_word

data buffer size in words.

struct hal_cordic_config_t
#include <stm32c5xx_hal_cordic.h>

CORDIC function global configuration structure definition.

Public Members

hal_cordic_function_t function

Function to apply (COSINE, SINE, PHASE, MODULOUS, …)

hal_cordic_scaling_factor_t scaling_factor

Scaling factor to apply to the arguments and/or results.

hal_cordic_in_width_t in_width

Width of input data (16-bit or 32-bit).

hal_cordic_out_width_t out_width

Width of output data (16-bit or 32-bit).

hal_cordic_precision_t precision

Precision required (number of iterations).

hal_cordic_nb_arg_t nb_arg

Number of arguments (one 32-bit value or two 32-bit values)

hal_cordic_nb_result_t nb_result

Number of results (one 32-bit two 16_bit values or two 32-bit

CORDIC Handle Structure

group CORDIC_Exported_Types_Group3

Typedefs

typedef struct hal_cordic_handle_s hal_cordic_handle_t

CORDIC handle structure type

typedef void ( * hal_cordic_cb_t ) ( hal_cordic_handle_t * hcordic )

Pointer to CORDIC callback function

struct hal_cordic_handle_s
#include <stm32c5xx_hal_cordic.h>

HAL CORDIC handle structure definition.

Public Members

hal_cordic_t instance

CORDIC instance

const int32_t * p_input_buffer

Pointer to CORDIC input data buffer

int32_t * p_output_buffer

Pointer to CORDIC output data buffer

uint32_t computation_nb

Remaining number of computation to do

uint32_t result_nb

Remaining number of result to get

hal_dma_handle_t * p_dma_in

CORDIC peripheral input data DMA handle parameters

hal_dma_handle_t * p_dma_out

CORDIC peripheral output data DMA handle parameters

volatile hal_cordic_state_t global_state

CORDIC state

hal_cordic_cb_t p_calculate_cplt_cb

CORDIC calculate complete callback

hal_cordic_cb_t p_write_cplt_cb

CORDIC write complete callback

hal_cordic_cb_t p_abort_cplt_cb

CORDIC abort complete callback

hal_cordic_cb_t p_write_half_cplt_cb

DMA write half complete callback

hal_cordic_cb_t p_read_half_cplt_cb

DMA read half complete callback

hal_cordic_cb_t p_error_cb

CORDIC error callback

volatile uint32_t last_error_codes

CORDIC peripheral error code

const void * p_user_data

User data pointer