1 /******************************************************************************* 2 * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice shall be included 12 * in all copies or substantial portions of the Software. 13 * 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 * OTHER DEALINGS IN THE SOFTWARE. 21 * 22 * Except as contained in this notice, the name of Maxim Integrated 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated 24 * Products, Inc. Branding Policy. 25 * 26 * The mere transfer of this software does not imply any licenses 27 * of trade secrets, proprietary technology, copyrights, patents, 28 * trademarks, maskwork rights, or any other form of intellectual 29 * property whatsoever. Maxim Integrated Products, Inc. retains all 30 * ownership rights. 31 * 32 * $Date: 2016-03-11 10:46:02 -0700 (Fri, 11 Mar 2016) $ 33 * $Revision: 21838 $ 34 * 35 ******************************************************************************/ 36 37 /** 38 * @file board.h 39 * @brief Board support package API. 40 */ 41 42 #ifndef _BOARD_H 43 #define _BOARD_H 44 45 #include "gpio.h" 46 #include "spim.h" 47 #include "ioman.h" 48 #include "led.h" 49 #include "pb.h" 50 51 #ifdef __cplusplus 52 extern "C" { 53 #endif 54 55 #ifndef CONSOLE_UART 56 #define CONSOLE_UART 1 /// UART instance to use for console 57 #endif 58 59 #ifndef CONSOLE_BAUD 60 #define CONSOLE_BAUD 115200 /// Console baud rate 61 #endif 62 63 // Pushbutton Indices 64 #define SW1 0 /// Pushbutton index for SW1 65 66 #define LED_OFF 1 /// Inactive state of LEDs 67 #define LED_ON 0 /// Active state of LEDs 68 69 // Console UART configuration 70 extern const uart_cfg_t console_uart_cfg; 71 extern const sys_cfg_uart_t console_sys_cfg; 72 73 // MAX14690 PMIC 74 #define MAX14690_I2CM_INST 0 75 #define MAX14690_I2CM MXC_I2CM2 76 extern const ioman_cfg_t max14690_io_cfg; 77 extern const gpio_cfg_t max14690_int; 78 extern const gpio_cfg_t max14690_mpc0; 79 80 /** 81 * \brief Initialize the BSP and board interfaces. 82 * \returns #E_NO_ERROR if everything is successful 83 */ 84 int Board_Init(void); 85 86 /** 87 * \brief Initialize or reinitialize the console. This may be necessary if the 88 * system clock rate is changed. 89 * \returns #E_NO_ERROR if everything is successful 90 */ 91 int Console_Init(void); 92 93 /** 94 * \brief Attempt to prepare the console for sleep. 95 * \returns #E_NO_ERROR if ready to sleep, #E_BUSY if not ready for sleep. 96 */ 97 int Console_PrepForSleep(void); 98 99 #ifdef __cplusplus 100 } 101 #endif 102 103 #endif /* _BOARD_H */ 104