add SPI, not working yet (also need to set SPOL/SPHA etc)

This commit is contained in:
Edward Emelianov
2026-03-17 23:57:08 +03:00
parent 165780bef9
commit c80f0884f5
13 changed files with 273 additions and 30 deletions

View File

@@ -97,11 +97,17 @@ typedef struct{
uint8_t istx : 1;
} usart_props_t;
typedef struct {
typedef struct{
uint8_t isscl : 1;
uint8_t issda : 1;
} i2c_props_t;
typedef struct{
uint8_t issck : 1;
uint8_t ismiso : 1;
uint8_t ismosi : 1;
} spi_props_t;
/*
typedef struct{
uint32_t speed;
@@ -121,6 +127,7 @@ int get_curpinconf(uint8_t port, uint8_t pin, pinconfig_t *c);
int get_usart_index(uint8_t port, uint8_t pin, usart_props_t *p);
int get_i2c_index(uint8_t port, uint8_t pin, i2c_props_t *p);
int get_spi_index(uint8_t port, uint8_t pin, spi_props_t *p);
int gpio_reinit();