summaryrefslogtreecommitdiff
path: root/OpenModelicaArduino/Firmware/Tiva C/StandardFirmata/Servo.h
diff options
context:
space:
mode:
authorPragya282018-06-18 20:34:00 +0530
committerPragya282018-06-18 20:34:00 +0530
commitf6a84e772d0e4dd4da1850ffe8e77428d69a3ef1 (patch)
treee786486ea64ea7449807ce05dec91b362c91d3c0 /OpenModelicaArduino/Firmware/Tiva C/StandardFirmata/Servo.h
parent44ad9efa7e729739cde3103d8fc1e475efa2a923 (diff)
downloadOpenModelicaEmbedded-1-f6a84e772d0e4dd4da1850ffe8e77428d69a3ef1.tar.gz
OpenModelicaEmbedded-1-f6a84e772d0e4dd4da1850ffe8e77428d69a3ef1.tar.bz2
OpenModelicaEmbedded-1-f6a84e772d0e4dd4da1850ffe8e77428d69a3ef1.zip
Tiva C examples added, package renamed
Diffstat (limited to 'OpenModelicaArduino/Firmware/Tiva C/StandardFirmata/Servo.h')
-rw-r--r--OpenModelicaArduino/Firmware/Tiva C/StandardFirmata/Servo.h54
1 files changed, 0 insertions, 54 deletions
diff --git a/OpenModelicaArduino/Firmware/Tiva C/StandardFirmata/Servo.h b/OpenModelicaArduino/Firmware/Tiva C/StandardFirmata/Servo.h
deleted file mode 100644
index 1ed6c78..0000000
--- a/OpenModelicaArduino/Firmware/Tiva C/StandardFirmata/Servo.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef SERVO_H
-#define SERVO_H
-
-#include "Energia.h"
-#include <inttypes.h>
-
-// Hardware limitations information
-#define MIN_SERVO_PULSE_WIDTH 544
-#define MAX_SERVO_PULSE_WIDTH 2400
-#define DEFAULT_SERVO_PULSE_WIDTH 1500
-#define REFRESH_INTERVAL 20000
-
-// Aliases for timer config and loading
-#define SERVO_TIMER TIMER2_BASE
-#define SERVO_TIME_CFG TIMER_CFG_PERIODIC
-#define SERVO_TIMER_TRIGGER TIMER_TIMA_TIMEOUT
-#define SERVO_TIMER_INTERRUPT INT_TIMER2A
-#define SERVO_TIMER_A TIMER_A
-#define SERVO_TIMER_PERIPH SYSCTL_PERIPH_TIMER2
-
-// Other defines
-#define SERVOS_PER_TIMER 8
-#define INVALID_SERVO 255
-#define MAX_SERVOS 8
-
-
-typedef struct
-{
- unsigned int pin_number;
- unsigned int pulse_width;
- bool enabled;
-} servo_t;
-
-class Servo
-{
-private:
- unsigned int index;
- int min;
- int max;
-public:
- Servo();
- unsigned int attach(unsigned int pin, int min = MIN_SERVO_PULSE_WIDTH, int max = MAX_SERVO_PULSE_WIDTH);
- void detach();
- void writeMicroseconds(int value);
- int readMicroseconds();
- void write(int value);
- int read();
- bool attached();
-
-};
-
-extern "C" void ServoIntHandler(void);
-
-#endif // SERVO_H