Class Rs485Communication
ClassList > Rs485Communication
Public Functions
| Type | Name | 
|---|---|
| void | configure (uint8_t * transmission_bufer, uint8_t * reception_buffer, uint16_t data_size, void(*)() user_function, rs485_speed_t data_speed=SPEED_10M)  configuration for RS485 communication using a 10Mbit/s speed  | 
| void | configureCustom (uint8_t * transmission_bufer, uint8_t * reception_buffer, uint16_t data_size, void(*)(void) user_function, uint32_t baudrate, bool oversampling_8)  Custom configuration for RS485 communication to choose the communication speed.  | 
| void | startTransmission ()  start a transmission i.e. you send what is contained in the transmission buffer  | 
| void | turnOffCommunication ()  Turn off the RS485.  | 
| void | turnOnCommunication ()  Turn on the RS485 communication.  | 
Public Functions Documentation
function configure
configuration for RS485 communication using a 10Mbit/s speed
void Rs485Communication::configure (
    uint8_t * transmission_bufer,
    uint8_t * reception_buffer,
    uint16_t data_size,
    void(*)() user_function,
    rs485_speed_t data_speed=SPEED_10M
) 
Parameters:
transmission_bufferPointer to the transmitted bufferreception_bufferPointer to the recevied bufferdata_sizeSize of the sent and received data (in byte)user_functionCallback function called when we received datadata_speedTransmission speed (by default to 10Mbits/s)- SPEED_2M
 - SPEED_5M
 - SPEED_10M
 - SPEED_20M
 
Warning:
the size of transmission_buffer and reception_buffer must be the same
Date:
2024
Author:
Ayoub Farah Hassan [email protected]
function configureCustom
Custom configuration for RS485 communication to choose the communication speed.
void Rs485Communication::configureCustom (
    uint8_t * transmission_bufer,
    uint8_t * reception_buffer,
    uint16_t data_size,
    void(*)(void) user_function,
    uint32_t baudrate,
    bool oversampling_8
) 
Parameters:
transmission_bufferPointer to the transmitted bufferreception_bufferPointer to the recevied bufferdata_sizeSize of the sent and received data (in byte)user_functionCallback function called when we received databaudratecommunication speed in bit/soversampling_8True for oversampling (and multiply communication speed by 2), false if you want to keep the normal speed communication
Warning:
the size of transmission_buffer and reception_buffer must be the same
function startTransmission
start a transmission i.e. you send what is contained in the transmission buffer
function turnOffCommunication
Turn off the RS485.
function turnOnCommunication
Turn on the RS485 communication.
Remark:
The RS485 is automatically turned on when initializing with configureDefault or configure, no need to call this function
The documentation for this class was generated from the following file docs/core/zephyr/modules/owntech_communication/zephyr/src/Rs485Communication.h