RTEMS  5.1
switch-nxp-pca9548a.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
11  *
12  * embedded brains GmbH
13  * Dornierstr. 4
14  * 82178 Puchheim
15  * Germany
16  * <rtems@embedded-brains.de>
17  *
18  * The license and distribution terms for this file may be
19  * found in the file LICENSE in this distribution or at
20  * http://www.rtems.org/license/LICENSE.
21  */
22 
23 #ifndef _DEV_I2C_SWITCH_NXP_PCA9548A_H
24 #define _DEV_I2C_SWITCH_NXP_PCA9548A_H
25 
26 #include <dev/i2c/i2c.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31 
42 int i2c_dev_register_switch_nxp_pca9548a(
43  const char *bus_path,
44  const char *dev_path,
45  uint16_t address
46 );
47 
48 #define SWITCH_NXP_PCA9548A_GET_CONTROL (I2C_DEV_IO_CONTROL + 0)
49 
50 #define SWITCH_NXP_PCA9548A_SET_CONTROL (I2C_DEV_IO_CONTROL + 1)
51 
52 static inline int switch_nxp_pca9548a_get_control(int fd, uint8_t *val)
53 {
54  return ioctl(fd, SWITCH_NXP_PCA9548A_GET_CONTROL, val);
55 }
56 
57 static inline int switch_nxp_pca9548a_set_control(int fd, uint8_t val)
58 {
59  return ioctl(fd, SWITCH_NXP_PCA9548A_SET_CONTROL, (void *)(uintptr_t) val);
60 }
61 
64 #ifdef __cplusplus
65 }
66 #endif /* __cplusplus */
67 
68 #endif /* _DEV_I2C_SWITCH_NXP_PCA9548A_H */
Inter-Integrated Circuit (I2C) Driver API.