Lines Matching refs:iopin

28 static inline void iopin_set_high(iopin_t *iopin)  in iopin_set_high()  argument
32 if (iopin->port == IOPIN_PORTA) { in iopin_set_high()
35 setbits_be16(datp, 1 << (15 - iopin->pin)); in iopin_set_high()
36 } else if (iopin->port == IOPIN_PORTB) { in iopin_set_high()
39 setbits_be32(datp, 1 << (31 - iopin->pin)); in iopin_set_high()
40 } else if (iopin->port == IOPIN_PORTC) { in iopin_set_high()
43 setbits_be16(datp, 1 << (15 - iopin->pin)); in iopin_set_high()
44 } else if (iopin->port == IOPIN_PORTD) { in iopin_set_high()
47 setbits_be16(datp, 1 << (15 - iopin->pin)); in iopin_set_high()
51 static inline void iopin_set_low(iopin_t *iopin) in iopin_set_low() argument
55 if (iopin->port == IOPIN_PORTA) { in iopin_set_low()
58 clrbits_be16(datp, 1 << (15 - iopin->pin)); in iopin_set_low()
59 } else if (iopin->port == IOPIN_PORTB) { in iopin_set_low()
62 clrbits_be32(datp, 1 << (31 - iopin->pin)); in iopin_set_low()
63 } else if (iopin->port == IOPIN_PORTC) { in iopin_set_low()
66 clrbits_be16(datp, 1 << (15 - iopin->pin)); in iopin_set_low()
67 } else if (iopin->port == IOPIN_PORTD) { in iopin_set_low()
70 clrbits_be16(datp, 1 << (15 - iopin->pin)); in iopin_set_low()
74 static inline uint iopin_is_high(iopin_t *iopin) in iopin_is_high() argument
78 if (iopin->port == IOPIN_PORTA) { in iopin_is_high()
81 return (in_be16(datp) >> (15 - iopin->pin)) & 1; in iopin_is_high()
82 } else if (iopin->port == IOPIN_PORTB) { in iopin_is_high()
85 return (in_be32(datp) >> (31 - iopin->pin)) & 1; in iopin_is_high()
86 } else if (iopin->port == IOPIN_PORTC) { in iopin_is_high()
89 return (in_be16(datp) >> (15 - iopin->pin)) & 1; in iopin_is_high()
90 } else if (iopin->port == IOPIN_PORTD) { in iopin_is_high()
93 return (in_be16(datp) >> (15 - iopin->pin)) & 1; in iopin_is_high()
98 static inline uint iopin_is_low(iopin_t *iopin) in iopin_is_low() argument
102 if (iopin->port == IOPIN_PORTA) { in iopin_is_low()
105 return ((in_be16(datp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_low()
106 } else if (iopin->port == IOPIN_PORTB) { in iopin_is_low()
109 return ((in_be32(datp) >> (31 - iopin->pin)) & 1) ^ 1; in iopin_is_low()
110 } else if (iopin->port == IOPIN_PORTC) { in iopin_is_low()
113 return ((in_be16(datp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_low()
114 } else if (iopin->port == IOPIN_PORTD) { in iopin_is_low()
117 return ((in_be16(datp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_low()
122 static inline void iopin_set_out(iopin_t *iopin) in iopin_set_out() argument
126 if (iopin->port == IOPIN_PORTA) { in iopin_set_out()
129 setbits_be16(dirp, 1 << (15 - iopin->pin)); in iopin_set_out()
130 } else if (iopin->port == IOPIN_PORTB) { in iopin_set_out()
133 setbits_be32(dirp, 1 << (31 - iopin->pin)); in iopin_set_out()
134 } else if (iopin->port == IOPIN_PORTC) { in iopin_set_out()
137 setbits_be16(dirp, 1 << (15 - iopin->pin)); in iopin_set_out()
138 } else if (iopin->port == IOPIN_PORTD) { in iopin_set_out()
141 setbits_be16(dirp, 1 << (15 - iopin->pin)); in iopin_set_out()
145 static inline void iopin_set_in(iopin_t *iopin) in iopin_set_in() argument
149 if (iopin->port == IOPIN_PORTA) { in iopin_set_in()
152 clrbits_be16(dirp, 1 << (15 - iopin->pin)); in iopin_set_in()
153 } else if (iopin->port == IOPIN_PORTB) { in iopin_set_in()
156 clrbits_be32(dirp, 1 << (31 - iopin->pin)); in iopin_set_in()
157 } else if (iopin->port == IOPIN_PORTC) { in iopin_set_in()
160 clrbits_be16(dirp, 1 << (15 - iopin->pin)); in iopin_set_in()
161 } else if (iopin->port == IOPIN_PORTD) { in iopin_set_in()
164 clrbits_be16(dirp, 1 << (15 - iopin->pin)); in iopin_set_in()
168 static inline uint iopin_is_out(iopin_t *iopin) in iopin_is_out() argument
172 if (iopin->port == IOPIN_PORTA) { in iopin_is_out()
175 return (in_be16(dirp) >> (15 - iopin->pin)) & 1; in iopin_is_out()
176 } else if (iopin->port == IOPIN_PORTB) { in iopin_is_out()
179 return (in_be32(dirp) >> (31 - iopin->pin)) & 1; in iopin_is_out()
180 } else if (iopin->port == IOPIN_PORTC) { in iopin_is_out()
183 return (in_be16(dirp) >> (15 - iopin->pin)) & 1; in iopin_is_out()
184 } else if (iopin->port == IOPIN_PORTD) { in iopin_is_out()
187 return (in_be16(dirp) >> (15 - iopin->pin)) & 1; in iopin_is_out()
192 static inline uint iopin_is_in(iopin_t *iopin) in iopin_is_in() argument
196 if (iopin->port == IOPIN_PORTA) { in iopin_is_in()
199 return ((in_be16(dirp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_in()
200 } else if (iopin->port == IOPIN_PORTB) { in iopin_is_in()
203 return ((in_be32(dirp) >> (31 - iopin->pin)) & 1) ^ 1; in iopin_is_in()
204 } else if (iopin->port == IOPIN_PORTC) { in iopin_is_in()
207 return ((in_be16(dirp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_in()
208 } else if (iopin->port == IOPIN_PORTD) { in iopin_is_in()
211 return ((in_be16(dirp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_in()
216 static inline void iopin_set_odr(iopin_t *iopin) in iopin_set_odr() argument
220 if (iopin->port == IOPIN_PORTA) { in iopin_set_odr()
223 setbits_be16(odrp, 1 << (15 - iopin->pin)); in iopin_set_odr()
224 } else if (iopin->port == IOPIN_PORTB) { in iopin_set_odr()
227 setbits_be16(odrp, 1 << (31 - iopin->pin)); in iopin_set_odr()
231 static inline void iopin_set_act(iopin_t *iopin) in iopin_set_act() argument
235 if (iopin->port == IOPIN_PORTA) { in iopin_set_act()
238 clrbits_be16(odrp, 1 << (15 - iopin->pin)); in iopin_set_act()
239 } else if (iopin->port == IOPIN_PORTB) { in iopin_set_act()
242 clrbits_be16(odrp, 1 << (31 - iopin->pin)); in iopin_set_act()
246 static inline uint iopin_is_odr(iopin_t *iopin) in iopin_is_odr() argument
250 if (iopin->port == IOPIN_PORTA) { in iopin_is_odr()
253 return (in_be16(odrp) >> (15 - iopin->pin)) & 1; in iopin_is_odr()
254 } else if (iopin->port == IOPIN_PORTB) { in iopin_is_odr()
257 return (in_be16(odrp) >> (31 - iopin->pin)) & 1; in iopin_is_odr()
262 static inline uint iopin_is_act(iopin_t *iopin) in iopin_is_act() argument
266 if (iopin->port == IOPIN_PORTA) { in iopin_is_act()
269 return ((in_be16(odrp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_act()
270 } else if (iopin->port == IOPIN_PORTB) { in iopin_is_act()
273 return ((in_be16(odrp) >> (31 - iopin->pin)) & 1) ^ 1; in iopin_is_act()
278 static inline void iopin_set_ded(iopin_t *iopin) in iopin_set_ded() argument
282 if (iopin->port == IOPIN_PORTA) { in iopin_set_ded()
285 setbits_be16(parp, 1 << (15 - iopin->pin)); in iopin_set_ded()
286 } else if (iopin->port == IOPIN_PORTB) { in iopin_set_ded()
289 setbits_be32(parp, 1 << (31 - iopin->pin)); in iopin_set_ded()
290 } else if (iopin->port == IOPIN_PORTC) { in iopin_set_ded()
293 setbits_be16(parp, 1 << (15 - iopin->pin)); in iopin_set_ded()
294 } else if (iopin->port == IOPIN_PORTD) { in iopin_set_ded()
297 setbits_be16(parp, 1 << (15 - iopin->pin)); in iopin_set_ded()
301 static inline void iopin_set_gen(iopin_t *iopin) in iopin_set_gen() argument
305 if (iopin->port == IOPIN_PORTA) { in iopin_set_gen()
308 clrbits_be16(parp, 1 << (15 - iopin->pin)); in iopin_set_gen()
309 } else if (iopin->port == IOPIN_PORTB) { in iopin_set_gen()
312 clrbits_be32(parp, 1 << (31 - iopin->pin)); in iopin_set_gen()
313 } else if (iopin->port == IOPIN_PORTC) { in iopin_set_gen()
316 clrbits_be16(parp, 1 << (15 - iopin->pin)); in iopin_set_gen()
317 } else if (iopin->port == IOPIN_PORTD) { in iopin_set_gen()
320 clrbits_be16(parp, 1 << (15 - iopin->pin)); in iopin_set_gen()
324 static inline uint iopin_is_ded(iopin_t *iopin) in iopin_is_ded() argument
328 if (iopin->port == IOPIN_PORTA) { in iopin_is_ded()
331 return (in_be16(parp) >> (15 - iopin->pin)) & 1; in iopin_is_ded()
332 } else if (iopin->port == IOPIN_PORTB) { in iopin_is_ded()
335 return (in_be32(parp) >> (31 - iopin->pin)) & 1; in iopin_is_ded()
336 } else if (iopin->port == IOPIN_PORTC) { in iopin_is_ded()
339 return (in_be16(parp) >> (15 - iopin->pin)) & 1; in iopin_is_ded()
340 } else if (iopin->port == IOPIN_PORTD) { in iopin_is_ded()
343 return (in_be16(parp) >> (15 - iopin->pin)) & 1; in iopin_is_ded()
348 static inline uint iopin_is_gen(iopin_t *iopin) in iopin_is_gen() argument
352 if (iopin->port == IOPIN_PORTA) { in iopin_is_gen()
355 return ((in_be16(parp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_gen()
356 } else if (iopin->port == IOPIN_PORTB) { in iopin_is_gen()
359 return ((in_be32(parp) >> (31 - iopin->pin)) & 1) ^ 1; in iopin_is_gen()
360 } else if (iopin->port == IOPIN_PORTC) { in iopin_is_gen()
363 return ((in_be16(parp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_gen()
364 } else if (iopin->port == IOPIN_PORTD) { in iopin_is_gen()
367 return ((in_be16(parp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_gen()
372 static inline void iopin_set_opt2(iopin_t *iopin) in iopin_set_opt2() argument
376 if (iopin->port == IOPIN_PORTC) { in iopin_set_opt2()
379 setbits_be16(sorp, 1 << (15 - iopin->pin)); in iopin_set_opt2()
383 static inline void iopin_set_opt1(iopin_t *iopin) in iopin_set_opt1() argument
387 if (iopin->port == IOPIN_PORTC) { in iopin_set_opt1()
390 clrbits_be16(sorp, 1 << (15 - iopin->pin)); in iopin_set_opt1()
394 static inline uint iopin_is_opt2(iopin_t *iopin) in iopin_is_opt2() argument
398 if (iopin->port == IOPIN_PORTC) { in iopin_is_opt2()
401 return (in_be16(sorp) >> (15 - iopin->pin)) & 1; in iopin_is_opt2()
406 static inline uint iopin_is_opt1(iopin_t *iopin) in iopin_is_opt1() argument
410 if (iopin->port == IOPIN_PORTC) { in iopin_is_opt1()
413 return ((in_be16(sorp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_opt1()
418 static inline void iopin_set_falledge(iopin_t *iopin) in iopin_set_falledge() argument
422 if (iopin->port == IOPIN_PORTC) { in iopin_set_falledge()
425 setbits_be16(intp, 1 << (15 - iopin->pin)); in iopin_set_falledge()
429 static inline void iopin_set_anyedge(iopin_t *iopin) in iopin_set_anyedge() argument
433 if (iopin->port == IOPIN_PORTC) { in iopin_set_anyedge()
436 clrbits_be16(intp, 1 << (15 - iopin->pin)); in iopin_set_anyedge()
440 static inline uint iopin_is_falledge(iopin_t *iopin) in iopin_is_falledge() argument
444 if (iopin->port == IOPIN_PORTC) { in iopin_is_falledge()
447 return (in_be16(intp) >> (15 - iopin->pin)) & 1; in iopin_is_falledge()
452 static inline uint iopin_is_anyedge(iopin_t *iopin) in iopin_is_anyedge() argument
456 if (iopin->port == IOPIN_PORTC) { in iopin_is_anyedge()
459 return ((in_be16(intp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_anyedge()