foxBMS - Unit Tests
1.4.1
The foxBMS Unit Tests API Documentation
|
Driver for the I2C module. More...
#include "i2c.h"
#include "database.h"
#include "diag.h"
#include "dma.h"
#include "fsystem.h"
#include "mcu.h"
Go to the source code of this file.
Functions | |
void | I2C_Initialize (void) |
STD_RETURN_TYPE_e | I2C_Read (uint32_t slaveAddress, uint8_t readAddress, uint32_t nrBytes, uint8_t *readData) |
reads from an I2C slave, blocking. More... | |
STD_RETURN_TYPE_e | I2C_ReadDirect (uint32_t slaveAddress, uint32_t nrBytes, uint8_t *readData) |
reads from an I2C slave, no register address written first, blocking. More... | |
STD_RETURN_TYPE_e | I2C_Write (uint32_t slaveAddress, uint8_t writeAddress, uint32_t nrBytes, uint8_t *writeData) |
writes to an I2C slave, blocking. More... | |
STD_RETURN_TYPE_e | I2C_WriteDirect (uint32_t slaveAddress, uint32_t nrBytes, uint8_t *writeData) |
writes to an I2C slave, no register address written first, blocking. More... | |
STD_RETURN_TYPE_e | I2C_ReadDma (uint32_t slaveAddress, uint8_t readAddress, uint32_t nrBytes, uint8_t *readData) |
reads from an I2C slave, using DMA. More... | |
STD_RETURN_TYPE_e | I2C_WriteDma (uint32_t slaveAddress, uint8_t writeAddress, uint32_t nrBytes, uint8_t *writeData) |
writes to an I2C slave, using DMA. More... | |
void | I2C_SetStopNow (void) |
sets stop condition. More... | |
Driver for the I2C module.
SPDX-License-Identifier: BSD-3-Clause
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
We kindly request you to use one or more of the following phrases to refer to foxBMS in your hardware, software, documentation or advertising materials:
Definition in file i2c.c.
void I2C_Initialize | ( | void | ) |
STD_RETURN_TYPE_e I2C_Read | ( | uint32_t | slaveAddress, |
uint8_t | readAddress, | ||
uint32_t | nrBytes, | ||
uint8_t * | readData | ||
) |
reads from an I2C slave, blocking.
slaveAddress | address of slave to communicate with |
readAddress | address of first register to read from |
nrBytes | number of registers to read |
readData | buffer containing the read data |
Definition at line 79 of file i2c.c.
STD_RETURN_TYPE_e I2C_ReadDirect | ( | uint32_t | slaveAddress, |
uint32_t | nrBytes, | ||
uint8_t * | readData | ||
) |
reads from an I2C slave, no register address written first, blocking.
slaveAddress | address of slave to communicate with |
nrBytes | number of registers to read |
readData | buffer containing the read data |
Definition at line 184 of file i2c.c.
STD_RETURN_TYPE_e I2C_ReadDma | ( | uint32_t | slaveAddress, |
uint8_t | readAddress, | ||
uint32_t | nrBytes, | ||
uint8_t * | readData | ||
) |
reads from an I2C slave, using DMA.
slaveAddress | address of slave to communicate with |
readAddress | address of first register to read from |
nrBytes | number of registers to read |
readData | buffer containing the read data |
Definition at line 434 of file i2c.c.
STD_RETURN_TYPE_e I2C_Write | ( | uint32_t | slaveAddress, |
uint8_t | writeAddress, | ||
uint32_t | nrBytes, | ||
uint8_t * | writeData | ||
) |
writes to an I2C slave, blocking.
slaveAddress | address of slave to communicate with |
writeAddress | address of first register to write to |
nrBytes | number of registers to write |
writeData | buffer containing the data to write |
Definition at line 257 of file i2c.c.
STD_RETURN_TYPE_e I2C_WriteDirect | ( | uint32_t | slaveAddress, |
uint32_t | nrBytes, | ||
uint8_t * | writeData | ||
) |
writes to an I2C slave, no register address written first, blocking.
slaveAddress | address of slave to communicate with |
nrBytes | number of registers to write |
writeData | buffer containing the data to write |
Definition at line 357 of file i2c.c.
STD_RETURN_TYPE_e I2C_WriteDma | ( | uint32_t | slaveAddress, |
uint8_t | writeAddress, | ||
uint32_t | nrBytes, | ||
uint8_t * | writeData | ||
) |
writes to an I2C slave, using DMA.
slaveAddress | address of slave to communicate with |
writeAddress | address of first register to write to |
nrBytes | number of registers to write |
writeData | buffer containing the data to write |
Definition at line 501 of file i2c.c.