Analog Devices EV-COG-AD3029LZ Board Support Package Documentation  Release 3.1.0
adi_adp5300.h
1 /*********************************************************************************
2  @file adi_adp5300.h
3  @brief Header file for the ADP5300 Driver.
4  This header file will have processor specific definitions.
5 
6  -----------------------------------------------------------------------------
7 Copyright (c) 2017 Analog Devices, Inc.
8 
9 All rights reserved.
10 
11 Redistribution and use in source and binary forms, with or without modification,
12 are permitted provided that the following conditions are met:
13  - Redistributions of source code must retain the above copyright notice,
14  this list of conditions and the following disclaimer.
15  - Redistributions in binary form must reproduce the above copyright notice,
16  this list of conditions and the following disclaimer in the documentation
17  and/or other materials provided with the distribution.
18  - Modified versions of the software must be conspicuously marked as such.
19  - This software is licensed solely and exclusively for use with processors
20  manufactured by or for Analog Devices, Inc.
21  - This software may not be combined or merged with other code in any manner
22  that would cause the software to become subject to terms and conditions
23  which differ from those listed here.
24  - Neither the name of Analog Devices, Inc. nor the names of its
25  contributors may be used to endorse or promote products derived
26  from this software without specific prior written permission.
27  - The use of this software may or may not infringe the patent rights of one
28  or more patent holders. This license does not release you from the
29  requirement that you obtain separate licenses from these patent holders
30  to use this software.
31 
32 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS"
33 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-
34 INFRINGEMENT, TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35 DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE
36 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR
37 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF
38 CLAIMS OF INTELLECTUAL PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF
39 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
40 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
41 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
42 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
43 POSSIBILITY OF SUCH DAMAGE.
44 
45 *****************************************************************************/
46 
47 #ifndef __ADP5300_H__
48 #define __ADP5300_H__
49 
50 #include <drivers/gpio/adi_gpio.h>
51 #include <adi_processor.h>
52 #include <adi_callback.h>
53 
54 
62 #if (defined(__ADUCM302x__) || defined(__ADUCM4x50__))
63 
64 #define ADI_ADP5300_MODE_PIN (ADI_GPIO_PIN_0)
65 
66 #define ADI_ADP5300_MODE_PORT (ADI_GPIO_PORT2)
67 
69 #define ADI_ADP5300_STOP_PIN (ADI_GPIO_PIN_12)
70 
71 #define ADI_ADP5300_STOP_PORT (ADI_GPIO_PORT0)
72 
74 #define ADI_ADP5300_VOUTOK_PIN (ADI_GPIO_PIN_15)
75 
76 #define ADI_ADP5300_VOUTOK_PORT (ADI_GPIO_PORT1)
77 #else
78 #error ADP5300 is not ported for this processor
79 #endif
80 
82 #define ADI_VOUTOK_IRQ_GROUP (ADI_GPIO_INTA_IRQ)
83 
95 typedef enum {
99 
110 typedef enum {
114 
129 ADI_GPIO_RESULT adi_adp5300_Init();
130 
146 ADI_GPIO_RESULT adi_adp5300_SetMode(ADI_ADP5300_MODE eMode);
147 
165 ADI_GPIO_RESULT adi_adp5300_SetSwitching(ADI_ADP5300_SWITCHING bState);
166 
188 ADI_GPIO_RESULT adi_adp5300_EnableVoutokInt(uint8_t bEnable);
189 
207 ADI_GPIO_RESULT adi_adp5300_ReadVoutokState(uint8_t * const pState);
208 
209 
218 void VoutokCallback(void * pCBParam, uint32_t Event, void * pArg);
219 
224 #endif
Definition: adi_adp5300.h:112
ADI_GPIO_RESULT adi_adp5300_SetSwitching(ADI_ADP5300_SWITCHING bState)
Set the switching state of the ADP5300.
Definition: adi_adp5300.c:91
ADI_GPIO_RESULT adi_adp5300_SetMode(ADI_ADP5300_MODE eMode)
Set the mode of the ADP5300.
Definition: adi_adp5300.c:79
Definition: adi_adp5300.h:97
ADI_ADP5300_SWITCHING
ADP5300 switching modes.
Definition: adi_adp5300.h:110
Definition: adi_adp5300.h:96
ADI_GPIO_RESULT adi_adp5300_ReadVoutokState(uint8_t *const pState)
Read VOUTOK output pin.
Definition: adi_adp5300.c:134
ADI_ADP5300_MODE
ADP5300 operational modes.
Definition: adi_adp5300.h:95
ADI_GPIO_RESULT adi_adp5300_Init()
Initialize the ADP5300.
Definition: adi_adp5300.c:49
ADI_GPIO_RESULT adi_adp5300_EnableVoutokInt(uint8_t bEnable)
Enable/disable the VOUTOK interrupt.
Definition: adi_adp5300.c:103
Definition: adi_adp5300.h:111