PIN module

Added GPIO defines, moved GPIO MUX initialization to new module.
Converted if/else to switch in GPIO initialization.
This commit is contained in:
diijkstra
2026-02-01 14:32:50 +01:00
parent 7d62b24a42
commit 48455a57b2
7 changed files with 292 additions and 120 deletions
+6 -8
View File
@@ -16,13 +16,11 @@
// #define DEFAULT_5C_1SFP
struct i2c_bus {
// These are I2C bus identifiers refer to GPIO MUX document
// for GPIO pin assignments for given bus numbers
uint8_t sda : 3; // SDA pin number 0-4
uint8_t scl : 3; // SCL pin number 0-3
uint8_t reserved : 2;
};
typedef struct {
// GPIO pins for SDA/SCL
uint8_t sda;
uint8_t scl;
} i2c_bus_t;
struct sfp_port
{
@@ -30,7 +28,7 @@ struct sfp_port
uint8_t pin_los; // gpio number 0-63, 0xFF = don't have it?
uint8_t pin_tx_disable; // gpio number 0-63, 0xFF = not present
uint8_t sds;
struct i2c_bus i2c_bus;
i2c_bus_t i2c;
};
typedef struct machine {