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_io_platform.h File Reference

MeshX IO Platform Interface. More...

#include "meshx_err.h"
#include <stdint.h>
#include <stdbool.h>

Go to the source code of this file.

Functions

meshx_err_t meshx_io_platform_init (void)
 Initialize platform IO subsystem.
meshx_err_t meshx_io_platform_deinit (void)
 Deinitialize platform IO subsystem.
void * meshx_io_platform_create_gpio (uint8_t logical_pin, const char *name, uint8_t mode, uint8_t pull, uint8_t drive, uint8_t initial_level, bool signal_inversion)
 Create platform-specific GPIO instance.
void * meshx_io_platform_create_pwm (uint8_t logical_pin, const char *name, uint32_t frequency, uint8_t duty_cycle, uint8_t resolution, uint8_t channel)
 Create platform-specific PWM instance.
void meshx_io_platform_destroy (void *handle)
 Destroy platform-specific IO instance.
meshx_err_t meshx_io_platform_execute (void *handle, uint8_t function, const uint32_t *args, uint8_t arg_count)
 Execute platform-specific IO function.
meshx_err_t meshx_io_platform_set_hosted_mode (uint8_t mode)
 Set hosted mode.
uint8_t meshx_io_platform_get_hosted_mode (void)
 Get current hosted mode.
meshx_err_t meshx_io_platform_send_hosted_event (uint8_t event_type, uint8_t logical_pin, uint8_t value)
 Send hosted mode event.

Detailed Description

MeshX IO Platform Interface.

This file defines the platform-specific interface for IO implementations.

Author
MeshX Team
Date
2024

Function Documentation

◆ meshx_io_platform_create_gpio()

void * meshx_io_platform_create_gpio ( uint8_t logical_pin,
const char * name,
uint8_t mode,
uint8_t pull,
uint8_t drive,
uint8_t initial_level,
bool signal_inversion )

Create platform-specific GPIO instance.

Parameters
logical_pinLogical pin number
namePin name
modeGPIO mode
pullPull resistor setting
driveDrive strength
initial_levelInitial output level
signal_inversionSignal inversion flag
Returns
void* Platform-specific GPIO instance handle

◆ meshx_io_platform_create_pwm()

void * meshx_io_platform_create_pwm ( uint8_t logical_pin,
const char * name,
uint32_t frequency,
uint8_t duty_cycle,
uint8_t resolution,
uint8_t channel )

Create platform-specific PWM instance.

Parameters
logical_pinLogical pin number
namePin name
frequencyPWM frequency
duty_cycleInitial duty cycle
resolutionPWM resolution
channelHardware channel
Returns
void* Platform-specific PWM instance handle

◆ meshx_io_platform_deinit()

meshx_err_t meshx_io_platform_deinit ( void )

Deinitialize platform IO subsystem.

Returns
meshx_err_t Error code

◆ meshx_io_platform_destroy()

void meshx_io_platform_destroy ( void * handle)

Destroy platform-specific IO instance.

Parameters
handlePlatform-specific IO instance handle

◆ meshx_io_platform_execute()

meshx_err_t meshx_io_platform_execute ( void * handle,
uint8_t function,
const uint32_t * args,
uint8_t arg_count )

Execute platform-specific IO function.

Parameters
handlePlatform-specific IO instance handle
functionIO function to execute
argsFunction arguments
arg_countNumber of arguments
Returns
meshx_err_t Error code

◆ meshx_io_platform_get_hosted_mode()

uint8_t meshx_io_platform_get_hosted_mode ( void )

Get current hosted mode.

Returns
uint8_t Current hosted mode

◆ meshx_io_platform_init()

meshx_err_t meshx_io_platform_init ( void )

Initialize platform IO subsystem.

Returns
meshx_err_t Error code

◆ meshx_io_platform_send_hosted_event()

meshx_err_t meshx_io_platform_send_hosted_event ( uint8_t event_type,
uint8_t logical_pin,
uint8_t value )

Send hosted mode event.

Parameters
event_typeEvent type
logical_pinLogical pin number
valueEvent value
Returns
meshx_err_t Error code

◆ meshx_io_platform_set_hosted_mode()

meshx_err_t meshx_io_platform_set_hosted_mode ( uint8_t mode)

Set hosted mode.

Parameters
modeHosted mode (0 = non-hosted, 1 = hosted)
Returns
meshx_err_t Error code