| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#pragma once |
| 6 |
|
| 7 |
#include <inttypes.h> |
| 8 |
#include <stdbool.h> |
| 9 |
|
| 10 |
#ifdef __cplusplus |
| 11 |
extern "C" { |
| 12 |
#endif |
| 13 |
|
| 14 |
void vera_spi_init(); |
| 15 |
void vera_spi_step(int mhz, int clocks); |
| 16 |
uint8_t vera_spi_read(uint8_t address); |
| 17 |
|
| 18 |
|
| 19 |
uint8_t vera_spi_peek(uint8_t address); |
| 20 |
void vera_spi_write(uint8_t address, uint8_t value); |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
typedef struct { |
| 27 |
bool ss; |
| 28 |
bool busy; |
| 29 |
bool autotx; |
| 30 |
uint8_t sending_byte; |
| 31 |
uint8_t received_byte; |
| 32 |
float outcounter; |
| 33 |
} vera_spi_debug_state_t; |
| 34 |
|
| 35 |
void vera_spi_debug_get_state(vera_spi_debug_state_t *out); |
| 36 |
|
| 37 |
#ifdef __cplusplus |
| 38 |
} |
| 39 |
#endif |