SRA Board Components
ESP-IDF component for SRA Board
Classes | Typedefs | Functions
mcpwm_interface.h File Reference
#include <stdint.h>
#include "esp_err.h"
Include dependency graph for mcpwm_interface.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  motor_t
 
struct  motor_config_t
 Motor Configuration. More...
 
struct  motor_mcpwm_config_t
 Motor MCPWM specific configuration. More...
 

Typedefs

typedef struct motor_t motor_t
 Motor interface. More...
 
typedef struct motor_tmotor_handle_t
 

Functions

esp_err_t motor_new_mcpwm_device (const motor_config_t *motor_config, const motor_mcpwm_config_t *mcpwm_config, motor_t **ret_motor)
 Create Motor based on MCPWM peripheral. More...
 

Typedef Documentation

◆ motor_handle_t

typedef struct motor_t* motor_handle_t

◆ motor_t

typedef struct motor_t motor_t

Motor interface.

Function Documentation

◆ motor_new_mcpwm_device()

esp_err_t motor_new_mcpwm_device ( const motor_config_t motor_config,
const motor_mcpwm_config_t mcpwm_config,
motor_t **  ret_motor 
)

Create Motor based on MCPWM peripheral.

Parameters
motor_configMotor configuration
mcpwm_configMCPWM specific configuration
ret_motorReturned Motor handle
Returns
  • ESP_OK: Create BDC Motor handle successfully
  • ESP_ERR_INVALID_ARG: Create BDC Motor handle failed because of invalid argument
  • ESP_ERR_NO_MEM: Create BDC Motor handle failed because of out of memory
  • ESP_FAIL: Create BDC Motor handle failed because some other error