ca13734bf0
Add kernel (Cortex-M0/M3/M4, Tricore, S32K, RISC-V ports), drivers, middleware (CAN stack, diagnostics, safety), applications, board support, build/test tooling, and documentation.
68 lines
2.3 KiB
C
68 lines
2.3 KiB
C
/**
|
|
* @file board.h
|
|
* @brief Custom ECU board definitions
|
|
*/
|
|
|
|
#ifndef BOARD_H
|
|
#define BOARD_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
/* ============================================================================
|
|
* Board Identification
|
|
* ============================================================================ */
|
|
#define BOARD_NAME "CustomECU-v1.0"
|
|
#define BOARD_MANUFACTURER "Automotive RTOS Team"
|
|
#define BOARD_VERSION "1.0"
|
|
#define BOARD_MCU "Custom"
|
|
|
|
/* ============================================================================
|
|
* Clock Configuration
|
|
* ============================================================================ */
|
|
#define SYSTEM_CLOCK 100000000U /* 100 MHz */
|
|
#define PERIPHERAL_CLOCK 50000000U /* 50 MHz */
|
|
#define TIMER_CLOCK 10000000U /* 10 MHz */
|
|
|
|
/* ============================================================================
|
|
* LED Definitions
|
|
* ============================================================================ */
|
|
#define LED_COUNT 4
|
|
#define LED_STATUS 0
|
|
#define LED_ERROR 1
|
|
#define LED_CAN_TX 2
|
|
#define LED_CAN_RX 3
|
|
|
|
/* ============================================================================
|
|
* Communication Interfaces
|
|
* ============================================================================ */
|
|
#define CAN_INTERFACE_COUNT 2
|
|
#define UART_INTERFACE_COUNT 2
|
|
#define SPI_INTERFACE_COUNT 1
|
|
#define I2C_INTERFACE_COUNT 1
|
|
|
|
/* ============================================================================
|
|
* Board Functions
|
|
* ============================================================================ */
|
|
void board_init(void);
|
|
void board_clock_init(void);
|
|
void board_gpio_init(void);
|
|
void board_uart_init(void);
|
|
void board_can_init(void);
|
|
void board_spi_init(void);
|
|
void board_i2c_init(void);
|
|
void board_adc_init(void);
|
|
void board_pwm_init(void);
|
|
void board_watchdog_init(void);
|
|
void board_watchdog_service(void);
|
|
void board_led_on(uint8_t led);
|
|
void board_led_off(uint8_t led);
|
|
void board_led_toggle(uint8_t led);
|
|
bool board_button_read(uint8_t button);
|
|
void board_delay_ms(uint32_t ms);
|
|
void board_delay_us(uint32_t us);
|
|
float board_get_temperature(void);
|
|
float board_get_voltage(void);
|
|
|
|
#endif /* BOARD_H */
|