SCB SPI internal interrupt insert user code?

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

cross mob
ShSh_291626
Level 3
Level 3

 Hi everyone,

   

Can I insert user code in the SCB SPI on the internal interrupt mode?

   

Like UDB UART can insert user code in the UART_INT.C

   

Thx

   

(My English is poor, thanks google translation)

0 Likes
8 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I do not have a SPI ap up but usually in the generated code

   

file for the component interrupt there is a text banner showing user

   

where he can put his defines and another for the code. Just open the

   

file and look for it.

   

 

   

Regards, Dana.

0 Likes
ShSh_291626
Level 3
Level 3

 Hi Dana,

   

I find _SPI_UART_INT.c file , but no have user define block...

   

I try to be modified, but a recompile will be restored

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I found this

   

 

   

SPIS_INT.c

   

 

   

/* User code required at start of ISR */
/* `#START SPIS_ISR_START_DEF` */

/* `#END` */

   

 

   

Regards, Dana.

0 Likes
ShSh_291626
Level 3
Level 3

 Dear Dana,

   

SPIS is UDB component?

   

I use SCB mode SPIS and set RX/TX buffer size at 64 byte, so it is start internal interrupt mode

   

In the "XXX_SPI_UART_INT.c" can't found

   

/* User code required at start of ISR */
/* `#START SPIS_ISR_START_DEF` */

/* `#END` */

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

For the SCB version of SPI there is an interrupt output (when required) to which you may connect an isr-component to.

   

Within the interrupt handler (best specified using _StartEx()) you may do whatever you want, but keep it short and do not forget to remove the interrupt cause.

   

 

   

Bob

0 Likes
ShSh_291626
Level 3
Level 3

HI Dana,

   

I think my problem solved,

   

I can use "xxx_SetCustomInterruptHandler" to set custom interrupt handler

   

Thank you~

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

This might be useful -

   

 

   

    

   

          

   

http://www.cypress.com/?rID=38267     AN54460 - PSoC® 3, PSoC 4, and PSoC 5LP Interrupts

   

 

   

 

   

Regards, Dana.

0 Likes
ShSh_291626
Level 3
Level 3

 Thanks Dana and Bob~~

0 Likes