Defines | |
#define | TRIGINT_SIN16_STATIC_TABLE 1 |
Compile time macro that can be used to disable the static (compile-time) lookup table. | |
Functions | |
int16_t | trigint_sin16 (trigint_angle_t angle) |
Returns the sine of angle as signed 16-bit integer. | |
int | trigint_sin16_table_size () |
Returns the size of the lookup table used for signed 16-bit integers. | |
int16_t | trigint_sin16_table_lookup (int index) |
Lookup a specific table entry for the given index. | |
void | trigint_sin16_init () |
Initialize the dynamic table. |
#define TRIGINT_SIN16_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_sin16_init() at runtime.
int16_t trigint_sin16 | ( | trigint_angle_t | angle | ) |
Returns the sine of angle as signed 16-bit integer.
It is scaled to an amplitude of 32,767, thus values will range from -32,767 to +32,767.
angle | the angle to compute the sine of |
int trigint_sin16_table_size | ( | ) |
Returns the size of the lookup table used for signed 16-bit integers.
int16_t trigint_sin16_table_lookup | ( | int | index | ) | [inline] |
Lookup a specific table entry for the given index.
index | a table index |
void trigint_sin16_init | ( | ) |
Initialize the dynamic table.
Must be called before any calls to trigint_sin16(). This is only necessary and available if the TRIGINT_SIN16_STATIC_TABLE macro is set to 0.