| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #ifndef __FILE_SERPLOT_DRV_H__
- #define __FILE_SERPLOT_DRV_H__
- #include "prj_com.h"
- // must be sure that (1+size_of(DAT)*DATNUM_MAX)*SPS*10 < Baud Rate
- #define SERPLOT_DATNUM_MAX (5)
- #define SERPLOT_PRINT_1FLOAT_1PREAMBLE(f1) \
- SerPlot.f.Data[0] = (f1); \
- SerPlot_DmaTxAct((char *)&(SerPlot.b.SOP_1P), 1+4*1)
- #define SERPLOT_PRINT_2FLOAT_1PREAMBLE(f1, f2) \
- SerPlot.f.Data[0] = (f1); \
- SerPlot.f.Data[1] = (f2); \
- SerPlot_DmaTxAct((char *)&(SerPlot.b.SOP_1P), 1+4*2)
- #define SERPLOT_PRINT_3FLOAT_1PREAMBLE(f1, f2, f3) \
- SerPlot.f.Data[0] = (f1); \
- SerPlot.f.Data[1] = (f2); \
- SerPlot.f.Data[2] = (f3); \
- SerPlot_DmaTxAct((char *)&(SerPlot.b.SOP_1P), 1+4*3)
- #define SERPLOT_PRINT_4FLOAT_1PREAMBLE(f1, f2, f3, f4) \
- SerPlot.f.Data[0] = (f1); \
- SerPlot.f.Data[1] = (f2); \
- SerPlot.f.Data[2] = (f3); \
- SerPlot.f.Data[3] = (f4); \
- SerPlot_DmaTxAct((char *)&(SerPlot.b.SOP_1P), 1+4*4)
- #define SERPLOT_PRINT_5FLOAT_1PREAMBLE(f1, f2, f3, f4, f5) \
- SerPlot.f.Data[0] = (f1); \
- SerPlot.f.Data[1] = (f2); \
- SerPlot.f.Data[2] = (f3); \
- SerPlot.f.Data[3] = (f4); \
- SerPlot.f.Data[4] = (f5); \
- SerPlot_DmaTxAct((char *)&(SerPlot.b.SOP_1P), 1+4*5)
- #define SERPLOT_DMATX_OFF (0x0001u)
- typedef union {
- struct {
- uint32_t Preamble;
- float Data[SERPLOT_DATNUM_MAX];
- } f;
- struct{
- uint8_t SOP_4P;
- uint8_t SOP_3P;
- uint8_t SOP_2P;
- uint8_t SOP_1P;
- } b;
- } SerPlot_NxFloat_t;
- extern void SerPlot_DmaTxAct(char *Ptr, uint16_t Len);
- extern SerPlot_NxFloat_t SerPlot;
- #endif
|