mirror of
https://github.com/infiniteCable2/openpilot.git
synced 2026-08-05 08:16:03 +08:00
0ba412d52e
256d274e7 Fix Mac installation instruction per: https://github.com/commaai/panda/pull/308/files bfd8ff1b1 Update cppcheck commit with more coverage b143a1cf9 Fixed Misra complaint 606f1d913 Fixed RTC on non-uno boards, second try. Cannot work when there is no xtal. 933c75770 Fix RTC on non-uno boards (#311) 48d0d0c78 VW button spam: fix safety and add tests (#306) 6cccf969a Fan and IR at 0 when in power savings mode (#309) 05373282a board get_sdk scripts were left on python2 de18a7ef1 bump version after uno merge 1965817d3 Changed default values for testing a12a148d5 Uno (#274) 7d29dc5a2 bump panda version. We really need a better way 40075321d VW: stricter limits to comply with comma safety policy e2e2be92c add safety mode to health packet 101238c7f turned on VW ignition based CAN logic a0d8d5dae fix misra 5.3: check_ignition is intended as check_started and can't be used twice ea636de61 made check_ignition function to both look at ignition_line and ignition_can 1102e6965 make ignition logic common for all cars (#303) 3a110c6f6 bump version after CMSIS core upgrade 55dfa5230 Update core to CMSIS 5.6 release (#251) ee864907c fix linter 2 f410b110d fix linter 55957d6e4 proper python3 exception inheritance 6ba0f47b5 fix linter errors 5c49fe050 Merge pull request #145 from gregjhogan/uds 0f361999b timeout is float 396d6aad5 safety_replay only installs few extra requirements 25af7d301 Misra also need python 3 env 7434c5ce2 centralize requirements for tests a0c37c70a coverage not needed in linter reqs fce38a91d Linter python (#299) 62e2f5caa update cppcheck commit 711810d2f more uds debug 4454e3a6b better CAN comm abstraction 6b1f28f57 fix more encoding and some bytes cleanup (#300) 43adad311 fix WARNING_INDICATOR_REQUESTED name 9c857da37 0x b64d6fa5d typing 768fdf7e1 bytes() > chr().encode() 1be15ea93 custom errors from thread 68da8315f more python3 eb358e81c uds lib example 4f288586d updates for python3 932745f62 support tx flow control for chunked messages b1c371292 add timeout param cdf2f626b bug fixes b1a319577 fix rx message filtering bug 80fb6a6fa convert uds lib to class 59cd2b47f handle separation time in microseconds 4429600d8 fix separation time parsing c641e66f7 fix typo 48b8dcc6f fix flow control delay scale 78f413d88 flow control delay 33a5167d9 bug fixes 8ee89a091 multi-frame tx 5e89a9c72 clear rx buffer and numeric error ids 966230063 fix remaining size calculation 01ef1fae3 zero pad messages before sending 1ddc9735d uds can communication dca176e71 syntax errors 95be4811e SERVICE_TYPE enum 98e73b51d more UDS message type implementation c1c5b0356 uds lib 162f4853d fix chr to bytes conversions (#298) 4972376de Update VW regression test to follow Comma safety index refactoring (#296) f9053f5df more Python 3 fixes, attempting to fix jenkins wifi regresison test (#295) 2f9e07628 Panda safety code for Volkswagen, Audi, SEAT, and Škoda (#293) git-subtree-dir: panda git-subtree-split: 256d274e760ce00d4e5ff5e0d9b86d0fb5924568 old-commit-hash: 22023ebd586de9239e6795e71c81f40c267597e3
72 lines
2.3 KiB
C
72 lines
2.3 KiB
C
// ******************** Prototypes ********************
|
|
typedef void (*board_init)(void);
|
|
typedef void (*board_enable_can_transciever)(uint8_t transciever, bool enabled);
|
|
typedef void (*board_enable_can_transcievers)(bool enabled);
|
|
typedef void (*board_set_led)(uint8_t color, bool enabled);
|
|
typedef void (*board_set_usb_power_mode)(uint8_t mode);
|
|
typedef void (*board_set_esp_gps_mode)(uint8_t mode);
|
|
typedef void (*board_set_can_mode)(uint8_t mode);
|
|
typedef void (*board_usb_power_mode_tick)(uint64_t tcnt);
|
|
typedef bool (*board_check_ignition)(void);
|
|
typedef uint32_t (*board_read_current)(void);
|
|
typedef void (*board_set_ir_power)(uint8_t percentage);
|
|
typedef void (*board_set_fan_power)(uint8_t percentage);
|
|
|
|
struct board {
|
|
const char *board_type;
|
|
const harness_configuration *harness_config;
|
|
board_init init;
|
|
board_enable_can_transciever enable_can_transciever;
|
|
board_enable_can_transcievers enable_can_transcievers;
|
|
board_set_led set_led;
|
|
board_set_usb_power_mode set_usb_power_mode;
|
|
board_set_esp_gps_mode set_esp_gps_mode;
|
|
board_set_can_mode set_can_mode;
|
|
board_usb_power_mode_tick usb_power_mode_tick;
|
|
board_check_ignition check_ignition;
|
|
board_read_current read_current;
|
|
board_set_ir_power set_ir_power;
|
|
board_set_fan_power set_fan_power;
|
|
};
|
|
|
|
// ******************* Definitions ********************
|
|
// These should match the enums in cereal/log.capnp and __init__.py
|
|
#define HW_TYPE_UNKNOWN 0U
|
|
#define HW_TYPE_WHITE_PANDA 1U
|
|
#define HW_TYPE_GREY_PANDA 2U
|
|
#define HW_TYPE_BLACK_PANDA 3U
|
|
#define HW_TYPE_PEDAL 4U
|
|
#define HW_TYPE_UNO 5U
|
|
|
|
// LED colors
|
|
#define LED_RED 0U
|
|
#define LED_GREEN 1U
|
|
#define LED_BLUE 2U
|
|
|
|
// USB power modes (from cereal.log.health)
|
|
#define USB_POWER_NONE 0U
|
|
#define USB_POWER_CLIENT 1U
|
|
#define USB_POWER_CDP 2U
|
|
#define USB_POWER_DCP 3U
|
|
|
|
// ESP modes
|
|
#define ESP_GPS_DISABLED 0U
|
|
#define ESP_GPS_ENABLED 1U
|
|
#define ESP_GPS_BOOTMODE 2U
|
|
|
|
// CAN modes
|
|
#define CAN_MODE_NORMAL 0U
|
|
#define CAN_MODE_GMLAN_CAN2 1U
|
|
#define CAN_MODE_GMLAN_CAN3 2U
|
|
#define CAN_MODE_OBD_CAN2 3U
|
|
|
|
// ********************* Globals **********************
|
|
uint8_t usb_power_mode = USB_POWER_NONE;
|
|
|
|
// ************ Board function prototypes *************
|
|
bool board_has_gps(void);
|
|
bool board_has_gmlan(void);
|
|
bool board_has_obd(void);
|
|
bool board_has_lin(void);
|
|
bool board_has_rtc(void);
|
|
bool board_has_relay(void); |