ICARUS OS (Intelligent Cooperative Architecture for Real-time Unified Systems) 0.1.0
Preemptive Real-Time Operating System for ARM Cortex-M7
Loading...
Searching...
No Matches
retarget_hal.h File Reference

ICARUS OS Hardware Abstraction Layer Interface. More...

#include "bsp/i2c.h"
#include "bsp/rtc.h"
#include "bsp/spi.h"
#include "bsp/timer.h"
#include "usb_device.h"
#include "bsp/gpio.h"
#include "lcd.h"
#include "bsp/lsm9ds1_reg.h"
#include "bsp/config.h"
#include "bsp/mpu.h"

Go to the source code of this file.

Macros

#define IMU_ADDRESS   0x6B
 I2C address for LSM9DS1 IMU (accelerometer/gyroscope)
 

Functions

void hal_init (void)
 Initialize all hardware abstraction layer components.
 
void LED_Blink (uint32_t Hdelay, uint32_t Ldelay)
 Blink LED with specified on/off timing.
 
void LED_On (void)
 Turn LED on (active high)
 
void LED_Off (void)
 Turn LED off.
 

Detailed Description

ICARUS OS Hardware Abstraction Layer Interface.

Version
0.1.0

Provides hardware initialization and low-level platform services for the STM32H750VBT6 target.

Target Hardware:
  • MCU: STM32H750VBT6 (ARM Cortex-M7 @ 480MHz)
  • Board: WeAct Studio STM32H750VBT6 Core Board
  • LED: PE3 (active high)
  • IMU: LSM9DS1 on I2C2 (address 0x6B)
See also
STM32H750 Reference Manual RM0433
Author
Souham Biswas
Date
2025

Definition in file retarget_hal.h.

Macro Definition Documentation

◆ IMU_ADDRESS

#define IMU_ADDRESS   0x6B

I2C address for LSM9DS1 IMU (accelerometer/gyroscope)

Definition at line 53 of file retarget_hal.h.

Function Documentation

◆ hal_init()

void hal_init ( void  )

Initialize all hardware abstraction layer components.

Configures MPU, caches, clocks, and all peripherals. Must be called before os_init().

Precondition
None (called at system startup)
Postcondition
All hardware ready for kernel initialization

Master initialization function that configures all hardware:

  1. Vector table relocation (if running from QSPI)
  2. MPU configuration for memory protection
  3. CPU cache enablement
  4. HAL library initialization
  5. System clock configuration (480MHz)
  6. GPIO initialization
  7. RTC initialization
  8. SPI4 initialization (LCD)
  9. TIM1 initialization (PWM)
  10. I2C2 initialization (IMU)
  11. USB CDC initialization
Precondition
None (called at system startup)
Postcondition
All hardware ready for kernel initialization
Note
Must be called before os_init()
USB may take up to 1 second to enumerate on host
See also
SystemClock_Config() for clock tree details

Definition at line 201 of file retarget_hal.c.

References BSP_FLASH_BASE, CPU_CACHE_Enable(), MPU_Config(), MX_GPIO_Init(), MX_I2C2_Init(), MX_RTC_Init(), MX_SPI4_Init(), MX_TIM1_Init(), MX_USB_DEVICE_Init(), and SystemClock_Config().

Referenced by main().

◆ LED_Blink()

void LED_Blink ( uint32_t  Hdelay,
uint32_t  Ldelay 
)

Blink LED with specified on/off timing.

Parameters
[in]HdelayLED on duration in OS ticks
[in]LdelayLED off duration in OS ticks
Note
Uses task_active_sleep() - must be called from task context

Blink LED with specified timing.

Turns LED on for specified duration, then off for specified duration. Uses task_active_sleep() for non-blocking delays.

Parameters
[in]HdelayLED on duration in OS ticks
[in]LdelayLED off duration in OS ticks
Precondition
GPIO must be initialized (MX_GPIO_Init called)
Must be called from task context (uses task_active_sleep)
Note
Total blink period = Hdelay + Ldelay ticks

Definition at line 93 of file retarget_hal.c.

◆ LED_Off()

void LED_Off ( void  )

Turn LED off.

Sets PE3 GPIO pin low to turn off the onboard LED.

Precondition
GPIO must be initialized

Definition at line 118 of file retarget_hal.c.

◆ LED_On()

void LED_On ( void  )

Turn LED on (active high)

Turn LED on.

Sets PE3 GPIO pin high to illuminate the onboard LED.

Precondition
GPIO must be initialized

Definition at line 107 of file retarget_hal.c.