blob: 63ae6ef70b4cd1481a22e1f385a847b999c92f1e (
plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
/*******************************************************************************
* Copyright (C) ST-Ericsson SA 2011
* License terms: 3-clause BSD license
******************************************************************************/
#ifndef T_PROTROM_HEADER_H_
#define T_PROTROM_HEADER_H_
/**
* @addtogroup ldr_communication_serv
* @{
* @addtogroup protrom_family
* @{
* @addtogroup ldr_protrom_header
* @{
*/
/*******************************************************************************
* Includes
******************************************************************************/
#include "t_basicdefinitions.h"
/*******************************************************************************
* Types, constants
******************************************************************************/
/** Header pattern for the protrom protocol*/
#define PROTROM_HEADER_PATTERN (0xAA)
/** Source address in the header*/
#define PROTROM_SOURCE_ADDRESS (0xEE)
/** Destination address in the header*/
#define PROTROM_DESTINATION_ADDRESS (0xEE)
/** The length of the header */
#define PROTROM_HEADER_LENGTH 7
/** Value of the reserved field */
#define PROTROM_RESERVED_FIELD 0x00
/** Offset of the header in the buffer */
#define HEADER_OFFSET_IN_BUFFER 8
/**
* Header search results
*/
#define NO_PROTROM_HEADER_PATTERN (0x00)
#define PROTROM_HEADER_PATTERN_MATCH (0x01)
#define PROTROM_HEADER_PATTERN_CANDIDATE (0x02)
/** Protocol types*/
typedef enum {
PROTO_PROTROM = 0xFB, /**< PROTROM protocol identification number. */
} Protrom_Protocol_t;
/** Header for command and bulk protocol */
typedef struct {
uint8 HeaderPattern; /**< Header pattern for marking header start.*/
uint8 Protocol; /**< Protocol type. */
uint8 SourceAddress; /**< Source address. */
uint8 DestinationAddress; /**< Destionation address. */
uint8 ReservedField; /**< Reserved field. */
uint16 PayloadLength; /**< Payload length. */
} Protrom_Header_t;
/** @} */
/** @} */
/** @} */
#endif /*T_PROTROM_HEADER_H_*/
|