feat: 增加 vofa justfloat 发送

This commit is contained in:
bmy
2024-03-11 19:32:44 +08:00
parent 6c0cfe1248
commit 6a6be1469b
4 changed files with 44 additions and 3 deletions

15
app/by_vofa.c Normal file
View File

@@ -0,0 +1,15 @@
#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);
}