Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Fields
sol_pin_mux Struct Reference

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...
 

Detailed Description

Structure defining the API of a Pin Multiplexer module.

Field Documentation

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.

Parameters
devicethe aio device number.
pinthe aio pin number.
Returns
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.

Parameters
pinthe gpio pin number.
configDesired configuration for the pin.
Returns
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.

Parameters
busthe i2c bus number.
Returns
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.

Returns
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.

Parameters
labelThe label of the pin as see on the board
protProtocol on which the pin should operate
argsWhere 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.
Returns
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.

Parameters
devicethe pwm device number.
channelthe channel number on device.
Returns
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.


The documentation for this struct was generated from the following file: