14#include <linux/types.h>
15#include "../inc/motor.h"
20static _Bool motorRunning;
23 system(
"insmod motordriver.ko");
28 system(
"rmmod motordriver");
35 int fd0 = open(
"/dev/motordriver0", O_WRONLY);
38 printf(
"Failed to open motor driver device driver.\n");
42 if(write(fd0, &RUN, 1) <= 0)
44 printf(
"Failed to write on device driver.\n");
59 int fd0 = open(
"/dev/motordriver0", O_WRONLY);
62 printf(
"Failed to open motor driver device driver.\n");
66 if(write(fd0, &STOP, 1) <= 0)
68 printf(
"Failed to write on device driver.\n");
void initMotor()
Load the motor driver device driver.
int stopMotor()
Stop the motor.
void remMotor()
Remove the motor driver device driver.
int startMotor()
Start the motor.
_Bool getMotorStatus()
Get the Motor Status object.