Files
templates/c/gas-logger/ports/pm35/gas_logger_pm35.h

23 lines
1017 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* Связь регистратора ПМ35 с картой доступных сигналов. Адреса сигналов согласуются с
* JSON-картой клиента; изменение только одной стороны приводит к неверной интерпретации снимка
* даже при успешном обмене.
*/
#ifndef GAS_LOGGER_PM35_H
#define GAS_LOGGER_PM35_H
#include "gas_logger.h"
/* Project adapter: pm35_modbus uses the firmware's zero-based modbus[128].
* pm67_voltage[2] is the latest CAN cache, updated under the same IRQ lock.
* No direct CAN requests are performed while capturing. */
typedef struct {
volatile uint16_t *modbus;
volatile uint16_t *pm67_voltage;
uint32_t (*enter)(void *);
void (*leave)(void *,uint32_t);
void *irq_user;
} gl_pm35_context;
gl_result gl_pm35_init(gas_logger *log, gl_pm35_context *context,
uint16_t *bank0, uint16_t *bank1, uint32_t bank_words);
#endif