at24mac.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Benjamin Valentin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #pragma once
10 
22 #include <stdint.h>
23 #include "net/eui48.h"
24 #include "net/eui64.h"
25 #include "periph/i2c.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
34 typedef uint_fast8_t at24mac_t;
35 
36 #define AT24MAC_ID_LEN (16)
41 typedef enum {
43  AT24MAC6XX
45 
49 typedef struct {
51  uint8_t i2c_addr;
54 
65 
76 
87 int at24mac_get_id128(at24mac_t dev, void *dst);
88 
98 
99 #ifdef __cplusplus
100 }
101 #endif
102 
Definition and IPv6 IID conversion for IEEE EUI-48 identifiers.
EUI-64 data type definition.
int at24mac_get_eui64(at24mac_t dev, eui64_t *addr)
Get the unique EUI64 address from a AT24MAC6xx chip.
at24mac_type_t at24mac_get_type(at24mac_t dev)
Get the type of a AT24MACxxx chip.
int at24mac_get_id128(at24mac_t dev, void *dst)
Get the unique ID from a AT24MACxxx chip.
uint_fast8_t at24mac_t
Device handle type for AT24Mac devices.
Definition: at24mac.h:34
int at24mac_get_eui48(at24mac_t dev, eui48_t *addr)
Get the unique EUI48 address from a AT24MAC4xx chip.
at24mac_type_t
Type of the AT24Mac device.
Definition: at24mac.h:41
@ AT24MAC4XX
provides EUI-48
Definition: at24mac.h:42
@ AT24MAC6XX
provides EUI-64
Definition: at24mac.h:43
uint_fast8_t i2c_t
Default i2c_t type definition.
Definition: i2c.h:144
Low-level I2C peripheral driver interface definition.
struct holding all params needed for device communication
Definition: at24mac.h:49
uint8_t i2c_addr
I2C address
Definition: at24mac.h:51
i2c_t i2c_dev
I2C device
Definition: at24mac.h:50
at24mac_type_t type
Device type
Definition: at24mac.h:52
Data type to represent an EUI-48.
Definition: eui48.h:34
Data type to represent an EUI-64.
Definition: eui64.h:55