Rtems 4.11 Clock driver (arm, beagle)

Source: Internet
Author: User

According to the BSP_HOWTO manual, the clock-driven framework is primarily implemented in the c/src/lib/libbsp/shared/clockdrv_shell.h file

Clock initialization

The clock-driven initialization function is clock_initialize (), where is the function called?

The clock_driver_table_entry is defined in the cpukit/include/rtems/clockdrv.h

#define Clock_driver_table_entry \  

The clock_driver_table_entry is then placed in the IO driver list, which should be called when it is initialized.


The Clock_initialize () function is defined in c/src/lib/libbsp/shared/clockdrv_shell.h and calls the 2 functions provided by the BSP:
CLOCK_DRIVER_SUPPORT_INSTALL_ISR () = Install interrupt handling function CLOCK_ISR
Clock_driver_support_initialize_hardware () = Initialize hardware

Then look at Clock_isr (), called Clock_driver_support_at_tick () at the end of the interrupt processing, which can be used to notify the hardware that the interrupt response has been completed.
The C_user manual describes the CLOCK_ISR () function that should be called Rtems_clock_tick (), which is done in Clock_isr () =>clock_driver_timecounter_tick (), however, Now call the updated version of Rtems_timecounter_tick (), the more modern clock driver needs a precise clock, each tick interrupt, to read this precise clock, so that can improve the accuracy of the timing.

The Clock_driver_support_shutdown_hardware () called in the Clock_exit () function is also a function that the BSP can provide to stop the clock from running.

Beagle

Look at the Beagle BSP code, in the c/src/lib/libbsp/arm/beagle/clock.c , straight to the end of the line to see it.

#defineClock_driver_support_at_tick () Beagle_clock_at_tick ()#defineClock_driver_support_initialize_hardware () beagle_clock_initialize ()#defineCLOCK_DRIVER_SUPPORT_INSTALL_ISR (ISR, OLD_ISR) Do{Beagle_clock_handler_install (ISR); OLD_ISR=NULL; }  while(0) #defineClock_driver_support_shutdown_hardware () Beagle_clock_cleanup ()/*Include Shared Source Clock driver code*/#include".. /.. /shared/clockdrv_shell.h" 


Beagle_clock_initialize () uses two clocks, a nonstop run, used as the precision clock (running at the highest frequency), and the other only to generate tick interrupts

Rtems 4.11 Clock driver (arm, beagle)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.