1 import ti.catalog.msp430.peripherals.clock.IClock;
2 import ti.catalog.msp430.peripherals.special_function.IE2;
3
4 /*!
5 * Universal Serial Communication Interface B0 I2C 2xx
6 */
7 metaonly module USCI_B0_I2C_2xx inherits IUSCI_B0_I2C {
8
9 10 11
12 create(IClock.Instance clock , IE2.Instance interruptEnableRegister2);
13
14 /*! Not-acknowledge interrupt enable */
15 enum UCNACKIE_t {
16 UCNACKIE_OFF = 0x00, /*! Interrupt disabled */
17 UCNACKIE = 0x80 /*! Interrupt enabled */
18 };
19
20 /*! Stop condition interrupt enable */
21 enum UCSTPIE_t {
22 UCSTPIE_OFF = 0x00, /*! Interrupt disabled */
23 UCSTPIE = 0x80 /*! Interrupt enabled */
24 };
25
26 /*! Start condition interrupt enable */
27 enum UCSTTIE_t {
28 UCSTTIE_OFF = 0x00, /*! Interrupt disabled */
29 UCSTTIE = 0x80 /*! Interrupt enabled */
30 };
31
32 /*! Arbitration lost interrupt enable */
33 enum UCALIE_t {
34 UCALIE_OFF = 0x00, /*! Interrupt disabled */
35 UCALIE = 0x80 /*! Interrupt enabled */
36 };
37
38 /*! USCI_Bx I2C Interrupt Enable Register */
39 struct UCBxI2CIE_t {
40 UCNACKIE_t UCNACKIE; /*! Not-acknowledge interrupt enable
41 * 0 Interrupt disabled
42 * 1 Interrupt enabled */
43 UCSTPIE_t UCSTPIE; /*! Stop condition interrupt enable
44 * 0 Interrupt disabled
45 * 1 Interrupt enabled */
46 UCSTTIE_t UCSTTIE; /*! Start condition interrupt enable
47 * 0 Interrupt disabled
48 * 1 Interrupt enabled */
49 UCALIE_t UCALIE; /*! Arbitration lost interrupt enable
50 * 0 Interrupt disabled
51 * 1 Interrupt enabled */
52 }
53
54 instance:
55 /*! @_nodoc */
56 config IClock.Instance clock;
57 /*! @_nodoc */
58 config IE2.Instance interruptEnableRegister2;
59
60 /*! USCI_Bx I2C Interrupt Enable Register */
61 config UCBxI2CIE_t UCB0I2CIE = {
62 UCNACKIE : UCNACKIE_OFF,
63 UCSTPIE : UCSTPIE_OFF,
64 UCSTTIE : UCSTTIE_OFF,
65 UCALIE : UCALIE_OFF,
66 };
67
68 bool setUCNACKIE(bool set);
69 bool getUCNACKIE();
70
71 bool setUCSTPIE(bool set);
72 bool getUCSTPIE();
73
74 bool setUCSTTIE(bool set);
75 bool getUCSTTIE();
76
77 bool setUCALIE(bool set);
78 bool getUCALIE();
79 }