Cleanup comments

This commit is contained in:
Ben V. Brown
2022-11-20 18:16:17 +11:00
parent a15f10e5e7
commit d3ac9eb7b2

View File

@@ -89,14 +89,14 @@ intCallback_Type *i2cIntCbfArra[I2C_ID_MAX][I2C_INT_ALL] = {{NULL}};
* @{ * @{
*/ */
/****************************************************************************/ /** /**
* @brief I2C interrupt handler * @brief I2C interrupt handler
* *
* @param i2cNo: I2C ID type * @param i2cNo: I2C ID type
* *
* @return None * @return None
* *
*******************************************************************************/ *******************************************************************************/
#ifndef BFLB_USE_HAL_DRIVER #ifndef BFLB_USE_HAL_DRIVER
static void I2C_IntHandler(I2C_ID_Type i2cNo) { static void I2C_IntHandler(I2C_ID_Type i2cNo) {
uint32_t tmpVal; uint32_t tmpVal;
@@ -157,15 +157,15 @@ static void I2C_IntHandler(I2C_ID_Type i2cNo) {
* @{ * @{
*/ */
/****************************************************************************/ /** /**
* @brief I2C write word data * @brief I2C write word data
* *
* @param i2cNo: I2C ID type * @param i2cNo: I2C ID type
* @param data: Data word * @param data: Data word
* *
* @return None * @return None
* *
*******************************************************************************/ *******************************************************************************/
void I2C_SendWord(I2C_ID_Type i2cNo, uint32_t data) { void I2C_SendWord(I2C_ID_Type i2cNo, uint32_t data) {
uint32_t I2Cx = I2C_BASE; uint32_t I2Cx = I2C_BASE;
@@ -174,14 +174,14 @@ void I2C_SendWord(I2C_ID_Type i2cNo, uint32_t data) {
BL_WR_REG(I2Cx, I2C_FIFO_WDATA, data); BL_WR_REG(I2Cx, I2C_FIFO_WDATA, data);
} }
/****************************************************************************/ /** /**
* @brief I2C read word data * @brief I2C read word data
* *
* @param i2cNo: I2C ID type * @param i2cNo: I2C ID type
* *
* @return word data * @return word data
* *
*******************************************************************************/ *******************************************************************************/
uint32_t I2C_RecieveWord(I2C_ID_Type i2cNo) { uint32_t I2C_RecieveWord(I2C_ID_Type i2cNo) {
uint32_t I2Cx = I2C_BASE; uint32_t I2Cx = I2C_BASE;
@@ -190,14 +190,14 @@ uint32_t I2C_RecieveWord(I2C_ID_Type i2cNo) {
return BL_RD_REG(I2Cx, I2C_FIFO_RDATA); return BL_RD_REG(I2Cx, I2C_FIFO_RDATA);
} }
/****************************************************************************/ /** /**
* @brief I2C enable * @brief I2C enable
* *
* @param i2cNo: I2C ID type * @param i2cNo: I2C ID type
* *
* @return None * @return None
* *
*******************************************************************************/ *******************************************************************************/
void I2C_Enable(I2C_ID_Type i2cNo) { void I2C_Enable(I2C_ID_Type i2cNo) {
uint32_t tmpVal; uint32_t tmpVal;
uint32_t I2Cx = I2C_BASE; uint32_t I2Cx = I2C_BASE;
@@ -210,14 +210,14 @@ void I2C_Enable(I2C_ID_Type i2cNo) {
BL_WR_REG(I2Cx, I2C_CONFIG, tmpVal); BL_WR_REG(I2Cx, I2C_CONFIG, tmpVal);
} }
/****************************************************************************/ /** /**
* @brief I2C disable * @brief I2C disable
* *
* @param i2cNo: I2C ID type * @param i2cNo: I2C ID type
* *
* @return None * @return None
* *
*******************************************************************************/ *******************************************************************************/
void I2C_Disable(I2C_ID_Type i2cNo) { void I2C_Disable(I2C_ID_Type i2cNo) {
uint32_t tmpVal; uint32_t tmpVal;
uint32_t I2Cx = I2C_BASE; uint32_t I2Cx = I2C_BASE;
@@ -243,14 +243,14 @@ void I2C_Disable(I2C_ID_Type i2cNo) {
BL_WR_REG(I2Cx, I2C_INT_STS, tmpVal); BL_WR_REG(I2Cx, I2C_INT_STS, tmpVal);
} }
/****************************************************************************/ /** /**
* @brief I2C set global reset function * @brief I2C set global reset function
* *
* @param i2cNo: I2C ID type * @param i2cNo: I2C ID type
* *
* @return SUCCESS or ERROR * @return SUCCESS or ERROR
* *
*******************************************************************************/ *******************************************************************************/
BL_Err_Type I2C_Reset(I2C_ID_Type i2cNo) { BL_Err_Type I2C_Reset(I2C_ID_Type i2cNo) {
/* Check the parameters */ /* Check the parameters */
CHECK_PARAM(IS_I2C_ID_TYPE(i2cNo)); CHECK_PARAM(IS_I2C_ID_TYPE(i2cNo));
@@ -259,16 +259,16 @@ BL_Err_Type I2C_Reset(I2C_ID_Type i2cNo) {
return SUCCESS; return SUCCESS;
} }
/****************************************************************************/ /** /**
* @brief I2C init function * @brief I2C init function
* *
* @param i2cNo: I2C ID type * @param i2cNo: I2C ID type
* @param direct: I2C read or write direct * @param direct: I2C read or write direct
* @param cfg: I2C transfer config struct * @param cfg: I2C transfer config struct
* *
* @return None * @return None
* *
*******************************************************************************/ *******************************************************************************/
void I2C_Init(I2C_ID_Type i2cNo, I2C_Direction_Type direct, I2C_Transfer_Cfg *cfg) { void I2C_Init(I2C_ID_Type i2cNo, I2C_Direction_Type direct, I2C_Transfer_Cfg *cfg) {
uint32_t tmpVal; uint32_t tmpVal;
uint32_t I2Cx = I2C_BASE; uint32_t I2Cx = I2C_BASE;
@@ -308,15 +308,15 @@ void I2C_Init(I2C_ID_Type i2cNo, I2C_Direction_Type direct, I2C_Transfer_Cfg *cf
#endif #endif
} }
/****************************************************************************/ /** /**
* @brief Set de-glitch function cycle count value * @brief Set de-glitch function cycle count value
* *
* @param i2cNo: I2C ID type * @param i2cNo: I2C ID type
* @param cnt: De-glitch function cycle count * @param cnt: De-glitch function cycle count
* *
* @return SUCCESS * @return SUCCESS
* *
*******************************************************************************/ *******************************************************************************/
BL_Err_Type I2C_SetDeglitchCount(I2C_ID_Type i2cNo, uint8_t cnt) { BL_Err_Type I2C_SetDeglitchCount(I2C_ID_Type i2cNo, uint8_t cnt) {
uint32_t tmpVal; uint32_t tmpVal;
uint32_t I2Cx = I2C_BASE; uint32_t I2Cx = I2C_BASE;
@@ -343,15 +343,15 @@ BL_Err_Type I2C_SetDeglitchCount(I2C_ID_Type i2cNo, uint8_t cnt) {
return SUCCESS; return SUCCESS;
} }
/****************************************************************************/ /** /**
* @brief Set i2c prd * @brief Set i2c prd
* *
* @param i2cNo: I2C ID type * @param i2cNo: I2C ID type
* @param phase: I2C phase value * @param phase: I2C phase value
* *
* @return None * @return None
* *
*******************************************************************************/ *******************************************************************************/
void I2C_SetPrd(I2C_ID_Type i2cNo, uint8_t phase) { void I2C_SetPrd(I2C_ID_Type i2cNo, uint8_t phase) {
uint32_t tmpVal; uint32_t tmpVal;
uint32_t I2Cx = I2C_BASE; uint32_t I2Cx = I2C_BASE;
@@ -380,15 +380,15 @@ void I2C_SetPrd(I2C_ID_Type i2cNo, uint8_t phase) {
BL_WR_REG(I2Cx, I2C_PRD_DATA, tmpVal); BL_WR_REG(I2Cx, I2C_PRD_DATA, tmpVal);
} }
/****************************************************************************/ /** /**
* @brief I2C set scl output clock * @brief I2C set scl output clock
* *
* @param i2cNo: I2C ID type * @param i2cNo: I2C ID type
* @param clk: Clock set * @param clk: Clock set
* *
* @return None * @return None
* *
*******************************************************************************/ *******************************************************************************/
void I2C_ClockSet(I2C_ID_Type i2cNo, uint32_t clk) { void I2C_ClockSet(I2C_ID_Type i2cNo, uint32_t clk) {
uint8_t bclkDiv = 0; uint8_t bclkDiv = 0;
@@ -412,15 +412,15 @@ void I2C_ClockSet(I2C_ID_Type i2cNo, uint32_t clk) {
} }
} }
/****************************************************************************/ /** /**
* @brief I2C set scl sync * @brief I2C set scl sync
* *
* @param i2cNo: I2C ID type * @param i2cNo: I2C ID type
* @param enable: Enable or disable I2C scl sync * @param enable: Enable or disable I2C scl sync
* *
* @return None * @return None
* *
*******************************************************************************/ *******************************************************************************/
void I2C_SetSclSync(I2C_ID_Type i2cNo, uint8_t enable) { void I2C_SetSclSync(I2C_ID_Type i2cNo, uint8_t enable) {
uint32_t tmpVal; uint32_t tmpVal;
uint32_t I2Cx = I2C_BASE; uint32_t I2Cx = I2C_BASE;
@@ -439,14 +439,14 @@ void I2C_SetSclSync(I2C_ID_Type i2cNo, uint8_t enable) {
BL_WR_REG(I2Cx, I2C_CONFIG, tmpVal); BL_WR_REG(I2Cx, I2C_CONFIG, tmpVal);
} }
/****************************************************************************/ /** /**
* @brief Get i2c busy state * @brief Get i2c busy state
* *
* @param i2cNo: I2C ID type * @param i2cNo: I2C ID type
* *
* @return RESET or SET * @return RESET or SET
* *
*******************************************************************************/ *******************************************************************************/
BL_Sts_Type I2C_IsBusy(I2C_ID_Type i2cNo) { BL_Sts_Type I2C_IsBusy(I2C_ID_Type i2cNo) {
uint32_t tmpVal; uint32_t tmpVal;
uint32_t I2Cx = I2C_BASE; uint32_t I2Cx = I2C_BASE;
@@ -458,14 +458,14 @@ BL_Sts_Type I2C_IsBusy(I2C_ID_Type i2cNo) {
return ((BL_IS_REG_BIT_SET(tmpVal, I2C_STS_I2C_BUS_BUSY)) ? SET : RESET); return ((BL_IS_REG_BIT_SET(tmpVal, I2C_STS_I2C_BUS_BUSY)) ? SET : RESET);
} }
/****************************************************************************/ /** /**
* @brief Get i2c transfer end state * @brief Get i2c transfer end state
* *
* @param i2cNo: I2C ID type * @param i2cNo: I2C ID type
* *
* @return RESET or SET * @return RESET or SET
* *
*******************************************************************************/ *******************************************************************************/
BL_Sts_Type I2C_TransferEndStatus(I2C_ID_Type i2cNo) { BL_Sts_Type I2C_TransferEndStatus(I2C_ID_Type i2cNo) {
uint32_t tmpVal; uint32_t tmpVal;
uint32_t I2Cx = I2C_BASE; uint32_t I2Cx = I2C_BASE;
@@ -477,15 +477,15 @@ BL_Sts_Type I2C_TransferEndStatus(I2C_ID_Type i2cNo) {
return ((BL_IS_REG_BIT_SET(tmpVal, I2C_END_INT)) ? SET : RESET); return ((BL_IS_REG_BIT_SET(tmpVal, I2C_END_INT)) ? SET : RESET);
} }
/****************************************************************************/ /** /**
* @brief I2C master write block data * @brief I2C master write block data
* *
* @param i2cNo: I2C ID type * @param i2cNo: I2C ID type
* @param cfg: I2C transfer config struct * @param cfg: I2C transfer config struct
* *
* @return SUCCESS or ERROR * @return SUCCESS or ERROR
* *
*******************************************************************************/ *******************************************************************************/
BL_Err_Type I2C_MasterSendBlocking(I2C_ID_Type i2cNo, I2C_Transfer_Cfg *cfg) { BL_Err_Type I2C_MasterSendBlocking(I2C_ID_Type i2cNo, I2C_Transfer_Cfg *cfg) {
uint8_t i; uint8_t i;
uint32_t timeOut = 0; uint32_t timeOut = 0;
@@ -550,15 +550,15 @@ BL_Err_Type I2C_MasterSendBlocking(I2C_ID_Type i2cNo, I2C_Transfer_Cfg *cfg) {
return SUCCESS; return SUCCESS;
} }
/****************************************************************************/ /** /**
* @brief I2C master read block data * @brief I2C master read block data
* *
* @param i2cNo: I2C ID type * @param i2cNo: I2C ID type
* @param cfg: I2C transfer config struct * @param cfg: I2C transfer config struct
* *
* @return SUCCESS or ERROR * @return SUCCESS or ERROR
* *
*******************************************************************************/ *******************************************************************************/
BL_Err_Type I2C_MasterReceiveBlocking(I2C_ID_Type i2cNo, I2C_Transfer_Cfg *cfg) { BL_Err_Type I2C_MasterReceiveBlocking(I2C_ID_Type i2cNo, I2C_Transfer_Cfg *cfg) {
uint8_t i = 0; uint8_t i = 0;
uint32_t timeOut = 0; uint32_t timeOut = 0;
@@ -643,16 +643,16 @@ BL_Err_Type I2C_MasterReceiveBlocking(I2C_ID_Type i2cNo, I2C_Transfer_Cfg *cfg)
return SUCCESS; return SUCCESS;
} }
/****************************************************************************/ /** /**
* @brief Mask/Unmask the I2C interrupt * @brief Mask/Unmask the I2C interrupt
* *
* @param i2cNo: I2C ID type * @param i2cNo: I2C ID type
* @param intType: Specifies the interrupt type * @param intType: Specifies the interrupt type
* @param intMask: Enable/Disable Specified interrupt type * @param intMask: Enable/Disable Specified interrupt type
* *
* @return None * @return None
* *
*******************************************************************************/ *******************************************************************************/
void I2C_IntMask(I2C_ID_Type i2cNo, I2C_INT_Type intType, BL_Mask_Type intMask) { void I2C_IntMask(I2C_ID_Type i2cNo, I2C_INT_Type intType, BL_Mask_Type intMask) {
uint32_t tmpVal; uint32_t tmpVal;
uint32_t I2Cx = I2C_BASE; uint32_t I2Cx = I2C_BASE;
@@ -783,16 +783,16 @@ void I2C_IntMask(I2C_ID_Type i2cNo, I2C_INT_Type intType, BL_Mask_Type intMask)
BL_WR_REG(I2Cx, I2C_INT_STS, tmpVal); BL_WR_REG(I2Cx, I2C_INT_STS, tmpVal);
} }
/****************************************************************************/ /** /**
* @brief Install I2C interrupt callback function * @brief Install I2C interrupt callback function
* *
* @param i2cNo: I2C ID type * @param i2cNo: I2C ID type
* @param intType: Specifies the interrupt type * @param intType: Specifies the interrupt type
* @param cbFun: Pointer to interrupt callback function. The type should be void (*fn)(void) * @param cbFun: Pointer to interrupt callback function. The type should be void (*fn)(void)
* *
* @return None * @return None
* *
*******************************************************************************/ *******************************************************************************/
#ifndef BFLB_USE_HAL_DRIVER #ifndef BFLB_USE_HAL_DRIVER
void I2C_Int_Callback_Install(I2C_ID_Type i2cNo, I2C_INT_Type intType, intCallback_Type *cbFun) { void I2C_Int_Callback_Install(I2C_ID_Type i2cNo, I2C_INT_Type intType, intCallback_Type *cbFun) {
/* Check the parameters */ /* Check the parameters */
@@ -803,14 +803,14 @@ void I2C_Int_Callback_Install(I2C_ID_Type i2cNo, I2C_INT_Type intType, intCallba
} }
#endif #endif
/****************************************************************************/ /** /**
* @brief I2C IRQ handler * @brief I2C IRQ handler
* *
* @param None * @param None
* *
* @return None * @return None
* *
*******************************************************************************/ *******************************************************************************/
#ifndef BFLB_USE_HAL_DRIVER #ifndef BFLB_USE_HAL_DRIVER
void I2C_IRQHandler(void) { I2C_IntHandler(I2C0_ID); } void I2C_IRQHandler(void) { I2C_IntHandler(I2C0_ID); }
#endif #endif