2022-05-24 14:13:31 +08:00
|
|
|
#include "TemplateDevice_UART.h"
|
2022-05-24 20:58:58 +08:00
|
|
|
#include <stdio.h>
|
2022-05-24 14:13:31 +08:00
|
|
|
|
2022-05-24 15:26:12 +08:00
|
|
|
void TemplateDevice_UART_platformDisable(PikaObj* self) {}
|
|
|
|
void TemplateDevice_UART_platformEnable(PikaObj* self) {}
|
|
|
|
void TemplateDevice_UART_platformRead(PikaObj* self) {}
|
|
|
|
void TemplateDevice_UART_platformReadBytes(PikaObj* self) {
|
|
|
|
int length = obj_getInt(self, "length");
|
|
|
|
uint8_t bytes_buff[] = {0x00, 0x01, 0x02, 0x03, 0x04,
|
|
|
|
0x05, 0x06, 0x07, 0x08};
|
|
|
|
obj_setBytes(self, "readData", bytes_buff, length);
|
|
|
|
}
|
|
|
|
void TemplateDevice_UART_platformWrite(PikaObj* self) {}
|
2022-05-24 20:58:58 +08:00
|
|
|
void TemplateDevice_UART_platformWriteBytes(PikaObj* self) {
|
|
|
|
uint8_t* bytes = obj_getBytes(self, "writeData");
|
|
|
|
int length = obj_getBytesSize(self, "writeData");
|
|
|
|
printf("[debug]: write to uart: [ ");
|
|
|
|
for (int i = 0; i < length; i++) {
|
|
|
|
printf("0x%02X ", bytes[i]);
|
|
|
|
}
|
|
|
|
printf("]\n");
|
|
|
|
}
|
2022-06-17 05:22:47 +00:00
|
|
|
|
|
|
|
void TemplateDevice_UART_platformGetEventId(PikaObj *self){
|
|
|
|
|
|
|
|
}
|