#include "esp_err.h"
#include "esp_log.h"
#include "mcpwm_interface.h"
Go to the source code of this file.
◆ MCPWM_FREQ
◆ MCPWM_RESOLUTION
#define MCPWM_RESOLUTION 10000000 |
◆ MOTOR_A_0
◆ MOTOR_A_1
◆ MOTOR_BACKWARD
#define MOTOR_BACKWARD 201 |
◆ MOTOR_FORWARD
#define MOTOR_FORWARD 200 |
◆ MOTOR_STOP
◆ enable_motor_driver()
esp_err_t enable_motor_driver |
( |
motor_handle_t * |
motor, |
|
|
int |
motor_id |
|
) |
| |
Enable motor driver.
- Parameters
-
motor_handle_t | Motor object handle |
motor_id | set it as MOTOR_A_0, MOTOR_A_1 to select the appropriate motor to bind to the handle. |
- Returns
- ESP_OK: Success
- ESP_ERR_INVALID_ARG: Invalid argument
- ESP_FAIL: Failed
◆ get_motor_driver_status()
int get_motor_driver_status |
( |
| ) |
|
Checks if the motor driver is engaged.
- Returns
- true if the motor driver is engaged, false otherwise.
◆ set_motor_speed()
esp_err_t set_motor_speed |
( |
motor_handle_t |
motor, |
|
|
int |
direction, |
|
|
float |
duty_cycle |
|
) |
| |