Formatted code (#1007)

* Updated style

* Updated files

* fixed new line

* Updated spacing

* File fix WIP

* Updated to clang 13

* updated comment style

* Removed old comment code
This commit is contained in:
jLynx 2023-05-19 08:16:05 +12:00 committed by GitHub
parent 7aca7ce74d
commit 033c4e9a5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
599 changed files with 70746 additions and 66896 deletions

View file

@ -22,44 +22,43 @@
#include "i2c_pp.hpp"
void I2C::start(const I2CConfig& config) {
i2cStart(_driver, &config);
i2cStart(_driver, &config);
}
void I2C::stop() {
i2cStop(_driver);
i2cStop(_driver);
}
bool I2C::transfer(
const address_t slave_address,
const uint8_t* const data_tx, const size_t count_tx,
uint8_t* const data_rx, const size_t count_rx,
systime_t timeout
) {
i2cAcquireBus(_driver);
const msg_t status = i2cMasterTransmitTimeout(
_driver, slave_address, data_tx, count_tx, data_rx, count_rx, timeout
);
i2cReleaseBus(_driver);
return (status == RDY_OK);
const address_t slave_address,
const uint8_t* const data_tx,
const size_t count_tx,
uint8_t* const data_rx,
const size_t count_rx,
systime_t timeout) {
i2cAcquireBus(_driver);
const msg_t status = i2cMasterTransmitTimeout(
_driver, slave_address, data_tx, count_tx, data_rx, count_rx, timeout);
i2cReleaseBus(_driver);
return (status == RDY_OK);
}
bool I2C::receive(
const address_t slave_address,
uint8_t* const data, const size_t count,
systime_t timeout
) {
i2cAcquireBus(_driver);
const msg_t status = i2cMasterReceiveTimeout(
_driver, slave_address, data, count, timeout
);
i2cReleaseBus(_driver);
return (status == RDY_OK);
const address_t slave_address,
uint8_t* const data,
const size_t count,
systime_t timeout) {
i2cAcquireBus(_driver);
const msg_t status = i2cMasterReceiveTimeout(
_driver, slave_address, data, count, timeout);
i2cReleaseBus(_driver);
return (status == RDY_OK);
}
bool I2C::transmit(
const address_t slave_address,
const uint8_t* const data, const size_t count,
systime_t timeout
) {
return transfer(slave_address, data, count, NULL, 0, timeout);
const address_t slave_address,
const uint8_t* const data,
const size_t count,
systime_t timeout) {
return transfer(slave_address, data, count, NULL, 0, timeout);
}