Execute IO function.
118 {
120
124 }
126 }
127
128 switch (function) {
130 if (args.size() < 1) {
132 }
133 uint8_t duty_cycle = static_cast<uint8_t>(args[0]);
134 if (duty_cycle > 100) {
136 }
137
141 return 0;
142 }
144 }
145
147 if (args.size() < 1) {
149 }
150 uint32_t frequency = args[0];
151 if (frequency == 0 || frequency > 1000000) {
153 }
154
158 return 0;
159 }
161 }
162
166
168
172
174
176
178 }
179
180 default:
182 }
183 }
meshx_err_t
MeshX Error Codes.
Definition meshx_err.h:43
**This function is called by the parent element when a state change request *is received It validates the request and returns a result to the element not the model layer **return * MESHX_SUCCESS
Definition meshx_model_level.cpp:385
meshx_err_t meshx_pwm_init(void)
Initialize PWM subsystem.
Definition meshx_pwm.c:69
meshx_err_t meshx_pwm_set_duty_cycle(uint8_t logical_pin, uint8_t duty_cycle)
Set PWM duty cycle.
Definition meshx_pwm.c:433
meshx_err_t meshx_pwm_set_frequency(uint8_t logical_pin, uint32_t frequency)
Set PWM frequency.
Definition meshx_pwm.c:515
@ NOT_INITIALIZED
Definition meshx_io_types.hpp:90
@ PWM_NOT_SUPPORTED
Definition meshx_io_types.hpp:87
@ INVALID_MODE
Definition meshx_io_types.hpp:82
@ NOT_SUPPORTED
Definition meshx_io_types.hpp:89
@ INTR_NOT_SUPPORTED
Definition meshx_io_types.hpp:85
@ PWM_INVALID_PARAM
Definition meshx_io_types.hpp:88
@ REGISTER_INTERRUPT
Definition meshx_io_interface.hpp:31
@ TOGGLE
Definition meshx_io_interface.hpp:28
@ UNREGISTER_INTERRUPT
Definition meshx_io_interface.hpp:32
@ SET_PWM_DUTY
Definition meshx_io_interface.hpp:29
@ SET_PWM_FREQUENCY
Definition meshx_io_interface.hpp:30
@ CUSTOM_FUNCTION
Definition meshx_io_interface.hpp:34
@ SET_LEVEL
Definition meshx_io_interface.hpp:26
@ GET_LEVEL
Definition meshx_io_interface.hpp:27
@ ENABLE_INTERRUPT
Definition meshx_io_interface.hpp:33