Changeset 429 for EcnlProtoTool/trunk/asp3_dcre/mbed/hal/pwmout_api.h
- Timestamp:
- Jul 3, 2020, 7:19:17 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/asp3_dcre/mbed/hal/pwmout_api.h
r321 r429 1 2 /** \addtogroup hal */ 3 /** @{*/ 1 4 /* mbed Microcontroller Library 2 5 * Copyright (c) 2006-2013 ARM Limited … … 25 28 #endif 26 29 30 /** Pwmout hal structure. pwmout_s is declared in the target's hal 31 */ 27 32 typedef struct pwmout_s pwmout_t; 28 33 29 void pwmout_init (pwmout_t* obj, PinName pin); 30 void pwmout_free (pwmout_t* obj); 34 /** 35 * \defgroup hal_pwmout Pwmout hal functions 36 * @{ 37 */ 31 38 32 void pwmout_write (pwmout_t* obj, float percent); 33 float pwmout_read (pwmout_t* obj); 39 /** Initialize the pwm out peripheral and configure the pin 40 * 41 * @param obj The pwmout object to initialize 42 * @param pin The pwmout pin to initialize 43 */ 44 void pwmout_init(pwmout_t *obj, PinName pin); 34 45 35 void pwmout_period (pwmout_t* obj, float seconds); 36 void pwmout_period_ms (pwmout_t* obj, int ms); 37 void pwmout_period_us (pwmout_t* obj, int us); 46 /** Deinitialize the pwmout object 47 * 48 * @param obj The pwmout object 49 */ 50 void pwmout_free(pwmout_t *obj); 38 51 39 void pwmout_pulsewidth (pwmout_t* obj, float seconds); 40 void pwmout_pulsewidth_ms(pwmout_t* obj, int ms); 41 void pwmout_pulsewidth_us(pwmout_t* obj, int us); 52 /** Set the output duty-cycle in range <0.0f, 1.0f> 53 * 54 * Value 0.0f represents 0 percentage, 1.0f represents 100 percent. 55 * @param obj The pwmout object 56 * @param percent The floating-point percentage number 57 */ 58 void pwmout_write(pwmout_t *obj, float percent); 59 60 /** Read the current float-point output duty-cycle 61 * 62 * @param obj The pwmout object 63 * @return A floating-point output duty-cycle 64 */ 65 float pwmout_read(pwmout_t *obj); 66 67 /** Set the PWM period specified in seconds, keeping the duty cycle the same 68 * 69 * Periods smaller than microseconds (the lowest resolution) are set to zero. 70 * @param obj The pwmout object 71 * @param seconds The floating-point seconds period 72 */ 73 void pwmout_period(pwmout_t *obj, float seconds); 74 75 /** Set the PWM period specified in miliseconds, keeping the duty cycle the same 76 * 77 * @param obj The pwmout object 78 * @param ms The milisecond period 79 */ 80 void pwmout_period_ms(pwmout_t *obj, int ms); 81 82 /** Set the PWM period specified in microseconds, keeping the duty cycle the same 83 * 84 * @param obj The pwmout object 85 * @param us The microsecond period 86 */ 87 void pwmout_period_us(pwmout_t *obj, int us); 88 89 /** Set the PWM pulsewidth specified in seconds, keeping the period the same. 90 * 91 * @param obj The pwmout object 92 * @param seconds The floating-point pulsewidth in seconds 93 */ 94 void pwmout_pulsewidth(pwmout_t *obj, float seconds); 95 96 /** Set the PWM pulsewidth specified in miliseconds, keeping the period the same. 97 * 98 * @param obj The pwmout object 99 * @param ms The floating-point pulsewidth in miliseconds 100 */ 101 void pwmout_pulsewidth_ms(pwmout_t *obj, int ms); 102 103 /** Set the PWM pulsewidth specified in microseconds, keeping the period the same. 104 * 105 * @param obj The pwmout object 106 * @param us The floating-point pulsewidth in microseconds 107 */ 108 void pwmout_pulsewidth_us(pwmout_t *obj, int us); 109 110 /**@}*/ 42 111 43 112 #ifdef __cplusplus … … 48 117 49 118 #endif 119 120 /** @}*/
Note:
See TracChangeset
for help on using the changeset viewer.