15 lines
462 B
C
15 lines
462 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};
|
||
|
|
uart_write_buffer(vofa->uart_index, (uint8_t *)vofa->param_ptr, vofa->param_num * 4);
|
||
|
|
uart_write_buffer(vofa->uart_index, tail, 4);
|
||
|
|
}
|