-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpcanfunc.h
49 lines (47 loc) · 2.24 KB
/
pcanfunc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* pcanfunc.h - flash program for PCAN routers
*
* Copyright (C) 2021 PEAK System-Technik GmbH
*
* www.peak-system.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Author: Oliver Hartkopp ([email protected])
* Maintainer(s): Stephane Grosjean ([email protected])
*
*/
#include <stdint.h>
#include <linux/can.h>
int query_modules(int s, struct can_frame *modules);
void init_set_cmd(struct can_frame *frame);
void set_startaddress(int s, uint8_t module_id, uint32_t addr);
void set_blocksize(int s, uint8_t module_id, uint32_t size);
void set_checksum(int s, uint8_t module_id, uint16_t csum);
void erase_sector(int s, uint8_t module_id);
void start_programming(int s, uint8_t module_id);
void verify(int s, uint8_t module_id);
void switch_to_bootloader(int s, uint8_t module_id);
void reset_module(int s, uint8_t module_id);
void end_programming(int s, uint8_t module_id);
uint8_t get_status(int s, uint8_t module_id, struct can_frame *cf);
uint8_t get_json_config(int s, uint8_t module_id, struct can_frame *modules, struct can_frame *cf);
int eval_modules(int s, int module_id, struct can_frame *modules);
void write_crc_array(uint8_t *buf, FILE *infile, uint32_t crc_start);
void write_block(int s, int dry_run, uint8_t module_id, uint32_t offset, uint32_t blksz, uint8_t *buf, uint32_t alternating_xor_flip, uint8_t ftd_len);
void erase_block(int s, int dry_run, uint8_t module_id, uint32_t startaddr, uint32_t blksz);
void erase_flashblocks(int s, int dry_run, FILE *infile, uint8_t module_id, uint8_t hw_type, int index);
int check_ch_name(FILE *infile, uint8_t hw_type);