|
| 1 | +/**------------------------------------------------------------------------- |
| 2 | +@file board.h |
| 3 | +
|
| 4 | +@brief Board specific definitions |
| 5 | +
|
| 6 | +This file contains all I/O definitions for a specific board for the |
| 7 | +application firmware. This files should be located in each project and |
| 8 | +modified to suit the need for the application use case. |
| 9 | +
|
| 10 | +@author Hoang Nguyen Hoan |
| 11 | +@date Nov. 16, 2016 |
| 12 | +
|
| 13 | +@license |
| 14 | +
|
| 15 | +Copyright (c) 2016, I-SYST inc., all rights reserved |
| 16 | +
|
| 17 | +Permission to use, copy, modify, and distribute this software for any purpose |
| 18 | +with or without fee is hereby granted, provided that the above copyright |
| 19 | +notice and this permission notice appear in all copies, and none of the |
| 20 | +names : I-SYST or its contributors may be used to endorse or |
| 21 | +promote products derived from this software without specific prior written |
| 22 | +permission. |
| 23 | +
|
| 24 | +For info or contributing contact : hnhoan at i-syst dot com |
| 25 | +
|
| 26 | +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY |
| 27 | +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 28 | +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 29 | +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY |
| 30 | +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 31 | +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 32 | +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 33 | +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 34 | +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 35 | +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 36 | +
|
| 37 | +----------------------------------------------------------------------------*/ |
| 38 | + |
| 39 | +#ifndef __BOARD_H__ |
| 40 | +#define __BOARD_H__ |
| 41 | + |
| 42 | +#include "blueio_board.h" |
| 43 | + |
| 44 | +// IBK-NRF5x |
| 45 | +// Button 1 |
| 46 | +#define BUT1_PORT BLUEIO_BUT1_PORT |
| 47 | +#define BUT1_PIN BLUEIO_BUT1_PIN |
| 48 | +#define BUT1_PINOP BLUEIO_BUT1_PINOP |
| 49 | +#define BUT1_SENSE IOPINSENSE_LOW_TRANSITION |
| 50 | +#define BUT1_SENSE_INT 0 |
| 51 | +#define BUT1_INT_PRIO 6 |
| 52 | + |
| 53 | +// Button 2 |
| 54 | +#define BUT2_PORT BLUEIO_BUT2_PORT |
| 55 | +#define BUT2_PIN BLUEIO_BUT2_PIN |
| 56 | +#define BUT2_PINOP BLUEIO_BUT2_PINOP |
| 57 | +#define BUT2_SENSE IOPINSENSE_LOW_TRANSITION |
| 58 | +#define BUT2_SENSE_INT BUT2_PIN |
| 59 | +#define BUT2_INT_PRIO 6 |
| 60 | + |
| 61 | + |
| 62 | +#define LED1_PORT BLUEIO_LED1_PORT |
| 63 | +#define LED1_PIN BLUEIO_LED1_PIN |
| 64 | +#define LED1_PINOP BLUEIO_LED1_PINOP |
| 65 | + |
| 66 | +#define LED2_PORT BLUEIO_LED2_PORT |
| 67 | +#define LED2_PIN BLUEIO_LED2_PIN |
| 68 | +#define LED2_PINOP BLUEIO_LED2_PINOP |
| 69 | + |
| 70 | +#define LED3_PORT BLUEIO_LED3_PORT |
| 71 | +#define LED3_PIN BLUEIO_LED3_PIN |
| 72 | +#define LED3_PINOP BLUEIO_LED3_PINOP |
| 73 | + |
| 74 | +#define LED4_PORT BLUEIO_LED4_PORT |
| 75 | +#define LED4_PIN BLUEIO_LED4_PIN |
| 76 | +#define LED4_PINOP BLUEIO_LED4_PINOP |
| 77 | + |
| 78 | +#define BUT_N_LED_PINS_MAP { \ |
| 79 | + {LED1_PORT, LED1_PIN, LED1_PINOP, IOPINDIR_OUTPUT, IOPINRES_NONE, IOPINTYPE_NORMAL}, \ |
| 80 | + {LED2_PORT, LED2_PIN, LED2_PINOP, IOPINDIR_OUTPUT, IOPINRES_NONE, IOPINTYPE_NORMAL}, \ |
| 81 | + {LED3_PORT, LED3_PIN, LED3_PINOP, IOPINDIR_OUTPUT, IOPINRES_NONE, IOPINTYPE_NORMAL}, \ |
| 82 | + {LED4_PORT, LED4_PIN, LED4_PINOP, IOPINDIR_OUTPUT, IOPINRES_NONE, IOPINTYPE_NORMAL}, \ |
| 83 | + {BUT1_PORT, BUT1_PIN, BUT1_PINOP, IOPINDIR_INPUT, IOPINRES_PULLDOWN, IOPINTYPE_NORMAL}, \ |
| 84 | + {BUT2_PORT, BUT2_PIN, BUT2_PINOP, IOPINDIR_INPUT, IOPINRES_PULLDOWN, IOPINTYPE_NORMAL}, \ |
| 85 | +} |
| 86 | + |
| 87 | +#endif // __BOARD_H__ |
| 88 | + |
0 commit comments