39 lines
955 B
C
39 lines
955 B
C
/* kline.h — cleaned up, matches new connection layer */
|
|
|
|
#ifndef INC_KLINE_H_
|
|
#define INC_KLINE_H_
|
|
|
|
#include "IKW1281Connection.h"
|
|
|
|
#define ECU_INIT_ADDRESS 0xF1
|
|
|
|
#define KLINE_RX_PIN GPIO_PIN_10
|
|
#define KLINE_TX_PIN GPIO_PIN_9
|
|
#define KLINE_GPIO_PORT GPIOA
|
|
|
|
#define SLAVE_ADDR 0xF1
|
|
#define SYNC_BYTE 0x55
|
|
#define POST_INIT_BAUD 9600
|
|
#define KEYWORD_LSB 0x8C
|
|
#define KEYWORD_MSB 0x51
|
|
#define REQUIRE_KEY_ACK 0 // no complements expected during 0x55/keywords
|
|
|
|
extern volatile uint8_t kline_connection_status;
|
|
|
|
typedef struct {
|
|
uint8_t dtc;
|
|
uint8_t status;
|
|
uint8_t extra;
|
|
} FaultCode;
|
|
|
|
size_t BuildCombinedFromInfo(const ControllerInfo *ci, uint8_t *out, size_t maxlen);
|
|
|
|
void KLine_Slave_Init(void);
|
|
void KLine_Rearm5Baud(void);
|
|
void KLine_Service(void);
|
|
void KLine_ServiceCommands(void);
|
|
void KLine_Slave_Poll(void);
|
|
void KLine_KeepAlivePoll(void);
|
|
|
|
#endif /* INC_KLINE_H_ */
|