Commit 59e8d7d5 authored by Andreas Werner's avatar Andreas Werner
Browse files

fix docu and update ltc6811 driverr

parent c6a8d4be
......@@ -69,5 +69,4 @@ HAL_DEFINE_GLOBAL_ARRAY(can);
# define CAN_UP(ns, c) int32_t ns##_can_up(struct can *c)
# define CAN_DOWN(ns, c) int32_t ns##_can_down(struct can *c)
#endif
/**\}*/
#endif
......@@ -135,7 +135,7 @@ int32_t i2c_recv(struct i2c *i2c, uint16_t id, uint8_t *data, uint32_t len, Tick
* \param id ID if id > 7-Bit Exended IDs is used
* \param sendData Send Data
* \param sendLen Send len
* \param recvdData Recv Data
* \param recvData Recv Data
* \param recvLen Recv len
* \param waittime max waittime in mutex or isr lock see xSemaphoreTake()
* \return -1 on error 0 on ok
......@@ -166,7 +166,7 @@ int32_t i2c_recvISR(struct i2c *i2c, uint16_t id, uint8_t *data, uint32_t len);
* \param id ID if id > 7-Bit Exended IDs is used
* \param sendData Send Data
* \param sendLen Send len
* \param recvdData Recv Data
* \param recvData Recv Data
* \param recvLen Recv len
* \return -1 on error 0 on ok
*/
......
......@@ -57,6 +57,5 @@ HAL_DEFINE_GLOBAL_ARRAY(i2c);
# define I2C_RECV_ISR(ns, i, id, data, len) int32_t i2c_recvISR(struct i2c *i, uint16_t id, uint8_t *data, uint32_t len)
# define I2C_TRANSVER_ISR(ns, i, id, sendData, sendLen, recvData, recvLen) int32_t ns##_i2c_transferISR(struct i2c *i, uint16_t id, uint8_t *sendData, uint32_t sendLen, uint8_t *recvData, uint32_t recvLen)
#endif
/**\}*/
#endif
This diff is collapsed.
......@@ -53,5 +53,4 @@ HAL_DEFINE_GLOBAL_ARRAY(mailbox);
# define MAILBOX_SEND_ISR(ns, p, data) int32_t ns##_mailbox_sendISR(struct mailbox *p, uint32_t data)
# define MAILBOX_RECV_ISR(ns, p, data) int32_t ns##_mailbox_recvISR(struct mailbox *p, uint32_t *data)
#endif
/**\}*/
#endif
......@@ -456,6 +456,9 @@ struct mpu9250_vector {
* MPU9250 init
* \param index Driver Index
* \param waittime max waittime in mutex or isr lock see xSemaphoreTake()
* \param spi SPI Device
* \param cs CS Number or SPI_OPT_CS_DIS
* \param gpio GPIO Pin Number or SPI_OPT_GPIO_DIS
* \return MPU9250 Instance or NULL on error
*/
struct mpu9250 *mpu9250_init(uint32_t index, struct spi *spi, uint8_t cs, uint16_t gpio, TickType_t waittime);
......@@ -501,10 +504,6 @@ extern const struct accel_ops mpu9250_accel_ops;
* this Macro to define a new MPU9250 dev
* \warning do not use the created Variable directly! Use the init function!
* \param id Unique identifier
* \param spi_id Index of SPI Dev
* \param cs_id CS Number or SPI_OPT_CS_DIS
* \param gpio_id GPIO Pin Number or SPI_OPT_GPIO_DIS
* \param baut Bautrate
*/
#define MPU9250_ADDDEV(id) \
struct mpu9250 mpu9250_##id; \
......
......@@ -10,12 +10,14 @@
#include <system.h>
#include <stdbool.h>
/**
* \defgroup Operation System Layer for FreeRTOS
* \defgroup OS Operation System Layer for FreeRTOS
* \ingroup HAL
*
* \code
* #include <os.h>
* \endcode
*
* \{
*/
#ifdef CONFIG_USE_STATIC
# define OS_DEFINE_TASK(name, stackSize) StaticTask_t name##_buffer; StackType_t name##_stack[stackSize]; TaskHandle_t name;
......
......@@ -119,5 +119,4 @@ HAL_DEFINE_GLOBAL_ARRAY(sd);
# define SD_WIRTE_ISR(ns, s, c, arg, l, d) static int32_t ns##_sd_writeISR(struct sd *s, uint32_t c, uint32_t arg, size_t l, uint32_t *d)
# define SD_READ_ISR(ns, s, c, arg, l, d) static int32_t ns##_sd_readISR(struct sd *s, uint32_t c, uint32_t arg, size_t l, uint32_t *d)
#endif
/**\}*/
#endif
......@@ -354,5 +354,4 @@ inline int32_t spiSlave_recvISR(struct spi_slave *slave, uint16_t *data, uint32_
return s->ops->spiSlave_recvISR(slave, data, len);
}
#endif
/**\}*/
#endif
......@@ -104,7 +104,7 @@ ltc6811_slave_init_error0:
return NULL;
}
int32_t ltc6811_write(struct ltc6811 *ltc, enum ltc_cmd cmd, uint8_t *data, uint32_t dataLen) {
int32_t ltc6811_write(struct ltc6811 *ltc, ltc_cmd_t cmd, uint8_t *data, uint32_t dataLen) {
uint32_t len = 2 /* Command */ + 2 /* Command PEC */ + dataLen /* Data inclusive PEC! */;
uint16_t *sendData = alloca(len);
uint16_t *recvData = alloca(len);
......@@ -131,7 +131,7 @@ int32_t ltc6811_write(struct ltc6811 *ltc, enum ltc_cmd cmd, uint8_t *data, uint
return 0;
}
int32_t ltc6811_read(struct ltc6811 *ltc, enum ltc_cmd cmd, uint8_t *data, uint32_t lenData) {
int32_t ltc6811_read(struct ltc6811 *ltc, ltc_cmd_t cmd, uint8_t *data, uint32_t lenData) {
uint32_t len = 2 /* Command */ + 2 /* Command PEC */ + lenData /* Data inclusive PEC! */;
uint16_t *sendData = alloca(len);
uint16_t *recvData = alloca(len);
......@@ -158,7 +158,7 @@ int32_t ltc6811_read(struct ltc6811 *ltc, enum ltc_cmd cmd, uint8_t *data, uint3
return 0;
}
int32_t ltc6811_writeRegister(struct ltc6811 *ltc, enum ltc_cmd cmd, uint8_t *newData, uint8_t *oldData) {
int32_t ltc6811_writeRegister(struct ltc6811 *ltc, ltc_cmd_t cmd, uint8_t *newData, uint8_t *oldData) {
int i;
int16_t pec;
uint8_t *data = alloca(ltc->numberOfSlaves * 8);
......@@ -188,7 +188,7 @@ int32_t ltc6811_writeRegister(struct ltc6811 *ltc, enum ltc_cmd cmd, uint8_t *ne
return ltc6811_write(ltc, cmd, data, ltc->numberOfSlaves * 8);
}
int32_t ltc6811_readRegister(struct ltc6811 *ltc, enum ltc_cmd cmd, uint8_t *registerContent) {
int32_t ltc6811_readRegister(struct ltc6811 *ltc, ltc_cmd_t cmd, uint8_t *registerContent) {
int i;
int j;
int16_t pec;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment