cancel
Showing results for 
Search instead for 
Did you mean: 

FM0+, FM3 & FM4 MCU

PaWa_3505426
New Contributor II

Hi

So i found a bug in the PDL Library v2.1.0

The function Mfs.I2c_ConfigAck() doesn't work like it is in the library.

I had to change it like this to get it working:

/**

******************************************************************************

** \brief Configure ACK signal sent to master

**

** \param [in] pstcI2c    Pointer to I2C instance 

** \param [in] enAck      ACK to be sent

** \arg  I2cAck ACK will be sent as response signal

** \arg  I2cNAck NACK will be sent as response signal

**

** \retval Ok                    ACK signal has been successfully configured

** \retval ErrorInvalidParameter If one of following conditions are met:

**                               - pstcI2c == NULL         

**

** This function is only meaningful when I2C is in slave mode

**

******************************************************************************/

en_result_t Mfs_I2c_ConfigAck(volatile stc_mfsn_i2c_t* pstcI2c, en_i2c_ack_t enAck)

{

     if(pstcI2c == NULL)

          return ErrorInvalidParameter;

     if(I2cAck == enAck){

               *((volatile uint8_t *)(0x42000000UL + ((uint32_t)(pstcI2c - 0x40000000UL) * 32) + (13 * 4))) = 1; //ACKE set

          }else{

               *((volatile uint8_t *)(0x42000000UL + ((uint32_t)(pstcI2c - 0x40000000UL) * 32) + (13 * 4))) = 0; //ACKE clear

          }

     return Ok;

}

0 Likes
1 Solution
3 Replies
GeonaP_26
Moderator
Moderator

Which is the IDE and version used? Please confirm whether this issue occurs in IAR IDE.

0 Likes
PaWa_3505426
New Contributor II

IDE: Keil uVision V5.17.0.0

ARM Compiler: V5.06 update 1 (build 61)  (comes built into uVision)

0 Likes
Top labels