mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-31 10:39:57 -04:00
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:
parent
7aca7ce74d
commit
033c4e9a5b
599 changed files with 70746 additions and 66896 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue