SPI macht interrupt
This commit is contained in:
parent
266d90df56
commit
fd2cb56ef3
11 changed files with 605 additions and 538 deletions
|
@ -15,13 +15,13 @@
|
|||
#define DMUX3 PD4
|
||||
|
||||
enum SPIADR {
|
||||
AA0 = 0,
|
||||
AA1 = 1,
|
||||
BEBA0 = 2,
|
||||
BEBA1 = 3,
|
||||
EXT = 4,
|
||||
AA0 = 0,
|
||||
AA1 = 1,
|
||||
BEBA0 = 2,
|
||||
BEBA1 = 3,
|
||||
EXT = 4,
|
||||
SWITCH = 5,
|
||||
NONE = 7,
|
||||
NONE = 7,
|
||||
};
|
||||
|
||||
class SPI
|
||||
|
@ -29,9 +29,20 @@ class SPI
|
|||
public:
|
||||
SPI(void);
|
||||
void init(void) const volatile;
|
||||
void setAdr(uint8_t) const volatile;
|
||||
uint8_t pushByte(uint8_t) const volatile;
|
||||
void handleTransfer() volatile;
|
||||
void transfer(uint8_t adr) volatile;
|
||||
void addByte(uint8_t b) volatile;
|
||||
void wait(void) volatile;
|
||||
|
||||
constexpr static uint8_t BUFFER_SIZE = 8;
|
||||
volatile uint8_t buffer[BUFFER_SIZE];
|
||||
|
||||
private:
|
||||
void setAdr(uint8_t) const volatile;
|
||||
|
||||
volatile uint8_t index = 0;
|
||||
volatile uint8_t length = 0;
|
||||
volatile bool active = false;
|
||||
};
|
||||
|
||||
#endif // SPI_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue