Example of Peripheral Structure .h file
Example of Peripheral Structure .h file
Example of Peripheral Structure .h file
Example of Peripheral Structure .h file
/* ADC Individual Register Bit Definitions */
/* ADC Individual Register Bit Definitions */
struct
struct
ADCTRL1_BITS { // bits description
ADCTRL1_BITS { // bits description
Uint16 rsvd1:4; // 3:0 reserved
Uint16 rsvd1:4; // 3:0 reserved
Uint16 SEQ_CASC:1; // 4 Cascaded sequencer mode
Uint16 SEQ_CASC:1; // 4 Cascaded sequencer mode
Uint16 rsvd2:1; // 5 reserved
Uint16 rsvd2:1; // 5 reserved
Uint16 CONT_RUN:1; // 6 Continuous run
Uint16 CONT_RUN:1; // 6 Continuous run
Uint16 CPS:1; // 7 ADC core clock
Uint16 CPS:1; // 7 ADC core clock
prescaler
prescaler
Uint16 ACQ_PS:4;
Uint16 ACQ_PS:4;
// 11:8 Acquisition window size
// 11:8 Acquisition window size
Uint16 SUSMOD:2; // 13:12 Emulation suspend mode
Uint16 SUSMOD:2; // 13:12 Emulation suspend mode
Uint16 RESET:1;
Uint16 RESET:1;
// 14 ADC reset
// 14 ADC reset
Uint16 rsvd3:1;
Uint16 rsvd3:1;
// 15 reserved
// 15 reserved
};
};
/* Allow access to the bit fields or entire register */
/* Allow access to the bit fields or entire register */
union ADCTRL1_REG {
union ADCTRL1_REG {
Uint16 all;
Uint16 all;
struct
struct
ADCTRL1_BITS bit;
ADCTRL1_BITS bit;
};
};
// ADC External References & Function Declarations:
// ADC External References & Function Declarations:
extern volatile
extern volatile
struct
struct
ADC_REGS
ADC_REGS
AdcRegs
AdcRegs
;
;
Example
Example
Adc
Adc
.h
.h
#include “DSP281x_Device.h”
#include “DSP281x_Device.h”
Void
Void
InitAdc
InitAdc
(void)
(void)
{
{
/* Reset the ADC module */
/* Reset the ADC module */
AdcRegs
AdcRegs
.ADCTRL1.bit.RESET = 1;
.ADCTRL1.bit.RESET = 1;
/* configure the ADC register */
/* configure the ADC register */
AdcRegs
AdcRegs
.ADCTRL1.all = 0x0710;
.ADCTRL1.all = 0x0710;
};
};
Example
Example
Adc
Adc
.c or main.c
.c or main.c
C28x - Peripheral Registers Header Files
3 - 7
Summary of Contents for C28 Series
Page 64: ...Summary 3 16 C28x Peripheral Registers Header Files ...
Page 78: ...Interrupt Sources 4 14 C28x Reset and Interrupts ...
Page 218: ...Lab 9 DSP BIOS 9 22 C28x Using DSP BIOS ...
Page 244: ...Lab 10 Programming the Flash 10 26 C28x System Design ...
Page 273: ...Appendix A eZdsp F2812 C28x Appendix A eZdsp F2812 A 1 ...
Page 276: ...Appendix P2 Expansion Interface A 4 C28x Appendix A eZdsp F2812 ...
Page 277: ...Appendix P4 P8 P7 I O Interface C28x Appendix A eZdsp F2812 A 5 ...
Page 278: ...Appendix A 6 C28x Appendix A eZdsp F2812 ...
Page 279: ...Appendix P5 P9 Analog Interface C28x Appendix A eZdsp F2812 A 7 ...
Page 282: ...Appendix A 10 C28x Appendix A eZdsp F2812 TP1 TP2 Test Points ...