Infineon MOTIX™ MCU TLE985x Device Family SDK
ssc.h
Go to the documentation of this file.
1 /*
2  ***********************************************************************************************************************
3  *
4  * Copyright (c) 2018-2023, Infineon Technologies AG
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without modification,are permitted provided that the
8  * following conditions are met:
9  *
10  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following
11  * disclaimer.
12  *
13  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
14  * following disclaimer in the documentation and/or other materials provided with the distribution.
15  *
16  * Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote
17  * products derived from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24  * WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
25  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  **********************************************************************************************************************/
39 /*******************************************************************************
40 ** Author(s) Identity **
41 ********************************************************************************
42 ** Initials Name **
43 ** ---------------------------------------------------------------------------**
44 ** TS T&S **
45 ** BG Blandine Guillot **
46 ** JO Julia OTt **
47 *******************************************************************************/
48 
49 /*******************************************************************************
50 ** Revision Control History **
51 ********************************************************************************
52 ** V0.2.0: 2018-02-13, TS: Initial version of revision history **
53 ** V0.2.1: 2019-01-28, TS: __STATIC_INLINE changed to INLINE **
54 ** Doxygen update **
55 ** Revision history moved from ssc.c to ssc.h **
56 ** V0.2.2: 2020-03-02, BG: Updated revision history format **
57 ** V0.2.3: 2022-01-21, JO: EP-934: Updated copyright and branding **
58 ** V0.2.4: 2023-08-28, JO: EP-435: Removed ARMCC v6 compiler warnings **
59 *******************************************************************************/
60 
61 #ifndef SSC_H
62 #define SSC_H
63 
64 /*******************************************************************************
65 ** Includes **
66 *******************************************************************************/
67 #include "tle985x.h"
68 #include "types.h"
69 #include "sfr_access.h"
70 
71 /*******************************************************************************
72 ** Global Macro Definitions **
73 *******************************************************************************/
75 #define SSC1_tBit_us (1.0 / (SSC1_MAN_BAUDRATE / 1000.0))
77 #define SSC2_tBit_us (1.0 / (SSC2_MAN_BAUDRATE / 1000.0))
78 
79 /*******************************************************************************
80 ** Global Function Declarations **
81 *******************************************************************************/
86 void SSC1_Init(void);
87 
92 void SSC2_Init(void);
93 
94 /*******************************************************************************
95 ** Inline Function Declarations **
96 *******************************************************************************/
114 INLINE void SSC1_TX_Int_Clr(void);
115 
133 INLINE void SSC1_RX_Int_Clr(void);
134 
152 INLINE void SSC1_Err_Int_Clr(void);
153 
171 INLINE void SSC2_TX_Int_Clr(void);
172 
190 INLINE void SSC2_RX_Int_Clr(void);
191 
209 INLINE void SSC2_Err_Int_Clr(void);
210 
228 INLINE void SSC1_TX_Int_En(void);
229 
248 INLINE void SSC1_TX_Int_Dis(void);
249 
267 INLINE void SSC1_RX_Int_En(void);
268 
287 INLINE void SSC1_RX_Int_Dis(void);
288 
306 INLINE void SSC1_Err_Int_En(void);
307 
326 INLINE void SSC1_Err_Int_Dis(void);
327 
345 INLINE void SSC2_TX_Int_En(void);
346 
365 INLINE void SSC2_TX_Int_Dis(void);
366 
384 INLINE void SSC2_RX_Int_En(void);
385 
404 INLINE void SSC2_RX_Int_Dis(void);
405 
423 INLINE void SSC2_Err_Int_En(void);
424 
443 INLINE void SSC2_Err_Int_Dis(void);
444 
457 INLINE void SSC1_TE_Sts_Clr(void);
458 
471 INLINE void SSC1_RE_Sts_Clr(void);
472 
485 INLINE void SSC1_PE_Sts_Clr(void);
486 
499 INLINE void SSC1_BE_Sts_Clr(void);
500 
513 INLINE void SSC2_TE_Sts_Clr(void);
514 
527 INLINE void SSC2_RE_Sts_Clr(void);
528 
541 INLINE void SSC2_PE_Sts_Clr(void);
542 
555 INLINE void SSC2_BE_Sts_Clr(void);
556 
571 INLINE void SSC1_SendWord(uint16 DataWord);
572 
590 
605 INLINE void SSC2_SendWord(uint16 DataWord);
606 
624 
625 /*******************************************************************************
626 ** Inline Function Definitions **
627 *******************************************************************************/
629 {
631 }
632 
634 {
636 }
637 
639 {
641 }
642 
644 {
646 }
647 
649 {
651 }
652 
654 {
656 }
657 
659 {
661 }
662 
664 {
666 }
667 
669 {
671 }
672 
674 {
676 }
677 
679 {
681 }
682 
684 {
686 }
687 
689 {
691 }
692 
694 {
696 }
697 
699 {
701 }
702 
704 {
706 }
707 
709 {
711 }
712 
714 {
716 }
717 
719 {
721 }
722 
724 {
726 }
727 
729 {
731 }
732 
734 {
736 }
737 
739 {
741 }
742 
744 {
746 }
747 
749 {
751 }
752 
754 {
756 }
757 
759 {
761 }
762 
764 {
766 }
767 
769 {
771 }
772 
774 {
776 }
777 
778 #endif
#define SSC2
Definition: tle985x.h:6280
#define SSC1
Definition: tle985x.h:6279
#define SCU
Definition: tle985x.h:6277
#define SCU_IRCON2CLR_TIR1C_Msk
Definition: tle985x.h:10034
#define SSC2_ISRCLR_BECLR_Msk
Definition: tle985x.h:10733
#define SSC1_ISRCLR_RECLR_Msk
Definition: tle985x.h:10665
#define SSC2_ISRCLR_PECLR_Msk
Definition: tle985x.h:10735
#define SSC1_RB_RB_VALUE_Pos
Definition: tle985x.h:10680
#define SCU_MODIEN1_EIREN1_Msk
Definition: tle985x.h:10131
#define SCU_MODIEN1_TIREN1_Pos
Definition: tle985x.h:10128
#define SCU_IRCON3CLR_TIR2C_Msk
Definition: tle985x.h:10048
#define SCU_MODIEN1_RIREN1_Msk
Definition: tle985x.h:10127
#define SSC2_ISRCLR_TECLR_Msk
Definition: tle985x.h:10739
#define SCU_IRCON3CLR_EIR2C_Pos
Definition: tle985x.h:10049
#define SSC2_TB_TB_VALUE_Pos
Definition: tle985x.h:10755
#define SCU_IRCON3CLR_EIR2C_Msk
Definition: tle985x.h:10050
#define SSC2_ISRCLR_RECLR_Msk
Definition: tle985x.h:10737
#define SCU_MODIEN1_TIREN2_Pos
Definition: tle985x.h:10122
#define SSC1_ISRCLR_BECLR_Pos
Definition: tle985x.h:10660
#define SSC1_ISRCLR_RECLR_Pos
Definition: tle985x.h:10664
#define SSC1_ISRCLR_PECLR_Pos
Definition: tle985x.h:10662
#define SSC1_TB_TB_VALUE_Pos
Definition: tle985x.h:10683
#define SSC2_ISRCLR_RECLR_Pos
Definition: tle985x.h:10736
#define SSC2_ISRCLR_TECLR_Pos
Definition: tle985x.h:10738
#define SCU_IRCON2CLR_RIR1C_Msk
Definition: tle985x.h:10032
#define SSC1_RB_RB_VALUE_Msk
Definition: tle985x.h:10681
#define SCU_IRCON3CLR_TIR2C_Pos
Definition: tle985x.h:10047
#define SCU_IRCON2CLR_EIR1C_Msk
Definition: tle985x.h:10036
#define SCU_MODIEN1_EIREN2_Pos
Definition: tle985x.h:10124
#define SCU_MODIEN1_TIREN2_Msk
Definition: tle985x.h:10123
#define SCU_MODIEN1_TIREN1_Msk
Definition: tle985x.h:10129
#define SCU_MODIEN1_EIREN1_Pos
Definition: tle985x.h:10130
#define SCU_IRCON2CLR_EIR1C_Pos
Definition: tle985x.h:10035
#define SCU_IRCON3CLR_RIR2C_Msk
Definition: tle985x.h:10046
#define SCU_MODIEN1_EIREN2_Msk
Definition: tle985x.h:10125
#define SCU_MODIEN1_RIREN2_Msk
Definition: tle985x.h:10121
#define SSC2_RB_RB_VALUE_Pos
Definition: tle985x.h:10752
#define SCU_IRCON2CLR_TIR1C_Pos
Definition: tle985x.h:10033
#define SSC1_ISRCLR_BECLR_Msk
Definition: tle985x.h:10661
#define SCU_MODIEN1_RIREN1_Pos
Definition: tle985x.h:10126
#define SCU_IRCON2CLR_RIR1C_Pos
Definition: tle985x.h:10031
#define SSC1_TB_TB_VALUE_Msk
Definition: tle985x.h:10684
#define SSC2_RB_RB_VALUE_Msk
Definition: tle985x.h:10753
#define SSC1_ISRCLR_TECLR_Pos
Definition: tle985x.h:10666
#define SSC2_TB_TB_VALUE_Msk
Definition: tle985x.h:10756
#define SCU_IRCON3CLR_RIR2C_Pos
Definition: tle985x.h:10045
#define SSC1_ISRCLR_TECLR_Msk
Definition: tle985x.h:10667
#define SSC1_ISRCLR_PECLR_Msk
Definition: tle985x.h:10663
#define SSC2_ISRCLR_PECLR_Pos
Definition: tle985x.h:10734
#define SSC2_ISRCLR_BECLR_Pos
Definition: tle985x.h:10732
#define SCU_MODIEN1_RIREN2_Pos
Definition: tle985x.h:10120
SFR low level access library.
INLINE uint16 u16_Field_Rd32(const volatile uint32 *reg, uint8 pos, uint32 msk)
This function reads a 16-bit field of a 32-bit register.
Definition: sfr_access.h:448
INLINE void Field_Wrt32(volatile uint32 *reg, uint8 pos, uint32 msk, uint32 val)
This function writes a bit field in a 32-bit register.
Definition: sfr_access.h:358
INLINE void Field_Mod32(volatile uint32 *reg, uint8 pos, uint32 msk, uint32 val)
This function writes a bit field in a 32-bit register.
Definition: sfr_access.h:378
INLINE void SSC2_TX_Int_Clr(void)
Clears transmit interrupt flag for SSC2.
Definition: ssc.h:643
INLINE void SSC1_SendWord(uint16 DataWord)
Sends SSC1 data word.
Definition: ssc.h:758
INLINE void SSC2_TX_Int_En(void)
Enables transmit interrupt for SSC2.
Definition: ssc.h:688
void SSC1_Init(void)
Initializes the SSC1 module.
INLINE void SSC2_RX_Int_En(void)
Enables receive interrupt for SSC2.
Definition: ssc.h:698
INLINE void SSC1_RE_Sts_Clr(void)
Clears Receive Error flag for SSC1.
Definition: ssc.h:723
INLINE void SSC2_PE_Sts_Clr(void)
Clears Phase Error flag for SSC2.
Definition: ssc.h:748
INLINE void SSC2_Err_Int_En(void)
Enables error interrupt for SSC2.
Definition: ssc.h:708
INLINE void SSC1_RX_Int_Dis(void)
Disables receive interrupt for SSC1.
Definition: ssc.h:673
INLINE void SSC2_BE_Sts_Clr(void)
Clears BaudRate Error flag for SSC2.
Definition: ssc.h:753
INLINE void SSC1_Err_Int_Clr(void)
Clears error interrupt flag for SSC1.
Definition: ssc.h:638
INLINE void SSC1_RX_Int_Clr(void)
Clears receive interrupt flag for SSC1.
Definition: ssc.h:633
INLINE void SSC1_RX_Int_En(void)
Enables receive interrupt for SSC1.
Definition: ssc.h:668
void SSC2_Init(void)
Initializes the SSC2 module.
INLINE void SSC2_TE_Sts_Clr(void)
Clears Transmit Error flag for SSC2.
Definition: ssc.h:738
INLINE void SSC2_RX_Int_Clr(void)
Clears receive interrupt flag for SSC2.
Definition: ssc.h:648
INLINE uint16 SSC2_ReadWord(void)
Reads SSC2 data word from receive buffer.
Definition: ssc.h:773
INLINE void SSC2_RE_Sts_Clr(void)
Clears Receive Error flag for SSC2.
Definition: ssc.h:743
INLINE void SSC1_Err_Int_Dis(void)
Disables error interrupt for SSC1.
Definition: ssc.h:683
INLINE void SSC2_Err_Int_Clr(void)
Clears error interrupt flag for SSC2.
Definition: ssc.h:653
INLINE void SSC1_PE_Sts_Clr(void)
Clears Phase Error flag for SSC1.
Definition: ssc.h:728
INLINE void SSC2_RX_Int_Dis(void)
Disables receive interrupt for SSC2.
Definition: ssc.h:703
INLINE void SSC1_TX_Int_En(void)
Enables transmit interrupt for SSC1.
Definition: ssc.h:658
INLINE void SSC1_Err_Int_En(void)
Enables error interrupt for SSC1.
Definition: ssc.h:678
INLINE void SSC1_TX_Int_Dis(void)
Disables transmit interrupt for SSC1.
Definition: ssc.h:663
INLINE uint16 SSC1_ReadWord(void)
Reads SSC1 data word from receive buffer.
Definition: ssc.h:763
INLINE void SSC1_BE_Sts_Clr(void)
Clears BaudRate Error flag for SSC1.
Definition: ssc.h:733
INLINE void SSC2_Err_Int_Dis(void)
Disables error interrupt for SSC2.
Definition: ssc.h:713
INLINE void SSC2_SendWord(uint16 DataWord)
Sends SSC2 data word.
Definition: ssc.h:768
INLINE void SSC1_TX_Int_Clr(void)
Clears transmit interrupt flag for SSC1.
Definition: ssc.h:628
INLINE void SSC1_TE_Sts_Clr(void)
Clears Transmit Error flag for SSC1.
Definition: ssc.h:718
INLINE void SSC2_TX_Int_Dis(void)
Disables transmit interrupt for SSC2.
Definition: ssc.h:693
CMSIS register HeaderFile.
General type declarations.
#define INLINE
Definition: types.h:145
uint8_t uint8
8 bit unsigned value
Definition: types.h:153
uint16_t uint16
16 bit unsigned value
Definition: types.h:154