summaryrefslogtreecommitdiff
path: root/lcmodule/source/cnh1606344_ldr_communication_module/include/r_z_family.h
blob: 8bb577f93fcd3f1498b604081c63072625ed9f09 (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
68
69
70
71
72
/*******************************************************************************
 * Copyright (C) ST-Ericsson SA 2011
 * License terms: 3-clause BSD license
 ******************************************************************************/
#ifndef INCLUSION_GUARD_R_Z_FAMILY_H
#define INCLUSION_GUARD_R_Z_FAMILY_H
/**
 *  @addtogroup ldr_communication_module
 *  @{
 *    @addtogroup Z_family Z protocol family
 *    The Z family include only one protocol, Z protocol, used for
 *    communication between the ROM code and PC tool. This module include
 *    Z transport layer and Z network layer for handling Z protocol. The Z
 *    network layer receive and send byte by byte because the format of the
 *    Z protocol do not have one strict format.
 *
 *    @{
 */

/*******************************************************************************
 * Includes
 ******************************************************************************/
#include "t_z_protocol.h"
#include "error_codes.h"
#include "t_communication_service.h"
#include "t_z_network.h"

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

#define Z_TRANSPORT(x) (&((Z_FamilyContext_t *) (x)->FamilyContext_p)->Transport)
#define Z_NETWORK(x) (&((Z_FamilyContext_t *) (x)->FamilyContext_p)->Network)

/**
 * Z family protocols initialization.
 *
 * Z transport and Z network layer will be initialized.
 *
 * @param [in] Communication_p Communication module context.
 *
 * @retval  E_SUCCESS                   After successful execution.
 * @retval  E_INVALID_INPUT_PARAMETERS  Invalid input parameter.
 */
ErrorCode_e Z_Family_Init(Communication_t *Communication_p);

/**
 * Z family protocols shutdown.
 *
 * Z transport and Z network layer will be shutdown.
 *
 * @param [in] Communication_p Communication module context.
 *
 * @retval  E_SUCCESS                   After successful execution.
 * @retval  E_INVALID_INPUT_PARAMETERS  Invalid input parameter.
 */
ErrorCode_e Z_Family_Shutdown(Communication_t *Communication_p);

/*
 * Z family Cancel Transmition.
 *
 * @param [in] Communication_p Communication module context.
 * @param [in] PacketsBeforeTransferStop Number of packets that will be transmited before stopping the transmition.
 *
 * @retval  E_SUCCESS                   After successful execution.
 * @retval  E_INVALID_INPUT_PARAMETERS  Invalid input parameter.
 */
ErrorCode_e Z_CancelReceiver(Communication_t *Communication_p, uint8 PacketsBeforeTransferStop);

/**     @} */
/** @} */
#endif //INCLUSION_GUARD_R_Z_FAMILY_H