summaryrefslogtreecommitdiff
path: root/lcmodule/source/cnh1606344_ldr_communication_module/include/r_a2_family.h
blob: 867317ed760a1c6c191d96fe8d1dc1bfbf303d3a (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
64
65
66
67
/*******************************************************************************
 * Copyright (C) ST-Ericsson SA 2011
 * License terms: 3-clause BSD license
 ******************************************************************************/
#ifndef _INCLUSION_GUARD_R_A2_FAMILY_H_
#define _INCLUSION_GUARD_R_A2_FAMILY_H_
/**
 *  @addtogroup ldr_communication_serv
 *  @{
 *    @addtogroup a2_family A2 protocol family
 *    The A2 family include only one protocol, A2 protocol, used for
 *    communication between the ME and PC tool. This module includes
 *    A2 transport layer and A2 network layer for handling A2 protocol.
 *
 *    @{
 */

/*******************************************************************************
 * Includes
 ******************************************************************************/
#include "t_a2_family.h"
#include "error_codes.h"

/*******************************************************************************
 * Declaration of functions
 ******************************************************************************/

#define A2_TRANSPORT(x) (&((A2_FamilyContext_t *) (x)->FamilyContext_p)->Transport)
#define A2_NETWORK(x) (&((A2_FamilyContext_t *) (x)->FamilyContext_p)->Network)
#define A2_SPEEDFLASH(x) (((volatile A2_SpeedflashContext_t*)&((A2_FamilyContext_t *) (x)->FamilyContext_p)->Speedflash))

/**
 * A2 family protocols initialization.
 *
 * @param [in] Communication_p Communication module context.
 *
 * @retval  E_SUCCESS                   After successful execution.
 * @retval  E_INVALID_INPUT_PARAMETERS  Invalid input parameter.
 */
ErrorCode_e A2_Family_Init(Communication_t *Communication_p);

/**
 * A2 family protocols shutdown.
 *
 * @param [in] Communication_p Communication module context.
 *
 * @retval  E_SUCCESS                   After successful execution.
 * @retval  E_INVALID_INPUT_PARAMETERS  Invalid input parameter.
 */
ErrorCode_e A2_Family_Shutdown(Communication_t *Communication_p);

/*
 * A2 Cancel Receiver.
 *
 * @param [in] Communication_p           Communication module context.
 * @param [in] PacketsBeforeTransferStop Number of packets that will be
 *                                       transmitted before stopping the
 *                                       transmission.
 *
 * @retval  E_SUCCESS                   After successful execution.
 * @retval  E_INVALID_INPUT_PARAMETERS  Invalid input parameter.
 */
ErrorCode_e A2_CancelReceiver(Communication_t *Communication_p, uint8 PacketsBeforeTransferStop);

/** @} */
/** @} */
#endif //_INCLUSION_GUARD_R_A2_FAMILY_H_