Move doc comments to header

This commit is contained in:
jazzpi
2022-06-12 15:15:53 +02:00
parent e503dbe632
commit 36c6bf2997
2 changed files with 43 additions and 51 deletions

View File

@ -16,13 +16,50 @@
typedef enum { BQ_COMM_OK, BQ_COMM_ERR_HAL, BQ_COMM_ERR_CRC } BQ_Comm_Status;
/**
* @brief Defines UART and DMA Handle
*
* Always call the init routine before using any other function of the libary.
*/
void init_BQCom(UART_HandleTypeDef* uarthandle);
/**
* @brief Calculate CRC according to BQ spec.
*
* @param message_buffer Message buffer, including two bytes for the CRC. The
* CRC will be written to the last two bytes.
* @param bufferlength The length of message_buffer, including the two bytes for
* the CRC.
*
* @return 0 if the buffer is to small
* @return 1 if the function was successful
*/
uint16_t Calculate_CRC(uint8_t* message_buffer, uint16_t bufferlength);
/**
* @brief Checks if the CRC is correct
*
* @return 0 if the Buffer is too small or the CRC is incorrect
* @return 1 if the CRC is correct
*/
uint16_t Check_CRC(uint8_t* message_buffer, uint16_t bufferlength);
/**
* @brief Writes data to a register of the BQ76.
*
* @param registeraddress specifies the register. Address definitions are
* available in BQ_Register_Definitions.h
* @param registersize defines the register size in bytes.
* @param data defines the data written to the BQ
*/
uint32_t BQ_Write_Register(uint8_t registeraddress, uint8_t registersize,
uint32_t data);
/**
* @brief Read the data of a register specified by its address
*
* @param registeraddress specifies the register. Address definitions are
* available in BQ_Register_Definitions.h
* @param registersize defines the register size in bytes.
*/
uint8_t BQ_Read_Register(uint8_t registeraddress, uint8_t registersize,
uint32_t* data);
/**
@ -32,9 +69,14 @@ uint8_t BQ_Read_Register(uint8_t registeraddress, uint8_t registersize,
* Buffer size should be 2xMeasured Voltages
*/
BQ_Comm_Status BQ_ReadMeasurements(uint8_t* buffer, uint8_t bufferlength);
uint8_t Communication_Reset();
/**
* @brief Hardware layer implementation of the UART transmit
*/
uint8_t BQ_UART_Transmit(uint8_t* message_buffer, uint16_t bufferlength);
/**
* @brief Hardware layer implementation of the UART receive
*/
uint8_t BQ_UART_Receive(uint8_t* message_buffer, uint16_t bufferlength);
#endif