00001 /* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved. 00002 * 00003 * The information contained herein is confidential property of Nordic 00004 * Semiconductor ASA.Terms and conditions of usage are described in detail 00005 * in NORDIC SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 00006 * 00007 * Licensees are granted free, non-transferable use of the information. NO 00008 * WARRENTY of ANY KIND is provided. This heading must NOT be removed from 00009 * the file. 00010 * 00011 * $LastChangedRevision: 133 $ 00012 */ 00013 00014 00019 #include "gzll.h" 00020 00021 void mcu_init() 00022 { 00023 RF = 1; // Radio IRQ enable 00024 00025 CE_LOW(); 00026 RFCTL = 0x10; // RF SPI Enable 00027 00028 T2CON = 0x10; // Reload mode 0, osc / 12 00029 T2I0 = 1; // Start Timer2 00030 } 00031 00032 void gzll_set_timer_period(uint16_t period) 00033 { 00034 T2 = CRC = (uint32_t)0x10000 - (int)((float)period * 4 / 3 + 0.5); // Set up period for timer 2 00035 }