Root/atusb/fw/board_rzusb.h

1/*
2 * fw/board_rzusb.h - RZUSB Board-specific functions and definitions
3 *
4 * Written 2016 by Stefan Schmidt
5 * Copyright 2016 Stefan Schmidt
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef BOARD_RZUSB_H
14#define BOARD_RZUSB_H
15
16#include <stdbool.h>
17#include <stdint.h>
18
19#define LED_PORT D
20#define LED_BIT 7
21#define nRST_RF_PORT B
22#define nRST_RF_BIT 5
23#define SLP_TR_PORT B
24#define SLP_TR_BIT 4
25
26#define SCLK_PORT B
27#define SCLK_BIT 1
28#define MOSI_PORT B
29#define MOSI_BIT 2
30
31#define MISO_PORT B
32#define MISO_BIT 3
33#define nSS_PORT B
34#define nSS_BIT 0
35#define IRQ_RF_PORT D
36#define IRQ_RF_BIT 4
37
38#define SPI_WAIT_DONE() while ((SPSR & (1 << SPIF)) == 0)
39#define SPI_DATA SPDR
40
41void set_clkm(void);
42void board_init(void);
43
44void spi_begin(void);
45void spi_off(void);
46void spi_init(void);
47
48#endif /* !BOARD_H */
49

Archive Download this file



interactive