Sha256: d1563847f6a3304f06a1fd95891bd80986fdf8e6a0700ba2edbc705697897e3b

Contents?: true

Size: 1.18 KB

Versions: 54

Compression:

Stored size: 1.18 KB

Contents

#include "Types.h"
#include "TimerInterruptConfigurator.h"
#include "TimerInterruptHandler.h"

static inline void SetInterruptHandler(void);
static inline void ConfigureInterruptSourceModeRegister(void);
static inline void ClearInterrupt(void);
static inline void EnableCompareInterruptForRegisterC(void);

void Timer_DisableInterrupt(void)
{
  AT91C_BASE_AIC->AIC_IDCR = TIMER0_ID_MASK;
}

void Timer_ResetSystemTime(void)
{
  Timer_SetSystemTime(0);
}

void Timer_ConfigureInterrupt(void)
{
  SetInterruptHandler();
  ConfigureInterruptSourceModeRegister();
  ClearInterrupt();
  EnableCompareInterruptForRegisterC();
}

void Timer_EnableInterrupt(void)
{
  AT91C_BASE_AIC->AIC_IECR = TIMER0_ID_MASK;
}

//
// Helpers
//

static inline void SetInterruptHandler(void)
{
  AT91C_BASE_AIC->AIC_SVR[AT91C_ID_TC0] = (uint32)Timer_InterruptHandler;
}

static inline void ConfigureInterruptSourceModeRegister(void)
{
  AT91C_BASE_AIC->AIC_SMR[AT91C_ID_TC0] = 1;
}

static inline void ClearInterrupt(void)
{
  AT91C_BASE_AIC->AIC_ICCR = TIMER0_ID_MASK;
}

static inline void EnableCompareInterruptForRegisterC(void)
{
  AT91C_BASE_TC0->TC_IER = AT91C_TC_CPCS;
}

Version data entries

54 entries across 39 versions & 1 rubygems

Version Path
ceedling-0.29.1 examples/temp_sensor/src/TimerInterruptConfigurator.c
ceedling-0.29.1 vendor/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.c
ceedling-0.29.0 examples/temp_sensor/src/TimerInterruptConfigurator.c
ceedling-0.29.0 vendor/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.c
ceedling-0.19.0 examples/temp_sensor/src/TimerInterruptConfigurator.c
ceedling-0.18.0 examples/temp_sensor/src/TimerInterruptConfigurator.c
ceedling-0.18.0 vendor/cmock/examples/src/TimerInterruptConfigurator.c
ceedling-0.17.0 vendor/cmock/examples/src/TimerInterruptConfigurator.c
ceedling-0.17.0 examples/temp_sensor/src/TimerInterruptConfigurator.c
ceedling-0.16.0 examples/temp_sensor/src/TimerInterruptConfigurator.c
ceedling-0.16.0 vendor/cmock/examples/src/TimerInterruptConfigurator.c
ceedling-0.15.6 vendor/cmock/examples/src/TimerInterruptConfigurator.c
ceedling-0.15.6 examples/temp_sensor/src/TimerInterruptConfigurator.c
ceedling-0.15.5 vendor/cmock/examples/src/TimerInterruptConfigurator.c
ceedling-0.15.5 examples/temp_sensor/src/TimerInterruptConfigurator.c
ceedling-0.15.4 examples/temp_sensor/src/TimerInterruptConfigurator.c
ceedling-0.15.4 vendor/cmock/examples/src/TimerInterruptConfigurator.c
ceedling-0.15.3 examples/temp_sensor/src/TimerInterruptConfigurator.c
ceedling-0.15.3 vendor/cmock/examples/src/TimerInterruptConfigurator.c
ceedling-0.15.2 vendor/cmock/examples/src/TimerInterruptConfigurator.c