Difference between SCB_SetMasterInterruptMode() and SCB_I2C_ISR_ExitCallback()

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
SaGh_4441651
Level 3
Level 3
First like received First like given

Can someone tell me what is the difference between these 2 functions?

0 Likes
1 Solution
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello,

The SCB_I2C_ISR_ExitCallback() function is used at the end of the SCB_I2C_ISR() interrupt handler (Function that handles the Interrupt Service Routine for the SCB I2C mode) to perform additional application-specific actions.

The SCB_SetMasterInterruptMode(uint32 InterruptMask) sets the Master interrupt sources in the interrupt request register. The parameter uint32 interruptMask is the Master interrupt sources to set in the Master interrupt request register (refer to SCB_GetMasterInterruptSource() function for return values).

For example in case of PSoC 4, the parameter for the function can be as follows:

*   - SCB_1_INTR_MASTER_I2C_ARB_LOST - I2C master lost arbitration.

*   - SCB_1_INTR_MASTER_I2C_NACK - I2C master received negative

*    acknowledgement (NAK).

*   - SCB_1_INTR_MASTER_I2C_ACK - I2C master received acknowledgement.

*   - SCB_1_INTR_MASTER_I2C_STOP - I2C master generated STOP.

*   - SCB_1_INTR_MASTER_I2C_BUS_ERROR - I2C master bus error

*     (detection of unexpected START or STOP condition).

Refer to the SCB component datasheet for more details on this: https://www.cypress.com/file/274551/download

Please feel free to update in case of any clarification.

Best Regards

Ekta

View solution in original post

0 Likes
1 Reply
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello,

The SCB_I2C_ISR_ExitCallback() function is used at the end of the SCB_I2C_ISR() interrupt handler (Function that handles the Interrupt Service Routine for the SCB I2C mode) to perform additional application-specific actions.

The SCB_SetMasterInterruptMode(uint32 InterruptMask) sets the Master interrupt sources in the interrupt request register. The parameter uint32 interruptMask is the Master interrupt sources to set in the Master interrupt request register (refer to SCB_GetMasterInterruptSource() function for return values).

For example in case of PSoC 4, the parameter for the function can be as follows:

*   - SCB_1_INTR_MASTER_I2C_ARB_LOST - I2C master lost arbitration.

*   - SCB_1_INTR_MASTER_I2C_NACK - I2C master received negative

*    acknowledgement (NAK).

*   - SCB_1_INTR_MASTER_I2C_ACK - I2C master received acknowledgement.

*   - SCB_1_INTR_MASTER_I2C_STOP - I2C master generated STOP.

*   - SCB_1_INTR_MASTER_I2C_BUS_ERROR - I2C master bus error

*     (detection of unexpected START or STOP condition).

Refer to the SCB component datasheet for more details on this: https://www.cypress.com/file/274551/download

Please feel free to update in case of any clarification.

Best Regards

Ekta

0 Likes