libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
cordic_common_v1.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CORDIC_CSR   MMIO32(CORDIC_BASE + 0x00)
 CORDIC control/status register. More...
 
#define CORDIC_WDATA   MMIO32(CORDIC_BASE + 0x04)
 CORDIC argument register. More...
 
#define CORDIC_RDATA   MMIO32(CORDIC_BASE + 0x08)
 CORDIC result register. More...
 
#define CORDIC_CSR_RRDY   (0x1 << 31)
 RRDY: result ready flag. More...
 
#define CORDIC_CSR_ARGSIZE   (0x1 << 22)
 ARGSIZE: Width of input data. More...
 
#define CORDIC_CSR_RESSIZE   (0x1 << 21)
 RESSIZE: Width of result data. More...
 
#define CORDIC_CSR_NARGS   (0x1 << 20)
 NARGS: Number of input data writes. More...
 
#define CORDIC_CSR_NRES   (0x1 << 19)
 NRES: Number of result data reads. More...
 
#define CORDIC_CSR_DMAWEN   (0x1 << 18)
 DMAWEN: DMA write enable. More...
 
#define CORDIC_CSR_DMAREN   (0x1 << 17)
 DMAREN: DMA write enable. More...
 
#define CORDIC_CSR_IEN   (0x1 << 16)
 DMAREN: Interrupt enable. More...
 
#define CORDIC_CSR_SCALE_1   (0x0)
 
#define CORDIC_CSR_SCALE_2   (0x1)
 
#define CORDIC_CSR_SCALE_4   (0x2)
 
#define CORDIC_CSR_SCALE_8   (0x3)
 
#define CORDIC_CSR_SCALE_16   (0x4)
 
#define CORDIC_CSR_SCALE_32   (0x5)
 
#define CORDIC_CSR_SCALE_64   (0x6)
 
#define CORDIC_CSR_SCALE_128   (0x7)
 
#define CORDIC_CSR_SCALE_SHIFT   (8)
 
#define CORDIC_CSR_SCALE_MASK   (0x7 << CORDIC_CSR_SCALE_SHIFT)
 
#define CORDIC_CSR_PRECISION_ITER_04   (0x1)
 
#define CORDIC_CSR_PRECISION_ITER_08   (0x2)
 
#define CORDIC_CSR_PRECISION_ITER_12   (0x3)
 
#define CORDIC_CSR_PRECISION_ITER_16   (0x4)
 
#define CORDIC_CSR_PRECISION_ITER_20   (0x5)
 
#define CORDIC_CSR_PRECISION_ITER_24   (0x6)
 
#define CORDIC_CSR_PRECISION_ITER_28   (0x7)
 
#define CORDIC_CSR_PRECISION_ITER_32   (0x8)
 
#define CORDIC_CSR_PRECISION_ITER_36   (0x9)
 
#define CORDIC_CSR_PRECISION_ITER_40   (0xA)
 
#define CORDIC_CSR_PRECISION_ITER_44   (0xB)
 
#define CORDIC_CSR_PRECISION_ITER_48   (0xC)
 
#define CORDIC_CSR_PRECISION_ITER_52   (0xD)
 
#define CORDIC_CSR_PRECISION_ITER_56   (0xE)
 
#define CORDIC_CSR_PRECISION_ITER_60   (0xF)
 
#define CORDIC_CSR_PRECISION_SHIFT   (4)
 
#define CORDIC_CSR_PRECISION_MASK   (0xF << CORDIC_CSR_PRECISION_SHIFT)
 
#define CORDIC_CSR_FUNC_COS   (0x0)
 
#define CORDIC_CSR_FUNC_SIN   (0x1)
 
#define CORDIC_CSR_FUNC_PHASE   (0x2)
 
#define CORDIC_CSR_FUNC_MODULUS   (0x3)
 
#define CORDIC_CSR_FUNC_ATAN   (0x4)
 
#define CORDIC_CSR_FUNC_COSH   (0x5)
 
#define CORDIC_CSR_FUNC_SINH   (0x6)
 
#define CORDIC_CSR_FUNC_ATANH   (0x7)
 
#define CORDIC_CSR_FUNC_COSINE   (0x8)
 
#define CORDIC_CSR_FUNC_SQRT   (0x9)
 
#define CORDIC_CSR_FUNC_SHIFT   (0)
 
#define CORDIC_CSR_FUNC_MASK   (0xF << CORDIC_CSR_FUNC_SHIFT)
 

Functions

bool cordic_is_result_ready (void)
 Read CORDIC result ready flag. More...
 
void cordic_set_argument_width_32bit (void)
 Set CORDIC to 32 bit argument data width. More...
 
void cordic_set_argument_width_16bit (void)
 Set CORDIC to 16 bit argument data width. More...
 
void cordic_set_result_width_32bit (void)
 Set CORDIC to 32 bit result data width. More...
 
void cordic_set_result_width_16bit (void)
 Set CORDIC to 16 bit result data width. More...
 
void cordic_set_number_of_arguments_1 (void)
 Set number of CORDIC arguments to one 32 bit argument or two 16 bit arguments. More...
 
void cordic_set_number_of_arguments_2 (void)
 Set number of CORDIC arguments to two 32 bit arguments. More...
 
void cordic_set_number_of_results_1 (void)
 Set number of CORDIC results to one 32 bit result or two 16 bit results. More...
 
void cordic_set_number_of_results_2 (void)
 Set number of CORDIC results to two 32 bit results. More...
 
void cordic_enable_dma_write (void)
 Enable DMA for writes to CORDIC_WDATA. More...
 
void cordic_disable_dma_write (void)
 Disable DMA for writes to CORDIC_WDATA. More...
 
void cordic_enable_dma_read (void)
 Enable DMA for read from CORDIC_RDATA. More...
 
void cordic_disable_dma_read (void)
 Disable DMA for read from CORDIC_RDATA. More...
 
void cordic_enable_interrupt (void)
 Enable interrupt when result is ready. More...
 
void cordic_set_scaling_factor (uint8_t n)
 Set scaling factor for CORDIC operations. More...
 
void cordic_set_precision (uint8_t precision)
 Set precision for CORDIC operations. More...
 
void cordic_set_function (uint8_t function)
 Set CORDIC operation type. More...
 
void cordic_write_16bit_argument (uint16_t argument)
 Write single 16 bit argument. More...
 
void cordic_write_16bit_arguments (uint16_t argument1, uint16_t argument2)
 Write two 16 bit arguments. More...
 
void cordic_write_32bit_argument (uint32_t argument)
 Write single 32 bit argument. More...
 
uint16_t cordic_read_16bit_result (void)
 Read single 16 bit result. More...
 
void cordic_read_16bit_results (uint16_t *result1, uint16_t *result2)
 Read two 16 bit results. More...
 
uint32_t cordic_read_32bit_result (void)
 Read 32 bit result. More...
 
void cordic_configure_for_cos_16bit (void)
 Configure cordic for 16 bit cosine. More...
 
void cordic_configure_for_cos_32bit (void)
 Configure cordic for 32 bit cosine. More...
 
void cordic_configure_for_sin_16bit (void)
 Configure cordic for 16 bit sine. More...
 
void cordic_configure_for_sin_32bit (void)
 Configure cordic for 32 bit sine. More...
 
int16_t cordic_cos_16bit (int16_t x)
 Compute 16 bit cosine using CORDIC (blocking) More...
 
int32_t cordic_cos_32bit (int32_t x)
 Compute 32 bit cosine using CORDIC (blocking) More...
 
int16_t cordic_sin_16bit (int16_t x)
 Compute 16 bit sine using CORDIC (blocking) More...
 
int32_t cordic_sin_32bit (int32_t x)
 Compute 32 bit sine using CORDIC (blocking) More...
 
void cordic_cos_16bit_async (int16_t x)
 Compute 16 bit cosine using CORDIC (non blocking) More...
 
void cordic_cos_32bit_async (int32_t x)
 Compute 32 bit cosine using CORDIC (non blocking) More...
 
void cordic_sin_16bit_async (int16_t x)
 Compute 16 bit sine using CORDIC (non blocking) More...
 
void cordic_sin_32bit_async (int32_t x)
 Compute 32 bit sine using CORDIC (non blocking) More...