-
Notifications
You must be signed in to change notification settings - Fork 1
/
nimolib.h
60 lines (51 loc) · 1.71 KB
/
nimolib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* This file is part of the m032HidBootloader distribution (https://github.com/nimo-labs/m032HidBootloader).
* Copyright (c) 2021 Nimolabs Ltd. www.nimo.uk
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "hal.h"
/*Main processor clock */
#define UP_CLK 48000000
#define HELPER 1
/*Uart config */
#define PRINTF_BUFF_SIZE 0
#define DEBUG_UART UART_CHAN0
#if defined(__NUVO_M032K)
#define UART_0_USE_PF2_3
#define UART_CHAN0 0
#define UART_CHAN0_SERCOM 0
#define UART_CHAN0_FIFO_LEN 10
#elif defined(__SAMR21) || defined(__SAMD21)
#define UART_CHAN0 0
#define UART_CHAN0_SERCOM 0
#define UART_CHAN0_IRQ void irq_handler_sercom0(void)
#define UART_CHAN0_FIFO_LEN 10
#define UART_CHAN0_PORT SAM_GPIO_PORTA
#define UART_CHAN0_RX_PIN 5
#define UART_CHAN0_TX_PIN 4
#define UART_CHAN0_RX_PAD 1
#define UART_CHAN0_TX_PAD 0 /*1 is pad 2*/
#define UART_CHAN0_PERHIPH_RX_MUX SAM_GPIO_PMUX_D
#define UART_CHAN0_PERHIPH_TX_MUX SAM_GPIO_PMUX_D
#endif
/* USB HID */
#define USB_VID 0x0416
#define USB_PID 0x5020
#define USB_BUFFER_SIZE 64
#define USB_VID 0x0416
#define USB_PID 0x5020
#if defined(__SAMR21) || defined(__SAMD21)
#define PERHIP_CLK_GEN 0
#endif
#define EXT_FLASH_APP_LOC 0x0