Share PM67 upload protocol through C core
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "pcan_crc.h"
|
||||
#include "balsam_can.h"
|
||||
#include "periph28335.h"
|
||||
#include "tms2812.h"
|
||||
#include "pcan_frame.h"
|
||||
#include "pcan_id.h"
|
||||
#include "gui_frame.h"
|
||||
@@ -162,6 +163,40 @@ const char *pcan_abi_periph28335_command_name(
|
||||
return periph28335_command_name(project_index, command_index);
|
||||
}
|
||||
|
||||
uint16_t pcan_abi_tms2812_crc16(const uint8_t *data, size_t size)
|
||||
{
|
||||
return tms2812_crc16(data, size);
|
||||
}
|
||||
|
||||
size_t pcan_abi_tms2812_build_upload(
|
||||
uint8_t controller, uint32_t word_address, uint32_t byte_count,
|
||||
uint8_t *output, size_t output_size)
|
||||
{
|
||||
return tms2812_build_upload_request(
|
||||
controller, word_address, byte_count, output, output_size);
|
||||
}
|
||||
|
||||
size_t pcan_abi_tms2812_expected_upload_size(uint32_t byte_count)
|
||||
{
|
||||
return tms2812_expected_upload_response_size(byte_count);
|
||||
}
|
||||
|
||||
int pcan_abi_tms2812_validate_upload(
|
||||
const uint8_t *data, size_t size, uint8_t controller,
|
||||
uint32_t byte_count)
|
||||
{
|
||||
return tms2812_validate_upload_response(
|
||||
data, size, controller, byte_count);
|
||||
}
|
||||
|
||||
int pcan_abi_tms2812_decode_upload(
|
||||
const uint8_t *data, size_t size, uint8_t controller,
|
||||
uint32_t byte_count, uint8_t *output, size_t output_size)
|
||||
{
|
||||
return tms2812_decode_upload_response(
|
||||
data, size, controller, byte_count, output, output_size);
|
||||
}
|
||||
|
||||
size_t pcan_abi_frame_encode(uint8_t sequence, uint8_t flags,
|
||||
uint32_t can_id, const uint8_t *data, uint8_t dlc,
|
||||
uint8_t *output, size_t output_size)
|
||||
|
||||
Reference in New Issue
Block a user