| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- /**
- * @file HW_PWM_ATY.h
- *
- * @param Project DEVICE_GENERAL_ATY_LIB
- *
- * @author ATY
- *
- * @copyright
- * - Copyright 2017 - 2023 MZ-ATY
- * - This code follows:
- * - MZ-ATY Various Contents Joint Statement -
- * <a href="https://mengze.top/MZ-ATY_VCJS">
- * https://mengze.top/MZ-ATY_VCJS</a>
- * - CC 4.0 BY-NC-SA -
- * <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">
- * https://creativecommons.org/licenses/by-nc-sa/4.0/</a>
- * - Your use will be deemed to have accepted the terms of this statement.
- *
- * @brief Familiar definition of PWM for users
- *
- * @version
- * - 1_01_220602 > ATY
- * -# Preliminary version, first Release
- * - Undone
- ********************************************************************************
- */
- #ifndef __HW_PWM_ATY_H
- #define __HW_PWM_ATY_H
- #include "INCLUDE_ATY.h"
- /******************************* For user *************************************/
- // #define __DEBUG_HW_PWM_ATY
- #define PWM1_CHOSE PWM_PIN_POS_0
- #define PWM2_CHOSE PWM_PIN_POS_0
- #define PWM3_CHOSE PWM_PIN_POS_0
- #define PWM4_CHOSE PWM_PIN_POS_0
- #define PWM5_CHOSE PWM_PIN_POS_0
- #define PWM6_CHOSE PWM_PIN_POS_0
- #define PWM7_CHOSE PWM_PIN_POS_0
- #define PWM8_CHOSE PWM_PIN_POS_0
- /******************************************************************************/
- #if defined(__STC51_ATY)
- #define PWM_CHANNEL_1P 0x01
- #define PWM_CHANNEL_1N 0x02
- #define PWM_CHANNEL_2P 0x04
- #define PWM_CHANNEL_2N 0x08
- #define PWM_CHANNEL_3P 0x10
- #define PWM_CHANNEL_3N 0x20
- #define PWM_CHANNEL_4P 0x40
- #define PWM_CHANNEL_4N 0x80
- #define PWM_CHANNEL_5P 0xF0
- #define PWM_CHANNEL_6P 0xF1
- #define PWM_CHANNEL_7P 0xF2
- #define PWM_CHANNEL_8P 0xF3
- #define PWM_PIN_POS_0 0x00 // PWMN
- #define PWM_PIN_POS_1 0x01 // PWMN_2
- #define PWM_PIN_POS_2 0x02 // PWMN_3
- #define PWM_PIN_POS_3 0x03 // PWMN_4
- #elif defined(__STM32_HAL_ATY)
- #elif defined(__ESP8266_RTOS_ATY)
- #endif /* PLATFORM */
- void PWM_Start(uint32_t periodS, float dutyS, uint8_t channelS);
- void PWM_Stop(uint8_t level, uint8_t channelS);
- void PwmFreqSet(uint32_t periodS, uint8_t channelS);
- #if defined(__STC8G_ATY)
- void PWM_StartPulse(uint32_t periodS, uint8_t channelS);
- #endif
- #ifdef __DEBUG_HW_PWM_ATY
- void PWM_Test(uint8_t testType);
- #endif /* __DEBUG_HW_PWM_ATY */
- #endif /* __HW_PWM_ATY_H */
- /******************************** End Of File *********************************/
|