149a45ad9SMatthias Ringwald /******************************************************************************* 249a45ad9SMatthias Ringwald * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. 349a45ad9SMatthias Ringwald * 449a45ad9SMatthias Ringwald * Permission is hereby granted, free of charge, to any person obtaining a 549a45ad9SMatthias Ringwald * copy of this software and associated documentation files (the "Software"), 649a45ad9SMatthias Ringwald * to deal in the Software without restriction, including without limitation 749a45ad9SMatthias Ringwald * the rights to use, copy, modify, merge, publish, distribute, sublicense, 849a45ad9SMatthias Ringwald * and/or sell copies of the Software, and to permit persons to whom the 949a45ad9SMatthias Ringwald * Software is furnished to do so, subject to the following conditions: 1049a45ad9SMatthias Ringwald * 1149a45ad9SMatthias Ringwald * The above copyright notice and this permission notice shall be included 1249a45ad9SMatthias Ringwald * in all copies or substantial portions of the Software. 1349a45ad9SMatthias Ringwald * 1449a45ad9SMatthias Ringwald * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 1549a45ad9SMatthias Ringwald * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 1649a45ad9SMatthias Ringwald * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 1749a45ad9SMatthias Ringwald * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES 1849a45ad9SMatthias Ringwald * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 1949a45ad9SMatthias Ringwald * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 2049a45ad9SMatthias Ringwald * OTHER DEALINGS IN THE SOFTWARE. 2149a45ad9SMatthias Ringwald * 2249a45ad9SMatthias Ringwald * Except as contained in this notice, the name of Maxim Integrated 2349a45ad9SMatthias Ringwald * Products, Inc. shall not be used except as stated in the Maxim Integrated 2449a45ad9SMatthias Ringwald * Products, Inc. Branding Policy. 2549a45ad9SMatthias Ringwald * 2649a45ad9SMatthias Ringwald * The mere transfer of this software does not imply any licenses 2749a45ad9SMatthias Ringwald * of trade secrets, proprietary technology, copyrights, patents, 2849a45ad9SMatthias Ringwald * trademarks, maskwork rights, or any other form of intellectual 2949a45ad9SMatthias Ringwald * property whatsoever. Maxim Integrated Products, Inc. retains all 3049a45ad9SMatthias Ringwald * ownership rights. 3149a45ad9SMatthias Ringwald * 3249a45ad9SMatthias Ringwald * $Date: 2016-03-11 10:46:02 -0700 (Fri, 11 Mar 2016) $ 3349a45ad9SMatthias Ringwald * $Revision: 21838 $ 3449a45ad9SMatthias Ringwald * 3549a45ad9SMatthias Ringwald ******************************************************************************/ 3649a45ad9SMatthias Ringwald 3749a45ad9SMatthias Ringwald /** 3849a45ad9SMatthias Ringwald * @file board.h 3949a45ad9SMatthias Ringwald * @brief Board support package API. 4049a45ad9SMatthias Ringwald */ 4149a45ad9SMatthias Ringwald 4249a45ad9SMatthias Ringwald #ifndef _BOARD_H 4349a45ad9SMatthias Ringwald #define _BOARD_H 4449a45ad9SMatthias Ringwald 4549a45ad9SMatthias Ringwald #include "gpio.h" 4649a45ad9SMatthias Ringwald #include "spim.h" 4749a45ad9SMatthias Ringwald #include "ioman.h" 4849a45ad9SMatthias Ringwald #include "led.h" 4949a45ad9SMatthias Ringwald #include "pb.h" 5049a45ad9SMatthias Ringwald 5149a45ad9SMatthias Ringwald #ifdef __cplusplus 5249a45ad9SMatthias Ringwald extern "C" { 5349a45ad9SMatthias Ringwald #endif 5449a45ad9SMatthias Ringwald 5549a45ad9SMatthias Ringwald #ifndef CONSOLE_UART 5649a45ad9SMatthias Ringwald #define CONSOLE_UART 1 /// UART instance to use for console 5749a45ad9SMatthias Ringwald #endif 5849a45ad9SMatthias Ringwald 5949a45ad9SMatthias Ringwald #ifndef CONSOLE_BAUD 6049a45ad9SMatthias Ringwald #define CONSOLE_BAUD 115200 /// Console baud rate 6149a45ad9SMatthias Ringwald #endif 6249a45ad9SMatthias Ringwald 6349a45ad9SMatthias Ringwald // Pushbutton Indices 6449a45ad9SMatthias Ringwald #define SW1 0 /// Pushbutton index for SW1 6549a45ad9SMatthias Ringwald 6649a45ad9SMatthias Ringwald #define LED_OFF 1 /// Inactive state of LEDs 6749a45ad9SMatthias Ringwald #define LED_ON 0 /// Active state of LEDs 6849a45ad9SMatthias Ringwald 69*24efff18SMatthias Ringwald #define LED_RED (0) /* (&led_pin[0]) */ 70*24efff18SMatthias Ringwald #define LED_GREEN (1) /* &led_pin[1] */ 71*24efff18SMatthias Ringwald #define LED_BLUE (2) /* led_pin[2] */ 72*24efff18SMatthias Ringwald 7349a45ad9SMatthias Ringwald // Console UART configuration 7449a45ad9SMatthias Ringwald extern const uart_cfg_t console_uart_cfg; 7549a45ad9SMatthias Ringwald extern const sys_cfg_uart_t console_sys_cfg; 7649a45ad9SMatthias Ringwald 7749a45ad9SMatthias Ringwald // MAX14690 PMIC 7849a45ad9SMatthias Ringwald #define MAX14690_I2CM_INST 0 7949a45ad9SMatthias Ringwald #define MAX14690_I2CM MXC_I2CM2 8049a45ad9SMatthias Ringwald extern const ioman_cfg_t max14690_io_cfg; 8149a45ad9SMatthias Ringwald extern const gpio_cfg_t max14690_int; 8249a45ad9SMatthias Ringwald extern const gpio_cfg_t max14690_mpc0; 8349a45ad9SMatthias Ringwald 8449a45ad9SMatthias Ringwald /** 8549a45ad9SMatthias Ringwald * \brief Initialize the BSP and board interfaces. 8649a45ad9SMatthias Ringwald * \returns #E_NO_ERROR if everything is successful 8749a45ad9SMatthias Ringwald */ 8849a45ad9SMatthias Ringwald int Board_Init(void); 8949a45ad9SMatthias Ringwald 9049a45ad9SMatthias Ringwald /** 9149a45ad9SMatthias Ringwald * \brief Initialize or reinitialize the console. This may be necessary if the 9249a45ad9SMatthias Ringwald * system clock rate is changed. 9349a45ad9SMatthias Ringwald * \returns #E_NO_ERROR if everything is successful 9449a45ad9SMatthias Ringwald */ 9549a45ad9SMatthias Ringwald int Console_Init(void); 9649a45ad9SMatthias Ringwald 9749a45ad9SMatthias Ringwald /** 9849a45ad9SMatthias Ringwald * \brief Attempt to prepare the console for sleep. 9949a45ad9SMatthias Ringwald * \returns #E_NO_ERROR if ready to sleep, #E_BUSY if not ready for sleep. 10049a45ad9SMatthias Ringwald */ 10149a45ad9SMatthias Ringwald int Console_PrepForSleep(void); 10249a45ad9SMatthias Ringwald 10349a45ad9SMatthias Ringwald #ifdef __cplusplus 10449a45ad9SMatthias Ringwald } 10549a45ad9SMatthias Ringwald #endif 10649a45ad9SMatthias Ringwald 10749a45ad9SMatthias Ringwald #endif /* _BOARD_H */ 108