Hello,
I am currently using an am243x Sitara board and have written an abstraction in C++ for GPIOs.
By now The Constructor has to be called by the user for every pin receiving the base address and pin number as well as direction and initial value as input parameters.
What I would like is to be able to automatically initialize the pins set in SysConfig on system startup.
Currently the pin configuration values are in ti_drivers_config.h as preprocessor defines.
In this case I seem to lack the knowledge how to obtain the right values for base address and pin number as well as direction and trigger type from preprocessor defines named after some user choices at runtime.
For me it would be much easier, if I had something like this:
typedef struct {
const char * name;
const uint32_t baseAddr;
const uint32_t pinNum;
uint8_t direction;
uint8_t triggerType;
} GpioConfig;
Maybe, if you can do it, though it is not absolutely necessary for me at the moment, even better would be:
typedef struct {
const char * name;
uint32_t frequency;
uint16_t tickPeriod;
} Clock;
typedef struct {
const char * name;
const uint32_t baseAddr;
const uint32_t pinNum;
uint8_t direction;
uint8_t triggerType;
Clock inputClock;
} GpioConfig;So that in the code I can access the GPIOs generated by SysConfig in an array
GpioConfig[];
similar to what we already have with
static Pinmux_PerCfg_t gPinMuxMainDomainCfg[]
in ti_pinmux_config.h
Would be great if you could incorporate something like this in one of the next SDK releases.
Thank you for your time and trouble.
Best regards
Philip.