sfl.h (640B)
1 // This file is Copyright (c) 2012-2015 Sebastien Bourdeauducq <sb@m-labs.hk> 2 // License: BSD 3 4 #ifndef __SFL_H 5 #define __SFL_H 6 7 #define SFL_MAGIC_LEN 14 8 #define SFL_MAGIC_REQ "sL5DdSMmkekro\n" 9 #define SFL_MAGIC_ACK "z6IHG7cYDID6o\n" 10 11 struct sfl_frame { 12 unsigned char payload_length; 13 unsigned char crc[2]; 14 unsigned char cmd; 15 unsigned char payload[255]; 16 } __attribute__((packed)); 17 18 /* General commands */ 19 #define SFL_CMD_ABORT 0x00 20 #define SFL_CMD_LOAD 0x01 21 #define SFL_CMD_JUMP 0x02 22 23 /* Replies */ 24 #define SFL_ACK_SUCCESS 'K' 25 #define SFL_ACK_CRCERROR 'C' 26 #define SFL_ACK_UNKNOWN 'U' 27 #define SFL_ACK_ERROR 'E' 28 29 #endif /* __SFL_H */