RTEMS  5.1
cs2100.h
Go to the documentation of this file.
1 /* ---------------------------------------------------------------------------- */
2 /* Atmel Microcontroller Software Support */
3 /* SAM Software Package License */
4 /* ---------------------------------------------------------------------------- */
5 /* Copyright (c) 2015, Atmel Corporation */
6 /* */
7 /* All rights reserved. */
8 /* */
9 /* Redistribution and use in source and binary forms, with or without */
10 /* modification, are permitted provided that the following condition is met: */
11 /* */
12 /* - Redistributions of source code must retain the above copyright notice, */
13 /* this list of conditions and the disclaimer below. */
14 /* */
15 /* Atmel's name may not be used to endorse or promote products derived from */
16 /* this software without specific prior written permission. */
17 /* */
18 /* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */
19 /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
20 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */
21 /* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */
22 /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
23 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
24 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
25 /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
26 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
27 /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
28 /* ---------------------------------------------------------------------------- */
29 
37 #ifndef CS2100_H
38 #define CS2100_H
39 
40 #include "board.h"
41 
42 /*----------------------------------------------------------------------------
43  * Definitions
44  *----------------------------------------------------------------------------*/
45 
46 #define CS2100_SLAVE_ADDRESS 0x4E
47 
49 #define CS2100_REG_ID 0x01
50 
52 #define CS2100_REG_CTRL 0x02
53 
55 #define CS2100_REG_DEV_CFG1 0x03
56 
58 #define CS2100_REG_CFG 0x05
59 
61 #define CS2100_REG_32_BIT_RATIO_1 0x06
62 
63 #define CS2100_REG_32_BIT_RATIO_2 0x07
64 
65 #define CS2100_REG_32_BIT_RATIO_3 0x08
66 
67 #define CS2100_REG_32_BIT_RATIO_4 0x09
68 
69 #define CS2100_REG_FUNC_CFG1 0x16
70 
71 #define CS2100_REG_FUNC_CFG2 0x17
72 
73 #define CS2100_REG_FUNC_CFG3 0x1E
74 
75 /*----------------------------------------------------------------------------
76  * Exported functions
77  *----------------------------------------------------------------------------*/
78 
79 extern uint16_t CS2100_Read(
80  Twid *pTwid,
81  uint32_t device,
82  uint32_t regAddr);
83 
84 extern void CS2100_Write(
85  Twid *pTwid,
86  uint32_t device,
87  uint32_t regAddr,
88  uint16_t data);
89 
90 extern uint8_t CS2100_Init(Twid *pTwid, uint32_t device, uint32_t PCK);
91 #endif // CS2100_H
92 
93 
Definition: rtemscompat1.h:15
TWI driver structure. Holds the internal state of the driver.
Definition: twid.h:72