Defines | |
| #define | TRIGINT_SIN8_STATIC_TABLE 1 |
| Compile time macro that can be used to disable the static (compile-time) lookup table. | |
Functions | |
| uint8_t | trigint_sin8u (trigint_angle_t angle) |
| Returns the sine of angle as an unsigned 8-bit integer. | |
| int8_t | trigint_sin8 (trigint_angle_t angle) |
| Returns the sine of angle as a signed 8-bit integer. | |
| int | trigint_sin8u_table_size () |
| Returns the size of the lookup table used for unsigned 8-bit integers. | |
| uint8_t | trigint_sin8u_table_lookup (int index) |
| Lookup a specific table entry for the given index. | |
| void | trigint_sin8_init () |
| Initialize the dynamic table. | |
| #define TRIGINT_SIN8_STATIC_TABLE 1 |
Compile time macro that can be used to disable the static (compile-time) lookup table.
This can be used to reduce compiled code size at the expense of requiring a call to trigint_sin8_init() at runtime.
| uint8_t trigint_sin8u | ( | trigint_angle_t | angle | ) |
Returns the sine of angle as an unsigned 8-bit integer.
It is scaled to an amplitude of 127 and offset by 128 thus values will range from 1 to 255.
| angle | the angle to compute the sine of |
| int8_t trigint_sin8 | ( | trigint_angle_t | angle | ) | [inline] |
Returns the sine of angle as a signed 8-bit integer.
It is scaled to an amplitude of 127 thus values will range from -127 to 127.
| angle | the angle to compute the sine of |
| int trigint_sin8u_table_size | ( | ) |
Returns the size of the lookup table used for unsigned 8-bit integers.
| uint8_t trigint_sin8u_table_lookup | ( | int | index | ) | [inline] |
Lookup a specific table entry for the given index.
| index | a table index |
| void trigint_sin8_init | ( | ) |
Initialize the dynamic table.
Must be called before any calls to trigint_sin8u() or trigint_sin8(). This is only necessary and available if the TRIGINT_SIN8_STATIC_TABLE macro is set to 0.