|
| 1 | +/**************************************************************************/ |
| 2 | +/*! |
| 3 | + @file elelctronutlabs_papyr.h |
| 4 | + @author Tavish Naruka <[email protected]> |
| 5 | +
|
| 6 | + @section LICENSE |
| 7 | +
|
| 8 | + Software License Agreement (BSD License) |
| 9 | +
|
| 10 | + Copyright (c) 2017, Adafruit Industries (adafruit.com) |
| 11 | + All rights reserved. |
| 12 | +
|
| 13 | + Redistribution and use in source and binary forms, with or without |
| 14 | + modification, are permitted provided that the following conditions are met: |
| 15 | + 1. Redistributions of source code must retain the above copyright |
| 16 | + notice, this list of conditions and the following disclaimer. |
| 17 | + 2. Redistributions in binary form must reproduce the above copyright |
| 18 | + notice, this list of conditions and the following disclaimer in the |
| 19 | + documentation and/or other materials provided with the distribution. |
| 20 | + 3. Neither the name of the copyright holders nor the |
| 21 | + names of its contributors may be used to endorse or promote products |
| 22 | + derived from this software without specific prior written permission. |
| 23 | +
|
| 24 | + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY |
| 25 | + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 26 | + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 27 | + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY |
| 28 | + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 29 | + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 30 | + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 31 | + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 32 | + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 33 | + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 34 | +*/ |
| 35 | +/**************************************************************************/ |
| 36 | + |
| 37 | +#ifndef PAPYR_H |
| 38 | +#define PAPYR_H |
| 39 | + |
| 40 | +/*------------------------------------------------------------------*/ |
| 41 | +/* LED |
| 42 | + *------------------------------------------------------------------*/ |
| 43 | +#define LEDS_NUMBER 2 |
| 44 | +#define LED_PRIMARY_PIN 13 |
| 45 | +#define LED_SECONDARY_PIN 14 |
| 46 | +#define LED_STATE_ON 0 |
| 47 | + |
| 48 | +/*------------------------------------------------------------------*/ |
| 49 | +/* BUTTON |
| 50 | + *------------------------------------------------------------------*/ |
| 51 | +// NOTE: USB UF2 bootloader can be triggered by double pressing RESET |
| 52 | +// App can trigger OTA bootloader by writing DFU_MAGIC_OTA_APPJUM to |
| 53 | +// GPREGRET register if softdevice is not initialized; or by |
| 54 | +// writing DFU_MAGIC_OTA_RESET in case softdevice is initialized. |
| 55 | +#define BUTTONS_NUMBER 2 |
| 56 | +#define BUTTON_1 18 // RESET also by default |
| 57 | +#define BUTTON_2 1 // P0.1 not exposed anywhere, FRST n/a |
| 58 | +#define BUTTON_PULL NRF_GPIO_PIN_PULLUP |
| 59 | + |
| 60 | +/*------------------------------------------------------------------*/ |
| 61 | +/* UART |
| 62 | + *------------------------------------------------------------------*/ |
| 63 | +#define RX_PIN_NUMBER 7 |
| 64 | +#define TX_PIN_NUMBER 8 |
| 65 | +#define CTS_PIN_NUMBER 0 |
| 66 | +#define RTS_PIN_NUMBER 0 |
| 67 | +#define HWFC false |
| 68 | + |
| 69 | +// Used as model string in OTA mode |
| 70 | +#define DIS_MANUFACTURER "Electronut Labs" |
| 71 | +#define DIS_MODEL "Papyr" |
| 72 | + |
| 73 | +#define BOARD_ID "Electronut Labs Papyr" |
| 74 | +#define INDEX_URL "https://docs.electronut.in/papyr" |
| 75 | + |
| 76 | +#define USB_DESC_VID 0x239A |
| 77 | +#define USB_DESC_UF2_PID 0x003B |
| 78 | + |
| 79 | +#define USB_STRING_DESCRIPTORS { \ |
| 80 | + /* 0: is supported language = English */ \ |
| 81 | + TUD_DESC_STRCONV(0x0409), \ |
| 82 | + \ |
| 83 | + /* 1: Manufacturer */ \ |
| 84 | + TUD_DESC_STRCONV('E','l','e','c','t','r','o','n','u','t',' ','L','a','b','s'), \ |
| 85 | + \ |
| 86 | + /* 2: Product */ \ |
| 87 | + TUD_DESC_STRCONV('P','a','p','y','r', ' ', 'D','F','U'), \ |
| 88 | + \ |
| 89 | + /* 3: Serials TODO use chip ID */ \ |
| 90 | + usb_desc_str_serial, \ |
| 91 | + \ |
| 92 | + /* 4: CDC Interface */ \ |
| 93 | + TUD_DESC_STRCONV('P','a','p','y','r',' ','S','e','r','i','a','l'), \ |
| 94 | + \ |
| 95 | + /* 5: MSC Interface */ \ |
| 96 | + TUD_DESC_STRCONV('P','a','p','y','r',' ','U','F','2'), \ |
| 97 | +} |
| 98 | + |
| 99 | +#endif // PPAPYR_H |
0 commit comments