forked from achamaikin/CCSModuleSW30Web
65 lines
1.3 KiB
C
Executable File
65 lines
1.3 KiB
C
Executable File
/*
|
|
* board.h
|
|
*
|
|
* Created on: Apr 15, 2024
|
|
* Author: colorbass
|
|
*/
|
|
|
|
#ifndef SRC_BOARD_H_
|
|
#define SRC_BOARD_H_
|
|
|
|
void GBT_Lock(uint8_t state);
|
|
|
|
typedef enum{
|
|
RELAY_AUX0 = 0,
|
|
RELAY_AUX1,
|
|
RELAY3,
|
|
RELAY_DC,
|
|
RELAY_AC,
|
|
RELAY_CP,
|
|
RELAY_CC,
|
|
RELAY_DC1,
|
|
//
|
|
RELAY_COUNT
|
|
} relay_t;
|
|
|
|
void RELAY_Write(relay_t num, uint8_t state);
|
|
void Init_Peripheral();
|
|
uint8_t GBT_LockGetState();
|
|
void GBT_Lock(uint8_t state);
|
|
uint8_t SW_GetAddr();
|
|
void ADC_Select_Channel(uint32_t ch);
|
|
uint8_t ADC_TryLock(void);
|
|
void ADC_LockBlocking(void);
|
|
void ADC_Unlock(void);
|
|
int16_t GBT_ReadTemp(uint8_t ch);
|
|
int16_t CONN_ReadTemp(uint8_t ch);
|
|
|
|
typedef enum{
|
|
IN_SW0 = 0,
|
|
IN_SW1,
|
|
IN0,
|
|
IN_ESTOP,
|
|
IN_FB1,
|
|
IN_CONT_FB_DC,
|
|
ISO_IN,
|
|
} inputNum_t;
|
|
|
|
uint8_t IN_ReadInput(inputNum_t input_n);
|
|
|
|
// Версия устройства
|
|
#define VERSION_OFFSET (0x1E4)
|
|
|
|
typedef struct __attribute__((packed)) {
|
|
uint32_t serialNumber; // Байты 0-3: серийный номер станции (little-endian)
|
|
uint8_t stationType; // Байт 4: тип станции
|
|
uint8_t boardVersion; // Байт 5: версия платы
|
|
uint8_t addrEdcan; // Байт 6: адрес EDCAN
|
|
uint8_t reserved[57]; // Байты 7-63: зарезервированы
|
|
} InfoBlock_t;
|
|
|
|
extern InfoBlock_t *InfoBlock;
|
|
|
|
|
|
#endif /* SRC_BOARD_H_ */
|