device.h
资源名称:se06.rar [点击查看]
上传用户:kepeng103
上传日期:2022-07-27
资源大小:2653k
文件大小:1k
源码类别:
DSP编程
开发平台:
C/C++
- #ifndef _DEV_H_
- #define _DEV_H_
- //PLL
- void pll_init(void);
- //led
- void set_led(uint8 mask, uint8 code);
- //gpio
- void gpio_init(void);
- //adc
- #define MASK_ADC_RESET 0x00002000
- #define MASK_ADC_SE 0x00000200
- #define ADC_SE_LO() REG32(GPIO_GPVAL) &= (~MASK_ADC_SE)
- #define ADC_SE_HI() REG32(GPIO_GPVAL) |= MASK_ADC_SE
- //dac
- #define MASK_DAC_PD 0x00000400
- #define MASK_DAC_MS 0x00000800
- #define DAC_MS_LO() REG32(GPIO_GPVAL) &= (~MASK_DAC_MS)
- #define DAC_MS_HI() REG32(GPIO_GPVAL) |= MASK_DAC_MS
- void dac_reset(void);
- //McBSP0
- #define MASK_DAC_MC 0x00000002
- #define MASK_DAC_MD 0x00000020
- #define DAC_MC_LO() REG32(MCBSP0_PCR) &= (~MASK_DAC_MC)
- #define DAC_MC_HI() REG32(MCBSP0_PCR) |= MASK_DAC_MC
- #define DAC_MD_LO() REG32(MCBSP0_PCR) &= (~MASK_DAC_MD)
- #define DAC_MD_HI() REG32(MCBSP0_PCR) |= MASK_DAC_MD
- void mcbsp0_init_serial(void);
- #define MAKE_ADC_CTL_WORD(DEV, REG, DATA) ((uint16)((DEV<<11 | REG<<8 | DATA)))
- void adc_init(void);
- //McASP1
- //#define AXR0_LO() REG32(MCASP1_PDOUT) &= (~0x00000001)
- //#define AXR0_HI() REG32(MCASP1_PDOUT) |= 0x00000001
- int mcasp_init(void);
- void mcasp_reset(void);
- void timer0_init(void);
- void timer1_init(void);
- void delay_ms(uint16 msec);
- #endif