MiraOS  1.22
mira_i2c.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (C) 2016 LumenRadio AB *
3  * *
4  * This file is part of MiraOS. *
5  * *
6  * MiraOS contains software components that are patented by LumenRadio. *
7  * Use of this software is under the terms of the LumenRadio MiraOS *
8  * license.
9  * *
10  * You should have received a copy of the MiraOS license from your *
11  * LumenRadio representative. If not, email to <licenses@lumenradio.com> *
12  ****************************************************************************/
13 
25 #ifndef LIBMIRA_I2C_H_
26 #define LIBMIRA_I2C_H_
27 
28 #include <stdint.h>
29 
35 typedef enum {
38 } MiraI2CSpeed;
39 
45 typedef enum {
49 
55 typedef enum {
62 
71 void mira_i2c_init(MiraI2CSpeed speed, MiraI2CPullupMode pullups);
72 
81 MiraI2CErrorCodeFlags mira_i2c_single_send(uint8_t address, uint8_t data);
82 
91 MiraI2CErrorCodeFlags mira_i2c_single_receive(uint8_t address, uint8_t* data_pointer);
92 
102 MiraI2CErrorCodeFlags mira_i2c_burst_send(uint8_t address, uint8_t* data_pointer, uint8_t length);
103 
113 MiraI2CErrorCodeFlags mira_i2c_burst_receive(uint8_t address, uint8_t* data_pointer, uint8_t length);
114 
127 MiraI2CErrorCodeFlags mira_i2c_generic_single_send(uint8_t address, uint8_t data, uint8_t send_start_and_address, uint8_t send_stop);
128 
141 MiraI2CErrorCodeFlags mira_i2c_generic_single_receive(uint8_t address, uint8_t* data_pointer, uint8_t send_start_and_address, uint8_t send_stop);
142 
143 #endif /* LIBMIRA_I2C_H_ */
MiraI2CErrorCodeFlags
Error codes for I2C master. Note that combination of errors can exist, in that case error codes are O...
Definition: mira_i2c.h:55
Definition: mira_i2c.h:47
MiraI2CSpeed
Supported I2C bus speeds.
Definition: mira_i2c.h:35
MiraI2CErrorCodeFlags mira_i2c_generic_single_send(uint8_t address, uint8_t data, uint8_t send_start_and_address, uint8_t send_stop)
Send a byte with optional start and stop conditions. Send a byte with optional start and stop conditi...
MiraI2CErrorCodeFlags mira_i2c_single_send(uint8_t address, uint8_t data)
Send a single byte.
MiraI2CErrorCodeFlags mira_i2c_single_receive(uint8_t address, uint8_t *data_pointer)
Receive a single byte.
Definition: mira_i2c.h:58
MiraI2CPullupMode
Supported pull-up options for the I2C bus.
Definition: mira_i2c.h:45
Definition: mira_i2c.h:56
MiraI2CErrorCodeFlags mira_i2c_generic_single_receive(uint8_t address, uint8_t *data_pointer, uint8_t send_start_and_address, uint8_t send_stop)
Read a byte with optional start and stop conditions. Read a byte with optional start and stop conditi...
Definition: mira_i2c.h:37
void mira_i2c_init(MiraI2CSpeed speed, MiraI2CPullupMode pullups)
Initialize the I2C driver.
MiraI2CErrorCodeFlags mira_i2c_burst_send(uint8_t address, uint8_t *data_pointer, uint8_t length)
Send multiple bytes.
Definition: mira_i2c.h:60
Definition: mira_i2c.h:59
MiraI2CErrorCodeFlags mira_i2c_burst_receive(uint8_t address, uint8_t *data_pointer, uint8_t length)
Receive multiple bytes.
Definition: mira_i2c.h:57
Definition: mira_i2c.h:46
Definition: mira_i2c.h:36