19 lines
568 B
C
19 lines
568 B
C
#include "by_vofa.h"
|
|
|
|
void by_vofa_init(by_vofa_t *vofa, uart_index_enum uart_index, uint8_t param_num, float *param_ptr)
|
|
{
|
|
vofa->uart_index = uart_index;
|
|
vofa->param_num = param_num;
|
|
vofa->param_ptr = param_ptr;
|
|
}
|
|
|
|
void by_vofa_send(by_vofa_t *vofa)
|
|
{
|
|
const uint8_t tail[4] = {0x00, 0x00, 0x80, 0x7F};
|
|
const uint8_t *param_ptr_u8 = (uint8_t *)vofa->param_ptr;
|
|
|
|
for (uint16_t i = 0; i < vofa->param_num * 4; i++) {
|
|
uart_write_byte(vofa->uart_index, *(param_ptr_u8 + i));
|
|
}
|
|
uart_write_buffer(vofa->uart_index, tail, 4);
|
|
} |