Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
sys_time_arch.h File Reference

LPC21xx timing functions. More...

#include "mcu_periph/sys_time.h"
#include "LPC21xx.h"
#include "armVIC.h"
#include "std.h"
+ Include dependency graph for sys_time_arch.h:

Go to the source code of this file.

Macros

#define TIMER0_VIC_SLOT   1
 
#define CPU_TICKS_OF_SEC(s)   (uint32_t)(s * PCLK / T0_PCLK_DIV + 0.5)
 
#define SIGNED_CPU_TICKS_OF_SEC(s)   (int32_t)(s * PCLK / T0_PCLK_DIV + 0.5)
 
#define SEC_OF_CPU_TICKS(t)   (t / PCLK * T0_PCLK_DIV)
 
#define MSEC_OF_CPU_TICKS(t)   (t / (PCLK/1000) * T0_PCLK_DIV)
 
#define USEC_OF_CPU_TICKS(t)   (t / (PCLK/1000000) * T0_PCLK_DIV)
 
#define SysTimeTimerStart(_t)   { _t = USEC_OF_CPU_TICKS(T0TC); }
 
#define SysTimeTimer(_t)   ( USEC_OF_CPU_TICKS(T0TC) - (_t))
 
#define SysTimeTimerStop(_t)   { _t = ( USEC_OF_CPU_TICKS(T0TC) - (_t)); }
 
#define SysTickTimerStart(_t)   { _t = T0TC; }
 
#define SysTickTimer(_t)   ((uint32_t)(T0TC - _t))
 
#define SysTickTimerStop(_t)   { _t = (T0TC - _t); }
 

Functions

void TIMER0_ISR (void) __attribute__((naked))
 
static void sys_time_usleep (uint32_t us)
 Busy wait, in microseconds. More...
 

Detailed Description

LPC21xx timing functions.

Definition in file sys_time_arch.h.

Macro Definition Documentation

#define CPU_TICKS_OF_SEC (   s)    (uint32_t)(s * PCLK / T0_PCLK_DIV + 0.5)

Definition at line 61 of file sys_time_arch.h.

#define MSEC_OF_CPU_TICKS (   t)    (t / (PCLK/1000) * T0_PCLK_DIV)

Definition at line 65 of file sys_time_arch.h.

Referenced by TRIG_ISR(), trigger_ext_periodic(), and windturbine_periodic().

#define SEC_OF_CPU_TICKS (   t)    (t / PCLK * T0_PCLK_DIV)

Definition at line 64 of file sys_time_arch.h.

#define SIGNED_CPU_TICKS_OF_SEC (   s)    (int32_t)(s * PCLK / T0_PCLK_DIV + 0.5)

Definition at line 62 of file sys_time_arch.h.

#define SysTickTimer (   _t)    ((uint32_t)(T0TC - _t))

Definition at line 75 of file sys_time_arch.h.

#define SysTickTimerStart (   _t)    { _t = T0TC; }

Definition at line 74 of file sys_time_arch.h.

#define SysTickTimerStop (   _t)    { _t = (T0TC - _t); }

Definition at line 76 of file sys_time_arch.h.

#define SysTimeTimer (   _t)    ( USEC_OF_CPU_TICKS(T0TC) - (_t))

Definition at line 71 of file sys_time_arch.h.

Referenced by actuators_set(), event_sysmon(), and periodic_sysmon().

#define SysTimeTimerStart (   _t)    { _t = USEC_OF_CPU_TICKS(T0TC); }
#define SysTimeTimerStop (   _t)    { _t = ( USEC_OF_CPU_TICKS(T0TC) - (_t)); }

Definition at line 72 of file sys_time_arch.h.

#define TIMER0_VIC_SLOT   1

Definition at line 58 of file sys_time_arch.h.

Referenced by sys_time_arch_init().

#define USEC_OF_CPU_TICKS (   t)    (t / (PCLK/1000000) * T0_PCLK_DIV)

Definition at line 66 of file sys_time_arch.h.

Function Documentation

static void sys_time_usleep ( uint32_t  us)
inlinestatic

Busy wait, in microseconds.

Definition at line 79 of file sys_time_arch.h.

References CPU_TICKS_OF_USEC, and T0TC.

Referenced by pcap01_init(), and xbee_init().

+ Here is the caller graph for this function:

void TIMER0_ISR ( void  )

Definition at line 154 of file sys_time_arch.c.

References ACTUATORS_IT, AMI601_ISR, AMI601_IT, ISR_ENTRY, ISR_EXIT, LED_TOGGLE, MB_SCALE_IT, MB_TACHO_IT, PPM_ISR, PPM_IT, PWM_INPUT_IT1, PWM_INPUT_IT2, Servos4015Mat_ISR, SERVOS_4017_ISR, ServosPPMMat_ISR, sys_tick_irq_handler(), SYS_TICK_IT, T0IR, TIMER0_IT_MASK, TRIG_ISR(), TRIGGER_IT, and VICVectAddr.

Referenced by sys_time_arch_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: