Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
servos_4015_MAT_hw.h File Reference
#include "std.h"
#include "LPC21xx.h"
#include "mcu_periph/sys_time.h"
#include <BOARD_CONFIG>
+ Include dependency graph for servos_4015_MAT_hw.h:

Go to the source code of this file.

Macros

#define SERVOS_TICS_OF_USEC(s)   cpu_ticks_of_usec(s)
 
#define ClipServo(x, a, b)   Clip(x, a, b)
 
#define _4015_NB_CHANNELS   8
 
#define Actuator4015Set(_i, _v)   { servos_values[_i] = SERVOS_TICS_OF_USEC(_v); }
 
#define Actuators4015Commit()   {}
 
#define Actuators4015Init()   actuators_4015_init()
 
#define SERVO_REFRESH_TICS   SERVOS_TICS_OF_USEC(20000)
 
#define ACTUATORS_IT   TIR_MR1I
 
#define Servos4015Mat_ISR()
 

Functions

void actuators_4015_init (void)
 

Variables

uint16_t servos_values [_4015_NB_CHANNELS]
 
uint8_t servos_4015_idx
 
uint32_t servos_delay
 

Macro Definition Documentation

◆ _4015_NB_CHANNELS

#define _4015_NB_CHANNELS   8

Definition at line 41 of file servos_4015_MAT_hw.h.

◆ Actuator4015Set

#define Actuator4015Set (   _i,
  _v 
)    { servos_values[_i] = SERVOS_TICS_OF_USEC(_v); }

Definition at line 43 of file servos_4015_MAT_hw.h.

◆ Actuators4015Commit

#define Actuators4015Commit ( )    {}

Definition at line 46 of file servos_4015_MAT_hw.h.

◆ Actuators4015Init

#define Actuators4015Init ( )    actuators_4015_init()

Definition at line 47 of file servos_4015_MAT_hw.h.

◆ ACTUATORS_IT

#define ACTUATORS_IT   TIR_MR1I

Definition at line 53 of file servos_4015_MAT_hw.h.

◆ ClipServo

#define ClipServo (   x,
  a,
  b 
)    Clip(x, a, b)

Definition at line 39 of file servos_4015_MAT_hw.h.

◆ SERVO_REFRESH_TICS

#define SERVO_REFRESH_TICS   SERVOS_TICS_OF_USEC(20000)

Definition at line 51 of file servos_4015_MAT_hw.h.

◆ Servos4015Mat_ISR

#define Servos4015Mat_ISR ( )
Value:
{ \
if (servos_4015_idx == 0) { \
servos_delay = SERVO_REFRESH_TICS; \
SetBit(IO1CLR, SERVO_DATA_PIN); \
} \
servos_delay -= servos_values[servos_4015_idx]; \
servos_4015_idx++; \
SetBit(IO1SET, SERVO_RESET_PIN); \
servos_4015_idx++; \
T0MR1 += servos_delay/2; \
} else { \
SetBit(IO1SET, SERVO_DATA_PIN); \
SetBit(IO1CLR, SERVO_RESET_PIN); \
servos_4015_idx = 0; \
T0MR1 += servos_delay/2; \
} \
/* lower clock pin */ \
T0EMR &= ~TEMR_EM1; \
}

Definition at line 54 of file servos_4015_MAT_hw.h.

◆ SERVOS_TICS_OF_USEC

#define SERVOS_TICS_OF_USEC (   s)    cpu_ticks_of_usec(s)

Definition at line 38 of file servos_4015_MAT_hw.h.

Function Documentation

◆ actuators_4015_init()

Variable Documentation

◆ servos_4015_idx

uint8_t servos_4015_idx

Definition at line 32 of file servos_4015_MAT_hw.c.

Referenced by actuators_4015_init().

◆ servos_delay

uint32_t servos_delay

Definition at line 33 of file servos_4015_MAT_hw.c.

◆ servos_values

uint16_t servos_values[_4015_NB_CHANNELS]

Definition at line 29 of file servos_4015_hw.c.

SERVO_DATA_PIN
#define SERVO_DATA_PIN
Definition: tiny_0.99.h:50
servos_values
uint16_t servos_values[_4015_NB_CHANNELS]
Definition: servos_4015_hw.c:29
_4015_NB_CHANNELS
#define _4015_NB_CHANNELS
Definition: servos_4015_MAT_hw.h:41
SERVO_RESET_PIN
#define SERVO_RESET_PIN
Definition: hb_1.1.h:34
TEMR_EM1
#define TEMR_EM1
Definition: lpcTMR.h:150
servos_4015_idx
uint8_t servos_4015_idx
Definition: servos_4015_MAT_hw.c:32
IO1CLR
#define IO1CLR
Definition: LPC21xx.h:340
SERVO_REFRESH_TICS
#define SERVO_REFRESH_TICS
Definition: servos_4015_MAT_hw.h:51
IO1SET
#define IO1SET
Definition: LPC21xx.h:338
servos_delay
uint32_t servos_delay
Definition: servos_4015_MAT_hw.c:33