Soletta™ Framework
|
Structure defining the API of a Pin Multiplexer module. More...
#include <sol-pin-mux-modules.h>
Data Fields | |
int(* | aio )(int device, int pin) |
Callback to setup the given pin to operate as Analog I/O. More... | |
uint16_t | api_version |
API version. More... | |
int(* | gpio )(uint32_t pin, const struct sol_gpio_config *config) |
Callback to setup the given pin to operate in the given GPIO configuration. More... | |
int(* | i2c )(uint8_t bus) |
Callback to setup the pins used of the given i2c bus number to operate in I2C mode. More... | |
int(* | init )(void) |
Called after the module is successfully load by Soletta to allow it to do any initialization it may require. More... | |
int(* | pin_map )(const char *label, const enum sol_io_protocol prot, va_list args) |
Callback to map a pin label to the parameters necessary so it works on the desired protocol. More... | |
const char * | plat_name |
Name of this multiplexer target platform. More... | |
int(* | pwm )(int device, int channel) |
Callback to setup the given pin to operate as PWM. More... | |
void(* | shutdown )(void) |
Called before the module is unloaded. More... | |
Structure defining the API of a Pin Multiplexer module.
int(* sol_pin_mux::aio)(int device, int pin) |
Callback to setup the given pin to operate as Analog I/O.
Soletta will call this function so the module can execute the instructions needed to configure 'device'/'pin' pair to operate as Analog I/O.
device | the aio device number. |
pin | the aio pin number. |
0
on success, error code (always negative) otherwise. uint16_t sol_pin_mux::api_version |
API version.
int(* sol_pin_mux::gpio)(uint32_t pin, const struct sol_gpio_config *config) |
Callback to setup the given pin to operate in the given GPIO configuration.
Soletta will call this function so the module can execute the instructions needed to configure pin
to operate as configured by config
.
pin | the gpio pin number. |
config | Desired configuration for the pin. |
0
on success, error code (always negative) otherwise. int(* sol_pin_mux::i2c)(uint8_t bus) |
Callback to setup the pins used of the given i2c bus number to operate in I2C mode.
Soletta will call this function so the module can execute the instructions needed to configure the pins used by the given i2c bus to operate in I2C mode.
bus | the i2c bus number. |
0
on success, error code (always negative) otherwise. int(* sol_pin_mux::init)(void) |
Called after the module is successfully load by Soletta to allow it to do any initialization it may require.
0
on success, error code (always negative) otherwise. int(* sol_pin_mux::pin_map)(const char *label, const enum sol_io_protocol prot, va_list args) |
Callback to map a pin label to the parameters necessary so it works on the desired protocol.
Find if a given pin labeled label
is capable of operate on protocol prot
and return the parameters needed to setup the protocol.
label | The label of the pin as see on the board |
prot | Protocol on which the pin should operate |
args | Where to write the output. Soletta will provide the required args based on the requested protocol, in the same order that they appear in the protocol API. |
0
on success, error code (always negative) otherwise. const char* sol_pin_mux::plat_name |
Name of this multiplexer target platform.
int(* sol_pin_mux::pwm)(int device, int channel) |
Callback to setup the given pin to operate as PWM.
Soletta will call this function so the module can execute the instructions needed to configure 'device'/'channel' pair to operate as PWM.
device | the pwm device number. |
channel | the channel number on device. |
0
on success, error code (always negative) otherwise. void(* sol_pin_mux::shutdown)(void) |
Called before the module is unloaded.
Is an opportunity for the module to execute any clean-up tasks it may require.