📄 pwm_set.h
字号:
#ifndef __PWM_SET__
#define __PWM_SET__
#include <msp430x14x.h>
#include <math.h>
#include <stdlib.h>
//#include "function_modulation.h"
//#include "GPIO_init.h"
#ifndef uint32
#define uint32 unsigned long
#endif
#ifndef uint16
#define uint16 unsigned int
#endif
#ifndef uint8
#define uint8 unsigned char
#endif
#ifndef uchar
#define uchar unsigned char
#endif
#define PWMCLOSE 0 //关闭PWM输出
#define PWMOPEN 1 //打开PWM输出
/***********************************************
** 函数名称: void PWM_module(uint16 cycle,uint8 channel)
** 功能描述: 启动PWM,设置周期cycle,初始PWM为0,选择通道channel,确定管脚;
** 晶 振: 4MHz
** 输 入: cycle 需要设置的周期,channel 需要设置的通道
** 输 出: 无
** 调用示例: PWM_module(250,BIT1|BIT2);
************************************************/
extern void PWM_module(uint16 cycle , uint16 PWM_value, uint8 channel);
/***********************************************
** 函数名称: uchar GoPwm( uchar doPwm )
** 功能描述: 控制PWM运行或者停止
** 晶 振: 4MHz
** 输 入: doPwm:PWMCLOSE:PWM停止, PWMOPEN :PWM运行
** 输 出: 运行状态
** 调用示例: uchar GoPwm( PWMOPEN );
************************************************/
extern uchar GoPwm( uchar doPwm );
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -