TTK4155 Ping-pong project
motor_driver_node2.c File Reference
#include "general_header_node2.h"
#include "motor_driver.h"
#include "TWI_Master.h"
#include "pi.h"
Include dependency graph for motor_driver_node2.c:

Macros

#define ENCODER_OE_PIN   5
 
#define ENCODER_RST_PIN   6
 
#define ENCODER_SEL_PIN   3
 
#define MOTOR_ENABLE_PIN   4
 
#define DIR_PIN   1
 

Functions

void motor_init (void)
 
int16_t read_encoder ()
 
void reset_encoder ()
 
uint16_t calibrate_encoder ()
 
int16_t read_position (uint16_t encoder_max_val)
 
void motor_set_val (int8_t input_percent)
 
void motor_regulator (struct pi_t *motor_param_p, int8_t reference)
 
int8_t read_position_rel (struct pi_t *motor_param_p)
 

Macro Definition Documentation

◆ DIR_PIN

#define DIR_PIN   1

◆ ENCODER_OE_PIN

#define ENCODER_OE_PIN   5

◆ ENCODER_RST_PIN

#define ENCODER_RST_PIN   6

◆ ENCODER_SEL_PIN

#define ENCODER_SEL_PIN   3

◆ MOTOR_ENABLE_PIN

#define MOTOR_ENABLE_PIN   4

Function Documentation

◆ calibrate_encoder()

uint16_t calibrate_encoder ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ motor_init()

void motor_init ( void  )
Here is the caller graph for this function:

◆ motor_regulator()

void motor_regulator ( struct pi_t motor_param_p,
int8_t  reference 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ motor_set_val()

void motor_set_val ( int8_t  input_percent)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_encoder()

int16_t read_encoder ( )
Here is the caller graph for this function:

◆ read_position()

int16_t read_position ( uint16_t  encoder_max_val)
Here is the call graph for this function:

◆ read_position_rel()

int8_t read_position_rel ( struct pi_t motor_param_p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset_encoder()

void reset_encoder ( )
Here is the caller graph for this function: