summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/HAL/avr/atmega1281/zigBit/include/halAtmelUid.h
blob: d393196664db66741c318ceba2e3027182651431 (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
/**************************************************************************//**
  \file  halAtmelUid.h

  \brief The header file describes the UID interface for Atmel MeshBean.

  \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:
    10/12/10 A. Malkin - Created
 ******************************************************************************/
/******************************************************************************
 *   WARNING: CHANGING THIS FILE MAY AFFECT CORE FUNCTIONALITY OF THE STACK.  *
 *   EXPERT USERS SHOULD PROCEED WITH CAUTION.                                *
 ******************************************************************************/

#ifndef _HALATMELUID_H
#define _HALATMELUID_H

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

/******************************************************************************
                   Definitions section
******************************************************************************/
#define SINGLE_WIRE_SUCCESS_STATUS 0
#define SINGLE_WIRE_ERROR_STATUS -1

/******************************************************************************
                   Types section
******************************************************************************/
/** \brief uid type. */
typedef union
{
  uint64_t uid;
  uint8_t array[sizeof(uint64_t)];
} HalUid_t;

/******************************************************************************
                 Inline static functions prototypes section.
******************************************************************************/
HAL_ASSIGN_PIN(SINGLE_WIRE, G, 5);  // Macros for the Single-wire pin actions.

/******************************************************************************
                   Prototypes section
******************************************************************************/
/**************************************************************************//**
\brief Reads Atmel MeshBean UID from ATTiny13A

\param[in] uidBuffer - memory for unique ID.

\return
    SINGLE_WIRE_SUCCESS_STATUS - if UID read successfully;
    SINGLE_WIRE_ERROR_STATUS - if error occured during UID read.
******************************************************************************/
int halReadAtmelMeshbeanUid(uint8_t *uidBuffer);

#endif /* _HALATMELUID_H */

// eof halAtmelUid.h