Files
AUTOM/workspace/AUTOM10/Core/Inc/pwm.h

63 lines
1.3 KiB
C
Raw Normal View History

2025-12-06 23:49:34 +01:00
/*
* pwm.h
*
* Created on: Dec 6, 2025
* Author: user
*/
#ifndef INC_PWM_H_
#define INC_PWM_H_
#include <stdbool.h>
bool IsPwmRunning(TIM_HandleTypeDef *htim, uint32_t Channel);;
void StopMot(TIM_HandleTypeDef *htim,uint32_t Channel);
void StartMot(TIM_HandleTypeDef *htim,uint32_t Channel,uint16_t pwmval);
void SetMotPwm(TIM_HandleTypeDef *htim,uint32_t Channel,uint16_t pwmval);
void SetMot(uint8_t mot,uint8_t dir,uint16_t pwmval);
2026-04-14 11:52:48 +02:00
void SetMotPerc(uint8_t mot,uint8_t dir,uint8_t perc);
2026-04-15 23:12:13 +02:00
uint8_t ramp(uint8_t mot,uint8_t dir,uint8_t percStart,uint8_t percEnd,uint8_t tr,uint8_t mode);
2025-12-06 23:49:34 +01:00
#define timMot1 &htim2
#define FWMot1 TIM_CHANNEL_1
#define BWMot1 TIM_CHANNEL_2
#define timMot2 &htim2
#define FWMot2 TIM_CHANNEL_3
#define BWMot2 TIM_CHANNEL_4
#define timMot3 &htim4
#define FWMot3 TIM_CHANNEL_1
#define BWMot3 TIM_CHANNEL_2
#define timMot4 &htim4
#define FWMot4 TIM_CHANNEL_3
#define BWMot4 TIM_CHANNEL_4
2026-05-02 13:05:31 +02:00
#define P1START 0x01
#define P1STOP 0x02
#define P2START 0x04
#define P2STOP 0x08
#define M1FW 0x10
#define M1BW 0x20
#define M2FW 0x40
#define M2BW 0x80
#define M3FW 0x100
#define M3BW 0x200
#define M4FW 0x400
#define M4BW 0x800
#define M1 1
#define M2 2
#define M3 3
#define M4 4
2025-12-06 23:49:34 +01:00
#define FW 0
#define BW 1
2026-04-15 23:12:13 +02:00
#define RAMPINIT 0
#define RAMPRUN 10
#define DONE 0
#define RUNNING 1
2025-12-06 23:49:34 +01:00
#endif /* INC_PWM_H_ */