i2c_general.h
Go to the documentation of this file.
/* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
void i2c_general_setup_master(bool fast);
bool i2c_general_check(void);
bool i2c_general_start(void);
bool i2c_general_select_slave(uint8_t slave, bool write);
bool i2c_general_read(uint8_t* data, size_t data_size);
bool i2c_general_write(const uint8_t* data, size_t data_size);
void i2c_general_stop(void);
i2c_general_setup_master
void i2c_general_setup_master(bool fast)
setup I2C peripheral
Definition: i2c_general.c:50
i2c_general_select_slave
bool i2c_general_select_slave(uint8_t slave, bool write)
select slave device
Definition: i2c_general.c:122
i2c_general_read
bool i2c_general_read(uint8_t *data, size_t data_size)
read data
Definition: i2c_general.c:157
i2c_general_stop
void i2c_general_stop(void)
sent stop condition
Definition: i2c_general.c:223
i2c_general_start
bool i2c_general_start(void)
send start condition
Definition: i2c_general.c:102
i2c_general_write
bool i2c_general_write(const uint8_t *data, size_t data_size)
write data
Definition: i2c_general.c:193
i2c_general_check
bool i2c_general_check(void)
check if SDA and SCL signals are high
Definition: i2c_general.c:97