Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

70 rindas
2.4 KiB

  1. #ifndef PLC_DEVICE_H
  2. #define PLC_DEVICE_H
  3. #include "plsr_address_map.h"
  4. #include "plsr_persistence.h"
  5. #include <stdint.h>
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. typedef enum
  10. {
  11. PLC_DEVICE_OK = 0,
  12. PLC_DEVICE_INVALID_ADDRESS,
  13. PLC_DEVICE_INVALID_ARGUMENT,
  14. PLC_DEVICE_NULL_POINTER,
  15. PLC_DEVICE_READ_ONLY,
  16. PLC_DEVICE_PERSISTENCE_ERROR,
  17. PLC_DEVICE_NOT_IMPLEMENTED,
  18. PLC_DEVICE_BUSY
  19. } PLC_DEVICE_RESULT;
  20. PLC_DEVICE_RESULT PlcDeviceInit(void);
  21. PLC_DEVICE_RESULT PlcDeviceReadHsd(uint16_t address, uint16_t *value);
  22. PLC_DEVICE_RESULT PlcDeviceWriteHsdConfig(uint16_t address, uint16_t value);
  23. PLC_DEVICE_RESULT PlcDevicePublishHsdRuntime(uint16_t address, uint16_t value);
  24. PLC_DEVICE_RESULT PlcDeviceReadHsdDword(uint16_t lowAddress, int32_t *value);
  25. PLC_DEVICE_RESULT PlcDevicePublishHsdDword(uint16_t lowAddress, int32_t value);
  26. PLC_DEVICE_RESULT PlcDeviceCheckpointHsd(void);
  27. PLC_DEVICE_RESULT PlcDeviceSetHsdCheckpointMeta(uint8_t positionValid,
  28. uint8_t lastBusy);
  29. uint8_t PlcDeviceGetRestoredHsdPositionValid(void);
  30. uint8_t PlcDeviceGetRestoredHsdLastBusy(void);
  31. PLC_DEVICE_RESULT PlcDeviceReadSfd(uint16_t address, uint16_t *value);
  32. PLC_DEVICE_RESULT PlcDeviceWriteSfd(uint16_t address, uint16_t value);
  33. PLC_DEVICE_RESULT PlcDeviceLoadSfd(void);
  34. PLC_DEVICE_RESULT PlcDeviceSaveSfd(void);
  35. PLC_DEVICE_RESULT PlcDeviceResetSfdDefaults(void);
  36. PLC_DEVICE_RESULT PlcDeviceReadSm(uint16_t address, uint8_t *state);
  37. PLC_DEVICE_RESULT PlcDeviceWriteSm(uint16_t address, uint8_t state);
  38. PLC_DEVICE_RESULT PlcDevicePublishSm(uint8_t axis,
  39. uint8_t pulseActive,
  40. uint8_t direction);
  41. PLC_DEVICE_RESULT PlcDeviceReadSd(uint16_t address, int32_t *value);
  42. PLC_DEVICE_RESULT PlcDeviceWriteSd(uint16_t address, int32_t value);
  43. PLC_DEVICE_RESULT PlcDevicePublishSd(uint8_t axis,
  44. uint8_t item,
  45. int32_t value);
  46. PLC_DEVICE_RESULT PlcDeviceGetEventAddress(uint8_t axis,
  47. uint16_t segmentNumber,
  48. uint16_t *eventAddress);
  49. uint8_t PlcDeviceIsHsdDirty(void);
  50. uint8_t PlcDeviceIsSfdDirty(void);
  51. PLSR_PERSISTENCE_RESULT PlcDeviceGetLastHsdLoadResult(void);
  52. PLSR_PERSISTENCE_RESULT PlcDeviceGetLastSfdLoadResult(void);
  53. #ifdef __cplusplus
  54. }
  55. #endif
  56. #endif /* PLC_DEVICE_H */