Lines Matching refs:sigmadelta_port
26 #define SIGMADELTA_OBJ_CHECK(sigmadelta_port) { \ argument
27 …SIGMADELTA_CHECK((sigmadelta_port < SIGMADELTA_PORT_MAX), "sigmadelta port error", ESP_ERR_INVALID…
28 …SIGMADELTA_CHECK((p_sigmadelta_obj[sigmadelta_port]), "sigmadelta driver has not been initialized"…
31 static inline esp_err_t _sigmadelta_set_duty(sigmadelta_port_t sigmadelta_port, sigmadelta_channel_… in _sigmadelta_set_duty() argument
33 SIGMADELTA_OBJ_CHECK(sigmadelta_port); in _sigmadelta_set_duty()
35 sigmadelta_hal_set_duty(&(p_sigmadelta_obj[sigmadelta_port]->hal), channel, duty); in _sigmadelta_set_duty()
39 static inline esp_err_t _sigmadelta_set_prescale(sigmadelta_port_t sigmadelta_port, sigmadelta_chan… in _sigmadelta_set_prescale() argument
41 SIGMADELTA_OBJ_CHECK(sigmadelta_port); in _sigmadelta_set_prescale()
43 sigmadelta_hal_set_prescale(&(p_sigmadelta_obj[sigmadelta_port]->hal), channel, prescale); in _sigmadelta_set_prescale()
47 static inline esp_err_t _sigmadelta_set_pin(sigmadelta_port_t sigmadelta_port, sigmadelta_channel_t… in _sigmadelta_set_pin() argument
49 SIGMADELTA_OBJ_CHECK(sigmadelta_port); in _sigmadelta_set_pin()
57 static inline esp_err_t _sigmadelta_config(sigmadelta_port_t sigmadelta_port, const sigmadelta_conf… in _sigmadelta_config() argument
59 SIGMADELTA_OBJ_CHECK(sigmadelta_port); in _sigmadelta_config()
61 _sigmadelta_set_duty(sigmadelta_port, config->channel, config->sigmadelta_duty); in _sigmadelta_config()
62 _sigmadelta_set_prescale(sigmadelta_port, config->channel, config->sigmadelta_prescale); in _sigmadelta_config()
63 _sigmadelta_set_pin(sigmadelta_port, config->channel, config->sigmadelta_gpio); in _sigmadelta_config()
67 esp_err_t sigmadelta_deinit(sigmadelta_port_t sigmadelta_port) in sigmadelta_deinit() argument
69 SIGMADELTA_OBJ_CHECK(sigmadelta_port); in sigmadelta_deinit()
71 heap_caps_free(p_sigmadelta_obj[sigmadelta_port]); in sigmadelta_deinit()
72 p_sigmadelta_obj[sigmadelta_port] = NULL; in sigmadelta_deinit()
76 esp_err_t sigmadelta_init(sigmadelta_port_t sigmadelta_port) in sigmadelta_init() argument
78 …SIGMADELTA_CHECK((sigmadelta_port < SIGMADELTA_PORT_MAX), "sigmadelta_port error", ESP_ERR_INVALID… in sigmadelta_init()
79 …SIGMADELTA_CHECK((p_sigmadelta_obj[sigmadelta_port]) == NULL, "sigmadelta driver already initializ… in sigmadelta_init()
81 …p_sigmadelta_obj[sigmadelta_port] = (sigmadelta_obj_t *) heap_caps_calloc(1, sizeof(sigmadelta_obj… in sigmadelta_init()
83 if (p_sigmadelta_obj[sigmadelta_port] == NULL) { in sigmadelta_init()
88 sigmadelta_hal_init(&(p_sigmadelta_obj[sigmadelta_port]->hal), sigmadelta_port); in sigmadelta_init()