Lines Matching refs:iopin

30 static inline void iopin_set_high(iopin_t *iopin)  in iopin_set_high()  argument
34 if (iopin->port == IOPIN_PORTA) { in iopin_set_high()
37 setbits_be16(datp, 1 << (15 - iopin->pin)); in iopin_set_high()
38 } else if (iopin->port == IOPIN_PORTB) { in iopin_set_high()
41 setbits_be32(datp, 1 << (31 - iopin->pin)); in iopin_set_high()
42 } else if (iopin->port == IOPIN_PORTC) { in iopin_set_high()
45 setbits_be16(datp, 1 << (15 - iopin->pin)); in iopin_set_high()
46 } else if (iopin->port == IOPIN_PORTD) { in iopin_set_high()
49 setbits_be16(datp, 1 << (15 - iopin->pin)); in iopin_set_high()
53 static inline void iopin_set_low(iopin_t *iopin) in iopin_set_low() argument
57 if (iopin->port == IOPIN_PORTA) { in iopin_set_low()
60 clrbits_be16(datp, 1 << (15 - iopin->pin)); in iopin_set_low()
61 } else if (iopin->port == IOPIN_PORTB) { in iopin_set_low()
64 clrbits_be32(datp, 1 << (31 - iopin->pin)); in iopin_set_low()
65 } else if (iopin->port == IOPIN_PORTC) { in iopin_set_low()
68 clrbits_be16(datp, 1 << (15 - iopin->pin)); in iopin_set_low()
69 } else if (iopin->port == IOPIN_PORTD) { in iopin_set_low()
72 clrbits_be16(datp, 1 << (15 - iopin->pin)); in iopin_set_low()
76 static inline uint iopin_is_high(iopin_t *iopin) in iopin_is_high() argument
80 if (iopin->port == IOPIN_PORTA) { in iopin_is_high()
83 return (in_be16(datp) >> (15 - iopin->pin)) & 1; in iopin_is_high()
84 } else if (iopin->port == IOPIN_PORTB) { in iopin_is_high()
87 return (in_be32(datp) >> (31 - iopin->pin)) & 1; in iopin_is_high()
88 } else if (iopin->port == IOPIN_PORTC) { in iopin_is_high()
91 return (in_be16(datp) >> (15 - iopin->pin)) & 1; in iopin_is_high()
92 } else if (iopin->port == IOPIN_PORTD) { in iopin_is_high()
95 return (in_be16(datp) >> (15 - iopin->pin)) & 1; in iopin_is_high()
100 static inline uint iopin_is_low(iopin_t *iopin) in iopin_is_low() argument
104 if (iopin->port == IOPIN_PORTA) { in iopin_is_low()
107 return ((in_be16(datp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_low()
108 } else if (iopin->port == IOPIN_PORTB) { in iopin_is_low()
111 return ((in_be32(datp) >> (31 - iopin->pin)) & 1) ^ 1; in iopin_is_low()
112 } else if (iopin->port == IOPIN_PORTC) { in iopin_is_low()
115 return ((in_be16(datp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_low()
116 } else if (iopin->port == IOPIN_PORTD) { in iopin_is_low()
119 return ((in_be16(datp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_low()
124 static inline void iopin_set_out(iopin_t *iopin) in iopin_set_out() argument
128 if (iopin->port == IOPIN_PORTA) { in iopin_set_out()
131 setbits_be16(dirp, 1 << (15 - iopin->pin)); in iopin_set_out()
132 } else if (iopin->port == IOPIN_PORTB) { in iopin_set_out()
135 setbits_be32(dirp, 1 << (31 - iopin->pin)); in iopin_set_out()
136 } else if (iopin->port == IOPIN_PORTC) { in iopin_set_out()
139 setbits_be16(dirp, 1 << (15 - iopin->pin)); in iopin_set_out()
140 } else if (iopin->port == IOPIN_PORTD) { in iopin_set_out()
143 setbits_be16(dirp, 1 << (15 - iopin->pin)); in iopin_set_out()
147 static inline void iopin_set_in(iopin_t *iopin) in iopin_set_in() argument
151 if (iopin->port == IOPIN_PORTA) { in iopin_set_in()
154 clrbits_be16(dirp, 1 << (15 - iopin->pin)); in iopin_set_in()
155 } else if (iopin->port == IOPIN_PORTB) { in iopin_set_in()
158 clrbits_be32(dirp, 1 << (31 - iopin->pin)); in iopin_set_in()
159 } else if (iopin->port == IOPIN_PORTC) { in iopin_set_in()
162 clrbits_be16(dirp, 1 << (15 - iopin->pin)); in iopin_set_in()
163 } else if (iopin->port == IOPIN_PORTD) { in iopin_set_in()
166 clrbits_be16(dirp, 1 << (15 - iopin->pin)); in iopin_set_in()
170 static inline uint iopin_is_out(iopin_t *iopin) in iopin_is_out() argument
174 if (iopin->port == IOPIN_PORTA) { in iopin_is_out()
177 return (in_be16(dirp) >> (15 - iopin->pin)) & 1; in iopin_is_out()
178 } else if (iopin->port == IOPIN_PORTB) { in iopin_is_out()
181 return (in_be32(dirp) >> (31 - iopin->pin)) & 1; in iopin_is_out()
182 } else if (iopin->port == IOPIN_PORTC) { in iopin_is_out()
185 return (in_be16(dirp) >> (15 - iopin->pin)) & 1; in iopin_is_out()
186 } else if (iopin->port == IOPIN_PORTD) { in iopin_is_out()
189 return (in_be16(dirp) >> (15 - iopin->pin)) & 1; in iopin_is_out()
194 static inline uint iopin_is_in(iopin_t *iopin) in iopin_is_in() argument
198 if (iopin->port == IOPIN_PORTA) { in iopin_is_in()
201 return ((in_be16(dirp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_in()
202 } else if (iopin->port == IOPIN_PORTB) { in iopin_is_in()
205 return ((in_be32(dirp) >> (31 - iopin->pin)) & 1) ^ 1; in iopin_is_in()
206 } else if (iopin->port == IOPIN_PORTC) { in iopin_is_in()
209 return ((in_be16(dirp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_in()
210 } else if (iopin->port == IOPIN_PORTD) { in iopin_is_in()
213 return ((in_be16(dirp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_in()
218 static inline void iopin_set_odr(iopin_t *iopin) in iopin_set_odr() argument
222 if (iopin->port == IOPIN_PORTA) { in iopin_set_odr()
225 setbits_be16(odrp, 1 << (15 - iopin->pin)); in iopin_set_odr()
226 } else if (iopin->port == IOPIN_PORTB) { in iopin_set_odr()
229 setbits_be16(odrp, 1 << (31 - iopin->pin)); in iopin_set_odr()
233 static inline void iopin_set_act(iopin_t *iopin) in iopin_set_act() argument
237 if (iopin->port == IOPIN_PORTA) { in iopin_set_act()
240 clrbits_be16(odrp, 1 << (15 - iopin->pin)); in iopin_set_act()
241 } else if (iopin->port == IOPIN_PORTB) { in iopin_set_act()
244 clrbits_be16(odrp, 1 << (31 - iopin->pin)); in iopin_set_act()
248 static inline uint iopin_is_odr(iopin_t *iopin) in iopin_is_odr() argument
252 if (iopin->port == IOPIN_PORTA) { in iopin_is_odr()
255 return (in_be16(odrp) >> (15 - iopin->pin)) & 1; in iopin_is_odr()
256 } else if (iopin->port == IOPIN_PORTB) { in iopin_is_odr()
259 return (in_be16(odrp) >> (31 - iopin->pin)) & 1; in iopin_is_odr()
264 static inline uint iopin_is_act(iopin_t *iopin) in iopin_is_act() argument
268 if (iopin->port == IOPIN_PORTA) { in iopin_is_act()
271 return ((in_be16(odrp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_act()
272 } else if (iopin->port == IOPIN_PORTB) { in iopin_is_act()
275 return ((in_be16(odrp) >> (31 - iopin->pin)) & 1) ^ 1; in iopin_is_act()
280 static inline void iopin_set_ded(iopin_t *iopin) in iopin_set_ded() argument
284 if (iopin->port == IOPIN_PORTA) { in iopin_set_ded()
287 setbits_be16(parp, 1 << (15 - iopin->pin)); in iopin_set_ded()
288 } else if (iopin->port == IOPIN_PORTB) { in iopin_set_ded()
291 setbits_be32(parp, 1 << (31 - iopin->pin)); in iopin_set_ded()
292 } else if (iopin->port == IOPIN_PORTC) { in iopin_set_ded()
295 setbits_be16(parp, 1 << (15 - iopin->pin)); in iopin_set_ded()
296 } else if (iopin->port == IOPIN_PORTD) { in iopin_set_ded()
299 setbits_be16(parp, 1 << (15 - iopin->pin)); in iopin_set_ded()
303 static inline void iopin_set_gen(iopin_t *iopin) in iopin_set_gen() argument
307 if (iopin->port == IOPIN_PORTA) { in iopin_set_gen()
310 clrbits_be16(parp, 1 << (15 - iopin->pin)); in iopin_set_gen()
311 } else if (iopin->port == IOPIN_PORTB) { in iopin_set_gen()
314 clrbits_be32(parp, 1 << (31 - iopin->pin)); in iopin_set_gen()
315 } else if (iopin->port == IOPIN_PORTC) { in iopin_set_gen()
318 clrbits_be16(parp, 1 << (15 - iopin->pin)); in iopin_set_gen()
319 } else if (iopin->port == IOPIN_PORTD) { in iopin_set_gen()
322 clrbits_be16(parp, 1 << (15 - iopin->pin)); in iopin_set_gen()
326 static inline uint iopin_is_ded(iopin_t *iopin) in iopin_is_ded() argument
330 if (iopin->port == IOPIN_PORTA) { in iopin_is_ded()
333 return (in_be16(parp) >> (15 - iopin->pin)) & 1; in iopin_is_ded()
334 } else if (iopin->port == IOPIN_PORTB) { in iopin_is_ded()
337 return (in_be32(parp) >> (31 - iopin->pin)) & 1; in iopin_is_ded()
338 } else if (iopin->port == IOPIN_PORTC) { in iopin_is_ded()
341 return (in_be16(parp) >> (15 - iopin->pin)) & 1; in iopin_is_ded()
342 } else if (iopin->port == IOPIN_PORTD) { in iopin_is_ded()
345 return (in_be16(parp) >> (15 - iopin->pin)) & 1; in iopin_is_ded()
350 static inline uint iopin_is_gen(iopin_t *iopin) in iopin_is_gen() argument
354 if (iopin->port == IOPIN_PORTA) { in iopin_is_gen()
357 return ((in_be16(parp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_gen()
358 } else if (iopin->port == IOPIN_PORTB) { in iopin_is_gen()
361 return ((in_be32(parp) >> (31 - iopin->pin)) & 1) ^ 1; in iopin_is_gen()
362 } else if (iopin->port == IOPIN_PORTC) { in iopin_is_gen()
365 return ((in_be16(parp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_gen()
366 } else if (iopin->port == IOPIN_PORTD) { in iopin_is_gen()
369 return ((in_be16(parp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_gen()
374 static inline void iopin_set_opt2(iopin_t *iopin) in iopin_set_opt2() argument
378 if (iopin->port == IOPIN_PORTC) { in iopin_set_opt2()
381 setbits_be16(sorp, 1 << (15 - iopin->pin)); in iopin_set_opt2()
385 static inline void iopin_set_opt1(iopin_t *iopin) in iopin_set_opt1() argument
389 if (iopin->port == IOPIN_PORTC) { in iopin_set_opt1()
392 clrbits_be16(sorp, 1 << (15 - iopin->pin)); in iopin_set_opt1()
396 static inline uint iopin_is_opt2(iopin_t *iopin) in iopin_is_opt2() argument
400 if (iopin->port == IOPIN_PORTC) { in iopin_is_opt2()
403 return (in_be16(sorp) >> (15 - iopin->pin)) & 1; in iopin_is_opt2()
408 static inline uint iopin_is_opt1(iopin_t *iopin) in iopin_is_opt1() argument
412 if (iopin->port == IOPIN_PORTC) { in iopin_is_opt1()
415 return ((in_be16(sorp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_opt1()
420 static inline void iopin_set_falledge(iopin_t *iopin) in iopin_set_falledge() argument
424 if (iopin->port == IOPIN_PORTC) { in iopin_set_falledge()
427 setbits_be16(intp, 1 << (15 - iopin->pin)); in iopin_set_falledge()
431 static inline void iopin_set_anyedge(iopin_t *iopin) in iopin_set_anyedge() argument
435 if (iopin->port == IOPIN_PORTC) { in iopin_set_anyedge()
438 clrbits_be16(intp, 1 << (15 - iopin->pin)); in iopin_set_anyedge()
442 static inline uint iopin_is_falledge(iopin_t *iopin) in iopin_is_falledge() argument
446 if (iopin->port == IOPIN_PORTC) { in iopin_is_falledge()
449 return (in_be16(intp) >> (15 - iopin->pin)) & 1; in iopin_is_falledge()
454 static inline uint iopin_is_anyedge(iopin_t *iopin) in iopin_is_anyedge() argument
458 if (iopin->port == IOPIN_PORTC) { in iopin_is_anyedge()
461 return ((in_be16(intp) >> (15 - iopin->pin)) & 1) ^ 1; in iopin_is_anyedge()