Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Switch NXP PCA9548A Driver API |
---|
5 | * |
---|
6 | * @ingroup I2CSWITCHNXPPCA9548A |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * Copyright (c) 2014 embedded brains GmbH. All rights reserved. |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.org/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #ifndef _DEV_I2C_SWITCH_NXP_PCA9548A_H |
---|
18 | #define _DEV_I2C_SWITCH_NXP_PCA9548A_H |
---|
19 | |
---|
20 | #include <dev/i2c/i2c.h> |
---|
21 | |
---|
22 | #ifdef __cplusplus |
---|
23 | extern "C" { |
---|
24 | #endif /* __cplusplus */ |
---|
25 | |
---|
26 | /** |
---|
27 | * @defgroup I2CSWITCHNXPPCA9548A Switch NXP PCA9535 Driver |
---|
28 | * |
---|
29 | * @ingroup I2CDevice |
---|
30 | * |
---|
31 | * @brief Driver for NXP PCA9548A 8-channel switch device. |
---|
32 | * |
---|
33 | * @{ |
---|
34 | */ |
---|
35 | |
---|
36 | int i2c_dev_register_switch_nxp_pca9548a( |
---|
37 | const char *bus_path, |
---|
38 | const char *dev_path, |
---|
39 | uint16_t address |
---|
40 | ); |
---|
41 | |
---|
42 | #define SWITCH_NXP_PCA9548A_GET_CONTROL (I2C_DEV_IO_CONTROL + 0) |
---|
43 | |
---|
44 | #define SWITCH_NXP_PCA9548A_SET_CONTROL (I2C_DEV_IO_CONTROL + 1) |
---|
45 | |
---|
46 | static inline int switch_nxp_pca9548a_get_control(int fd, uint8_t *val) |
---|
47 | { |
---|
48 | return ioctl(fd, SWITCH_NXP_PCA9548A_GET_CONTROL, val); |
---|
49 | } |
---|
50 | |
---|
51 | static inline int switch_nxp_pca9548a_set_control(int fd, uint8_t val) |
---|
52 | { |
---|
53 | return ioctl(fd, SWITCH_NXP_PCA9548A_SET_CONTROL, (void *)(uintptr_t) val); |
---|
54 | } |
---|
55 | |
---|
56 | /** @} */ |
---|
57 | |
---|
58 | #ifdef __cplusplus |
---|
59 | } |
---|
60 | #endif /* __cplusplus */ |
---|
61 | |
---|
62 | #endif /* _DEV_I2C_SWITCH_NXP_PCA9548A_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.