BSP430  20141115
Board Support Package for MSP430 microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
eusci.h
Go to the documentation of this file.
1 /* Copyright 2012-2014, Peter A. Bigot
2  *
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * * Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * * Neither the name of the software nor the names of its contributors may be
16  * used to endorse or promote products derived from this software without
17  * specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31 
84 #ifndef BSP430_PERIPH_EUSCI_H
85 #define BSP430_PERIPH_EUSCI_H
86 
87 #include <bsp430/periph.h>
88 #include <bsp430/serial_.h>
89 
97 #define BSP430_MODULE_EUSCI (defined(__MSP430_HAS_EUSCI_A0__) \
98  || defined(__MSP430_HAS_EUSCI_B0__))
99 
100 #if defined(BSP430_DOXYGEN) || (BSP430_MODULE_EUSCI - 0)
101 
106 #ifndef BSP430_EUSCI_UART_MAX_BAUD
107 #define BSP430_EUSCI_UART_MAX_BAUD 1000000UL
108 #endif /* BSP430_EUSCI_UART_MAX_BAUD */
109 
111 typedef struct sBSP430hplEUSCIA {
112  union { /* 0x00 */
113  unsigned int ctlw0;
114  struct {
115  unsigned char ctl1;
116  unsigned char ctl0;
117  };
118  };
119  unsigned int ctlw1; /* 0x02 */
120  unsigned int _unused_0x04;
121  union { /* 0x06 */
122  unsigned int brw;
123  struct {
124  unsigned char br0;
125  unsigned char br1;
126  };
127  };
128  unsigned int mctlw; /* 0x08 */
129  unsigned int statw; /* 0x0A */
130  unsigned int rxbuf; /* 0x0C */
131  unsigned int txbuf; /* 0x0E */
132  unsigned int abctl; /* 0x10 */
133  union { /* 0x12 */
134  unsigned int irctl;
135  struct {
136  unsigned char irtctl; /* 0x12 */
137  unsigned char irrctl; /* 0x13 */
138  };
139  };
140  unsigned int _unused_0x14;
141  unsigned int _unused_0x16;
142  unsigned int _unused_0x18;
143  unsigned int ie; /* 0x1A */
144  unsigned int ifg; /* 0x1C */
145  unsigned int iv; /* 0x1E */
147 
149 typedef struct sBSP430hplEUSCIB {
150  union { /* 0x00 */
151  unsigned int ctlw0;
152  struct {
153  unsigned char ctl1;
154  unsigned char ctl0;
155  };
156  };
157  unsigned int ctlw1; /* 0x02 */
158  unsigned int _unused_0x04;
159  union { /* 0x06 */
160  unsigned int brw;
161  struct {
162  unsigned char br0;
163  unsigned char br1;
164  };
165  };
166  union {
167  unsigned int statw; /* 0x08 */
168  struct {
169  unsigned char stat;
170  unsigned char bcnt;
171  };
172  };
173  unsigned int tbcnt; /* 0x0A */
174  unsigned int rxbuf; /* 0x0C */
175  unsigned int txbuf; /* 0x0E */
176  unsigned int _unused_0x10;
177  unsigned int _unused_0x12;
178  unsigned int i2coa0; /* 0x14 */
179  unsigned int i2coa1; /* 0x16 */
180  unsigned int i2coa2; /* 0x18 */
181  unsigned int i2coa3; /* 0x1A */
182  unsigned int addrx; /* 0x1C */
183  unsigned int addmask; /* 0x1E */
184  unsigned int i2csa; /* 0x20 */
185  unsigned int _unused_0x22;
186  unsigned int _unused_0x24;
187  unsigned int _unused_0x26;
188  unsigned int _unused_0x28;
189  unsigned int ie; /* 0x2A */
190  unsigned int ifg; /* 0x2C */
191  unsigned int iv; /* 0x2E */
193 
195 #define BSP430_PERIPH_EUSCI_A0_BASEADDRESS_ __MSP430_BASEADDRESS_EUSCI_A0__
196 #define BSP430_PERIPH_EUSCI_A1_BASEADDRESS_ __MSP430_BASEADDRESS_EUSCI_A1__
197 #define BSP430_PERIPH_EUSCI_A2_BASEADDRESS_ __MSP430_BASEADDRESS_EUSCI_A2__
198 #define BSP430_PERIPH_EUSCI_A3_BASEADDRESS_ __MSP430_BASEADDRESS_EUSCI_A3__
199 #define BSP430_PERIPH_EUSCI_B0_BASEADDRESS_ __MSP430_BASEADDRESS_EUSCI_B0__
200 #define BSP430_PERIPH_EUSCI_B1_BASEADDRESS_ __MSP430_BASEADDRESS_EUSCI_B1__
201  /* DOXYGEN_INTERNAL */
202 
203 /* !BSP430! periph=serial instance=EUSCI_A0,EUSCI_A1,EUSCI_A2,EUSCI_A3,EUSCI_B0,EUSCI_B1 insert=hal_decl */
204 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [hal_decl] */
221 #ifndef configBSP430_HAL_EUSCI_A0
222 #define configBSP430_HAL_EUSCI_A0 0
223 #endif /* configBSP430_HAL_EUSCI_A0 */
224 
226 #if (configBSP430_HAL_EUSCI_A0 - 0)
227 /* You do not need to know about this */
228 extern sBSP430halSERIAL xBSP430hal_EUSCI_A0_;
229 #endif /* configBSP430_HAL_EUSCI_A0 */
230 
238 #if defined(BSP430_DOXYGEN) || (configBSP430_HAL_EUSCI_A0 - 0)
239 #define BSP430_HAL_EUSCI_A0 (&xBSP430hal_EUSCI_A0_)
240 #endif /* configBSP430_HAL_EUSCI_A0 */
241 
258 #ifndef configBSP430_HAL_EUSCI_A1
259 #define configBSP430_HAL_EUSCI_A1 0
260 #endif /* configBSP430_HAL_EUSCI_A1 */
261 
263 #if (configBSP430_HAL_EUSCI_A1 - 0)
264 /* You do not need to know about this */
265 extern sBSP430halSERIAL xBSP430hal_EUSCI_A1_;
266 #endif /* configBSP430_HAL_EUSCI_A1 */
267 
275 #if defined(BSP430_DOXYGEN) || (configBSP430_HAL_EUSCI_A1 - 0)
276 #define BSP430_HAL_EUSCI_A1 (&xBSP430hal_EUSCI_A1_)
277 #endif /* configBSP430_HAL_EUSCI_A1 */
278 
295 #ifndef configBSP430_HAL_EUSCI_A2
296 #define configBSP430_HAL_EUSCI_A2 0
297 #endif /* configBSP430_HAL_EUSCI_A2 */
298 
300 #if (configBSP430_HAL_EUSCI_A2 - 0)
301 /* You do not need to know about this */
302 extern sBSP430halSERIAL xBSP430hal_EUSCI_A2_;
303 #endif /* configBSP430_HAL_EUSCI_A2 */
304 
312 #if defined(BSP430_DOXYGEN) || (configBSP430_HAL_EUSCI_A2 - 0)
313 #define BSP430_HAL_EUSCI_A2 (&xBSP430hal_EUSCI_A2_)
314 #endif /* configBSP430_HAL_EUSCI_A2 */
315 
332 #ifndef configBSP430_HAL_EUSCI_A3
333 #define configBSP430_HAL_EUSCI_A3 0
334 #endif /* configBSP430_HAL_EUSCI_A3 */
335 
337 #if (configBSP430_HAL_EUSCI_A3 - 0)
338 /* You do not need to know about this */
339 extern sBSP430halSERIAL xBSP430hal_EUSCI_A3_;
340 #endif /* configBSP430_HAL_EUSCI_A3 */
341 
349 #if defined(BSP430_DOXYGEN) || (configBSP430_HAL_EUSCI_A3 - 0)
350 #define BSP430_HAL_EUSCI_A3 (&xBSP430hal_EUSCI_A3_)
351 #endif /* configBSP430_HAL_EUSCI_A3 */
352 
369 #ifndef configBSP430_HAL_EUSCI_B0
370 #define configBSP430_HAL_EUSCI_B0 0
371 #endif /* configBSP430_HAL_EUSCI_B0 */
372 
374 #if (configBSP430_HAL_EUSCI_B0 - 0)
375 /* You do not need to know about this */
376 extern sBSP430halSERIAL xBSP430hal_EUSCI_B0_;
377 #endif /* configBSP430_HAL_EUSCI_B0 */
378 
386 #if defined(BSP430_DOXYGEN) || (configBSP430_HAL_EUSCI_B0 - 0)
387 #define BSP430_HAL_EUSCI_B0 (&xBSP430hal_EUSCI_B0_)
388 #endif /* configBSP430_HAL_EUSCI_B0 */
389 
406 #ifndef configBSP430_HAL_EUSCI_B1
407 #define configBSP430_HAL_EUSCI_B1 0
408 #endif /* configBSP430_HAL_EUSCI_B1 */
409 
411 #if (configBSP430_HAL_EUSCI_B1 - 0)
412 /* You do not need to know about this */
413 extern sBSP430halSERIAL xBSP430hal_EUSCI_B1_;
414 #endif /* configBSP430_HAL_EUSCI_B1 */
415 
423 #if defined(BSP430_DOXYGEN) || (configBSP430_HAL_EUSCI_B1 - 0)
424 #define BSP430_HAL_EUSCI_B1 (&xBSP430hal_EUSCI_B1_)
425 #endif /* configBSP430_HAL_EUSCI_B1 */
426 
427 /* END AUTOMATICALLY GENERATED CODE [hal_decl] */
428 /* !BSP430! end=hal_decl */
429 
430 /* !BSP430! periph=euscia instance=EUSCI_A0,EUSCI_A1,EUSCI_A2,EUSCI_A3 insert=periph_decl */
431 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [periph_decl] */
447 #ifndef configBSP430_HPL_EUSCI_A0
448 #define configBSP430_HPL_EUSCI_A0 (configBSP430_HAL_EUSCI_A0 - 0)
449 #endif /* configBSP430_HPL_EUSCI_A0 */
450 
451 #if (configBSP430_HAL_EUSCI_A0 - 0) && ! (configBSP430_HPL_EUSCI_A0 - 0)
452 #warning configBSP430_HAL_EUSCI_A0 requested without configBSP430_HPL_EUSCI_A0
453 #endif /* HAL and not HPL */
454 
461 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_A0 - 0)
462 #define BSP430_PERIPH_EUSCI_A0 ((tBSP430periphHandle)(BSP430_PERIPH_EUSCI_A0_BASEADDRESS_))
463 #endif /* configBSP430_HPL_EUSCI_A0 */
464 
480 #ifndef configBSP430_HPL_EUSCI_A1
481 #define configBSP430_HPL_EUSCI_A1 (configBSP430_HAL_EUSCI_A1 - 0)
482 #endif /* configBSP430_HPL_EUSCI_A1 */
483 
484 #if (configBSP430_HAL_EUSCI_A1 - 0) && ! (configBSP430_HPL_EUSCI_A1 - 0)
485 #warning configBSP430_HAL_EUSCI_A1 requested without configBSP430_HPL_EUSCI_A1
486 #endif /* HAL and not HPL */
487 
494 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_A1 - 0)
495 #define BSP430_PERIPH_EUSCI_A1 ((tBSP430periphHandle)(BSP430_PERIPH_EUSCI_A1_BASEADDRESS_))
496 #endif /* configBSP430_HPL_EUSCI_A1 */
497 
513 #ifndef configBSP430_HPL_EUSCI_A2
514 #define configBSP430_HPL_EUSCI_A2 (configBSP430_HAL_EUSCI_A2 - 0)
515 #endif /* configBSP430_HPL_EUSCI_A2 */
516 
517 #if (configBSP430_HAL_EUSCI_A2 - 0) && ! (configBSP430_HPL_EUSCI_A2 - 0)
518 #warning configBSP430_HAL_EUSCI_A2 requested without configBSP430_HPL_EUSCI_A2
519 #endif /* HAL and not HPL */
520 
527 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_A2 - 0)
528 #define BSP430_PERIPH_EUSCI_A2 ((tBSP430periphHandle)(BSP430_PERIPH_EUSCI_A2_BASEADDRESS_))
529 #endif /* configBSP430_HPL_EUSCI_A2 */
530 
546 #ifndef configBSP430_HPL_EUSCI_A3
547 #define configBSP430_HPL_EUSCI_A3 (configBSP430_HAL_EUSCI_A3 - 0)
548 #endif /* configBSP430_HPL_EUSCI_A3 */
549 
550 #if (configBSP430_HAL_EUSCI_A3 - 0) && ! (configBSP430_HPL_EUSCI_A3 - 0)
551 #warning configBSP430_HAL_EUSCI_A3 requested without configBSP430_HPL_EUSCI_A3
552 #endif /* HAL and not HPL */
553 
560 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_A3 - 0)
561 #define BSP430_PERIPH_EUSCI_A3 ((tBSP430periphHandle)(BSP430_PERIPH_EUSCI_A3_BASEADDRESS_))
562 #endif /* configBSP430_HPL_EUSCI_A3 */
563 
564 /* END AUTOMATICALLY GENERATED CODE [periph_decl] */
565 /* !BSP430! end=periph_decl */
566 
567 /* !BSP430! insert=hpl_decl */
568 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [hpl_decl] */
576 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_A0 - 0)
577 #define BSP430_HPL_EUSCI_A0 ((volatile sBSP430hplEUSCIA *)BSP430_PERIPH_EUSCI_A0)
578 #endif /* configBSP430_HPL_EUSCI_A0 */
579 
587 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_A1 - 0)
588 #define BSP430_HPL_EUSCI_A1 ((volatile sBSP430hplEUSCIA *)BSP430_PERIPH_EUSCI_A1)
589 #endif /* configBSP430_HPL_EUSCI_A1 */
590 
598 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_A2 - 0)
599 #define BSP430_HPL_EUSCI_A2 ((volatile sBSP430hplEUSCIA *)BSP430_PERIPH_EUSCI_A2)
600 #endif /* configBSP430_HPL_EUSCI_A2 */
601 
609 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_A3 - 0)
610 #define BSP430_HPL_EUSCI_A3 ((volatile sBSP430hplEUSCIA *)BSP430_PERIPH_EUSCI_A3)
611 #endif /* configBSP430_HPL_EUSCI_A3 */
612 
613 /* END AUTOMATICALLY GENERATED CODE [hpl_decl] */
614 /* !BSP430! end=hpl_decl */
615 
616 /* !BSP430! insert=hal_isr_decl */
617 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [hal_isr_decl] */
633 #ifndef configBSP430_HAL_EUSCI_A0_ISR
634 #define configBSP430_HAL_EUSCI_A0_ISR (configBSP430_HAL_EUSCI_A0 - 0)
635 #endif /* configBSP430_HAL_EUSCI_A0_ISR */
636 
637 #if (configBSP430_HAL_EUSCI_A0_ISR - 0) && ! (configBSP430_HAL_EUSCI_A0 - 0)
638 #warning configBSP430_HAL_EUSCI_A0_ISR requested without configBSP430_HAL_EUSCI_A0
639 #endif /* HAL_ISR and not HAL */
640 
656 #ifndef configBSP430_HAL_EUSCI_A1_ISR
657 #define configBSP430_HAL_EUSCI_A1_ISR (configBSP430_HAL_EUSCI_A1 - 0)
658 #endif /* configBSP430_HAL_EUSCI_A1_ISR */
659 
660 #if (configBSP430_HAL_EUSCI_A1_ISR - 0) && ! (configBSP430_HAL_EUSCI_A1 - 0)
661 #warning configBSP430_HAL_EUSCI_A1_ISR requested without configBSP430_HAL_EUSCI_A1
662 #endif /* HAL_ISR and not HAL */
663 
679 #ifndef configBSP430_HAL_EUSCI_A2_ISR
680 #define configBSP430_HAL_EUSCI_A2_ISR (configBSP430_HAL_EUSCI_A2 - 0)
681 #endif /* configBSP430_HAL_EUSCI_A2_ISR */
682 
683 #if (configBSP430_HAL_EUSCI_A2_ISR - 0) && ! (configBSP430_HAL_EUSCI_A2 - 0)
684 #warning configBSP430_HAL_EUSCI_A2_ISR requested without configBSP430_HAL_EUSCI_A2
685 #endif /* HAL_ISR and not HAL */
686 
702 #ifndef configBSP430_HAL_EUSCI_A3_ISR
703 #define configBSP430_HAL_EUSCI_A3_ISR (configBSP430_HAL_EUSCI_A3 - 0)
704 #endif /* configBSP430_HAL_EUSCI_A3_ISR */
705 
706 #if (configBSP430_HAL_EUSCI_A3_ISR - 0) && ! (configBSP430_HAL_EUSCI_A3 - 0)
707 #warning configBSP430_HAL_EUSCI_A3_ISR requested without configBSP430_HAL_EUSCI_A3
708 #endif /* HAL_ISR and not HAL */
709 
710 /* END AUTOMATICALLY GENERATED CODE [hal_isr_decl] */
711 /* !BSP430! end=hal_isr_decl */
712 
713 /* !BSP430! periph=euscib instance=EUSCI_B0,EUSCI_B1 insert=periph_decl */
714 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [periph_decl] */
730 #ifndef configBSP430_HPL_EUSCI_B0
731 #define configBSP430_HPL_EUSCI_B0 (configBSP430_HAL_EUSCI_B0 - 0)
732 #endif /* configBSP430_HPL_EUSCI_B0 */
733 
734 #if (configBSP430_HAL_EUSCI_B0 - 0) && ! (configBSP430_HPL_EUSCI_B0 - 0)
735 #warning configBSP430_HAL_EUSCI_B0 requested without configBSP430_HPL_EUSCI_B0
736 #endif /* HAL and not HPL */
737 
744 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_B0 - 0)
745 #define BSP430_PERIPH_EUSCI_B0 ((tBSP430periphHandle)(BSP430_PERIPH_EUSCI_B0_BASEADDRESS_))
746 #endif /* configBSP430_HPL_EUSCI_B0 */
747 
763 #ifndef configBSP430_HPL_EUSCI_B1
764 #define configBSP430_HPL_EUSCI_B1 (configBSP430_HAL_EUSCI_B1 - 0)
765 #endif /* configBSP430_HPL_EUSCI_B1 */
766 
767 #if (configBSP430_HAL_EUSCI_B1 - 0) && ! (configBSP430_HPL_EUSCI_B1 - 0)
768 #warning configBSP430_HAL_EUSCI_B1 requested without configBSP430_HPL_EUSCI_B1
769 #endif /* HAL and not HPL */
770 
777 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_B1 - 0)
778 #define BSP430_PERIPH_EUSCI_B1 ((tBSP430periphHandle)(BSP430_PERIPH_EUSCI_B1_BASEADDRESS_))
779 #endif /* configBSP430_HPL_EUSCI_B1 */
780 
781 /* END AUTOMATICALLY GENERATED CODE [periph_decl] */
782 /* !BSP430! end=periph_decl */
783 
784 /* !BSP430! insert=hpl_decl */
785 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [hpl_decl] */
793 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_B0 - 0)
794 #define BSP430_HPL_EUSCI_B0 ((volatile sBSP430hplEUSCIB *)BSP430_PERIPH_EUSCI_B0)
795 #endif /* configBSP430_HPL_EUSCI_B0 */
796 
804 #if defined(BSP430_DOXYGEN) || (configBSP430_HPL_EUSCI_B1 - 0)
805 #define BSP430_HPL_EUSCI_B1 ((volatile sBSP430hplEUSCIB *)BSP430_PERIPH_EUSCI_B1)
806 #endif /* configBSP430_HPL_EUSCI_B1 */
807 
808 /* END AUTOMATICALLY GENERATED CODE [hpl_decl] */
809 /* !BSP430! end=hpl_decl */
810 
811 /* !BSP430! insert=hal_isr_decl */
812 /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [hal_isr_decl] */
828 #ifndef configBSP430_HAL_EUSCI_B0_ISR
829 #define configBSP430_HAL_EUSCI_B0_ISR (configBSP430_HAL_EUSCI_B0 - 0)
830 #endif /* configBSP430_HAL_EUSCI_B0_ISR */
831 
832 #if (configBSP430_HAL_EUSCI_B0_ISR - 0) && ! (configBSP430_HAL_EUSCI_B0 - 0)
833 #warning configBSP430_HAL_EUSCI_B0_ISR requested without configBSP430_HAL_EUSCI_B0
834 #endif /* HAL_ISR and not HAL */
835 
851 #ifndef configBSP430_HAL_EUSCI_B1_ISR
852 #define configBSP430_HAL_EUSCI_B1_ISR (configBSP430_HAL_EUSCI_B1 - 0)
853 #endif /* configBSP430_HAL_EUSCI_B1_ISR */
854 
855 #if (configBSP430_HAL_EUSCI_B1_ISR - 0) && ! (configBSP430_HAL_EUSCI_B1 - 0)
856 #warning configBSP430_HAL_EUSCI_B1_ISR requested without configBSP430_HAL_EUSCI_B1
857 #endif /* HAL_ISR and not HAL */
858 
859 /* END AUTOMATICALLY GENERATED CODE [hal_isr_decl] */
860 /* !BSP430! end=hal_isr_decl */
861 
864  unsigned char ctl0_byte,
865  unsigned char ctl1_byte,
866  unsigned long baud);
867 
870  unsigned char ctl0_byte,
871  unsigned char ctl1_byte,
872  unsigned int prescaler);
873 
876  unsigned char ctl0_byte,
877  unsigned char ctl1_byte,
878  unsigned int prescaler);
879 
881 int iBSP430eusciSetReset_rh (hBSP430halSERIAL hal, int resetp);
882 
884 int iBSP430eusciSetHold_rh (hBSP430halSERIAL hal, int holdp);
885 
888 
891 
894 
897 
899 int iBSP430eusciUARTtxByte_rh (hBSP430halSERIAL device, uint8_t c);
900 
902 int iBSP430eusciUARTtxData_rh (hBSP430halSERIAL device, const uint8_t * data, size_t len);
903 
905 int iBSP430eusciUARTtxASCIIZ_rh (hBSP430halSERIAL device, const char * str);
906 
909  const uint8_t * tx_data,
910  size_t tx_len,
911  size_t rx_len,
912  uint8_t * rx_data);
913 
914 
917  int own_address,
918  int slave_address);
919 
922  uint8_t * rx_data,
923  size_t rx_len);
924 
927  const uint8_t * tx_data,
928  size_t tx_len);
929 
939 static BSP430_CORE_INLINE
940 volatile sBSP430hplEUSCIA *
942 {
943  /* !BSP430! periph=eusci instance=EUSCI_A0,EUSCI_A1,EUSCI_A2,EUSCI_A2 */
944  /* !BSP430! insert=periph_hpl_demux */
945  /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [periph_hpl_demux] */
946 #if (configBSP430_HPL_EUSCI_A0 - 0)
947  if (BSP430_PERIPH_EUSCI_A0 == periph) {
948  return BSP430_HPL_EUSCI_A0;
949  }
950 #endif /* configBSP430_HPL_EUSCI_A0 */
951 
952 #if (configBSP430_HPL_EUSCI_A1 - 0)
953  if (BSP430_PERIPH_EUSCI_A1 == periph) {
954  return BSP430_HPL_EUSCI_A1;
955  }
956 #endif /* configBSP430_HPL_EUSCI_A1 */
957 
958 #if (configBSP430_HPL_EUSCI_A2 - 0)
959  if (BSP430_PERIPH_EUSCI_A2 == periph) {
960  return BSP430_HPL_EUSCI_A2;
961  }
962 #endif /* configBSP430_HPL_EUSCI_A2 */
963 
964 #if (configBSP430_HPL_EUSCI_A2 - 0)
965  if (BSP430_PERIPH_EUSCI_A2 == periph) {
966  return BSP430_HPL_EUSCI_A2;
967  }
968 #endif /* configBSP430_HPL_EUSCI_A2 */
969 
970  /* END AUTOMATICALLY GENERATED CODE [periph_hpl_demux] */
971  /* !BSP430! end=periph_hpl_demux */
972  return NULL;
973 }
974 
984 static BSP430_CORE_INLINE
985 volatile sBSP430hplEUSCIB *
987 {
988  /* !BSP430! periph=eusci instance=EUSCI_B0,EUSCI_B1 */
989  /* !BSP430! insert=periph_hpl_demux */
990  /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [periph_hpl_demux] */
991 #if (configBSP430_HPL_EUSCI_B0 - 0)
992  if (BSP430_PERIPH_EUSCI_B0 == periph) {
993  return BSP430_HPL_EUSCI_B0;
994  }
995 #endif /* configBSP430_HPL_EUSCI_B0 */
996 
997 #if (configBSP430_HPL_EUSCI_B1 - 0)
998  if (BSP430_PERIPH_EUSCI_B1 == periph) {
999  return BSP430_HPL_EUSCI_B1;
1000  }
1001 #endif /* configBSP430_HPL_EUSCI_B1 */
1002 
1003  /* END AUTOMATICALLY GENERATED CODE [periph_hpl_demux] */
1004  /* !BSP430! end=periph_hpl_demux */
1005  return NULL;
1006 }
1007 
1016 static BSP430_CORE_INLINE
1019 {
1020  /* !BSP430! periph=eusci instance=EUSCI_A0,EUSCI_A1,EUSCI_A2,EUSCI_A3,EUSCI_B0,EUSCI_B1 */
1021  /* !BSP430! insert=periph_hal_demux */
1022  /* BEGIN AUTOMATICALLY GENERATED CODE---DO NOT MODIFY [periph_hal_demux] */
1023 #if (configBSP430_HAL_EUSCI_A0 - 0)
1024  if (BSP430_PERIPH_EUSCI_A0 == periph) {
1025  return BSP430_HAL_EUSCI_A0;
1026  }
1027 #endif /* configBSP430_HAL_EUSCI_A0 */
1028 
1029 #if (configBSP430_HAL_EUSCI_A1 - 0)
1030  if (BSP430_PERIPH_EUSCI_A1 == periph) {
1031  return BSP430_HAL_EUSCI_A1;
1032  }
1033 #endif /* configBSP430_HAL_EUSCI_A1 */
1034 
1035 #if (configBSP430_HAL_EUSCI_A2 - 0)
1036  if (BSP430_PERIPH_EUSCI_A2 == periph) {
1037  return BSP430_HAL_EUSCI_A2;
1038  }
1039 #endif /* configBSP430_HAL_EUSCI_A2 */
1040 
1041 #if (configBSP430_HAL_EUSCI_A3 - 0)
1042  if (BSP430_PERIPH_EUSCI_A3 == periph) {
1043  return BSP430_HAL_EUSCI_A3;
1044  }
1045 #endif /* configBSP430_HAL_EUSCI_A3 */
1046 
1047 #if (configBSP430_HAL_EUSCI_B0 - 0)
1048  if (BSP430_PERIPH_EUSCI_B0 == periph) {
1049  return BSP430_HAL_EUSCI_B0;
1050  }
1051 #endif /* configBSP430_HAL_EUSCI_B0 */
1052 
1053 #if (configBSP430_HAL_EUSCI_B1 - 0)
1054  if (BSP430_PERIPH_EUSCI_B1 == periph) {
1055  return BSP430_HAL_EUSCI_B1;
1056  }
1057 #endif /* configBSP430_HAL_EUSCI_B1 */
1058 
1059  /* END AUTOMATICALLY GENERATED CODE [periph_hal_demux] */
1060  /* !BSP430! end=periph_hal_demux */
1061  return NULL;
1062 }
1063 
1070 const char * xBSP430eusciName (tBSP430periphHandle periph);
1071 
1072 #endif /* BSP430_MODULE_EUSCI */
1073 
1074 #endif /* BSP430_PERIPH_EUSCI_H */
1075 
#define BSP430_HAL_EUSCI_A0
Definition: eusci.h:239
unsigned int mctlw
Definition: eusci.h:128
int iBSP430eusciSetReset_rh(hBSP430halSERIAL hal, int resetp)
unsigned int ctlw1
Definition: eusci.h:119
int iBSP430eusciClose(hBSP430halSERIAL hal)
void vBSP430eusciWakeupTransmit_rh(hBSP430halSERIAL device)
unsigned int i2csa
Definition: eusci.h:184
int iBSP430eusciI2CtxData_rh(hBSP430halSERIAL hal, const uint8_t *tx_data, size_t tx_len)
unsigned int statw
Definition: eusci.h:167
#define BSP430_HPL_EUSCI_A1
Definition: eusci.h:588
#define BSP430_HPL_EUSCI_B0
Definition: eusci.h:794
unsigned char stat
Definition: eusci.h:169
unsigned int ctlw0
Definition: eusci.h:113
unsigned int ctlw1
Definition: eusci.h:157
#define BSP430_HAL_EUSCI_A3
Definition: eusci.h:350
unsigned int irctl
Definition: eusci.h:134
hBSP430halSERIAL hBSP430eusciOpenI2C(hBSP430halSERIAL hal, unsigned char ctl0_byte, unsigned char ctl1_byte, unsigned int prescaler)
unsigned char bcnt
Definition: eusci.h:170
unsigned int addrx
Definition: eusci.h:182
Definition: serial_.h:193
unsigned int i2coa2
Definition: eusci.h:180
struct sBSP430hplEUSCIB sBSP430hplEUSCIB
int iBSP430eusciUARTtxByte_rh(hBSP430halSERIAL device, uint8_t c)
int iBSP430eusciUARTrxByte_rh(hBSP430halSERIAL device)
unsigned int addmask
Definition: eusci.h:183
static BSP430_CORE_INLINE volatile sBSP430hplEUSCIB * xBSP430hplLookupEUSCIB(tBSP430periphHandle periph)
Definition: eusci.h:986
unsigned char br0
Definition: eusci.h:124
unsigned char br1
Definition: eusci.h:125
unsigned char ctl0
Definition: eusci.h:116
hBSP430halSERIAL hBSP430eusciOpenSPI(hBSP430halSERIAL hal, unsigned char ctl0_byte, unsigned char ctl1_byte, unsigned int prescaler)
#define BSP430_HAL_EUSCI_B1
Definition: eusci.h:424
unsigned int ctlw0
Definition: eusci.h:151
int iBSP430eusciI2CrxData_rh(hBSP430halSERIAL hal, uint8_t *rx_data, size_t rx_len)
void vBSP430eusciFlush_ni(hBSP430halSERIAL device)
unsigned char irtctl
Definition: eusci.h:136
#define BSP430_CORE_INLINE
Definition: core.h:439
Generic peripheral support for MSP430 MCUs.
unsigned int txbuf
Definition: eusci.h:175
#define BSP430_HPL_EUSCI_A0
Definition: eusci.h:577
#define BSP430_HAL_EUSCI_B0
Definition: eusci.h:387
int iBSP430eusciSPITxRx_rh(hBSP430halSERIAL hal, const uint8_t *tx_data, size_t tx_len, size_t rx_len, uint8_t *rx_data)
int iBSP430eusciI2CsetAddresses_rh(hBSP430halSERIAL hal, int own_address, int slave_address)
#define BSP430_PERIPH_EUSCI_A2
Definition: eusci.h:528
unsigned int tbcnt
Definition: eusci.h:173
unsigned int brw
Definition: eusci.h:122
unsigned char ctl0
Definition: eusci.h:154
int iBSP430eusciSetHold_rh(hBSP430halSERIAL hal, int holdp)
unsigned char br1
Definition: eusci.h:163
#define BSP430_HAL_EUSCI_A1
Definition: eusci.h:276
#define BSP430_PERIPH_EUSCI_B0
Definition: eusci.h:745
unsigned char irrctl
Definition: eusci.h:137
unsigned int txbuf
Definition: eusci.h:131
static BSP430_CORE_INLINE hBSP430halSERIAL hBSP430eusciLookup(tBSP430periphHandle periph)
Definition: eusci.h:1018
unsigned int i2coa1
Definition: eusci.h:179
Definition: eusci.h:149
#define BSP430_PERIPH_EUSCI_A3
Definition: eusci.h:561
unsigned char ctl1
Definition: eusci.h:153
#define BSP430_HPL_EUSCI_A2
Definition: eusci.h:599
#define BSP430_PERIPH_EUSCI_B1
Definition: eusci.h:778
unsigned int rxbuf
Definition: eusci.h:174
unsigned int abctl
Definition: eusci.h:132
int iBSP430eusciUARTtxData_rh(hBSP430halSERIAL device, const uint8_t *data, size_t len)
int iBSP430eusciUARTtxASCIIZ_rh(hBSP430halSERIAL device, const char *str)
struct sBSP430hplEUSCIA sBSP430hplEUSCIA
static BSP430_CORE_INLINE volatile sBSP430hplEUSCIA * xBSP430hplLookupEUSCIA(tBSP430periphHandle periph)
Definition: eusci.h:941
unsigned int iv
Definition: eusci.h:191
unsigned char br0
Definition: eusci.h:162
unsigned int statw
Definition: eusci.h:129
int tBSP430periphHandle
Definition: periph.h:106
unsigned int rxbuf
Definition: eusci.h:130
#define BSP430_HPL_EUSCI_B1
Definition: eusci.h:805
unsigned int brw
Definition: eusci.h:160
Structures for abstracted serial interface.
const char * xBSP430eusciName(tBSP430periphHandle periph)
#define BSP430_HAL_EUSCI_A2
Definition: eusci.h:313
#define BSP430_PERIPH_EUSCI_A1
Definition: eusci.h:495
unsigned int ie
Definition: eusci.h:143
unsigned int i2coa0
Definition: eusci.h:178
unsigned int i2coa3
Definition: eusci.h:181
Definition: eusci.h:111
unsigned int iv
Definition: eusci.h:145
unsigned int ifg
Definition: eusci.h:144
hBSP430halSERIAL hBSP430eusciOpenUART(hBSP430halSERIAL hal, unsigned char ctl0_byte, unsigned char ctl1_byte, unsigned long baud)
unsigned int ie
Definition: eusci.h:189
unsigned int ifg
Definition: eusci.h:190
#define BSP430_PERIPH_EUSCI_A0
Definition: eusci.h:462
unsigned char ctl1
Definition: eusci.h:115