123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #ifndef _SPI_H_
- #define _SPI_H_
- #define SCSPI SERCOM2
- #define P14_DIR 0x00004000
- #define P14_OUT 0x00004000
- #define P15_DIR 0x00008000
- #define P15_OUT 0x00008000
- #define SC2_RCLCK_LO REG_PORT_OUTCLR1 = P14_OUT
- #define SC2_RCLCK_HI REG_PORT_OUTSET1 = P14_OUT
- #define SC2_OE_ENA REG_PORT_OUTCLR1 = P15_OUT
- #define SC2_OE_DIS REG_PORT_OUTSET1 = P15_OUT
- #define SC2_DIRSET REG_PORT_DIRSET1 = P14_DIR | P15_DIR;
- typedef union {
- struct {
- uint16_t RSVD4:1;
- uint16_t RSVD3:1;
- uint16_t RSVD2:1;
- uint16_t RSVD1:1;
- uint16_t SDB_N:1;
- uint16_t IRST:1;
- uint16_t SRC_2:1;
- uint16_t SRC_1:1;
- uint16_t E_VBUS_2:1;
- uint16_t E_VBUS_1:1;
- uint16_t E_DN1_N:1;
- uint16_t S_DN1:1;
- uint16_t E_UP_N:1;
- uint16_t S_UP:1;
- uint16_t HUB_RESET_N:1;
- uint16_t HUB_CONNECT:1;
- } bit;
- uint16_t reg;
- } Srdata_t;
- extern Srdata_t srdata;
- void SPI_WriteSRData(void);
- void SPI_Init(void);
- #endif
|