xref: /openbsd-src/sys/dev/ic/si4136reg.h (revision d2cfacca638e31ac44c6759190615f70deac641d)
1*d2cfaccaSjsg /*	$OpenBSD: si4136reg.h,v 1.3 2009/08/16 18:03:48 jsg Exp $	*/
22b3868e1Smillert /* $NetBSD$ */
32b3868e1Smillert 
42b3868e1Smillert /*
52b3868e1Smillert  * Copyright (c) 2004 David Young.  All rights reserved.
62b3868e1Smillert  *
72b3868e1Smillert  * This code was written by David Young.
82b3868e1Smillert  *
92b3868e1Smillert  * Redistribution and use in source and binary forms, with or without
102b3868e1Smillert  * modification, are permitted provided that the following conditions
112b3868e1Smillert  * are met:
122b3868e1Smillert  * 1. Redistributions of source code must retain the above copyright
132b3868e1Smillert  *    notice, this list of conditions and the following disclaimer.
142b3868e1Smillert  * 2. Redistributions in binary form must reproduce the above copyright
152b3868e1Smillert  *    notice, this list of conditions and the following disclaimer in the
162b3868e1Smillert  *    documentation and/or other materials provided with the distribution.
172b3868e1Smillert  * 3. Neither the name of the author nor the names of any co-contributors
182b3868e1Smillert  *    may be used to endorse or promote products derived from this software
192b3868e1Smillert  *    without specific prior written permission.
202b3868e1Smillert  *
212b3868e1Smillert  * THIS SOFTWARE IS PROVIDED BY David Young ``AS IS'' AND ANY
222b3868e1Smillert  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
232b3868e1Smillert  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
242b3868e1Smillert  * PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL David
252b3868e1Smillert  * Young BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
262b3868e1Smillert  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
272b3868e1Smillert  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
282b3868e1Smillert  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
292b3868e1Smillert  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
302b3868e1Smillert  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
312b3868e1Smillert  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
322b3868e1Smillert  * OF SUCH DAMAGE.
332b3868e1Smillert  */
342b3868e1Smillert 
352b3868e1Smillert #ifndef _DEV_IC_SI4136REG_H_
362b3868e1Smillert #define	_DEV_IC_SI4136REG_H_
372b3868e1Smillert 
382b3868e1Smillert /*
392b3868e1Smillert  * Serial bus format for Silicon Laboratories Si4126/Si4136 RF synthesizer.
402b3868e1Smillert  */
41*d2cfaccaSjsg #define SI4126_TWI_DATA_MASK	0x3ffff0
42*d2cfaccaSjsg #define SI4126_TWI_ADDR_MASK	0xf
432b3868e1Smillert 
442b3868e1Smillert /*
452b3868e1Smillert  * Registers for Silicon Laboratories Si4126/Si4136 RF synthesizer.
462b3868e1Smillert  */
472b3868e1Smillert #define SI4126_MAIN	0	/* main configuration */
48*d2cfaccaSjsg #define	SI4126_MAIN_AUXSEL_MASK	0x3000	/* aux. output pin function */
492b3868e1Smillert /* reserved */
502b3868e1Smillert #define	SI4126_MAIN_AUXSEL_RSVD		LSHIFT(0x0, SI4126_MAIN_AUXSEL_MASK)
512b3868e1Smillert /* force low */
522b3868e1Smillert #define	SI4126_MAIN_AUXSEL_FRCLOW	LSHIFT(0x1, SI4126_MAIN_AUXSEL_MASK)
532b3868e1Smillert /* Lock Detect (LDETB) */
542b3868e1Smillert #define	SI4126_MAIN_AUXSEL_LDETB	LSHIFT(0x3, SI4126_MAIN_AUXSEL_MASK)
552b3868e1Smillert 
56*d2cfaccaSjsg #define	SI4126_MAIN_IFDIV_MASK	0xc00	/* IFOUT = IFVCO
572b3868e1Smillert 						 * frequency / 2**IFDIV.
582b3868e1Smillert 						 */
592b3868e1Smillert 
60*d2cfaccaSjsg #define	SI4126_MAIN_XINDIV2	(1<<6)	/* 1: divide crystal input (XIN) by 2 */
61*d2cfaccaSjsg #define	SI4126_MAIN_LPWR	(1<<5)	/* 1: low-power mode */
62*d2cfaccaSjsg #define	SI4126_MAIN_AUTOPDB	(1<<3)	/* 1: equivalent to
632b3868e1Smillert 					 *    reg[SI4126_POWER] <-
642b3868e1Smillert 					 *    SI4126_POWER_PDIB |
652b3868e1Smillert 					 *    SI4126_POWER_PDRB.
662b3868e1Smillert 					 *
672b3868e1Smillert 					 * 0: power-down under control of
682b3868e1Smillert 					 *    reg[SI4126_POWER].
692b3868e1Smillert 					 */
702b3868e1Smillert 
712b3868e1Smillert #define	SI4126_GAIN	1		/* phase detector gain */
72*d2cfaccaSjsg #define	SI4126_GAIN_KPI_MASK	0x30	/* IF phase detector gain */
73*d2cfaccaSjsg #define	SI4126_GAIN_KP2_MASK	0xc	/* RF2 phase detector gain */
74*d2cfaccaSjsg #define	SI4126_GAIN_KP1_MASK	0x3	/* RF1 phase detector gain */
752b3868e1Smillert 
762b3868e1Smillert #define	SI4126_POWER	2		/* powerdown */
77*d2cfaccaSjsg #define	SI4126_POWER_PDIB	(1<<1)	/* 1: IF synthesizer on */
78*d2cfaccaSjsg #define	SI4126_POWER_PDRB	(1<<0)	/* 1: RF synthesizer on */
792b3868e1Smillert 
802b3868e1Smillert #define	SI4126_RF1N	3		/* RF1 N divider */
812b3868e1Smillert #define	SI4126_RF2N	4		/* RF2 N divider */
822b3868e1Smillert #define	SI4126_IFN	5		/* IF N divider */
832b3868e1Smillert #define	SI4126_RF1R	6		/* RF1 R divider */
842b3868e1Smillert #define	SI4126_RF2R	7		/* RF2 R divider */
852b3868e1Smillert #define	SI4126_IFR	8		/* IF R divider */
862b3868e1Smillert 
872b3868e1Smillert #endif /* _DEV_IC_SI4136REG_H_ */
88