dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
bl_xfer.h
Go to the documentation of this file.
1 
11 /*
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful, but
18  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20  * for more details.
21  *
22  * You should have received a copy of the GNU General Public License along
23  * with this program; if not, see <http://www.gnu.org/licenses/>
24  */
25 
26 #ifndef BL_XFER_H_
27 #define BL_XFER_H_
28 
29 #include <stdint.h> /* uint*_t */
30 #include <stdbool.h> /* bool */
31 
32 #include "bl_messages.h" /* struct msg_xfer_* */
33 
34 struct xfer_state {
36 
37  uintptr_t partition_id;
38  uint32_t partition_base;
39  uint32_t partition_size;
43  bool check_crc;
44  uint32_t crc;
45 
46  uint32_t bytes_to_xfer;
47 };
48 
49 extern bool bl_xfer_completed_p(const struct xfer_state * xfer);
50 extern bool bl_xfer_crc_ok_p(const struct xfer_state * xfer);
51 extern bool bl_xfer_read_start(struct xfer_state * xfer, const struct msg_xfer_start *xfer_start);
52 extern bool bl_xfer_send_next_read_packet(struct xfer_state * xfer);
53 extern bool bl_xfer_write_start(struct xfer_state * xfer, const struct msg_xfer_start *xfer_start);
54 extern bool bl_xfer_write_cont(struct xfer_state * xfer, const struct msg_xfer_cont *xfer_cont);
56 extern bool bl_xfer_send_capabilities_self(void);
57 
58 #endif /* BL_XFER_H_ */
59 
bool bl_xfer_completed_p(const struct xfer_state *xfer)
Definition: bl_xfer.c:66
bool in_progress
Definition: bl_xfer.h:35
bool bl_xfer_read_start(struct xfer_state *xfer, const struct msg_xfer_start *xfer_start)
Definition: bl_xfer.c:85
struct msg_wipe_partition wipe_partition
uint32_t original_partition_offset
Definition: bl_xfer.h:40
bool bl_xfer_wipe_partition(const struct msg_wipe_partition *wipe_partition)
Definition: bl_xfer.c:314
bool check_crc
Definition: bl_xfer.h:43
uint32_t bytes_to_xfer
Definition: bl_xfer.h:46
bool bl_xfer_send_next_read_packet(struct xfer_state *xfer)
Definition: bl_xfer.c:149
uintptr_t partition_id
Definition: bl_xfer.h:37
bool bl_xfer_crc_ok_p(const struct xfer_state *xfer)
Definition: bl_xfer.c:71
bool bl_xfer_write_start(struct xfer_state *xfer, const struct msg_xfer_start *xfer_start)
Definition: bl_xfer.c:189
uint32_t current_partition_offset
Definition: bl_xfer.h:41
uint32_t partition_base
Definition: bl_xfer.h:38
bool bl_xfer_write_cont(struct xfer_state *xfer, const struct msg_xfer_cont *xfer_cont)
Definition: bl_xfer.c:270
struct msg_xfer_start xfer_start
uint32_t crc
Definition: bl_xfer.h:44
struct msg_xfer_cont xfer_cont
uint32_t next_packet_number
Definition: bl_xfer.h:42
bool bl_xfer_send_capabilities_self(void)
Definition: bl_xfer.c:354
uint32_t partition_size
Definition: bl_xfer.h:39