|
| 1 | +// Generated by PeakRDL-cheader - A free and open-source header generator |
| 2 | +// https://github.com/SystemRDL/PeakRDL-cheader |
| 3 | + |
| 4 | +#ifndef ATXMEGA_SPI_BF_H |
| 5 | +#define ATXMEGA_SPI_BF_H |
| 6 | + |
| 7 | +#ifdef __cplusplus |
| 8 | +extern "C" { |
| 9 | +#endif |
| 10 | + |
| 11 | +#include <stdint.h> |
| 12 | +#include <assert.h> |
| 13 | + |
| 14 | +// Reg - atxmega_spi::CTRL |
| 15 | +#define ATXMEGA_SPI__CTRL__PRESCALER_bm 0x3 |
| 16 | +#define ATXMEGA_SPI__CTRL__PRESCALER_bp 0 |
| 17 | +#define ATXMEGA_SPI__CTRL__PRESCALER_bw 2 |
| 18 | +#define ATXMEGA_SPI__CTRL__PRESCALER_reset 0x0 |
| 19 | +#define ATXMEGA_SPI__CTRL__MODE_bm 0xc |
| 20 | +#define ATXMEGA_SPI__CTRL__MODE_bp 2 |
| 21 | +#define ATXMEGA_SPI__CTRL__MODE_bw 2 |
| 22 | +#define ATXMEGA_SPI__CTRL__MODE_reset 0x0 |
| 23 | +#define ATXMEGA_SPI__CTRL__MASTER_bm 0x10 |
| 24 | +#define ATXMEGA_SPI__CTRL__MASTER_bp 4 |
| 25 | +#define ATXMEGA_SPI__CTRL__MASTER_bw 1 |
| 26 | +#define ATXMEGA_SPI__CTRL__MASTER_reset 0x0 |
| 27 | +#define ATXMEGA_SPI__CTRL__DORD_bm 0x20 |
| 28 | +#define ATXMEGA_SPI__CTRL__DORD_bp 5 |
| 29 | +#define ATXMEGA_SPI__CTRL__DORD_bw 1 |
| 30 | +#define ATXMEGA_SPI__CTRL__DORD_reset 0x0 |
| 31 | +#define ATXMEGA_SPI__CTRL__ENABLE_bm 0x40 |
| 32 | +#define ATXMEGA_SPI__CTRL__ENABLE_bp 6 |
| 33 | +#define ATXMEGA_SPI__CTRL__ENABLE_bw 1 |
| 34 | +#define ATXMEGA_SPI__CTRL__ENABLE_reset 0x0 |
| 35 | +#define ATXMEGA_SPI__CTRL__CLK2X_bm 0x80 |
| 36 | +#define ATXMEGA_SPI__CTRL__CLK2X_bp 7 |
| 37 | +#define ATXMEGA_SPI__CTRL__CLK2X_bw 1 |
| 38 | +#define ATXMEGA_SPI__CTRL__CLK2X_reset 0x0 |
| 39 | +typedef union { |
| 40 | + struct __attribute__ ((__packed__)) { |
| 41 | + uint8_t PRESCALER :2; |
| 42 | + uint8_t MODE :2; |
| 43 | + uint8_t MASTER :1; |
| 44 | + uint8_t DORD :1; |
| 45 | + uint8_t ENABLE :1; |
| 46 | + uint8_t CLK2X :1; |
| 47 | + } f; |
| 48 | + uint8_t w; |
| 49 | +} atxmega_spi__CTRL_t; |
| 50 | + |
| 51 | +// Reg - atxmega_spi::INTCTRL |
| 52 | +#define ATXMEGA_SPI__INTCTRL__INTLVL_bm 0x3 |
| 53 | +#define ATXMEGA_SPI__INTCTRL__INTLVL_bp 0 |
| 54 | +#define ATXMEGA_SPI__INTCTRL__INTLVL_bw 2 |
| 55 | +#define ATXMEGA_SPI__INTCTRL__INTLVL_reset 0x0 |
| 56 | +typedef union { |
| 57 | + struct __attribute__ ((__packed__)) { |
| 58 | + uint8_t INTLVL :2; |
| 59 | + uint8_t :6; |
| 60 | + } f; |
| 61 | + uint8_t w; |
| 62 | +} atxmega_spi__INTCTRL_t; |
| 63 | + |
| 64 | +// Reg - atxmega_spi::STATUS |
| 65 | +#define ATXMEGA_SPI__STATUS__WRCOL_bm 0x40 |
| 66 | +#define ATXMEGA_SPI__STATUS__WRCOL_bp 6 |
| 67 | +#define ATXMEGA_SPI__STATUS__WRCOL_bw 1 |
| 68 | +#define ATXMEGA_SPI__STATUS__WRCOL_reset 0x0 |
| 69 | +#define ATXMEGA_SPI__STATUS__IF_bm 0x80 |
| 70 | +#define ATXMEGA_SPI__STATUS__IF_bp 7 |
| 71 | +#define ATXMEGA_SPI__STATUS__IF_bw 1 |
| 72 | +#define ATXMEGA_SPI__STATUS__IF_reset 0x0 |
| 73 | +typedef union { |
| 74 | + struct __attribute__ ((__packed__)) { |
| 75 | + uint8_t :6; |
| 76 | + uint8_t WRCOL :1; |
| 77 | + uint8_t IF :1; |
| 78 | + } f; |
| 79 | + uint8_t w; |
| 80 | +} atxmega_spi__STATUS_t; |
| 81 | + |
| 82 | +// Reg - atxmega_spi::DATA |
| 83 | +#define ATXMEGA_SPI__DATA__WDATA_bm 0xff |
| 84 | +#define ATXMEGA_SPI__DATA__WDATA_bp 0 |
| 85 | +#define ATXMEGA_SPI__DATA__WDATA_bw 8 |
| 86 | +#define ATXMEGA_SPI__DATA__RDATA_bm 0xff |
| 87 | +#define ATXMEGA_SPI__DATA__RDATA_bp 0 |
| 88 | +#define ATXMEGA_SPI__DATA__RDATA_bw 8 |
| 89 | +typedef union { |
| 90 | + struct __attribute__ ((__packed__)) { |
| 91 | + uint8_t RDATA :8; |
| 92 | + } fr; |
| 93 | + struct __attribute__ ((__packed__)) { |
| 94 | + uint8_t WDATA :8; |
| 95 | + } fw; |
| 96 | + uint8_t w; |
| 97 | +} atxmega_spi__DATA_t; |
| 98 | + |
| 99 | +// Addrmap - atxmega_spi |
| 100 | +typedef struct __attribute__ ((__packed__)) { |
| 101 | + atxmega_spi__CTRL_t CTRL; |
| 102 | + atxmega_spi__INTCTRL_t INTCTRL; |
| 103 | + atxmega_spi__STATUS_t STATUS; |
| 104 | + atxmega_spi__DATA_t DATA; |
| 105 | +} atxmega_spi_t; |
| 106 | + |
| 107 | + |
| 108 | +static_assert(sizeof(atxmega_spi_t) == 0x4, "Packing error"); |
| 109 | + |
| 110 | +#ifdef __cplusplus |
| 111 | +} |
| 112 | +#endif |
| 113 | + |
| 114 | +#endif /* ATXMEGA_SPI_BF_H */ |
0 commit comments