Project

General

Profile

Statistics
| Revision:

root / lab4 / .minix-src / include / minix / i2cdriver.h @ 13

History | View | Annotate | Download (1.35 KB)

1 13 up20180614
/* Prototypes and definitions for i2c drivers. */
2
3
#ifndef _MINIX_I2CDRIVER_H
4
#define _MINIX_I2CDRIVER_H
5
6
#include <minix/endpoint.h>
7
#include <minix/i2c.h>
8
#include <minix/ipc.h>
9
10
/* Functions defined by i2cdriver.c: */
11
int i2cdriver_env_parse(uint32_t * bus, i2c_addr_t * address,
12
                                                i2c_addr_t * valid_addrs);
13
void i2cdriver_announce(uint32_t bus);
14
endpoint_t i2cdriver_bus_endpoint(uint32_t bus);
15
int i2cdriver_subscribe_bus_updates(uint32_t bus);
16
void i2cdriver_handle_bus_update(endpoint_t * bus_endpoint, uint32_t bus,
17
                                                        i2c_addr_t address);
18
int i2cdriver_reserve_device(endpoint_t bus_endpoint, i2c_addr_t address);
19
int i2cdriver_exec(endpoint_t bus_endpoint, minix_i2c_ioctl_exec_t *ioctl_exec);
20
21
int i2creg_raw_read8(endpoint_t bus, i2c_addr_t addr, uint8_t * val);
22
int i2creg_read8(endpoint_t bus, i2c_addr_t addr, uint8_t reg, uint8_t * val);
23
int i2creg_read16(endpoint_t bus, i2c_addr_t addr, uint8_t reg, uint16_t * val);
24
int i2creg_read24(endpoint_t bus, i2c_addr_t addr, uint8_t reg, uint32_t * val);
25
int i2creg_raw_write8(endpoint_t bus, i2c_addr_t addr, uint8_t val);
26
int i2creg_write8(endpoint_t bus, i2c_addr_t addr, uint8_t reg, uint8_t val);
27
int i2creg_set_bits8(endpoint_t bus, i2c_addr_t addr, uint8_t reg,
28
                                                                uint8_t bits);
29
int i2creg_clear_bits8(endpoint_t bus, i2c_addr_t addr, uint8_t reg,
30
                                                                uint8_t bits);
31
32
#endif /* _MINIX_I2CDRIVER_H */