| 1 | /// CORDIC function |
| 2 | #[allow (missing_docs)] |
| 3 | #[derive (Debug, Clone, Copy)] |
| 4 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
| 5 | pub enum Function { |
| 6 | Cos = 0, |
| 7 | Sin, |
| 8 | Phase, |
| 9 | Modulus, |
| 10 | Arctan, |
| 11 | Cosh, |
| 12 | Sinh, |
| 13 | Arctanh, |
| 14 | Ln, |
| 15 | Sqrt, |
| 16 | } |
| 17 | |
| 18 | /// CORDIC precision |
| 19 | #[allow (missing_docs)] |
| 20 | #[derive (Debug, Clone, Copy, Default)] |
| 21 | pub enum Precision { |
| 22 | Iters4 = 1, |
| 23 | Iters8, |
| 24 | Iters12, |
| 25 | Iters16, |
| 26 | Iters20, |
| 27 | #[default] |
| 28 | Iters24, // this value is recommended by Reference Manual |
| 29 | Iters28, |
| 30 | Iters32, |
| 31 | Iters36, |
| 32 | Iters40, |
| 33 | Iters44, |
| 34 | Iters48, |
| 35 | Iters52, |
| 36 | Iters56, |
| 37 | Iters60, |
| 38 | } |
| 39 | |
| 40 | /// CORDIC scale |
| 41 | #[allow (missing_docs)] |
| 42 | #[derive (Debug, Clone, Copy, Default, PartialEq)] |
| 43 | #[cfg_attr (feature = "defmt" , derive(defmt::Format))] |
| 44 | pub enum Scale { |
| 45 | #[default] |
| 46 | Arg1Res1 = 0, |
| 47 | Arg1o2Res2, |
| 48 | Arg1o4Res4, |
| 49 | Arg1o8Res8, |
| 50 | Arg1o16Res16, |
| 51 | Arg1o32Res32, |
| 52 | Arg1o64Res64, |
| 53 | Arg1o128Res128, |
| 54 | } |
| 55 | |
| 56 | /// CORDIC argument/result register access count |
| 57 | #[allow (missing_docs)] |
| 58 | #[derive (Clone, Copy, Default)] |
| 59 | pub enum AccessCount { |
| 60 | #[default] |
| 61 | One, |
| 62 | Two, |
| 63 | } |
| 64 | |
| 65 | /// CORDIC argument/result data width |
| 66 | #[allow (missing_docs)] |
| 67 | #[derive (Clone, Copy)] |
| 68 | pub enum Width { |
| 69 | Bits32, |
| 70 | Bits16, |
| 71 | } |
| 72 | |