summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/MAC_PHY/MAC_HWI/include/machwiMemAccess.h
blob: ac75894f81de26eca1b0d99c644b336b2eb5b365 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/******************************************************************************
  \file machwiMemAccess.h
  
  \brief Provides access to MACHWI memory .

  \author
    Atmel Corporation: http://www.atmel.com \n
    Support email: avr@atmel.com

  Copyright (c) 2008-2011, Atmel Corporation. All rights reserved.
  Licensed under Atmel's Limited License Agreement (BitCloudTM).
  
  \internal
    History:     
      11/07/08 A. Mandychev - Created.
******************************************************************************/

#ifndef _MACHWIMEMACCESS_H
#define _MACHWIMEMACCESS_H

/******************************************************************************
                    Includes section
******************************************************************************/
#include <types.h>
#include <macMem.h>

/******************************************************************************
                    Define(s) section
******************************************************************************/

/******************************************************************************
                    Types section
******************************************************************************/

/******************************************************************************
                        External variables.
******************************************************************************/

/******************************************************************************
                        Inline static functions prototypes section.
******************************************************************************/
/******************************************************************************
  Gets address of MACHWI memory.
  Parameters: none.
  returns: Address of MACHWI memory.
******************************************************************************/
INLINE MachwiMem_t* machwiGetMem(void)
{
  return &macMem.hwi;
}

/******************************************************************************
  Stores the pointer to the current request.
  Parameters:
    req - pointer to the current request.
  returns:
    none.
******************************************************************************/
INLINE void machwiStoreReqParams(void *req)
{
  machwiGetMem()->machwiReq = req;
}

/******************************************************************************
  Gets the pointer to the current request.
  Parameters:
    none.
  returns:
    Pointer to the current request.
******************************************************************************/
INLINE void* machwiGetReqParams(void)
{
  return machwiGetMem()->machwiReq;
}

/**************************************************************************//**
 \brief  Allocates memory to execute request to MAC HWD sublayer.
 
 \return none.
******************************************************************************/
INLINE MachwiHwdReqDescr_t* machwiGetHwdReqMem(void)
{
  return &machwiGetMem()->machwdReq;
}

#endif /* _MACHWIMEM_H */

// eof machwiMemAccess.h