RTEMS 7.0-rc1
Loading...
Searching...
No Matches
Macros | Functions | Variables
clockdrv.c File Reference

S3C2400 clock specific using the System Timer. More...

#include <rtems.h>
#include <bsp/irq.h>
#include <bsp.h>
#include <s3c24xx.h>
#include "../../../shared/dev/clock/clockimpl.h"

Macros

#define Clock_driver_support_at_tick(arg)
 
#define Clock_driver_support_install_isr(_new)    BSP_install_rtems_irq_handler(&clock_isr_data)
 
#define Clock_driver_support_initialize_hardware()
 
#define CLOCK_DRIVER_USE_DUMMY_TIMECOUNTER
 

Functions

void Clock_isr (rtems_irq_hdl_param arg)
 

Variables

rtems_irq_connect_data clock_isr_data
 

Detailed Description

S3C2400 clock specific using the System Timer.

Macro Definition Documentation

◆ Clock_driver_support_at_tick

#define Clock_driver_support_at_tick (   arg)
Value:
do { \
ClearPending(BIT_TIMER4); \
} while(0)

When we get the clock interrupt

  • clear the interrupt bit?
  • restart the timer?

◆ Clock_driver_support_initialize_hardware

#define Clock_driver_support_initialize_hardware (   void)
Value:
do { \
uint32_t cr; \
uint32_t freq; \
/* set MUX for Timer4 to 1/16 */ \
cr=rTCFG1 & 0xFFF0FFFF; \
rTCFG1=(cr | (3<<16)); \
freq = get_PCLK(); \
/* set TIMER4 counter, input freq=PLCK/16/16Mhz*/ \
freq = (freq /16)/16; \
rTCNTB4 = ((freq / 1000) * rtems_configuration_get_microseconds_per_tick()) / 1000; \
/*unmask TIMER4 irq*/ \
rINTMSK&=~BIT_TIMER4; \
/* start TIMER4 with autoreload */ \
cr=rTCON & 0xFF8FFFFF; \
rTCON=(cr|(0x6<<20)); \
rTCON=(cr|(0x5<<20)); \
} while (0)
#define rtems_configuration_get_microseconds_per_tick()
Gets the number of microseconds per clock tick configured for this application.
Definition: config.h:527

Initialize the hardware for the clock

  • Set the frequency
  • enable it
  • clear any pending interrupts

Since you may want the clock always running, you can enable interrupts here. If you do so, the clock_isr_on(), clock_isr_off(), and clock_isr_is_on() functions can be NOPs.

◆ Clock_driver_support_install_isr

#define Clock_driver_support_install_isr (   _new)     BSP_install_rtems_irq_handler(&clock_isr_data)

Installs the clock ISR. You shouldn't need to change this.

Variable Documentation

◆ clock_isr_data

rtems_irq_connect_data clock_isr_data
Initial value:
= {
.name = BSP_INT_TIMER4,
.hdl = Clock_isr,
.handle = NULL,
.on = clock_isr_on,
.off = clock_isr_off,
.isOn = clock_isr_is_on,
}