24 #ifndef P33C_DSP_SFR_ABSTRACTION_H 25 #define P33C_DSP_SFR_ABSTRACTION_H 40 #define REG_CORCON_UNUSED_MSK 0b0100000000000000 41 #define REG_CORCON_VALID_DATA_WRITE_MSK 0b1011100011110011 42 #define REG_CORCON_VALID_DATA_READ_MSK 0b1011111111111111 44 #define REG_CORCON_VAR_VARIABLE 0b1000000000000000 45 #define REG_CORCON_VAR_FIXED 0b0000000000000000 48 CORCON_VAR_VARIABLE = 0b1,
49 CORCON_VAR_FIXED = 0b0
51 typedef enum CORCON_VAR_e CORCON_VAR_t;
53 #define REG_CORCON_US_MIXED 0b0010000000000000 // DSP engine multiplies are mixed sign 54 #define REG_CORCON_US_UNSIGNED 0b0001000000000000 // DSP engine multiplies are unsigned 55 #define REG_CORCON_US_SIGNED 0b0000000000000000 // DSP engine multiplies are signed 58 CORCON_US_MIXED = 0b10,
59 CORCON_US_UNSIGNED = 0b01,
60 CORCON_US_SIGNED = 0b00
62 typedef enum CORCON_US_e CORCON_US_t;
64 #define REG_CORCON_EDT_TERMINATE 0b0000100000000000 65 #define REG_CORCON_EDT_RUN 0b0000000000000000 68 CORCON_EDT_TERMINATE = 0b1,
71 typedef enum CORCON_EDT_e CORCON_EDT_t;
73 #define REG_CORCON_DL_7 0b0000011100000000 // Seven DO loops are active 74 #define REG_CORCON_DL_6 0b0000011100000000 // Six DO loops are active 75 #define REG_CORCON_DL_5 0b0000011100000000 // Five DO loops are active 76 #define REG_CORCON_DL_4 0b0000011100000000 // Four DO loops are active 77 #define REG_CORCON_DL_3 0b0000011100000000 // Three DO loops are active 78 #define REG_CORCON_DL_2 0b0000011100000000 // Two DO loops are active 79 #define REG_CORCON_DL_1 0b0000011100000000 // One DO loops are active 80 #define REG_CORCON_DL_0 0b0000011100000000 // Zero DO loops are active 82 enum CORCON_DL_STAT_e{
92 typedef enum CORCON_DL_STAT_e CORCON_DL_STAT_t;
94 #define REG_CORCON_SATA_ON 0b0000000010000000 // Accumulator A saturation is enabled 95 #define REG_CORCON_SATA_OFF 0b0000000000000000 // Accumulator A saturation is disabled 101 typedef enum CORCON_SATA_e CORCON_SATA_t;
103 #define REG_CORCON_SATB_ON 0b0000000001000000 // Accumulator B saturation is enabled 104 #define REG_CORCON_SATB_OFF 0b0000000000000000 // Accumulator B saturation is disabled 107 CORCON_SATB_ON = 0b1,
108 CORCON_SATB_OFF = 0b0
110 typedef enum CORCON_SATB_e CORCON_SATB_t;
112 #define REG_CORCON_SATDW_ON 0b0000000000100000 // Data Space write saturation is enabled 113 #define REG_CORCON_SATDW_OFF 0b0000000000000000 // Data Space write saturation is disabled 116 CORCON_SATDW_ON = 0b1,
117 CORCON_SATDW_OFF = 0b0
119 typedef enum CORCON_SATDW_e CORCON_SATDW_t;
121 #define REG_CORCON_ACCSAT_931 0b0000000000010000 // 9.31 saturation (super saturation) 122 #define REG_CORCON_ACCSAT_131 0b0000000000000000 // 1.31 saturation (normal saturation) 124 enum CORCON_ACCSAT_e{
125 CORCON_ACCSAT_931 = 0b1,
126 CORCON_ACCSAT_131 = 0b0
128 typedef enum CORCON_ACCSAT_e CORCON_ACCSAT_t;
130 #define REG_CORCON_IPL3_STAT_GT7 0b0000000000001000 131 #define REG_CORCON_IPL3_STAT_LT7 0b0000000000000000 133 enum CORCON_IPL3_STAT_e{
134 CORCON_IPL3_STAT_GT7 = 0b1,
135 CORCON_IPL3_STAT_LT7 = 0b0
137 typedef enum CORCON_IPL3_STAT_e CORCON_IPL3_STAT_t;
139 #define REG_CORCON_SFA_ACTIVE 0b0000000000000100 // Stack frame is active; W14 and W15 address 0x0000 to 0xFFFF, regardless of DSRPAG 140 #define REG_CORCON_SFA_INACTIVE 0b0000000000000000 // Stack frame is not active; W14 and W15 address the base Data Space 143 CORCON_SFA_ACTIVE = 0b1,
144 CORCON_SFA_INACTIVE = 0b0
146 typedef enum CORCON_SFA_e CORCON_SFA_t;
148 #define REG_CORCON_RND_BIASED 0b0000000000000010 // Biased (conventional) rounding is enabled 149 #define REG_CORCON_RND_UNBIASED 0b0000000000000000 // Unbiased (convergent) rounding is enabled 152 CORCON_RND_BIASED = 0b1,
153 CORCON_RND_UNBIASED = 0b0
155 typedef enum CORCON_RND_e CORCON_RND_t;
157 #define REG_CORCON_IF_INTEGER 0b0000000000000001 // Integer mode is enabled for DSP multiply 158 #define REG_CORCON_IF_FRACTIONAL 0b0000000000000000 // Fractional mode is enabled for DSP multiply 161 CORCON_IF_INTEGER = 0b1,
162 CORCON_IF_FRACTIONAL = 0b0
164 typedef enum CORCON_IF_e CORCON_IF_t;
189 #define p33c_DspConfig_GetHandle() (struct P33C_DSP_CONFIG_s*)&CORCON 193 extern volatile uint16_t p33c_Dsp_WriteConfig(
volatile struct P33C_DSP_CONFIG_s dsp_cfg);
struct tagCORCONBITS bits
union P33C_DSP_CONFIG_s::@122 CORCON