MeshX 0.4
This repository provides an implementation for Bluetooth Low Energy (BLE) Mesh network nodes. The project allows you to create BLE mesh nodes that can communicate with each other, enabling the development of smart home solutions or other IoT-based applications.
Loading...
Searching...
No Matches
meshx_gpio_platform.h File Reference

MeshX GPIO Platform Interface. More...

#include "meshx_gpio.h"
#include "meshx_pwm.h"

Go to the source code of this file.

Functions

meshx_err_t meshx_gpio_platform_init (void)
 Platform-specific GPIO initialization.
meshx_err_t meshx_gpio_platform_deinit (void)
 Platform-specific GPIO deinitialization.
meshx_err_t meshx_gpio_platform_set_level (uint8_t physical_pin, uint8_t level)
 Platform-specific pin level set.
meshx_err_t meshx_gpio_platform_get_level (uint8_t physical_pin, uint8_t *level)
 Platform-specific pin level get.
meshx_err_t meshx_gpio_platform_configure_pin (uint8_t physical_pin, meshx_gpio_mode_t mode, meshx_gpio_pull_t pull, meshx_gpio_drive_t drive)
 Platform-specific pin mode configuration.
meshx_err_t meshx_gpio_platform_register_intr (uint8_t physical_pin, meshx_gpio_intr_type_t intr_type, void(*isr_handler)(void *), void *arg)
 Platform-specific interrupt registration.
meshx_err_t meshx_gpio_platform_unregister_intr (uint8_t physical_pin)
 Platform-specific interrupt unregistration.
meshx_err_t meshx_gpio_platform_intr_enable (uint8_t physical_pin, bool enable)
 Platform-specific interrupt enable/disable.
meshx_err_t meshx_pwm_platform_init (void)
 Platform-specific PWM initialization.
meshx_err_t meshx_pwm_platform_deinit (void)
 Platform-specific PWM deinitialization.
meshx_err_t meshx_pwm_platform_start (uint8_t physical_pin, uint32_t frequency, uint8_t duty_cycle, uint8_t resolution)
 Platform-specific PWM start.
meshx_err_t meshx_pwm_platform_stop (uint8_t physical_pin)
 Platform-specific PWM stop.
meshx_err_t meshx_pwm_platform_set_duty_cycle (uint8_t physical_pin, uint8_t duty_cycle)
 Platform-specific PWM duty cycle set.
meshx_err_t meshx_pwm_platform_set_frequency (uint8_t physical_pin, uint32_t frequency)
 Platform-specific PWM frequency set.
meshx_err_t meshx_io_platform_execute_function (uint8_t physical_pin, meshx_io_function_t function, const uint32_t *args, uint8_t arg_count)
 Platform-specific IO function execution.
meshx_err_t meshx_io_platform_register_custom_function (uint16_t function_id, meshx_err_t(*handler)(uint8_t physical_pin, const uint32_t *args, uint8_t arg_count, void *user_data), void *user_data)
 Platform-specific custom function registration.

Detailed Description

MeshX GPIO Platform Interface.

This file defines the platform-specific interface for GPIO implementations. BSP implementations must provide these functions for GPIO operations.

Author
MeshX Team
Date
2024

Function Documentation

◆ meshx_gpio_platform_configure_pin()

meshx_err_t meshx_gpio_platform_configure_pin ( uint8_t physical_pin,
meshx_gpio_mode_t mode,
meshx_gpio_pull_t pull,
meshx_gpio_drive_t drive )

Platform-specific pin mode configuration.

Parameters
physical_pinPhysical pin number (platform-specific)
modePin mode (meshx_gpio_mode_t)
pullPull resistor setting (meshx_gpio_pull_t)
driveDrive strength (meshx_gpio_drive_t)
Returns
meshx_err_t MESHX_SUCCESS on success, error code on failure

◆ meshx_gpio_platform_deinit()

meshx_err_t meshx_gpio_platform_deinit ( void )

Platform-specific GPIO deinitialization.

This function deinitializes the platform-specific GPIO hardware.

Returns
meshx_err_t MESHX_SUCCESS on success, error code on failure

◆ meshx_gpio_platform_get_level()

meshx_err_t meshx_gpio_platform_get_level ( uint8_t physical_pin,
uint8_t * level )

Platform-specific pin level get.

Parameters
physical_pinPhysical pin number (platform-specific)
[out]levelPointer to store pin level
Returns
meshx_err_t MESHX_SUCCESS on success, error code on failure

◆ meshx_gpio_platform_init()

meshx_err_t meshx_gpio_platform_init ( void )

Platform-specific GPIO initialization.

This function initializes the platform-specific GPIO hardware.

Returns
meshx_err_t MESHX_SUCCESS on success, error code on failure

◆ meshx_gpio_platform_intr_enable()

meshx_err_t meshx_gpio_platform_intr_enable ( uint8_t physical_pin,
bool enable )

Platform-specific interrupt enable/disable.

Parameters
physical_pinPhysical pin number (platform-specific)
enabletrue to enable, false to disable
Returns
meshx_err_t MESHX_SUCCESS on success, error code on failure

◆ meshx_gpio_platform_register_intr()

meshx_err_t meshx_gpio_platform_register_intr ( uint8_t physical_pin,
meshx_gpio_intr_type_t intr_type,
void(* isr_handler )(void *),
void * arg )

Platform-specific interrupt registration.

Parameters
physical_pinPhysical pin number (platform-specific)
intr_typeInterrupt trigger type
isr_handlerInterrupt service routine handler
argArgument passed to ISR handler
Returns
meshx_err_t MESHX_SUCCESS on success, error code on failure

◆ meshx_gpio_platform_set_level()

meshx_err_t meshx_gpio_platform_set_level ( uint8_t physical_pin,
uint8_t level )

Platform-specific pin level set.

Parameters
physical_pinPhysical pin number (platform-specific)
levelPin level (0 = low, 1 = high)
Returns
meshx_err_t MESHX_SUCCESS on success, error code on failure

◆ meshx_gpio_platform_unregister_intr()

meshx_err_t meshx_gpio_platform_unregister_intr ( uint8_t physical_pin)

Platform-specific interrupt unregistration.

Parameters
physical_pinPhysical pin number (platform-specific)
Returns
meshx_err_t MESHX_SUCCESS on success, error code on failure

◆ meshx_io_platform_execute_function()

meshx_err_t meshx_io_platform_execute_function ( uint8_t physical_pin,
meshx_io_function_t function,
const uint32_t * args,
uint8_t arg_count )

Platform-specific IO function execution.

This is the function-based API for extensible IO operations. BSP implementations must support the standard IO functions and can optionally support custom functions.

Parameters
physical_pinPhysical pin number (platform-specific)
functionIO function to execute (meshx_io_function_t)
argsFunction arguments vector
arg_countNumber of arguments in the vector
Returns
meshx_err_t MESHX_SUCCESS on success, error code on failure

◆ meshx_io_platform_register_custom_function()

meshx_err_t meshx_io_platform_register_custom_function ( uint16_t function_id,
meshx_err_t(* handler )(uint8_t physical_pin, const uint32_t *args, uint8_t arg_count, void *user_data),
void * user_data )

Platform-specific custom function registration.

BSP implementations can use this to register custom IO functions that are not part of the standard IO function set.

Parameters
function_idCustom function ID
handlerFunction handler
user_dataUser data for the handler
Returns
meshx_err_t MESHX_SUCCESS on success, error code on failure

◆ meshx_pwm_platform_deinit()

meshx_err_t meshx_pwm_platform_deinit ( void )

Platform-specific PWM deinitialization.

Returns
meshx_err_t MESHX_SUCCESS on success, error code on failure

◆ meshx_pwm_platform_init()

meshx_err_t meshx_pwm_platform_init ( void )

Platform-specific PWM initialization.

Returns
meshx_err_t MESHX_SUCCESS on success, error code on failure

◆ meshx_pwm_platform_set_duty_cycle()

meshx_err_t meshx_pwm_platform_set_duty_cycle ( uint8_t physical_pin,
uint8_t duty_cycle )

Platform-specific PWM duty cycle set.

Parameters
physical_pinPhysical pin number (platform-specific)
duty_cycleDuty cycle (0-100%)
Returns
meshx_err_t MESHX_SUCCESS on success, error code on failure

◆ meshx_pwm_platform_set_frequency()

meshx_err_t meshx_pwm_platform_set_frequency ( uint8_t physical_pin,
uint32_t frequency )

Platform-specific PWM frequency set.

Parameters
physical_pinPhysical pin number (platform-specific)
frequencyFrequency in Hz
Returns
meshx_err_t MESHX_SUCCESS on success, error code on failure

◆ meshx_pwm_platform_start()

meshx_err_t meshx_pwm_platform_start ( uint8_t physical_pin,
uint32_t frequency,
uint8_t duty_cycle,
uint8_t resolution )

Platform-specific PWM start.

Parameters
physical_pinPhysical pin number (platform-specific)
frequencyPWM frequency in Hz
duty_cycleDuty cycle (0-100%)
resolutionPWM resolution in bits
Returns
meshx_err_t MESHX_SUCCESS on success, error code on failure

◆ meshx_pwm_platform_stop()

meshx_err_t meshx_pwm_platform_stop ( uint8_t physical_pin)

Platform-specific PWM stop.

Parameters
physical_pinPhysical pin number (platform-specific)
Returns
meshx_err_t MESHX_SUCCESS on success, error code on failure