Skip to content

Commit

Permalink
fixup! fixup! kinetis: Use bitband.h macros
Browse files Browse the repository at this point in the history
  • Loading branch information
Joakim Nohlgård committed May 2, 2017
1 parent 2a5617d commit c3e0cba
Showing 1 changed file with 2 additions and 31 deletions.
33 changes: 2 additions & 31 deletions cpu/k60/include/cpu_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,39 +69,10 @@ extern "C"
/** @} */

/**
* @name Clock settings for the LPTMR0 timer
* @{
*/
#define LPTMR_CLKEN() (bit_set32(&SIM->SCGC5, SIM_SCGC5_LPTMR_SHIFT)) /**< Enable LPTMR0 clock gate */
#define LPTMR_CLKSRC_MCGIRCLK 0 /**< internal reference clock (4MHz) */
#define LPTMR_CLKSRC_LPO 1 /**< PMC 1kHz output */
#define LPTMR_CLKSRC_ERCLK32K 2 /**< RTC clock 32768Hz */
#define LPTMR_CLKSRC_OSCERCLK 3 /**< system oscillator output */

#ifndef LPTMR_CLKSRC
#define LPTMR_CLKSRC LPTIMER_CLKSRC_ERCLK32K /**< default clock source */
#endif

#if (LPTMR_CLKSRC == LPTMR_CLKSRC_MCGIRCLK)
#define LPTMR_CLK_PRESCALE 1
#define LPTMR_SPEED 1000000
#elif (LPTMR_CLKSRC == LPTMR_CLKSRC_OSCERCLK)
#define LPTMR_CLK_PRESCALE 1
#define LPTMR_SPEED 1000000
#elif (LPTMR_CLKSRC == LPTMR_CLKSRC_ERCLK32K)
#define LPTMR_CLK_PRESCALE 0
#define LPTMR_SPEED 32768
#else
#define LPTMR_CLK_PRESCALE 0
#define LPTMR_SPEED 1000
#endif

/** @} */

/**
* @name PIT module configuration
* @name Timer hardware information
*/
/** @{ */
#define LPTMR_CLKEN() (bit_set32(&SIM->SCGC5, SIM_SCGC5_LPTMR_SHIFT)) /**< Enable LPTMR0 clock gate */
#define PIT_CLKEN() (bit_set32(&SIM->SCGC6, SIM_SCGC6_PIT_SHIFT)) /**< Enable PIT clock gate */
/** @} */

Expand Down

0 comments on commit c3e0cba

Please sign in to comment.