AN60024

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

cross mob
AlVa_264671
Level 5
Level 5
25 sign-ins First like given First like received

Hi every one !!!

   

Can anyone tell me what does it means sw_Read() in AN60024 ?

   

Here is piece of code.

   

/* Init switch variables */
    uint8 switches[2] = {0, 0}; /* [0] = current, [1] = previous */
    switches[0] = switches[1] = SW_Read(); /* 0 = pressed, 1 = not pressed */
   
I believe is a kind of fuction that get the state of pin wher the switch is conected, is that correct.?

   

Thank you very much

0 Likes
4 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

SW is a pin component (just look at the schematics). So you need to look into the pin component data sheet. There you will find the _read() method.

0 Likes
AlVa_264671
Level 5
Level 5
25 sign-ins First like given First like received

Thank you very much hli, I got lost with "SW"  name on the pin name, it si very trival !!!!

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Naming the pin components for their purpose is good practice, though it can be confusing sometimes...

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

You can always use a functional name combined with physical name

   

and get an easily understood pin name.

   

 

   

Like "OpAmpout_P0_0_MyDACout."

   

 

   

Regards, Dana.

0 Likes