You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
4.0 KiB
C++

/*
* RUBUSCell.h
*
* Author: Aleksey Gerasimenko
* gerasimenko.aleksey.n@gmail.com
*/
#ifndef MODBUSRTU_RUBUSREGISTER_H_
#define MODBUSRTU_RUBUSREGISTER_H_
#include <math.h>
#include <stdint.h>
#include "framework.h"
#include "SYSCTRL/SystemEnvironment.h"
#include "MODBUSRTU/RUBUSTypes.h"
namespace MODBUSRTU
{
class RUBUSRegister
{
private:
uint16_t m_index;
bool m_is_read_only;
void* m_param;
rubus_variant_type_t m_type;
public:
RUBUSRegister();
RUBUSRegister(const RUBUSRegister& cell);
public:
void register_bool (uint16_t index, uint16_t readonly, bool* param);
void register_float (uint16_t index, uint16_t readonly, float* param);
void register_uint8 (uint16_t index, uint16_t readonly, uint8_t* param);
void register_uint16(uint16_t index, uint16_t readonly, uint16_t* param);
void register_uint32(uint16_t index, uint16_t readonly, uint32_t* param);
void register_int8 (uint16_t index, uint16_t readonly, int8_t* param);
void register_int16 (uint16_t index, uint16_t readonly, int16_t* param);
void register_int32 (uint16_t index, uint16_t readonly, int32_t* param);
void register_bit0 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit1 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit2 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit3 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit4 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit5 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit6 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit7 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit8 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit9 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit10 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit11 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit12 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit13 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit14 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit15 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit16 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit17 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit18 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit19 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit20 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit21 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit22 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit23 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit24 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit25 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit26 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit27 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit28 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit29 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit30 (uint16_t index, uint16_t readonly, uint16_t* param);
void register_bit31 (uint16_t index, uint16_t readonly, uint16_t* param);
public:
uint16_t get_index();
bool is_read_only();
MODBUSRTU::rubus_variant_type_t get_type();
public:
MODBUSRTU::RUBUS_REGISTER_32 read_register();
uint16_t write_register(MODBUSRTU::RUBUS_REGISTER_32 data);
private:
inline void _read_bit(uint16_t& auxreg, uint16_t mask);
//
};//
} /* namespace MODBUSRTU */
#endif /* MODBUSRTU_RUBUSREGISTER_H_ */