├── .gitattributes ├── .github └── workflows │ └── main.yml ├── .gitignore ├── .gitmodules ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── arch ├── ARM │ ├── Nordic │ │ ├── devices │ │ │ ├── nrf51 │ │ │ │ └── nrf-device.ads │ │ │ └── nrf52 │ │ │ │ ├── nrf-device.adb │ │ │ │ └── nrf-device.ads │ │ ├── drivers │ │ │ ├── nrf51 │ │ │ │ ├── nrf-adc.adb │ │ │ │ ├── nrf-adc.ads │ │ │ │ ├── nrf-clock-set_high_freq_external_frequency.adb │ │ │ │ ├── nrf-events.ads │ │ │ │ ├── nrf-interrupts.ads │ │ │ │ ├── nrf-ppi.adb │ │ │ │ ├── nrf-ppi.ads │ │ │ │ └── nrf-tasks.ads │ │ │ ├── nrf52 │ │ │ │ ├── nrf-adc.adb │ │ │ │ ├── nrf-adc.ads │ │ │ │ ├── nrf-clock-set_high_freq_external_frequency.adb │ │ │ │ ├── nrf-events.ads │ │ │ │ ├── nrf-interrupts.ads │ │ │ │ ├── nrf-ppi.adb │ │ │ │ ├── nrf-ppi.ads │ │ │ │ └── nrf-tasks.ads │ │ │ └── nrf_common │ │ │ │ ├── nrf-clock.adb │ │ │ │ ├── nrf-clock.ads │ │ │ │ ├── nrf-events.adb │ │ │ │ ├── nrf-gpio-tasks_and_events.adb │ │ │ │ ├── nrf-gpio-tasks_and_events.ads │ │ │ │ ├── nrf-gpio.adb │ │ │ │ ├── nrf-gpio.ads │ │ │ │ ├── nrf-interrupts.adb │ │ │ │ ├── nrf-radio.adb │ │ │ │ ├── nrf-radio.ads │ │ │ │ ├── nrf-rng.adb │ │ │ │ ├── nrf-rng.ads │ │ │ │ ├── nrf-rtc.adb │ │ │ │ ├── nrf-rtc.ads │ │ │ │ ├── nrf-spi_master.adb │ │ │ │ ├── nrf-spi_master.ads │ │ │ │ ├── nrf-tasks.adb │ │ │ │ ├── nrf-temperature.adb │ │ │ │ ├── nrf-temperature.ads │ │ │ │ ├── nrf-timers.adb │ │ │ │ ├── nrf-timers.ads │ │ │ │ ├── nrf-twi.adb │ │ │ │ ├── nrf-twi.ads │ │ │ │ ├── nrf-uart.adb │ │ │ │ ├── nrf-uart.ads │ │ │ │ └── nrf.ads │ │ └── svd │ │ │ ├── nrf51 │ │ │ ├── nrf_svd-aar.ads │ │ │ ├── nrf_svd-adc.ads │ │ │ ├── nrf_svd-amli.ads │ │ │ ├── nrf_svd-ccm.ads │ │ │ ├── nrf_svd-clock.ads │ │ │ ├── nrf_svd-ecb.ads │ │ │ ├── nrf_svd-ficr.ads │ │ │ ├── nrf_svd-gpio.ads │ │ │ ├── nrf_svd-gpiote.ads │ │ │ ├── nrf_svd-lpcomp.ads │ │ │ ├── nrf_svd-mpu.ads │ │ │ ├── nrf_svd-nvmc.ads │ │ │ ├── nrf_svd-power.ads │ │ │ ├── nrf_svd-ppi.ads │ │ │ ├── nrf_svd-qdec.ads │ │ │ ├── nrf_svd-radio.ads │ │ │ ├── nrf_svd-rng.ads │ │ │ ├── nrf_svd-rtc.ads │ │ │ ├── nrf_svd-spi.ads │ │ │ ├── nrf_svd-spim.ads │ │ │ ├── nrf_svd-spis.ads │ │ │ ├── nrf_svd-temp.ads │ │ │ ├── nrf_svd-timer.ads │ │ │ ├── nrf_svd-twi.ads │ │ │ ├── nrf_svd-uart.ads │ │ │ ├── nrf_svd-uicr.ads │ │ │ ├── nrf_svd-wdt.ads │ │ │ └── nrf_svd.ads │ │ │ └── nrf52 │ │ │ ├── nrf_svd-aar.ads │ │ │ ├── nrf_svd-bprot.ads │ │ │ ├── nrf_svd-ccm.ads │ │ │ ├── nrf_svd-clock.ads │ │ │ ├── nrf_svd-comp.ads │ │ │ ├── nrf_svd-ecb.ads │ │ │ ├── nrf_svd-egu.ads │ │ │ ├── nrf_svd-ficr.ads │ │ │ ├── nrf_svd-fpu.ads │ │ │ ├── nrf_svd-gpio.ads │ │ │ ├── nrf_svd-gpiote.ads │ │ │ ├── nrf_svd-i2s.ads │ │ │ ├── nrf_svd-lpcomp.ads │ │ │ ├── nrf_svd-mwu.ads │ │ │ ├── nrf_svd-nfct.ads │ │ │ ├── nrf_svd-nvmc.ads │ │ │ ├── nrf_svd-pdm.ads │ │ │ ├── nrf_svd-power.ads │ │ │ ├── nrf_svd-ppi.ads │ │ │ ├── nrf_svd-pwm.ads │ │ │ ├── nrf_svd-qdec.ads │ │ │ ├── nrf_svd-radio.ads │ │ │ ├── nrf_svd-rng.ads │ │ │ ├── nrf_svd-rtc.ads │ │ │ ├── nrf_svd-saadc.ads │ │ │ ├── nrf_svd-spi.ads │ │ │ ├── nrf_svd-spim.ads │ │ │ ├── nrf_svd-spis.ads │ │ │ ├── nrf_svd-temp.ads │ │ │ ├── nrf_svd-timer.ads │ │ │ ├── nrf_svd-twi.ads │ │ │ ├── nrf_svd-twim.ads │ │ │ ├── nrf_svd-twis.ads │ │ │ ├── nrf_svd-uart.ads │ │ │ ├── nrf_svd-uarte.ads │ │ │ ├── nrf_svd-uicr.ads │ │ │ ├── nrf_svd-wdt.ads │ │ │ └── nrf_svd.ads │ ├── STM32 │ │ ├── .gitignore │ │ ├── README.md │ │ ├── devices │ │ │ ├── stm32f40x │ │ │ │ ├── stm32-device.adb │ │ │ │ ├── stm32-device.ads │ │ │ │ ├── stm32-rcc.adb │ │ │ │ └── stm32-rcc.ads │ │ │ ├── stm32f42x │ │ │ │ ├── stm32-device.adb │ │ │ │ ├── stm32-device.ads │ │ │ │ ├── stm32-rcc.adb │ │ │ │ └── stm32-rcc.ads │ │ │ ├── stm32f46_79x │ │ │ │ ├── stm32-device.adb │ │ │ │ ├── stm32-device.ads │ │ │ │ ├── stm32-rcc.adb │ │ │ │ └── stm32-rcc.ads │ │ │ ├── stm32f7x │ │ │ │ ├── stm32-device.adb │ │ │ │ ├── stm32-device.ads │ │ │ │ ├── stm32-rcc.adb │ │ │ │ └── stm32-rcc.ads │ │ │ └── stm32f7x9 │ │ │ │ ├── stm32-device.adb │ │ │ │ ├── stm32-device.ads │ │ │ │ ├── stm32-rcc.adb │ │ │ │ └── stm32-rcc.ads │ │ ├── driver_demos │ │ │ ├── demo_L3GD20_dataready_int │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_l3gd20_dataready_int.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ ├── demo_l3gd20.adb │ │ │ │ │ ├── gyro_interrupts.adb │ │ │ │ │ ├── gyro_interrupts.ads │ │ │ │ │ ├── output_utils.adb │ │ │ │ │ └── output_utils.ads │ │ │ ├── demo_L3GD20_fifo_int │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_l3gd20_fifo_int.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ ├── demo_l3gd20.adb │ │ │ │ │ ├── gyro_interrupts.adb │ │ │ │ │ ├── gyro_interrupts.ads │ │ │ │ │ ├── output_utils.adb │ │ │ │ │ └── output_utils.ads │ │ │ ├── demo_L3GD20_polling │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_l3gd20.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ ├── demo_l3gd20.adb │ │ │ │ │ ├── output_utils.adb │ │ │ │ │ └── output_utils.ads │ │ │ ├── demo_LIS3DSH_pwm │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_lis3dsh_pwm.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ ├── demo_lis3dsh_pwm.adb │ │ │ │ │ └── demo_pwm_settings.ads │ │ │ ├── demo_LIS3DSH_tilt │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_lis3dsh_tilt.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ └── demo_lis3dsh_tilt.adb │ │ │ ├── demo_adc_dma │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_adc_dma.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ └── demo_adc_vbat_dma.adb │ │ │ ├── demo_adc_interrupts │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_adc_interrupts.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ ├── adc_interrupt_handling.adb │ │ │ │ │ ├── adc_interrupt_handling.ads │ │ │ │ │ └── demo_adc_vbat_interrupts.adb │ │ │ ├── demo_adc_polling │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_adc_polling.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ ├── demo_adc_gpio_polling.adb │ │ │ │ │ ├── demo_adc_temperature_polling.adb │ │ │ │ │ ├── demo_adc_vbat_polling.adb │ │ │ │ │ └── demo_adc_vref_polling.adb │ │ │ ├── demo_adc_timer_dma │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_adc_timer_dma.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ └── demo_adc_timer_dma.adb │ │ │ ├── demo_adc_timer_triggered │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_adc_timer_triggered.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ ├── adc_interrupt_handling.adb │ │ │ │ │ ├── adc_interrupt_handling.ads │ │ │ │ │ └── demo_adc_timer_triggered.adb │ │ │ ├── demo_crc │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_crc.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ ├── demo_crc.adb │ │ │ │ │ ├── dma_interrupt_handling.adb │ │ │ │ │ ├── dma_interrupt_handling.ads │ │ │ │ │ └── memory_transfer.ads │ │ │ ├── demo_dac_basic │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_dac_basic.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ └── demo_dac_basic.adb │ │ │ ├── demo_dac_dma │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_dac_dma.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ └── demo_dac_dma.adb │ │ │ ├── demo_dma_mem_to_mem │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_dma_mem_to_mem.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ ├── demo_dma_interrupts.adb │ │ │ │ │ ├── demo_dma_polling.adb │ │ │ │ │ ├── peripherals.ads │ │ │ │ │ ├── stm32f4_dma_interrupts.adb │ │ │ │ │ └── stm32f4_dma_interrupts.ads │ │ │ ├── demo_dma_mem_to_peripheral │ │ │ │ ├── .gdbinit │ │ │ │ ├── README.md │ │ │ │ ├── demo_usart_dma_continuous.gpr │ │ │ │ ├── gnat.adc │ │ │ │ └── src │ │ │ │ │ ├── demo_usart_dma_continuous.adb │ │ │ │ │ └── peripherals.ads │ │ │ ├── demo_dma_mem_to_peripheral_pwm │ │ │ │ ├── README.md │ │ │ │ ├── demo_pwm_dma_continuous.gpr │ │ │ │ ├── gnat.adc │ │ │ │ └── src │ │ │ │ │ └── demo_pwm_dma_continuous.adb │ │ │ ├── demo_gpio_direct_leds │ │ │ │ ├── .gdbinit │ │ │ │ ├── README.md │ │ │ │ ├── demo_gpio.gpr │ │ │ │ ├── gnat.adc │ │ │ │ └── src │ │ │ │ │ └── demo_gpio.adb │ │ │ ├── demo_independent_watchdog │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_iwdg.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ └── demo_iwdg.adb │ │ │ ├── demo_rng │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_rng.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ └── demo_rng.adb │ │ │ ├── demo_timer_interrupts_basic │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_basic_timer_interrupts.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ ├── demo.adb │ │ │ │ │ ├── stm32f4_timer_interrupts.adb │ │ │ │ │ └── stm32f4_timer_interrupts.ads │ │ │ ├── demo_timer_interrupts_multichannel │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_timer_interrupts_multichannel.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ ├── demo.adb │ │ │ │ │ ├── stm32f4_timer_interrupts.adb │ │ │ │ │ └── stm32f4_timer_interrupts.ads │ │ │ ├── demo_timer_pwm │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_timer_pwm.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ ├── demo_pwm_adt.adb │ │ │ │ │ └── demo_timer_pwm.adb │ │ │ ├── demo_timer_quad_encoder │ │ │ │ ├── demo_timer_quad_encoder.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ │ ├── demo_encoder.adb │ │ │ │ │ ├── encoder_emulator.adb │ │ │ │ │ ├── encoder_emulator.ads │ │ │ │ │ ├── motor.adb │ │ │ │ │ └── motor.ads │ │ │ ├── demo_usart_interrupts │ │ │ │ ├── .gdbinit │ │ │ │ ├── README.md │ │ │ │ ├── demo_usart_interrupts.gpr │ │ │ │ ├── gnat.adc │ │ │ │ └── src │ │ │ │ │ ├── demo_usart_interrupts.adb │ │ │ │ │ ├── peripherals.ads │ │ │ │ │ ├── serial_port.adb │ │ │ │ │ └── serial_port.ads │ │ │ ├── demo_usart_polling │ │ │ │ ├── .gdbinit │ │ │ │ ├── README.md │ │ │ │ ├── demo_usart_polling.gpr │ │ │ │ ├── gnat.adc │ │ │ │ └── src │ │ │ │ │ └── demo_usart_polling.adb │ │ │ └── demo_window_watchdog │ │ │ │ ├── .gdbinit │ │ │ │ ├── demo_wwdg.gpr │ │ │ │ ├── gnat.adc │ │ │ │ ├── readme.md │ │ │ │ └── src │ │ │ │ └── demo_wwdg.adb │ │ ├── drivers │ │ │ ├── crc_stm32f4 │ │ │ │ ├── stm32-crc-dma.adb │ │ │ │ ├── stm32-crc-dma.ads │ │ │ │ ├── stm32-crc.adb │ │ │ │ └── stm32-crc.ads │ │ │ ├── dma │ │ │ │ ├── stm32-dma.adb │ │ │ │ └── stm32-dma.ads │ │ │ ├── dma2d │ │ │ │ ├── stm32-dma2d-interrupt.adb │ │ │ │ ├── stm32-dma2d-interrupt.ads │ │ │ │ ├── stm32-dma2d-polling.adb │ │ │ │ ├── stm32-dma2d-polling.ads │ │ │ │ ├── stm32-dma2d.adb │ │ │ │ └── stm32-dma2d.ads │ │ │ ├── dma_interrupts │ │ │ │ ├── stm32-dma-interrupts.adb │ │ │ │ └── stm32-dma-interrupts.ads │ │ │ ├── dma_stm32f769 │ │ │ │ ├── stm32-dma.adb │ │ │ │ └── stm32-dma.ads │ │ │ ├── dsi │ │ │ │ ├── stm32-dsi.adb │ │ │ │ └── stm32-dsi.ads │ │ │ ├── fmc │ │ │ │ ├── stm32-fmc.adb │ │ │ │ └── stm32-fmc.ads │ │ │ ├── fsmc │ │ │ │ ├── README.md │ │ │ │ ├── stm32-fsmc.adb │ │ │ │ └── stm32-fsmc.ads │ │ │ ├── i2c_stm32f4 │ │ │ │ ├── stm32-i2c-dma.adb │ │ │ │ ├── stm32-i2c-dma.ads │ │ │ │ ├── stm32-i2c.adb │ │ │ │ └── stm32-i2c.ads │ │ │ ├── i2c_stm32f7 │ │ │ │ ├── stm32-i2c.adb │ │ │ │ └── stm32-i2c.ads │ │ │ ├── ltdc │ │ │ │ ├── stm32-ltdc.adb │ │ │ │ └── stm32-ltdc.ads │ │ │ ├── power_control_stm32f4 │ │ │ │ ├── stm32-power_control.adb │ │ │ │ └── stm32-power_control.ads │ │ │ ├── power_control_stm32f7 │ │ │ │ ├── stm32-power_control.adb │ │ │ │ └── stm32-power_control.ads │ │ │ ├── sai │ │ │ │ ├── stm32-sai.adb │ │ │ │ └── stm32-sai.ads │ │ │ ├── sd │ │ │ │ ├── sdio │ │ │ │ │ ├── sdmmc_svd.ads │ │ │ │ │ └── sdmmc_svd_periph.ads │ │ │ │ ├── sdmmc │ │ │ │ │ ├── sdmmc_svd.ads │ │ │ │ │ └── sdmmc_svd_periph.ads │ │ │ │ ├── stm32-sdmmc.adb │ │ │ │ ├── stm32-sdmmc.ads │ │ │ │ ├── stm32-sdmmc_interrupt.adb │ │ │ │ └── stm32-sdmmc_interrupt.ads │ │ │ ├── stm32-adc.adb │ │ │ ├── stm32-adc.ads │ │ │ ├── stm32-dac.adb │ │ │ ├── stm32-dac.ads │ │ │ ├── stm32-dcmi.adb │ │ │ ├── stm32-dcmi.ads │ │ │ ├── stm32-device_id.adb │ │ │ ├── stm32-device_id.ads │ │ │ ├── stm32-exti.adb │ │ │ ├── stm32-exti.ads │ │ │ ├── stm32-gpio.adb │ │ │ ├── stm32-gpio.ads │ │ │ ├── stm32-i2s.adb │ │ │ ├── stm32-i2s.ads │ │ │ ├── stm32-iwdg.adb │ │ │ ├── stm32-iwdg.ads │ │ │ ├── stm32-pwm.adb │ │ │ ├── stm32-pwm.ads │ │ │ ├── stm32-rng-interrupts.adb │ │ │ ├── stm32-rng-interrupts.ads │ │ │ ├── stm32-rng-polling.adb │ │ │ ├── stm32-rng-polling.ads │ │ │ ├── stm32-rng.adb │ │ │ ├── stm32-rng.ads │ │ │ ├── stm32-rtc.adb │ │ │ ├── stm32-rtc.ads │ │ │ ├── stm32-setup.adb │ │ │ ├── stm32-setup.ads │ │ │ ├── stm32-spi-dma.adb │ │ │ ├── stm32-spi-dma.ads │ │ │ ├── stm32-spi.adb │ │ │ ├── stm32-spi.ads │ │ │ ├── stm32-syscfg.adb │ │ │ ├── stm32-syscfg.ads │ │ │ ├── stm32-timers.adb │ │ │ ├── stm32-timers.ads │ │ │ ├── stm32-wwdg.adb │ │ │ ├── stm32-wwdg.ads │ │ │ ├── stm32.ads │ │ │ └── uart_stm32f4 │ │ │ │ ├── stm32-usarts.adb │ │ │ │ └── stm32-usarts.ads │ │ └── svd │ │ │ ├── stm32f40x │ │ │ ├── stm32_svd-adc.ads │ │ │ ├── stm32_svd-can.ads │ │ │ ├── stm32_svd-crc.ads │ │ │ ├── stm32_svd-dac.ads │ │ │ ├── stm32_svd-dbg.ads │ │ │ ├── stm32_svd-dcmi.ads │ │ │ ├── stm32_svd-dma.ads │ │ │ ├── stm32_svd-ethernet.ads │ │ │ ├── stm32_svd-exti.ads │ │ │ ├── stm32_svd-flash.ads │ │ │ ├── stm32_svd-fsmc.ads │ │ │ ├── stm32_svd-gpio.ads │ │ │ ├── stm32_svd-i2c.ads │ │ │ ├── stm32_svd-iwdg.ads │ │ │ ├── stm32_svd-nvic.ads │ │ │ ├── stm32_svd-pwr.ads │ │ │ ├── stm32_svd-rcc.ads │ │ │ ├── stm32_svd-rng.ads │ │ │ ├── stm32_svd-rtc.ads │ │ │ ├── stm32_svd-sdio.ads │ │ │ ├── stm32_svd-spi.ads │ │ │ ├── stm32_svd-syscfg.ads │ │ │ ├── stm32_svd-tim.ads │ │ │ ├── stm32_svd-usart.ads │ │ │ ├── stm32_svd-usb_otg_fs.ads │ │ │ ├── stm32_svd-usb_otg_hs.ads │ │ │ ├── stm32_svd-wwdg.ads │ │ │ └── stm32_svd.ads │ │ │ ├── stm32f429x │ │ │ ├── stm32_svd-adc.ads │ │ │ ├── stm32_svd-can.ads │ │ │ ├── stm32_svd-crc.ads │ │ │ ├── stm32_svd-dac.ads │ │ │ ├── stm32_svd-dbg.ads │ │ │ ├── stm32_svd-dcmi.ads │ │ │ ├── stm32_svd-dma.ads │ │ │ ├── stm32_svd-dma2d.ads │ │ │ ├── stm32_svd-ethernet.ads │ │ │ ├── stm32_svd-exti.ads │ │ │ ├── stm32_svd-flash.ads │ │ │ ├── stm32_svd-fsmc.ads │ │ │ ├── stm32_svd-gpio.ads │ │ │ ├── stm32_svd-i2c.ads │ │ │ ├── stm32_svd-iwdg.ads │ │ │ ├── stm32_svd-ltdc.ads │ │ │ ├── stm32_svd-nvic.ads │ │ │ ├── stm32_svd-pwr.ads │ │ │ ├── stm32_svd-rcc.ads │ │ │ ├── stm32_svd-rng.ads │ │ │ ├── stm32_svd-rtc.ads │ │ │ ├── stm32_svd-sai.ads │ │ │ ├── stm32_svd-sdio.ads │ │ │ ├── stm32_svd-spi.ads │ │ │ ├── stm32_svd-syscfg.ads │ │ │ ├── stm32_svd-tim.ads │ │ │ ├── stm32_svd-usart.ads │ │ │ ├── stm32_svd-usb_otg_fs.ads │ │ │ ├── stm32_svd-usb_otg_hs.ads │ │ │ ├── stm32_svd-wwdg.ads │ │ │ └── stm32_svd.ads │ │ │ ├── stm32f46_79x │ │ │ ├── stm32_svd-adc.ads │ │ │ ├── stm32_svd-can.ads │ │ │ ├── stm32_svd-crc.ads │ │ │ ├── stm32_svd-cryp.ads │ │ │ ├── stm32_svd-dac.ads │ │ │ ├── stm32_svd-dbg.ads │ │ │ ├── stm32_svd-dcmi.ads │ │ │ ├── stm32_svd-dma.ads │ │ │ ├── stm32_svd-dma2d.ads │ │ │ ├── stm32_svd-dsi.ads │ │ │ ├── stm32_svd-ethernet.ads │ │ │ ├── stm32_svd-exti.ads │ │ │ ├── stm32_svd-flash.ads │ │ │ ├── stm32_svd-fsmc.ads │ │ │ ├── stm32_svd-gpio.ads │ │ │ ├── stm32_svd-hash.ads │ │ │ ├── stm32_svd-i2c.ads │ │ │ ├── stm32_svd-iwdg.ads │ │ │ ├── stm32_svd-ltdc.ads │ │ │ ├── stm32_svd-nvic.ads │ │ │ ├── stm32_svd-pwr.ads │ │ │ ├── stm32_svd-quadspi.ads │ │ │ ├── stm32_svd-rcc.ads │ │ │ ├── stm32_svd-rng.ads │ │ │ ├── stm32_svd-rtc.ads │ │ │ ├── stm32_svd-sai.ads │ │ │ ├── stm32_svd-sdio.ads │ │ │ ├── stm32_svd-spi.ads │ │ │ ├── stm32_svd-syscfg.ads │ │ │ ├── stm32_svd-tim.ads │ │ │ ├── stm32_svd-usart.ads │ │ │ ├── stm32_svd-usb_otg_fs.ads │ │ │ ├── stm32_svd-usb_otg_hs.ads │ │ │ ├── stm32_svd-wwdg.ads │ │ │ └── stm32_svd.ads │ │ │ ├── stm32f7x │ │ │ ├── stm32_svd-adc.ads │ │ │ ├── stm32_svd-can.ads │ │ │ ├── stm32_svd-cec.ads │ │ │ ├── stm32_svd-crc.ads │ │ │ ├── stm32_svd-cryp.ads │ │ │ ├── stm32_svd-dac.ads │ │ │ ├── stm32_svd-dbg.ads │ │ │ ├── stm32_svd-dcmi.ads │ │ │ ├── stm32_svd-dma.ads │ │ │ ├── stm32_svd-dma2d.ads │ │ │ ├── stm32_svd-ethernet.ads │ │ │ ├── stm32_svd-exti.ads │ │ │ ├── stm32_svd-flash.ads │ │ │ ├── stm32_svd-fsmc.ads │ │ │ ├── stm32_svd-gpio.ads │ │ │ ├── stm32_svd-hash.ads │ │ │ ├── stm32_svd-i2c.ads │ │ │ ├── stm32_svd-iwdg.ads │ │ │ ├── stm32_svd-lptim.ads │ │ │ ├── stm32_svd-ltdc.ads │ │ │ ├── stm32_svd-nvic.ads │ │ │ ├── stm32_svd-pwr.ads │ │ │ ├── stm32_svd-quadspi.ads │ │ │ ├── stm32_svd-rcc.ads │ │ │ ├── stm32_svd-rng.ads │ │ │ ├── stm32_svd-rtc.ads │ │ │ ├── stm32_svd-sai.ads │ │ │ ├── stm32_svd-sdmmc.ads │ │ │ ├── stm32_svd-spdif_rx.ads │ │ │ ├── stm32_svd-spi.ads │ │ │ ├── stm32_svd-syscfg.ads │ │ │ ├── stm32_svd-tim.ads │ │ │ ├── stm32_svd-usart.ads │ │ │ ├── stm32_svd-usb_otg_fs.ads │ │ │ ├── stm32_svd-usb_otg_hs.ads │ │ │ ├── stm32_svd-wwdg.ads │ │ │ └── stm32_svd.ads │ │ │ └── stm32f7x9 │ │ │ ├── stm32_svd-adc.ads │ │ │ ├── stm32_svd-can.ads │ │ │ ├── stm32_svd-cec.ads │ │ │ ├── stm32_svd-crc.ads │ │ │ ├── stm32_svd-cryp.ads │ │ │ ├── stm32_svd-dac.ads │ │ │ ├── stm32_svd-dcmi.ads │ │ │ ├── stm32_svd-dfsdm.ads │ │ │ ├── stm32_svd-dma.ads │ │ │ ├── stm32_svd-dma2d.ads │ │ │ ├── stm32_svd-dsi.ads │ │ │ ├── stm32_svd-ethernet.ads │ │ │ ├── stm32_svd-exti.ads │ │ │ ├── stm32_svd-flash.ads │ │ │ ├── stm32_svd-fsmc.ads │ │ │ ├── stm32_svd-gpio.ads │ │ │ ├── stm32_svd-hash.ads │ │ │ ├── stm32_svd-i2c.ads │ │ │ ├── stm32_svd-iwdg.ads │ │ │ ├── stm32_svd-jpeg.ads │ │ │ ├── stm32_svd-lptim.ads │ │ │ ├── stm32_svd-ltdc.ads │ │ │ ├── stm32_svd-mdios.ads │ │ │ ├── stm32_svd-nvic.ads │ │ │ ├── stm32_svd-pwr.ads │ │ │ ├── stm32_svd-quadspi.ads │ │ │ ├── stm32_svd-rcc.ads │ │ │ ├── stm32_svd-rng.ads │ │ │ ├── stm32_svd-rtc.ads │ │ │ ├── stm32_svd-sai.ads │ │ │ ├── stm32_svd-sdmmc.ads │ │ │ ├── stm32_svd-spdif_rx.ads │ │ │ ├── stm32_svd-spi.ads │ │ │ ├── stm32_svd-syscfg.ads │ │ │ ├── stm32_svd-tim.ads │ │ │ ├── stm32_svd-usart.ads │ │ │ ├── stm32_svd-usb_otg_fs.ads │ │ │ ├── stm32_svd-usb_otg_hs.ads │ │ │ ├── stm32_svd-wwdg.ads │ │ │ └── stm32_svd.ads │ └── cortex_m │ │ ├── src │ │ ├── cache │ │ │ └── cortex_m-cache.adb │ │ ├── cm0 │ │ │ ├── cortex_m_svd-debug.ads │ │ │ ├── cortex_m_svd-dwt.ads │ │ │ ├── cortex_m_svd-nvic.ads │ │ │ ├── cortex_m_svd-scb.ads │ │ │ ├── cortex_m_svd-systick.ads │ │ │ └── cortex_m_svd.ads │ │ ├── cm4 │ │ │ ├── cortex_m_svd-debug.ads │ │ │ ├── cortex_m_svd-dwt.ads │ │ │ ├── cortex_m_svd-mpu.ads │ │ │ ├── cortex_m_svd-nvic.ads │ │ │ ├── cortex_m_svd-scb.ads │ │ │ ├── cortex_m_svd-systick.ads │ │ │ └── cortex_m_svd.ads │ │ ├── cm4f │ │ │ ├── cortex_m_svd-debug.ads │ │ │ ├── cortex_m_svd-dwt.ads │ │ │ ├── cortex_m_svd-fpu.ads │ │ │ ├── cortex_m_svd-mpu.ads │ │ │ ├── cortex_m_svd-nvic.ads │ │ │ ├── cortex_m_svd-scb.ads │ │ │ ├── cortex_m_svd-systick.ads │ │ │ └── cortex_m_svd.ads │ │ ├── cm7 │ │ │ ├── cortex_m_svd-cache.ads │ │ │ ├── cortex_m_svd-debug.ads │ │ │ ├── cortex_m_svd-dwt.ads │ │ │ ├── cortex_m_svd-fpu.ads │ │ │ ├── cortex_m_svd-mpu.ads │ │ │ ├── cortex_m_svd-nvic.ads │ │ │ ├── cortex_m_svd-pf.ads │ │ │ ├── cortex_m_svd-scb.ads │ │ │ ├── cortex_m_svd-systick.ads │ │ │ └── cortex_m_svd.ads │ │ ├── cortex_m-cache.ads │ │ ├── cortex_m-debug.adb │ │ ├── cortex_m-debug.ads │ │ ├── cortex_m-dwt.adb │ │ ├── cortex_m-dwt.ads │ │ ├── cortex_m-hints.adb │ │ ├── cortex_m-hints.ads │ │ ├── cortex_m-reset.adb │ │ ├── cortex_m-reset.ads │ │ ├── cortex_m-systick.adb │ │ ├── cortex_m-systick.ads │ │ ├── cortex_m.ads │ │ ├── fpu │ │ │ ├── cortex_m-fpu.adb │ │ │ └── cortex_m-fpu.ads │ │ ├── memory_barriers.adb │ │ ├── memory_barriers.ads │ │ ├── nocache │ │ │ └── cortex_m-cache.adb │ │ ├── nvic_cm0 │ │ │ ├── cortex_m-nvic.adb │ │ │ └── cortex_m-nvic.ads │ │ ├── nvic_cm4_cm7 │ │ │ ├── cortex_m-nvic.adb │ │ │ └── cortex_m-nvic.ads │ │ ├── semihosting-filesystem.adb │ │ ├── semihosting-filesystem.ads │ │ ├── semihosting.adb │ │ └── semihosting.ads │ │ └── svd │ │ └── cortex_m-debug.svd ├── RISC-V │ ├── SiFive │ │ ├── devices │ │ │ └── FE310 │ │ │ │ └── fe310-device.ads │ │ ├── drivers │ │ │ ├── fe310-clint.adb │ │ │ ├── fe310-clint.ads │ │ │ ├── fe310-gpio.adb │ │ │ ├── fe310-gpio.ads │ │ │ ├── fe310-performance_monitor.adb │ │ │ ├── fe310-performance_monitor.ads │ │ │ ├── fe310-pwm.adb │ │ │ ├── fe310-pwm.ads │ │ │ ├── fe310-rtc.adb │ │ │ ├── fe310-rtc.ads │ │ │ ├── fe310-time.adb │ │ │ ├── fe310-time.ads │ │ │ ├── fe310-uart.adb │ │ │ ├── fe310-uart.ads │ │ │ ├── fe310.adb │ │ │ ├── fe310.ads │ │ │ ├── gpio0 │ │ │ │ ├── sifive-gpio.adb │ │ │ │ └── sifive-gpio.ads │ │ │ ├── pwm0 │ │ │ │ ├── sifive-pwm.adb │ │ │ │ └── sifive-pwm.ads │ │ │ ├── spi0 │ │ │ │ ├── sifive-spi.adb │ │ │ │ └── sifive-spi.ads │ │ │ └── uart0 │ │ │ │ ├── sifive-uart.adb │ │ │ │ └── sifive-uart.ads │ │ ├── sifive.ads │ │ └── svd │ │ │ └── FE310 │ │ │ ├── fe310_svd-clint.ads │ │ │ ├── fe310_svd-gpio.ads │ │ │ ├── fe310_svd-otp_mem.ads │ │ │ ├── fe310_svd-pric.ads │ │ │ ├── fe310_svd-pwm.ads │ │ │ ├── fe310_svd-rtc.ads │ │ │ ├── fe310_svd-spi.ads │ │ │ ├── fe310_svd-uart.ads │ │ │ └── fe310_svd.ads │ └── src │ │ ├── riscv-csr.ads │ │ ├── riscv-csr_generic.adb │ │ ├── riscv-csr_generic.ads │ │ ├── riscv.ads │ │ ├── rv32 │ │ ├── riscv-csr_generic-read_csr_64.adb │ │ ├── riscv-csr_generic-write_csr_64.adb │ │ └── riscv-types.ads │ │ └── rv64 │ │ ├── riscv-csr_generic-read_csr_64.adb │ │ ├── riscv-csr_generic-write_csr_64.adb │ │ └── riscv-types.ads └── svd.mk ├── boards ├── HiFive1 │ ├── README.md │ ├── hifive1_zfp.gpr │ └── src │ │ ├── hifive1-leds.adb │ │ ├── hifive1-leds.ads │ │ ├── hifive1.ads │ │ └── zfp │ │ ├── adl_config.ads │ │ ├── crt0.S │ │ └── link.ld ├── HiFive1_rev_B │ ├── hifive1_rev_b_zfp.gpr │ └── src │ │ └── zfp │ │ ├── adl_config.ads │ │ ├── crt0.S │ │ └── link.ld ├── MicroBit │ ├── README.md │ ├── microbit_zfp.gpr │ └── src │ │ ├── microbit-accelerometer.adb │ │ ├── microbit-accelerometer.ads │ │ ├── microbit-buttons.adb │ │ ├── microbit-buttons.ads │ │ ├── microbit-console.adb │ │ ├── microbit-console.ads │ │ ├── microbit-display-symbols.adb │ │ ├── microbit-display-symbols.ads │ │ ├── microbit-display.adb │ │ ├── microbit-display.ads │ │ ├── microbit-i2c.adb │ │ ├── microbit-i2c.ads │ │ ├── microbit-ios-neopixel.adb │ │ ├── microbit-ios-neopixel.ads │ │ ├── microbit-ios.adb │ │ ├── microbit-ios.ads │ │ ├── microbit-music.adb │ │ ├── microbit-music.ads │ │ ├── microbit-servos.adb │ │ ├── microbit-servos.ads │ │ ├── microbit-spi.adb │ │ ├── microbit-spi.ads │ │ ├── microbit-time.adb │ │ ├── microbit-time.ads │ │ ├── microbit.ads │ │ └── zfp │ │ ├── adl_config.ads │ │ ├── crt0.S │ │ └── link.ld ├── NRF52_DK │ ├── README.md │ ├── nrf52_dk_zfp.gpr │ └── src │ │ ├── nrf52_dk-buttons.adb │ │ ├── nrf52_dk-buttons.ads │ │ ├── nrf52_dk-ios.adb │ │ ├── nrf52_dk-ios.ads │ │ ├── nrf52_dk-leds.adb │ │ ├── nrf52_dk-leds.ads │ │ ├── nrf52_dk-time.adb │ │ ├── nrf52_dk-time.ads │ │ ├── nrf52_dk.ads │ │ └── zfp │ │ ├── adl_config.ads │ │ ├── crt0.S │ │ └── link.ld ├── OpenMV2 │ ├── openmv2_full.gpr │ ├── openmv2_sfp.gpr │ └── src │ │ ├── full │ │ └── adl_config.ads │ │ ├── openmv-bitmap.adb │ │ ├── openmv-bitmap.ads │ │ ├── openmv-lcd_shield.adb │ │ ├── openmv-lcd_shield.ads │ │ ├── openmv-sensor.adb │ │ ├── openmv-sensor.ads │ │ ├── openmv.adb │ │ ├── openmv.ads │ │ └── sfp │ │ └── adl_config.ads ├── README.md ├── Unleashed │ ├── src │ │ ├── full │ │ │ ├── adl_config.ads │ │ │ └── sifive-device.ads │ │ ├── sfp │ │ │ ├── adl_config.ads │ │ │ └── sifive-device.ads │ │ ├── unleashed-leds.adb │ │ ├── unleashed-leds.ads │ │ ├── unleashed.ads │ │ └── zfp │ │ │ ├── adl_config.ads │ │ │ └── sifive-device.ads │ ├── unleashed_full.gpr │ ├── unleashed_sfp.gpr │ └── unleashed_zfp.gpr ├── board_projects_generator.py ├── crazyflie │ ├── crazyflie_full.gpr │ ├── crazyflie_sfp.gpr │ └── src │ │ ├── full │ │ └── adl_config.ads │ │ ├── sfp │ │ └── adl_config.ads │ │ ├── stm32-board.adb │ │ └── stm32-board.ads ├── feather_stm32f405 │ ├── feather_stm32f405_full.gpr │ ├── feather_stm32f405_sfp.gpr │ └── src │ │ ├── feather_stm32f405-i2c.adb │ │ ├── feather_stm32f405-i2c.ads │ │ ├── feather_stm32f405-led.adb │ │ ├── feather_stm32f405-led.ads │ │ ├── feather_stm32f405.ads │ │ ├── full │ │ └── adl_config.ads │ │ └── sfp │ │ └── adl_config.ads ├── native │ ├── config_src │ │ └── adl_config.ads │ ├── native.gpr │ └── src │ │ ├── filesystem-native.adb │ │ ├── filesystem-native.ads │ │ └── native.ads ├── nucleo_f446ze │ ├── nucleo_f446ze_full.gpr │ ├── nucleo_f446ze_sfp.gpr │ └── src │ │ ├── full │ │ └── adl_config.ads │ │ └── sfp │ │ └── adl_config.ads ├── stm32_common │ ├── common │ │ ├── stm32-user_button.adb │ │ └── stm32-user_button.ads │ ├── dma2d │ │ ├── stm32-dma2d_bitmap.adb │ │ └── stm32-dma2d_bitmap.ads │ ├── ltdc │ │ ├── framebuffer_ltdc.adb │ │ └── framebuffer_ltdc.ads │ ├── nucleo_f446ze │ │ ├── stm32-board.adb │ │ └── stm32-board.ads │ ├── otm8009a │ │ ├── framebuffer_dsi.adb │ │ └── framebuffer_dsi.ads │ ├── sdcard │ │ ├── sdcard.adb │ │ └── sdcard.ads │ ├── sdram │ │ ├── stm32-sdram.adb │ │ └── stm32-sdram.ads │ ├── stm32f407disco │ │ ├── stm32-board.adb │ │ └── stm32-board.ads │ ├── stm32f429disco │ │ ├── framebuffer_ili9341.adb │ │ ├── framebuffer_ili9341.ads │ │ ├── stm32-board.adb │ │ ├── stm32-board.ads │ │ ├── touch_panel_stmpe811.adb │ │ └── touch_panel_stmpe811.ads │ ├── stm32f469disco │ │ ├── audio.adb │ │ ├── audio.ads │ │ ├── framebuffer_otm8009a.adb │ │ ├── framebuffer_otm8009a.ads │ │ ├── stm32-board.adb │ │ ├── stm32-board.ads │ │ ├── touch_panel_ft6x06.adb │ │ └── touch_panel_ft6x06.ads │ ├── stm32f746disco │ │ ├── audio.adb │ │ ├── audio.ads │ │ ├── framebuffer_rk043fn48h.adb │ │ ├── framebuffer_rk043fn48h.ads │ │ ├── stm32-board.adb │ │ ├── stm32-board.ads │ │ ├── touch_panel_ft5336.adb │ │ └── touch_panel_ft5336.ads │ └── stm32f769disco │ │ ├── audio.adb │ │ ├── audio.ads │ │ ├── framebuffer_otm8009a.adb │ │ ├── framebuffer_otm8009a.ads │ │ ├── stm32-board.adb │ │ ├── stm32-board.ads │ │ ├── touch_panel_ft6x06.adb │ │ └── touch_panel_ft6x06.ads ├── stm32_f4ve │ ├── src │ │ ├── display_ili9341.adb │ │ ├── display_ili9341.ads │ │ ├── full │ │ │ └── adl_config.ads │ │ ├── sfp │ │ │ └── adl_config.ads │ │ ├── stm32-board.adb │ │ ├── stm32-board.ads │ │ ├── touch_panel_xpt2046.adb │ │ └── touch_panel_xpt2046.ads │ ├── stm32_f4ve_full.gpr │ └── stm32_f4ve_sfp.gpr ├── stm32_h405 │ ├── src │ │ ├── full │ │ │ └── adl_config.ads │ │ ├── sfp │ │ │ └── adl_config.ads │ │ ├── stm32_h405-led.adb │ │ ├── stm32_h405-led.ads │ │ └── stm32_h405.ads │ ├── stm32_h405_full.gpr │ └── stm32_h405_sfp.gpr ├── stm32f407_discovery │ ├── src │ │ ├── full │ │ │ └── adl_config.ads │ │ └── sfp │ │ │ └── adl_config.ads │ ├── stm32f407_discovery_full.gpr │ └── stm32f407_discovery_sfp.gpr ├── stm32f429_discovery │ ├── src │ │ ├── full │ │ │ └── adl_config.ads │ │ └── sfp │ │ │ └── adl_config.ads │ ├── stm32f429_discovery_full.gpr │ └── stm32f429_discovery_sfp.gpr ├── stm32f469_discovery │ ├── src │ │ ├── full │ │ │ └── adl_config.ads │ │ └── sfp │ │ │ └── adl_config.ads │ ├── stm32f469_discovery_full.gpr │ └── stm32f469_discovery_sfp.gpr ├── stm32f4xx_m │ ├── src │ │ ├── full │ │ │ └── adl_config.ads │ │ ├── sfp │ │ │ └── adl_config.ads │ │ ├── stm32-board.adb │ │ └── stm32-board.ads │ ├── stm32f4xx_m_full.gpr │ └── stm32f4xx_m_sfp.gpr ├── stm32f746_discovery │ ├── src │ │ ├── full │ │ │ └── adl_config.ads │ │ └── sfp │ │ │ └── adl_config.ads │ ├── stm32f746_discovery_full.gpr │ └── stm32f746_discovery_sfp.gpr └── stm32f769_discovery │ ├── src │ ├── full │ │ └── adl_config.ads │ └── sfp │ │ └── adl_config.ads │ ├── stm32f769_discovery_full.gpr │ └── stm32f769_discovery_sfp.gpr ├── components ├── eth │ ├── stm32-eth.adb │ └── stm32-eth.ads └── src │ ├── adafruit.ads │ ├── audio │ ├── CS43L22 │ │ ├── cs43l22.adb │ │ └── cs43l22.ads │ ├── SGTL5000 │ │ ├── sgtl5000.adb │ │ └── sgtl5000.ads │ └── W8994 │ │ ├── wm8994.adb │ │ └── wm8994.ads │ ├── camera │ ├── OV2640 │ │ ├── bit_fields.adb │ │ ├── bit_fields.ads │ │ ├── ov2640.adb │ │ └── ov2640.ads │ └── OV7725 │ │ ├── ov7725.adb │ │ └── ov7725.ads │ ├── environment │ ├── lps25h-i2c.adb │ ├── lps25h-i2c.ads │ ├── lps25h-spi.adb │ ├── lps25h-spi.ads │ └── lps25h.ads │ ├── io_expander │ ├── AdaFruit_Trellis │ │ ├── adafruit-trellis.adb │ │ └── adafruit-trellis.ads │ ├── MCP23xxx │ │ ├── mcp23008.ads │ │ ├── mcp23017.ads │ │ ├── mcp23x08-i2c.adb │ │ ├── mcp23x08-i2c.ads │ │ ├── mcp23x08.adb │ │ ├── mcp23x08.ads │ │ ├── mcp23x17-i2c.adb │ │ ├── mcp23x17-i2c.ads │ │ ├── mcp23x17.adb │ │ └── mcp23x17.ads │ ├── ht16k33 │ │ ├── ht16k33.adb │ │ └── ht16k33.ads │ ├── pcf8574 │ │ ├── pcf8574.adb │ │ └── pcf8574.ads │ └── stmpe1600 │ │ ├── stmpe1600.adb │ │ └── stmpe1600.ads │ ├── keyboard │ ├── bbq10kbd.adb │ └── bbq10kbd.ads │ ├── memory │ └── W25Q16 │ │ ├── README.md │ │ ├── w25q16.adb │ │ └── w25q16.ads │ ├── motion │ ├── ak8963 │ │ ├── ak8963.adb │ │ └── ak8963.ads │ ├── bno055 │ │ ├── bno055_i2c_io.adb │ │ ├── bno055_i2c_io.ads │ │ ├── bosch_bno055.adb │ │ └── bosch_bno055.ads │ ├── l3gd20 │ │ ├── l3gd20.adb │ │ └── l3gd20.ads │ ├── lis3dsh │ │ ├── lis3dsh-spi.adb │ │ ├── lis3dsh-spi.ads │ │ ├── lis3dsh.adb │ │ └── lis3dsh.ads │ ├── lsm303agr │ │ ├── lsm303agr.adb │ │ └── lsm303agr.ads │ ├── mma8653 │ │ ├── mma8653.adb │ │ └── mma8653.ads │ ├── mpu9250 │ │ ├── mpu9250.adb │ │ └── mpu9250.ads │ └── pmw3901 │ │ ├── pmw3901.adb │ │ └── pmw3901.ads │ ├── printer │ └── adafruit_thermal_printer │ │ ├── adafruit-thermal_printer.adb │ │ └── adafruit-thermal_printer.ads │ ├── radio │ ├── hm11 │ │ ├── README.md │ │ ├── hm11.adb │ │ └── hm11.ads │ └── nrf24l01p │ │ ├── README.md │ │ ├── nrf24l01p.adb │ │ └── nrf24l01p.ads │ ├── range_sensor │ ├── VL53L0X │ │ ├── vl53l0x.adb │ │ └── vl53l0x.ads │ └── VL53L1X │ │ ├── README.md │ │ ├── vl53l1x.adb │ │ └── vl53l1x.ads │ ├── screen │ ├── ST7735R │ │ ├── st7735r-ram_framebuffer.adb │ │ ├── st7735r-ram_framebuffer.ads │ │ ├── st7735r.adb │ │ └── st7735r.ads │ ├── adafruit-charliewing.adb │ ├── adafruit-charliewing.ads │ ├── ili9341 │ │ ├── README.md │ │ ├── ili9341-b16_connector.adb │ │ ├── ili9341-b16_connector.ads │ │ ├── ili9341-device-bitmap.adb │ │ ├── ili9341-device-bitmap.ads │ │ ├── ili9341-device.adb │ │ ├── ili9341-device.ads │ │ ├── ili9341-regs.ads │ │ ├── ili9341-spi_connector.adb │ │ ├── ili9341-spi_connector.ads │ │ └── ili9341.ads │ ├── is31fl3731.adb │ ├── is31fl3731.ads │ ├── lcd │ │ ├── lcd_hd44780-custom_characters.ads │ │ ├── lcd_hd44780-pcf8574.adb │ │ ├── lcd_hd44780-pcf8574.ads │ │ ├── lcd_hd44780.adb │ │ └── lcd_hd44780.ads │ ├── otm8009a │ │ ├── otm8009a.adb │ │ └── otm8009a.ads │ ├── pcd8544 │ │ ├── pcd8544.adb │ │ ├── pcd8544.ads │ │ └── pcd8544_reg.ads │ └── ssd1306 │ │ ├── ssd1306-standard_resolutions.ads │ │ ├── ssd1306.adb │ │ └── ssd1306.ads │ └── touch_panel │ ├── ft5336 │ ├── ft5336.adb │ └── ft5336.ads │ ├── ft6x06 │ ├── ft6x06.adb │ └── ft6x06.ads │ ├── stmpe811 │ ├── stmpe811.adb │ └── stmpe811.ads │ └── xpt2046 │ ├── README.md │ ├── xpt2046-temperature.adb │ ├── xpt2046.adb │ └── xpt2046.ads ├── docs ├── Ada_Drivers_Library-vs-bb_runtimes.md ├── design.md ├── filesystem.md ├── how_to_create_my_own_adl_project.md └── porting_to_a_new_platform.md ├── examples ├── .gitignore ├── HiFive1 │ ├── README.md │ ├── hifive1_example.gpr │ └── src │ │ └── main.adb ├── HiFive1_rev_B │ ├── README.md │ ├── hifive1_rev_B_example.gpr │ └── src │ │ └── main.adb ├── MicroBit │ ├── BLE_beacon │ │ ├── BLE_beacon.gpr │ │ └── src │ │ │ ├── beacon.adb │ │ │ ├── beacon.ads │ │ │ └── main.adb │ ├── README.md │ ├── accelerometer │ │ ├── README.md │ │ ├── accelerometer.gpr │ │ └── src │ │ │ └── main.adb │ ├── analog_in │ │ ├── README.md │ │ ├── analog_in.gpr │ │ └── src │ │ │ └── main.adb │ ├── analog_out │ │ ├── README.md │ │ ├── analog_out.gpr │ │ └── src │ │ │ └── main.adb │ ├── buttons │ │ ├── README.md │ │ ├── buttons.gpr │ │ └── src │ │ │ └── main.adb │ ├── digital_in │ │ ├── README.md │ │ ├── digital_in.gpr │ │ └── src │ │ │ └── main.adb │ ├── digital_out │ │ ├── README.md │ │ ├── digital_out.gpr │ │ └── src │ │ │ └── main.adb │ ├── doc │ │ └── fritzing_sketches │ │ │ ├── analog_in.fzz │ │ │ ├── analog_out.fzz │ │ │ ├── digital_in.fzz │ │ │ ├── digital_out.fzz │ │ │ ├── music.fzz │ │ │ └── screenshots │ │ │ ├── analog_in.png │ │ │ ├── digital_in.png │ │ │ ├── digital_out.png │ │ │ └── music.png │ ├── follower │ │ ├── README.md │ │ ├── follower.gpr │ │ └── src │ │ │ ├── hmi.adb │ │ │ ├── hmi.ads │ │ │ └── main.adb │ ├── music │ │ ├── README.md │ │ ├── music.gpr │ │ └── src │ │ │ └── main.adb │ ├── neopixel │ │ ├── README.md │ │ ├── neopixel.gpr │ │ └── src │ │ │ ├── led_demo.adb │ │ │ ├── led_demo.ads │ │ │ └── main.adb │ ├── servos │ │ ├── README.md │ │ ├── servos.gpr │ │ └── src │ │ │ └── main.adb │ └── text_scrolling │ │ ├── README.md │ │ ├── src │ │ ├── beacon.adb │ │ ├── beacon.ads │ │ └── main.adb │ │ └── text_scrolling.gpr ├── NRF52_DK │ ├── BLE_beacon │ │ ├── BLE_beacon.gpr │ │ └── src │ │ │ ├── beacon.adb │ │ │ ├── beacon.ads │ │ │ └── main.adb │ ├── README.md │ ├── buttons │ │ ├── README.md │ │ ├── buttons.gpr │ │ └── src │ │ │ └── main.adb │ └── digital_out │ │ ├── README.md │ │ ├── digital_out.gpr │ │ └── src │ │ └── main.adb ├── OpenMV2 │ ├── README.md │ ├── openmv2_example.gpr │ └── src │ │ ├── last_chance_handler.adb │ │ ├── last_chance_handler.ads │ │ └── main.adb ├── README.md ├── STM32F429_Discovery │ ├── README.md │ ├── blinky_f429disco.gpr │ ├── dma2d_stm32f429disco.gpr │ ├── draw_stm32f429disco.gpr │ ├── hm11_f429disco.gpr │ ├── nrf24l01p_f429disco.gpr │ └── serial_ports_f429disco.gpr ├── STM32F469_Discovery │ ├── README.md │ ├── dma2d_stm32f469disco.gpr │ ├── draw_stm32f469disco.gpr │ └── hello_world_tasking_f469disco.gpr ├── STM32F4_DISCO │ ├── README.md │ ├── accelerometer │ │ ├── accelerometer.gpr │ │ └── src │ │ │ └── main.adb │ ├── blinky_f4disco.gpr │ ├── filesystem │ │ ├── README.md │ │ ├── filesystem.gpr │ │ └── src │ │ │ └── main.adb │ ├── serial_ports_f4disco.gpr │ └── simple_audio │ │ ├── simple_audio.gpr │ │ └── src │ │ ├── audio_stream.adb │ │ ├── audio_stream.ads │ │ └── main.adb ├── STM32F746_Discovery │ ├── README.md │ ├── blinky_f7disco.gpr │ ├── dma2d_stm32f746disco.gpr │ └── draw_stm32f746disco.gpr ├── STM32F769_Discovery │ ├── README.md │ ├── dma2d_stm32f769disco.gpr │ └── draw_stm32f769disco.gpr ├── Unleashed │ └── blinky │ │ ├── src │ │ └── main.adb │ │ └── unleashed_blinky.gpr ├── feather_stm32f405 │ ├── blinky │ │ ├── blinky.gpr │ │ └── src │ │ │ └── main.adb │ └── charlie_wing │ │ ├── charlie_wing.gpr │ │ └── src │ │ └── main.adb ├── nucleo_f446ze │ └── blinky_f446ze.gpr ├── shared │ ├── README.md │ ├── common │ │ ├── common.gpr │ │ ├── gui │ │ │ ├── bitmapped_drawing.adb │ │ │ ├── bitmapped_drawing.ads │ │ │ ├── bmp_fonts.adb │ │ │ ├── bmp_fonts.ads │ │ │ ├── hershey_fonts-futural.ads │ │ │ ├── hershey_fonts.adb │ │ │ ├── hershey_fonts.ads │ │ │ ├── lcd_std_out.adb │ │ │ ├── lcd_std_out.ads │ │ │ ├── screen_interface.adb │ │ │ └── screen_interface.ads │ │ ├── lch_full │ │ │ ├── last_chance_handler.ads │ │ │ ├── lcd │ │ │ │ └── last_chance_handler.adb │ │ │ └── led │ │ │ │ └── last_chance_handler.adb │ │ └── lch_sfp │ │ │ ├── last_chance_handler.ads │ │ │ ├── lcd │ │ │ └── last_chance_handler.adb │ │ │ └── led │ │ │ └── last_chance_handler.adb │ ├── draw │ │ └── src │ │ │ └── draw.adb │ ├── hello_world_blinky │ │ ├── .gdbinit │ │ ├── readme.md │ │ └── src │ │ │ └── blinky.adb │ ├── hello_world_tasking │ │ ├── .gdbinit │ │ ├── gnat.adc │ │ ├── readme.md │ │ └── src │ │ │ ├── driver.adb │ │ │ ├── driver.ads │ │ │ └── hello_world.adb │ ├── hm11 │ │ ├── .gdbinit │ │ ├── README.md │ │ └── src │ │ │ ├── drivers.adb │ │ │ ├── drivers.ads │ │ │ └── hm11_example.adb │ ├── nrf24l01p │ │ ├── .gdbinit │ │ ├── README.md │ │ └── src │ │ │ ├── nrf24l01p_example.adb │ │ │ ├── watchdogs.adb │ │ │ └── watchdogs.ads │ ├── serial_ports │ │ ├── .gdbinit │ │ ├── README.md │ │ ├── gnat.adc │ │ ├── host_app │ │ │ ├── build_host_app.gpr │ │ │ └── host.adb │ │ └── src │ │ │ ├── demo_serial_port_blocking.adb │ │ │ ├── demo_serial_port_nonblocking.adb │ │ │ ├── demo_serial_port_streaming.adb │ │ │ ├── message_buffers.adb │ │ │ ├── message_buffers.ads │ │ │ ├── peripherals_blocking.ads │ │ │ ├── peripherals_nonblocking.ads │ │ │ ├── peripherals_streaming.ads │ │ │ ├── serial_io-blocking.adb │ │ │ ├── serial_io-blocking.ads │ │ │ ├── serial_io-nonblocking.adb │ │ │ ├── serial_io-nonblocking.ads │ │ │ ├── serial_io-streaming.adb │ │ │ ├── serial_io-streaming.ads │ │ │ ├── serial_io.adb │ │ │ └── serial_io.ads │ └── stm32_dma2d │ │ └── src │ │ └── dma2d.adb ├── stm32_f4ve │ ├── README.md │ ├── blinky_stm32_f4ve.gpr │ ├── draw │ │ ├── README.md │ │ ├── draw.adb │ │ └── draw.gpr │ ├── lcd │ │ ├── README.md │ │ ├── lcd.gpr │ │ └── main.adb │ └── lcd_spi │ │ ├── README.md │ │ ├── lcd_spi.gpr │ │ ├── main.adb │ │ ├── spi │ │ ├── display_ili9341.adb │ │ └── display_ili9341.ads │ │ └── stm32_f4ve_full_spi.gpr ├── stm32_h405 │ ├── blinky │ │ ├── blinky.gpr │ │ └── src │ │ │ └── main.adb │ └── lcd_test │ │ ├── lcd_test.gpr │ │ └── src │ │ └── lcd_test.adb └── stm32f4xx_m │ ├── README.md │ ├── blinky │ ├── blinky.gpr │ └── src │ │ └── main.adb │ ├── flash │ ├── README.md │ ├── flash.gpr │ └── src │ │ └── main.adb │ ├── sdcard_fs │ ├── README.md │ ├── sdcard_fs.gpr │ └── src │ │ └── main.adb │ └── sdcard_raw_io │ ├── README.md │ ├── sdcard_raw_io.gpr │ └── src │ └── main.adb ├── hal └── src │ ├── hal-audio.ads │ ├── hal-bitmap.ads │ ├── hal-block_drivers.ads │ ├── hal-dsi.ads │ ├── hal-filesystem.ads │ ├── hal-flash.ads │ ├── hal-framebuffer.ads │ ├── hal-gpio.ads │ ├── hal-i2c.ads │ ├── hal-real_time_clock.ads │ ├── hal-sdmmc.adb │ ├── hal-sdmmc.ads │ ├── hal-spi.ads │ ├── hal-time.ads │ ├── hal-touch_panel.ads │ ├── hal-uart.ads │ └── hal.ads ├── middleware └── src │ ├── BLE │ ├── bluetooth_low_energy-beacon.adb │ ├── bluetooth_low_energy-beacon.ads │ ├── bluetooth_low_energy-packets.adb │ ├── bluetooth_low_energy-packets.ads │ ├── bluetooth_low_energy.adb │ └── bluetooth_low_energy.ads │ ├── audio │ ├── simple_synthesizer.adb │ └── simple_synthesizer.ads │ ├── bitmap │ ├── bitmap_color_conversion.adb │ ├── bitmap_color_conversion.ads │ ├── bitmap_file_output.adb │ ├── bitmap_file_output.ads │ ├── memory_mapped_bitmap.adb │ ├── memory_mapped_bitmap.ads │ ├── soft_drawing_bitmap.adb │ └── soft_drawing_bitmap.ads │ ├── command_line │ ├── command_line-filesystem-cat.adb │ ├── command_line-filesystem-cat.ads │ ├── command_line-filesystem-list_directory.adb │ ├── command_line-filesystem-list_directory.ads │ ├── command_line-filesystem-remove_directory.adb │ ├── command_line-filesystem-remove_directory.ads │ ├── command_line-filesystem-touch.adb │ ├── command_line-filesystem-touch.ads │ ├── command_line-filesystem.adb │ ├── command_line-filesystem.ads │ ├── command_line.adb │ └── command_line.ads │ ├── filesystem │ ├── file_io.adb │ ├── file_io.ads │ ├── filesystem-fat-directories.adb │ ├── filesystem-fat-directories.ads │ ├── filesystem-fat-files.adb │ ├── filesystem-fat-files.ads │ ├── filesystem-fat.adb │ ├── filesystem-fat.ads │ ├── filesystem-mbr.adb │ ├── filesystem-mbr.ads │ ├── filesystem.ads │ ├── partitions.adb │ ├── partitions.ads │ ├── pathname_manipulation.adb │ └── pathname_manipulation.ads │ ├── monitor │ ├── monitor-block_drivers.adb │ ├── monitor-block_drivers.ads │ └── monitor.ads │ ├── neopixel │ ├── neopixel.adb │ └── neopixel.ads │ ├── ravenscar-common │ ├── ravenscar_time.adb │ └── ravenscar_time.ads │ ├── sdmmc │ ├── sdmmc_init.adb │ └── sdmmc_init.ads │ └── utils │ ├── file_block_drivers.adb │ ├── file_block_drivers.ads │ ├── hex_dump.adb │ ├── hex_dump.ads │ ├── logging.adb │ ├── logging.ads │ ├── logging_with_categories.adb │ ├── logging_with_categories.ads │ ├── logging_with_priority.adb │ └── logging_with_priority.ads ├── scripts ├── build_all_examples.py ├── check_readme.py ├── config │ ├── __init__.py │ ├── archs.py │ ├── boards.py │ ├── devices.py │ ├── peripherals.py │ ├── user_input │ │ ├── __init__.py │ │ └── console.py │ └── validation.py └── project_wizard.py └── testsuite ├── .gitignore ├── README.md ├── run.py ├── tests ├── bitmap_drawing │ ├── ref.bmp │ ├── src │ │ └── tc_bitmap_drawing.adb │ ├── tc.gpr │ └── tc_bitmap_drawing.out ├── command_line │ ├── src │ │ ├── tc_cmd_builtins.adb │ │ └── tc_cmd_filesystem.adb │ ├── tc.gpr │ ├── tc_cmd_builtins.out │ ├── tc_cmd_filesystem.out │ └── test_material │ │ ├── sub1 │ │ └── test.txt │ │ ├── sub2 │ │ ├── sub2-1 │ │ │ └── test.txt │ │ └── test.txt │ │ └── test.txt ├── disk_partitions │ ├── disk_8_partitions.img │ ├── src │ │ └── tc_read_partitions.adb │ ├── tc.gpr │ └── tc_read_partitions.out ├── fat_driver │ ├── create_disk_image.sh │ ├── fat.fs │ ├── src │ │ ├── tc_fat_read.adb │ │ └── tc_fat_write.adb │ ├── tc.gpr │ ├── tc_fat_read.out │ └── tc_fat_write.out ├── hexdump │ ├── src │ │ └── tc_hexdump.adb │ ├── tc.gpr │ └── tc_hexdump.out ├── logging │ ├── src │ │ ├── tc_log_filtering.adb │ │ ├── tc_log_prio_and_cat.adb │ │ └── tc_log_priorities.adb │ ├── tc.gpr │ ├── tc_log_filtering.out │ ├── tc_log_prio_and_cat.out │ └── tc_log_priorities.out ├── monitors │ ├── src │ │ ├── dummy_block_driver.adb │ │ ├── dummy_block_driver.ads │ │ └── tc_block_driver.adb │ ├── tc.gpr │ └── tc_block_driver.out └── wire_simulation │ ├── src │ └── tc_virtual_wire.adb │ ├── tc.gpr │ └── tc_virtual_wire.out └── utils ├── src ├── compare_files.adb ├── compare_files.ads ├── test_directories.adb ├── test_directories.ads ├── wire_simulation.adb └── wire_simulation.ads └── test_utils.gpr /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text eol=lf 3 | 4 | # Declare files that will always have LF line endings on checkout. 5 | *.adb text eol=lf 6 | *.adc text eol=lf 7 | *.ads text eol=lf 8 | *.gpr text eol=lf 9 | 10 | # Denote all files that are truly binary and should not be modified. 11 | *.png binary 12 | *.jpg binary 13 | *.bmp binary 14 | *.fs binary 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.db 2 | *.ali 3 | *.o 4 | *.a 5 | *.xml 6 | *.cgpr 7 | *.bexch 8 | *.lexch 9 | *.ci 10 | *.cswi 11 | *.stderr 12 | *.stdout 13 | *~ 14 | *.pyc 15 | obj/ 16 | lib/ 17 | 18 | examples/HiFive1/zfp-hifive1/ 19 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdaCore/Ada_Drivers_Library/8a62be90b9ef13042ce9dbf2112f453fb6dec777/.gitmodules -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing to Ada_Drivers_Library 2 | =================================== 3 | 4 | Thank you for taking the time to contribute! 5 | 6 | If this is your first contribution, we invite you to read our [list of 7 | guidelines](https://github.com/AdaCore/contributing-howto), common to all 8 | AdaCore repositories. 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2015-2016, AdaCore 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the copyright holder nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /arch/ARM/STM32/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | *.lexch 4 | gnatinspect.* 5 | *~ 6 | -------------------------------------------------------------------------------- /arch/ARM/STM32/README.md: -------------------------------------------------------------------------------- 1 | These projects represent general MCU devices, such as a platform based on an 2 | STM32F405. 3 | 4 | Use one of these project if that is the kind of hardware your target is based 5 | upon. For example, the Crazyflie 2.0 uses an STM32F405, so project 6 | stm32f40x.gpr would be appropriate. 7 | 8 | Note that if you are using one of the `*_Discovery` boards, there are projects 9 | available in the boards directory at the root of this repository. The 10 | corresponding project would be appropriate since it includes the additional 11 | hardware specific to the board. With that approach the additional hardware 12 | specific to that board will available, such as the user buttons and LEDs. 13 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_L3GD20_dataready_int/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_L3GD20_dataready_int/demo_l3gd20_dataready_int.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f429_discovery/stm32f429_discovery_full.gpr"; 2 | 3 | project Demo_L3GD20_Dataready_Int extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Main use ("demo_l3gd20.adb"); 6 | 7 | for Languages use ("Ada"); 8 | for Source_Dirs use ("src"); 9 | for Object_Dir use "obj/" & STM32F429_Discovery_Full.Build; 10 | for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); 11 | for Create_Missing_Dirs use "true"; 12 | 13 | package Builder is 14 | for Global_Configuration_Pragmas use "gnat.adc"; 15 | end Builder; 16 | 17 | package Compiler renames STM32F429_Discovery_Full.Compiler; 18 | 19 | end Demo_L3GD20_Dataready_Int; 20 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_L3GD20_dataready_int/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_L3GD20_dataready_int/readme.md: -------------------------------------------------------------------------------- 1 | This program demonstrates use of the L3GD20 gyroscope, provided as a 2 | separate component (external to the MCU) by some of the STM Discovery 3 | boards. 4 | 5 | The pitch, roll, and yaw values are continuously displayed on the LCD, 6 | as are the adjusted raw values. Move the board to see them change. The 7 | values will be positive or negative, depending on the direction of 8 | movement. Note that the values are not constant, even when the board is 9 | not moving, due to noise. 10 | 11 | This program demonstrates use of interrupts rather than polling. 12 | 13 | Note that you will need to set the RTS scenario variable to "ravenscar-full" 14 | because the demo code uses the floating point image attribute. -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_L3GD20_fifo_int/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_L3GD20_fifo_int/demo_l3gd20_fifo_int.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f429_discovery/stm32f429_discovery_full.gpr"; 2 | 3 | project Demo_L3GD20_FIFO_Int extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Main use ("demo_l3gd20.adb"); 6 | for Languages use ("Ada"); 7 | for Source_Dirs use ("src"); 8 | for Object_Dir use "obj/" & STM32F429_Discovery_Full.Build; 9 | for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); 10 | for Create_Missing_Dirs use "true"; 11 | 12 | package Builder is 13 | for Global_Configuration_Pragmas use "gnat.adc"; 14 | end Builder; 15 | 16 | package Compiler renames STM32F429_Discovery_Full.Compiler; 17 | 18 | end Demo_L3GD20_FIFO_Int; 19 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_L3GD20_fifo_int/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_L3GD20_fifo_int/readme.md: -------------------------------------------------------------------------------- 1 | This program demonstrates use of the L3GD20 gyroscope, provided as a 2 | separate component (external to the MCU) by some of the STM Discovery boards. 3 | 4 | This program demonstrates use of the gyro's on-board FIFO, driven by an 5 | interrupt signalling that the FIFO is partially full. In particular, the 6 | gyro generates an interrupt when the FIFO has at least the number of 7 | entries specified by a "watermark" configured by the main program. The 8 | FIFO contains at least that many sets of raw values for the three X, Y, 9 | and Z axes. We read all those actually in the FIFO, even if greater than 10 | the number specified by the watermark. We then average them into one set 11 | of three axis readings, and use that for further processing. In 12 | particular, on each iteration we subtract the stable bias offset from 13 | each axis value and scale by the selected sensitivity. The adjusted and 14 | scaled values are displayed on each iteration. The stable bias offsets 15 | are also displayed, initially (not iteratively since they are not 16 | recomputed). 17 | 18 | Note that you will need to set the RTS scenario variable to "ravenscar-full" 19 | because the demo code uses the floating point image attribute. -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_L3GD20_polling/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_L3GD20_polling/demo_l3gd20.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f429_discovery/stm32f429_discovery_full.gpr"; 2 | 3 | project Demo_L3GD20 extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Source_Dirs use ("src"); for Target use "arm-eabi"; 6 | for Main use ("demo_l3gd20.adb"); 7 | for Languages use ("Ada"); 8 | for Object_Dir use "obj/" & STM32F429_Discovery_Full.Build; 9 | for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); 10 | for Create_Missing_Dirs use "true"; 11 | 12 | package Builder is 13 | for Global_Configuration_Pragmas use "gnat.adc"; 14 | end Builder; 15 | 16 | package Compiler renames STM32F429_Discovery_Full.Compiler; 17 | 18 | end Demo_L3GD20; 19 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_L3GD20_polling/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_L3GD20_polling/readme.md: -------------------------------------------------------------------------------- 1 | This program demonstrates use of the L3GD20 gyroscope, provided as a 2 | separate component (external to the MCU) by some of the STM Discovery boards. 3 | 4 | The pitch, roll, and yaw values are continuously displayed on the LCD, 5 | as are the adjusted raw values. Move the board to see them change. The 6 | values will be positive or negative, depending on the direction of 7 | movement. Note that the values are not constant, even when the board is 8 | not moving, due to noise. 9 | 10 | Polling is used to determine when gyro data are available. 11 | 12 | Note that you will need to set the RTS scenario variable to "ravenscar-full" 13 | because the demo code uses the floating point image attribute. -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_LIS3DSH_pwm/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_LIS3DSH_pwm/demo_lis3dsh_pwm.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f407_discovery/stm32f407_discovery_full.gpr"; 2 | 3 | project Demo_LIS3DSH_PWM extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Languages use ("Ada"); 6 | for Main use ("demo_lis3dsh_pwm.adb"); 7 | for Source_Dirs use ("src"); 8 | for Object_Dir use "obj/" & STM32F407_Discovery_Full.Build; 9 | for Runtime ("Ada") use STM32F407_Discovery_Full'Runtime("Ada"); 10 | for Create_Missing_Dirs use "true"; 11 | 12 | package Builder is 13 | for Global_Configuration_Pragmas use "gnat.adc"; 14 | end Builder; 15 | 16 | package Compiler renames STM32F407_Discovery_Full.Compiler; 17 | 18 | end Demo_LIS3DSH_PWM; 19 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_LIS3DSH_pwm/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_LIS3DSH_pwm/readme.md: -------------------------------------------------------------------------------- 1 | This program demonstrates use of the LIS3DSH accelerometer and a timer to 2 | drive the brightness of the LEDs. 3 | 4 | Note that this demonstration program is specific to the STM32F4 Discovery 5 | boards because it references the specific accelerometer used on (later 6 | versions of) those boards and because it references the four user LEDs 7 | on those boards. (The LIS3DSH accelerometer is used on board versions 8 | designated by the number MB997C printed on the top of the board.) 9 | 10 | The idea is that the person holding the board will "pitch" it up and down 11 | and "roll" it left and right around the Z axis running through the center 12 | of the chip. As the board is moved, the brightness of the four LEDs 13 | surrounding the accelerometer will vary with the accelerations experienced 14 | by the board. In particular, as the angles increase the LEDs corresponding 15 | to those sides of the board will become brighter. The LEDs will thus become 16 | brightest as the board is held with any one side down, pointing toward the 17 | ground. 18 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_LIS3DSH_tilt/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_LIS3DSH_tilt/demo_lis3dsh_tilt.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f407_discovery/stm32f407_discovery_full.gpr"; 2 | 3 | project Demo_LIS3DSH_Tilt extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Languages use ("Ada"); 6 | for Main use ("demo_lis3dsh_tilt.adb"); 7 | for Source_Dirs use ("src"); 8 | for Object_Dir use "obj/" & STM32F407_Discovery_Full.Build; 9 | for Runtime ("Ada") use STM32F407_Discovery_Full'Runtime("Ada"); 10 | for Create_Missing_Dirs use "true"; 11 | 12 | package Builder is 13 | for Global_Configuration_Pragmas use "gnat.adc"; 14 | end Builder; 15 | 16 | package Compiler renames STM32F407_Discovery_Full.Compiler; 17 | 18 | end Demo_LIS3DSH_Tilt; 19 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_LIS3DSH_tilt/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_LIS3DSH_tilt/readme.md: -------------------------------------------------------------------------------- 1 | This program demonstrates basic use of the LIS3DSH accelerometer chip. 2 | (The LIS3DSH is used on later versions of the STM32F4 Discovery boards, 3 | designated by the number MB997C printed on the top of the board.) 4 | 5 | The LEDs surrounding the accelerometer will come on and off as the board 6 | is moved, reflecting the directions of the accelerations measured by the 7 | device. As the board is moved off of level the LEDs will flash on and off 8 | accordingly. 9 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_adc_dma/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_adc_dma/demo_adc_dma.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f429_discovery/stm32f429_discovery_full.gpr"; 2 | 3 | project Demo_ADC_DMA extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Main use ("demo_adc_vbat_dma"); 6 | for Languages use ("Ada"); 7 | for Source_Dirs use ("src"); 8 | for Object_Dir use "obj/" & STM32F429_Discovery_Full.Build; 9 | for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); 10 | for Create_Missing_Dirs use "true"; 11 | 12 | package Builder is 13 | for Global_Configuration_Pragmas use "gnat.adc"; 14 | end Builder; 15 | 16 | package Compiler renames STM32F429_Discovery_Full.Compiler; 17 | 18 | end Demo_ADC_DMA; 19 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_adc_dma/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_adc_dma/readme.md: -------------------------------------------------------------------------------- 1 | This program demonstrates reading the VBat (battery voltage) value from 2 | an ADC unit, using DMA. 3 | 4 | Note that you may need to enable optimization (see the scenario variable) for 5 | proper execution. 6 | 7 | This program is expected to run on the STM32F429 Discovery boards because 8 | it uses the LCD to display results. This display usage is entirely for 9 | convenience -- some other means for showing the results could be used, such 10 | as a serial port, or some other board with a different display. 11 | 12 | Both raw (sensed) and scaled values are continuously displayed. 13 | 14 | Note that you will very likely need to reset the board manually for proper 15 | execution. -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_adc_interrupts/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_adc_interrupts/demo_adc_interrupts.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f429_discovery/stm32f429_discovery_full.gpr"; 2 | 3 | project Demo_ADC_Interrupts extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Main use ("demo_adc_vbat_interrupts"); 6 | 7 | for Languages use ("Ada"); 8 | for Source_Dirs use ("src"); 9 | for Object_Dir use "obj/" & STM32F429_Discovery_Full.Build; 10 | for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); 11 | for Create_Missing_Dirs use "true"; 12 | 13 | package Builder is 14 | for Global_Configuration_Pragmas use "gnat.adc"; 15 | end Builder; 16 | 17 | package Compiler renames STM32F429_Discovery_Full.Compiler; 18 | 19 | end Demo_ADC_Interrupts; 20 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_adc_interrupts/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_adc_interrupts/readme.md: -------------------------------------------------------------------------------- 1 | This program demonstrates reading the VBat (battery voltage) value from 2 | an ADC unit, using interrupts. 3 | 4 | This program is expected to run on the STM32F429 Discovery boards because 5 | it uses the LCD to display results. This display usage is entirely for 6 | convenience -- some other means for showing the results could be used, such 7 | as a serial port, or some other board with a different display. 8 | 9 | Both raw (sensed) and scaled values are continuously displayed. -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_adc_polling/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_adc_polling/demo_adc_polling.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f429_discovery/stm32f429_discovery_full.gpr"; 2 | 3 | project Demo_ADC_Polling extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Main use ("demo_adc_temperature_polling", 6 | "demo_adc_vref_polling", 7 | "demo_adc_vbat_polling", 8 | "demo_adc_gpio_polling"); 9 | 10 | for Languages use ("Ada"); 11 | for Source_Dirs use ("src"); 12 | for Object_Dir use "obj/" & STM32F429_Discovery_Full.Build; 13 | for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); 14 | for Create_Missing_Dirs use "true"; 15 | 16 | package Builder is 17 | for Global_Configuration_Pragmas use "gnat.adc"; 18 | end Builder; 19 | 20 | package Compiler renames STM32F429_Discovery_Full.Compiler; 21 | 22 | end Demo_ADC_Polling; 23 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_adc_polling/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_adc_timer_dma/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_adc_timer_dma/demo_adc_timer_dma.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f429_discovery/stm32f429_discovery_full.gpr"; 2 | 3 | project Demo_ADC_Timer_DMA extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Main use ("demo_adc_timer_dma"); 6 | 7 | for Languages use ("Ada"); 8 | for Source_Dirs use ("src"); 9 | for Object_Dir use "obj/" & STM32F429_Discovery_Full.Build; 10 | for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); 11 | for Create_Missing_Dirs use "true"; 12 | 13 | package Builder is 14 | for Global_Configuration_Pragmas use "gnat.adc"; 15 | end Builder; 16 | 17 | package Compiler renames STM32F429_Discovery_Full.Compiler; 18 | 19 | end Demo_ADC_Timer_DMA; 20 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_adc_timer_dma/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_adc_timer_dma/readme.md: -------------------------------------------------------------------------------- 1 | This program demonstrates reading the VBat (battery voltage) value from 2 | an ADC unit, using a timer to trigger the conversions and DMA to copy the 3 | sampled value from the ADC to the application variable. 4 | 5 | This program is expected to run on the STM32F429 Discovery boards because 6 | it uses the LCD to display results. This display usage is entirely for 7 | convenience -- some other means for showing the results could be used, such 8 | as a serial port, or some other board with a different display. 9 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_adc_timer_triggered/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_adc_timer_triggered/demo_adc_timer_triggered.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f429_discovery/stm32f429_discovery_full.gpr"; 2 | 3 | project Demo_ADC_Timer_Triggered extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Main use ("demo_adc_timer_triggered"); 6 | 7 | for Languages use ("Ada"); 8 | for Source_Dirs use ("src"); 9 | for Object_Dir use "obj/" & STM32F429_Discovery_Full.Build; 10 | for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); 11 | for Create_Missing_Dirs use "true"; 12 | 13 | package Builder is 14 | for Global_Configuration_Pragmas use "gnat.adc"; 15 | end Builder; 16 | 17 | package Compiler renames STM32F429_Discovery_Full.Compiler; 18 | 19 | end Demo_ADC_Timer_Triggered; 20 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_adc_timer_triggered/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_adc_timer_triggered/readme.md: -------------------------------------------------------------------------------- 1 | This program demonstrates reading the VBat (battery voltage) value from 2 | an ADC unit, using a timer to trigger the conversions. 3 | 4 | This program is expected to run on the STM32F429 Discovery boards because 5 | it uses the LCD to display results. This display usage is entirely for 6 | convenience -- some other means for showing the results could be used, such 7 | as a serial port, or some other board with a different display. 8 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_crc/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_crc/demo_crc.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f429_discovery/stm32f429_discovery_full.gpr"; 2 | 3 | project Demo_CRC extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime ("Ada"); 6 | 7 | for Target use "arm-eabi"; 8 | 9 | for Languages use ("Ada"); 10 | 11 | for Source_Dirs use ("src/**"); 12 | 13 | for Object_Dir use "obj"; 14 | 15 | for Create_Missing_Dirs use "True"; 16 | 17 | for Main use ("demo_crc.adb"); 18 | 19 | package Compiler renames STM32F429_Discovery_Full.Compiler; 20 | 21 | end Demo_CRC; 22 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_crc/gnat.adc: -------------------------------------------------------------------------------- 1 | -- pragma Profile (GNAT_Extended_Ravenscar); 2 | 3 | pragma Partition_Elaboration_Policy (Sequential); 4 | 5 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_crc/readme.md: -------------------------------------------------------------------------------- 1 | This program demonstrates use of the CRC processor on STM32F4x MCUs. (The 2 | STM32F3 MCUs, among others, have additional CRC capabilities.) 3 | 4 | The checksum for a given block of 32-bit words is calculated two ways and 5 | then compared. 6 | 7 | The checksum is first computed on the data block by calling a routine that 8 | transfers the block content to the CRC processor in a loop, which is to say 9 | that the CPU does the transfer. In the second approach, DMA is used to transfer 10 | the data block to the CRC processor. Obviously for a large data block, this 11 | second approach is far quicker. 12 | 13 | This program is expected to run on the STM32F429 Discovery boards because 14 | it uses the LCD to display results. This display usage is entirely for 15 | convenience -- some other means for showing the results could be used, such 16 | as a serial port, or some other board with a different display. 17 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_dac_basic/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_dac_basic/demo_dac_basic.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f429_discovery/stm32f429_discovery_full.gpr"; 2 | 3 | project Demo_DAC_Basic extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Main use ("demo_dac_basic.adb"); 6 | for Languages use ("Ada"); 7 | for Source_Dirs use ("src"); 8 | for Object_Dir use "obj/" & STM32F429_Discovery_Full.Build; 9 | for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); 10 | for Create_Missing_Dirs use "true"; 11 | 12 | package Builder is 13 | for Global_Configuration_Pragmas use "gnat.adc"; 14 | end Builder; 15 | 16 | package Compiler renames STM32F429_Discovery_Full.Compiler; 17 | 18 | end Demo_DAC_Basic; 19 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_dac_basic/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_dac_basic/readme.md: -------------------------------------------------------------------------------- 1 | This program demonstrates basic DAC use, using explicit calls to control 2 | the output value and conversion starting/stopping. 3 | 4 | The user increments the percentage of the DAC output (VRef+) voltage using 5 | the blue User button on the board (e.g., a STM32F429 Discovery board). 6 | The current percentage is displayed on the LCD. When incremented, the 7 | new percentage is converted into an absolute value based on the selected 8 | resolution. For example, a digital value of 2048 represents 50% in 12-bit 9 | resolution. 10 | 11 | Attach a voltmeter to PA4 (or PA5 if channel 2 is used) to see the voltage 12 | change as a result of pushing the blue button. -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_dac_dma/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_dac_dma/demo_dac_dma.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f429_discovery/stm32f429_discovery_full.gpr"; 2 | 3 | project Demo_DAC_DMA extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Main use ("demo_dac_dma"); 6 | for Languages use ("Ada"); 7 | for Source_Dirs use ("src"); 8 | for Object_Dir use "obj/" & STM32F429_Discovery_Full.Build; 9 | for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); 10 | for Create_Missing_Dirs use "true"; 11 | 12 | package Builder is 13 | for Global_Configuration_Pragmas use "gnat.adc"; 14 | end Builder; 15 | 16 | package Compiler renames STM32F429_Discovery_Full.Compiler; 17 | 18 | end Demo_DAC_DMA; 19 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_dac_dma/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_dac_dma/readme.md: -------------------------------------------------------------------------------- 1 | This program demonstrates digital-to-analog conversion (DAC) output using 2 | DMA driven by a timer for the DAC input. 3 | 4 | The user increments the percentage of the DAC output (VRef+) voltage 5 | using the blue User button on the board (e.g., a STM32F429 Discovery 6 | board). The current percentage is displayed on the LCD. The percentage 7 | is converted into an absolute value based on the selected resolution. 8 | For example, a digital value of 2048 represents 50% in 12-bit 9 | resolution. The DMA controller periodically transfers this digital value 10 | to the DAC, driven by a timer. The DAC continuously converts this 11 | digital value to an analog voltage. 12 | 13 | Attach a voltmeter to PA4 (or PA5 if channel 2 is used) to see the voltage 14 | changes. -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_dma_mem_to_mem/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_dma_mem_to_mem/demo_dma_mem_to_mem.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f407_discovery/stm32f407_discovery_full.gpr"; 2 | 3 | project Demo_DMA_Mem_to_Mem extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Main use ("demo_dma_interrupts.adb", "demo_dma_polling.adb"); 6 | for Languages use ("Ada"); 7 | for Source_Dirs use ("src"); 8 | for Object_Dir use "obj/" & STM32F407_Discovery_Full.Build; 9 | for Runtime ("Ada") use STM32F407_Discovery_Full'Runtime("Ada"); 10 | for Create_Missing_Dirs use "true"; 11 | 12 | package Builder is 13 | for Global_Configuration_Pragmas use "gnat.adc"; 14 | end Builder; 15 | 16 | package Compiler renames STM32F407_Discovery_Full.Compiler; 17 | 18 | end Demo_DMA_Mem_to_Mem; 19 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_dma_mem_to_mem/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_dma_mem_to_mem/readme.md: -------------------------------------------------------------------------------- 1 | This demonstration illustrates using the DMA controller to send a block 2 | of data from memory to memory. 3 | 4 | There are two versions of the demonstration, therefore two main 5 | programs. In both cases the data are copied (via DMA) only once. The 6 | program simply verifies that the destination value is identical to the 7 | source value. 8 | 9 | One program ("demo_dma_polling.adb") uses polling to determine when the 10 | DMA transfer is complete. The other program ("demo_dma_interrupts.adb") 11 | uses interrupts. 12 | 13 | In both programs the green LED will blink rapidly (permanently) if there 14 | is an error indicated by the DMA controller. Otherwise, If the copied 15 | data values are identical to the source values then the green LED will 16 | be on steadily, otherwise the red LED will be on. 17 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_dma_mem_to_peripheral/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_dma_mem_to_peripheral/README.md: -------------------------------------------------------------------------------- 1 | This program demonstrates using the DMA controller to send data from 2 | memory to a peripheral. 3 | 4 | Specifically, it uses DMA to send a block of characters to a USART. The 5 | characters are sent continuously as long as the program executes. 6 | 7 | Note that all the LEDs flash initially, before any characters are sent, 8 | as a confirmation of overall execution. 9 | 10 | You need a way to connect the GPIO pins on the target board to a serial port on 11 | your host computer. 12 | 13 | You can use a USB cable specifically designed to appear as a serial port. 14 | For example, one among many such cables is the following: 15 | 16 | * Mouser Part No: 895-TTL-232R-5V 17 | * Manufacturer Part No: TTL-232R-5V 18 | * Manufacturer: FTDI 19 | * Description: USB Cables / IEEE 1394 Cables USB Embedded Serial Conv 5V 0.1" Header 20 | 21 | The end of the cable is a female header, described in the datasheet 22 | (`DS_TTL-232R_CABLES-217672.pdf`). See pages 10 and 11 in particular. 23 | 24 | Using male-to-female connector wires, connect the following on the STM32F4: 25 | 26 | * header pin 1, the black wire's header slot, to a ground pin on the board 27 | * header pin 4, the orange wire's header slot, to **PA3** 28 | * header pin 5, the yellow wire's header slot, to **PA2** 29 | 30 | Header pin 4 on the cable is TXD, the transmit data output. 31 | Header pin 5 on the cable is RXD, the receive data input. 32 | See table 4.1 on page 11 of the datasheet for all the pins. 33 | 34 | On the host, just plug in the USB-to-serial cable. 35 | 36 | We use an app named HyperSerialPort on the host. Once the cable is connected it 37 | will appear like a COM port so use the "Refresh" button in the Settings dialog 38 | to find the port represented by the cable. 39 | 40 | The USART is set to: 115_200, N81, no flow control so change the app's connection 41 | accordingly. 42 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_dma_mem_to_peripheral/demo_usart_dma_continuous.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f407_discovery/stm32f407_discovery_full.gpr"; 2 | 3 | project Demo_USART_DMA_Continuous extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Main use ("demo_usart_dma_continuous.adb"); 6 | for Languages use ("Ada"); 7 | for Source_Dirs use ("src"); 8 | for Object_Dir use "obj/" & STM32F407_Discovery_Full.Build; 9 | for Runtime ("Ada") use STM32F407_Discovery_Full'Runtime("Ada"); 10 | for Create_Missing_Dirs use "true"; 11 | 12 | package Builder is 13 | for Global_Configuration_Pragmas use "gnat.adc"; 14 | end Builder; 15 | 16 | package Compiler renames STM32F407_Discovery_Full.Compiler; 17 | 18 | end Demo_USART_DMA_Continuous; 19 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_dma_mem_to_peripheral/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_dma_mem_to_peripheral_pwm/README.md: -------------------------------------------------------------------------------- 1 | This program demonstrates using the DMA controller to send data from 2 | memory to a peripheral. 3 | 4 | Specifically, it uses DMA to send a duty cycles values to the Timer (PWM). 5 | 6 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_dma_mem_to_peripheral_pwm/demo_pwm_dma_continuous.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f4xx_m/stm32f4xx_m_full.gpr"; 2 | 3 | project Demo_PWM_DMA_Continuous extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Main use ("demo_pwm_dma_continuous.adb"); 6 | for Languages use ("Ada"); 7 | for Source_Dirs use ("src"); 8 | for Object_Dir use "obj/" & STM32F4XX_M_Full.Build; 9 | for Runtime ("Ada") use STM32F4XX_M_Full'Runtime("Ada"); 10 | for Create_Missing_Dirs use "true"; 11 | 12 | package Builder is 13 | for Global_Configuration_Pragmas use "gnat.adc"; 14 | end Builder; 15 | 16 | package Compiler renames STM32F4XX_M_Full.Compiler; 17 | 18 | end Demo_PWM_DMA_Continuous; 19 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_dma_mem_to_peripheral_pwm/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_gpio_direct_leds/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_gpio_direct_leds/README.md: -------------------------------------------------------------------------------- 1 | This program demonstrates using the GPIO driver and interrupt 2 | configuration to blink the four LEDs on the STM32F4 Discovery board. 3 | 4 | The LEDs blink in a circular pattern, initially rotating clockwise. When 5 | the blue user button is pressed the rotation direction changes. Button 6 | presses generate interrupts that signal state changes that can then be 7 | queried by application code. 8 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_gpio_direct_leds/demo_gpio.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f407_discovery/stm32f407_discovery_full.gpr"; 2 | 3 | project Demo_GPIO extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Languages use ("Ada"); 6 | 7 | for Main use ("demo_gpio"); 8 | 9 | for Source_Dirs use ("src"); 10 | 11 | for Object_Dir use "obj/" & STM32F407_Discovery_Full.Build; 12 | 13 | for Runtime ("Ada") use STM32F407_Discovery_Full'Runtime("Ada"); 14 | 15 | for Create_Missing_Dirs use "true"; 16 | 17 | package Builder is 18 | for Global_Configuration_Pragmas use "gnat.adc"; 19 | end Builder; 20 | 21 | type App_Builds is ("Debug", "Production"); 22 | App_Build : App_Builds := external ("APP_BUILD", "Production"); 23 | 24 | for Object_Dir use "obj/" & App_Build; 25 | 26 | package Compiler is 27 | case App_Build is 28 | when "Debug" => 29 | for Default_Switches ("ada") use 30 | ("-g", 31 | "-gnatwa", 32 | "-gnata", -- enable pre/postconditions 33 | "-gnatQ", 34 | "-gnatw.X", -- disable warnings about exceptions and LCH 35 | "-ffunction-sections", 36 | "-fdata-sections"); 37 | 38 | when "Production" => 39 | for Default_Switches ("ada") use ( 40 | "-g", 41 | "-O2", 42 | "-gnatp", 43 | "-gnatn2", -- honor Inline requests 44 | "-Winline", -- warn if cannot honor Inline aspect/pragma 45 | "-gnatw.X", 46 | "-ffunction-sections", 47 | "-fdata-sections"); 48 | end case; 49 | end Compiler; 50 | 51 | end Demo_GPIO; 52 | 53 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_gpio_direct_leds/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_independent_watchdog/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_independent_watchdog/demo_iwdg.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f407_discovery/stm32f407_discovery_full.gpr"; 2 | 3 | project Demo_IWDG extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Main use ("demo_iwdg.adb"); 6 | for Languages use ("Ada"); 7 | for Source_Dirs use ("src"); 8 | for Object_Dir use "obj/" & STM32F407_Discovery_Full.Build; 9 | for Runtime ("Ada") use STM32F407_Discovery_Full'Runtime("Ada"); 10 | for Create_Missing_Dirs use "true"; 11 | 12 | package Builder is 13 | for Global_Configuration_Pragmas use "gnat.adc"; 14 | end Builder; 15 | 16 | package Compiler renames STM32F407_Discovery_Full.Compiler; 17 | 18 | end Demo_IWDG; 19 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_independent_watchdog/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_independent_watchdog/readme.md: -------------------------------------------------------------------------------- 1 | This program demonstrates the on-board "independent watchdog" provided by 2 | the STM32F4 family. 3 | 4 | The program first blinks all the LEDs on and off three times to signal 5 | initial execution. It then blinks the green LED indefinitely, also 6 | resetting the watchdog so that the board is not reset. If you see all the 7 | LEDs blink after initial power-up you know that the board has been reset 8 | by the watchdog. That makes it easy to experiment with the watchdog's 9 | parameters. 10 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_rng/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_rng/demo_rng.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f429_discovery/stm32f429_discovery_full.gpr"; 2 | 3 | project Demo_RNG extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Main use ("demo_rng.adb"); 6 | for Languages use ("Ada"); 7 | for Source_Dirs use ("src"); 8 | for Object_Dir use "obj/" & STM32F429_Discovery_Full.Build; 9 | for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); 10 | for Create_Missing_Dirs use "true"; 11 | 12 | package Builder is 13 | for Global_Configuration_Pragmas use "gnat.adc"; 14 | end Builder; 15 | 16 | package Compiler renames STM32F429_Discovery_Full.Compiler; 17 | 18 | end Demo_RNG; 19 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_rng/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_rng/readme.md: -------------------------------------------------------------------------------- 1 | This program demonstrates the STM32 on-board random number generator 2 | hardware. The function Random is called iteratively, indefinitely, and 3 | the results are displayed. Some display hardware is therefore assumed 4 | but the demo is otherwise independent of specific boards (as long as the 5 | RNG hardware functionality is present). 6 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_timer_interrupts_basic/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_timer_interrupts_basic/demo_basic_timer_interrupts.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f407_discovery/stm32f407_discovery_full.gpr"; 2 | 3 | project demo_basic_timer_interrupts extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Languages use ("Ada"); 6 | for Main use ("demo.adb"); 7 | for Source_Dirs use ("src"); 8 | for Object_Dir use "obj/" & STM32F407_Discovery_Full.Build; 9 | for Runtime ("Ada") use STM32F407_Discovery_Full'Runtime("Ada"); 10 | for Create_Missing_Dirs use "true"; 11 | 12 | package Builder is 13 | for Global_Configuration_Pragmas use "gnat.adc"; 14 | end Builder; 15 | 16 | package Compiler renames STM32F407_Discovery_Full.Compiler; 17 | 18 | end demo_basic_timer_interrupts; 19 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_timer_interrupts_basic/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_timer_interrupts_basic/readme.md: -------------------------------------------------------------------------------- 1 | This program demonstrates basic timer interrupts. On each interrupt the 2 | green LED will blink on the Discovery board. Interrupts occur at one 3 | second intervals (an arbitrary choice) so the LED will be on for a 4 | second, off for a second, and so on, indefinitely. 5 | 6 | The demo uses the green LED, which should be fairly common across 7 | multiple STM boards. 8 | 9 | Note that the control over the LED the toggling) is done within the 10 | interrupt handler, not in the main procedure. 11 | 12 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_timer_interrupts_multichannel/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_timer_interrupts_multichannel/demo_timer_interrupts_multichannel.gpr: -------------------------------------------------------------------------------- 1 | -- This demo is intended for the F4 Discovery board because it uses all four 2 | -- LEDs. Using four LEDs is not a functional necessity but driving only one or 3 | -- two LEDs would not be that interesting. If you use a different target with 4 | -- fewer LEDs, change the number of interrupts generated to match only the 5 | -- number of LEDs available. 6 | 7 | with "../../../../../boards/stm32f407_discovery/stm32f407_discovery_full.gpr"; 8 | 9 | project demo_timer_interrupts_multichannel extends "../../../../../examples/shared/common/common.gpr" is 10 | 11 | for Languages use ("Ada"); 12 | for Main use ("demo.adb"); 13 | for Source_Dirs use ("src"); 14 | for Object_Dir use "obj/" & STM32F407_Discovery_Full.Build; 15 | for Runtime ("Ada") use STM32F407_Discovery_Full'Runtime("Ada"); 16 | for Create_Missing_Dirs use "true"; 17 | 18 | package Builder is 19 | for Global_Configuration_Pragmas use "gnat.adc"; 20 | end Builder; 21 | 22 | package Compiler renames STM32F407_Discovery_Full.Compiler; 23 | 24 | end demo_timer_interrupts_multichannel; 25 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_timer_interrupts_multichannel/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_timer_interrupts_multichannel/readme.md: -------------------------------------------------------------------------------- 1 | This program demonstrates using one timer to generate several periodic 2 | interrupts, each with a different period. Each interrupt is tied to a 3 | separate LED such that the LED blinks at the corresponding rate. 4 | 5 | It uses the STM F4 Discovery board for the sake of the four LEDs but another 6 | board could be used, with different LED configurations. Using a board 7 | with fewer LEDs is possible. -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_timer_pwm/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_timer_pwm/demo_timer_pwm.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f407_discovery/stm32f407_discovery_full.gpr"; 2 | 3 | project Demo_Timer_PWM extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Languages use ("Ada"); 6 | for Main use ("demo_pwm_adt", "demo_timer_pwm"); 7 | for Source_Dirs use ("src"); 8 | for Object_Dir use "obj/" & STM32F407_Discovery_Full.Build; 9 | for Runtime ("Ada") use STM32F407_Discovery_Full'Runtime("Ada"); 10 | for Create_Missing_Dirs use "true"; 11 | 12 | package Builder is 13 | for Global_Configuration_Pragmas use "gnat.adc"; 14 | end Builder; 15 | 16 | package Compiler renames STM32F407_Discovery_Full.Compiler; 17 | 18 | end Demo_Timer_PWM; 19 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_timer_pwm/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_timer_pwm/readme.md: -------------------------------------------------------------------------------- 1 | This demonstration causes an on-board LED to increase and decrease in 2 | brightness, iteratively, for as long as the application runs. In effect 3 | the LED light waxes and wanes. 4 | See http://visualgdb.com/tutorials/arm/stm32/fpu/ for the inspiration. 5 | 6 | There are two demonstrations, hence main programs, showing how to 7 | achieve the effect. Both use pulse-width-modulation (PWM) to make the 8 | LED change brightness. Both are making use of the STM timer's built-in 9 | PWM functionality. One program uses the STM32.Timer package directly to 10 | achieve the effect. The other program uses the STM32.PWM package that is 11 | a simplifying wrapper around the timer PWM functionality. 12 | 13 | The direct use is demonstrated by "demo_timer_pwm.adb" whereas the program 14 | "demo_pwm_adt.adb" illustrates the abstract data type PWM package use. 15 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_timer_quad_encoder/demo_timer_quad_encoder.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f407_discovery/stm32f407_discovery_full.gpr"; 2 | 3 | project Demo_Timer_Quad_Encoder extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Languages use ("Ada"); 6 | for Main use ("demo_encoder.adb"); 7 | for Source_Dirs use ("src"); 8 | for Object_Dir use "obj/" & STM32F407_Discovery_Full.Build; 9 | for Runtime ("Ada") use STM32F407_Discovery_Full'Runtime("Ada"); 10 | for Create_Missing_Dirs use "true"; 11 | 12 | package Builder is 13 | for Global_Configuration_Pragmas use "gnat.adc"; 14 | end Builder; 15 | 16 | package Compiler renames STM32F407_Discovery_Full.Compiler; 17 | 18 | end Demo_Timer_Quad_Encoder; 19 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_timer_quad_encoder/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_usart_interrupts/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_usart_interrupts/README.md: -------------------------------------------------------------------------------- 1 | You need a way to connect the GPIO pins on the target board to a serial port on 2 | your host computer. 3 | 4 | You can use a USB cable specifically designed to appear as a COM port: 5 | 6 | * Mouser Part No: 895-TTL-232R-5V 7 | * Manufacturer Part No: TTL-232R-5V 8 | * Manufacturer: FTDI 9 | * Description: USB Cables / IEEE 1394 Cables USB Embedded Serial Conv 5V 0.1" Header 10 | 11 | The end of the cable is a female header, described in the datasheet 12 | (`DS_TTL-232R_CABLES-217672.pdf`). See pages 10 and 11 in particular. 13 | 14 | Using male-to-female connector wires, connect the following on the STM32F4: 15 | 16 | * header pin 1, the black wire's header slot, to a ground pin on the board 17 | * header pin 4, the orange wire's header slot, to **PB7** 18 | * header pin 5, the yellow wire's header slot, to **PB6** 19 | 20 | Header pin 4 on the cable is TXD, the transmit data output. 21 | Header pin 5 on the cable is RXD, the receive data input. 22 | See table 4.1 on page 11 of the datasheet for all the pins. 23 | 24 | On the host, just plug in the USB-to-serial cable. 25 | 26 | We use an app named HyperSerialPort on the host. Once the cable is connected it 27 | will appear like a COM port so use the "Refresh" button in the Settings dialog 28 | to find the port represented by the cable. 29 | 30 | The USART is set to: 115_200, N81, no flow control so change the app's connection 31 | accordingly. -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_usart_interrupts/demo_usart_interrupts.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f407_discovery/stm32f407_discovery_full.gpr"; 2 | 3 | project Demo_USART_Interrupts extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Main use ("demo_usart_interrupts.adb"); 6 | for Languages use ("Ada"); 7 | for Source_Dirs use ("src"); 8 | for Object_Dir use "obj/" & STM32F407_Discovery_Full.Build; 9 | for Runtime ("Ada") use STM32F407_Discovery_Full'Runtime("Ada"); 10 | for Create_Missing_Dirs use "true"; 11 | 12 | package Builder is 13 | for Global_Configuration_Pragmas use "gnat.adc"; 14 | end Builder; 15 | 16 | package Compiler renames STM32F407_Discovery_Full.Compiler; 17 | 18 | end Demo_USART_Interrupts; 19 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_usart_interrupts/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_usart_polling/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_usart_polling/README.md: -------------------------------------------------------------------------------- 1 | You need a way to connect the GPIO pins on the target board to a serial port on 2 | your host computer. 3 | 4 | You can use a USB cable specifically designed to appear as a COM port: 5 | 6 | * Mouser Part No: 895-TTL-232R-5V 7 | * Manufacturer Part No: TTL-232R-5V 8 | * Manufacturer: FTDI 9 | * Description: USB Cables / IEEE 1394 Cables USB Embedded Serial Conv 5V 0.1" Header 10 | 11 | The end of the cable is a female header, described in the datasheet 12 | (`DS_TTL-232R_CABLES-217672.pdf`). See pages 10 and 11 in particular. 13 | 14 | Using male-to-female connector wires, connect the following on the STM32F4: 15 | 16 | * header pin 1, the black wire's header slot, to a ground pin on the board 17 | * header pin 4, the orange wire's header slot, to **PB7** 18 | * header pin 5, the yellow wire's header slot, to **PB6** 19 | 20 | Header pin 4 on the cable is TXD, the transmit data output. 21 | Header pin 5 on the cable is RXD, the receive data input. 22 | See table 4.1 on page 11 of the datasheet for all the pins. 23 | 24 | On the host, just plug in the USB-to-serial cable. 25 | 26 | We use an app named HyperSerialPort on the host. Once the cable is connected it 27 | will appear like a COM port so use the "Refresh" button in the Settings dialog 28 | to find the port represented by the cable. 29 | 30 | The USART is set to: 115_200, N81, no flow control so change the app's connection 31 | accordingly. -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_usart_polling/demo_usart_polling.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f407_discovery/stm32f407_discovery_full.gpr"; 2 | 3 | project Demo_USART_Polling extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Main use ("demo_usart_polling.adb"); 6 | for Languages use ("Ada"); 7 | for Source_Dirs use ("src"); 8 | for Object_Dir use "obj/" & STM32F407_Discovery_Full.Build; 9 | for Runtime ("Ada") use STM32F407_Discovery_Full'Runtime("Ada"); 10 | for Create_Missing_Dirs use "true"; 11 | 12 | package Builder is 13 | for Global_Configuration_Pragmas use "gnat.adc"; 14 | end Builder; 15 | 16 | package Compiler renames STM32F407_Discovery_Full.Compiler; 17 | 18 | end Demo_USART_Polling; 19 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_usart_polling/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_window_watchdog/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_window_watchdog/demo_wwdg.gpr: -------------------------------------------------------------------------------- 1 | with "../../../../../boards/stm32f429_discovery/stm32f429_discovery_full.gpr"; 2 | 3 | project Demo_WWDG extends "../../../../../examples/shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime ("Ada"); 6 | 7 | for Target use "arm-eabi"; 8 | 9 | for Languages use ("Ada"); 10 | 11 | for Source_Dirs use ("src"); 12 | 13 | for Object_Dir use "obj"; 14 | 15 | for Create_Missing_Dirs use "True"; 16 | 17 | for Main use ("demo_wwdg.adb"); 18 | 19 | package Compiler renames STM32F429_Discovery_Full.Compiler; 20 | 21 | end Demo_WWDG; 22 | -------------------------------------------------------------------------------- /arch/ARM/STM32/driver_demos/demo_window_watchdog/gnat.adc: -------------------------------------------------------------------------------- 1 | -- pragma Profile (GNAT_Extended_Ravenscar); 2 | 3 | pragma Partition_Elaboration_Policy (Sequential); 4 | 5 | -------------------------------------------------------------------------------- /arch/ARM/STM32/drivers/fsmc/README.md: -------------------------------------------------------------------------------- 1 | # Flexible static memory controller (FSMC) 2 | 3 | This component of STM32F40x/41x processors allows for the management 4 | of static memory, flash memory, and PC Cards. Unlike the FMC in more 5 | advanced MCU models, dynamic memory is not supported. Each type of 6 | memory has its address bank. The controller offers flexible settings 7 | for various operating modes. For instance, extended modes can have 8 | different delays set for read and write operations. It is recommended 9 | to refer to the STM32 Reference Manual (RM0090) for a detailed description 10 | of possible modes and corresponding settings. 11 | 12 | * [Datasheet](https://www.st.com/resource/en/reference_manual/dm00031020-stm32f405-415-stm32f407-417-stm32f427-437-and-stm32f429-439-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf) - STM32 Reference Manual (RM0090), FSMC chapter. 13 | 14 | * [Configuration example](../../../../../boards/stm32_f4ve/src/display_ili9341.adb) - display_ili9341.adb: 15 | 16 | ## Example 17 | 18 | Configuring Bank_1 for ILI9341 LCD controller: 19 | 20 | * half word (16 bit access) 21 | * with write enabled 22 | * distinct read and write timings 23 | 24 | ```ada 25 | STM32.FSMC.Configure 26 | (Bank_1 => 27 | (1 => -- TFT is connected to sub-bank 1 28 | (Is_Set => True, 29 | Value => 30 | (Write_Enable => True, 31 | Bus_Width => STM32.FSMC.Half_Word, 32 | Memory_Type => STM32.FSMC.SRAM, 33 | Bus_Turn => 15, -- 90ns 34 | Data_Setup => 57, -- 342ns 35 | Address_Setup => 0, 36 | Extended => 37 | (STM32.FSMC.Mode_A, 38 | Write_Bus_Turn => 3, -- 18ns 39 | Write_Data_Setup => 2, -- 12ns 40 | Write_Address_Setup => 0), 41 | others => <>)), 42 | others => <>)); 43 | ``` -------------------------------------------------------------------------------- /arch/ARM/cortex_m/src/cm0/cortex_m_svd-nvic.ads: -------------------------------------------------------------------------------- 1 | -- This spec has been automatically generated from cm0.svd 2 | 3 | pragma Restrictions (No_Elaboration_Code); 4 | pragma Ada_2012; 5 | pragma Style_Checks (Off); 6 | 7 | with HAL; 8 | 9 | package Cortex_M_SVD.NVIC is 10 | pragma Preelaborate; 11 | 12 | --------------- 13 | -- Registers -- 14 | --------------- 15 | 16 | -- Interrupt Priority Register 17 | 18 | -- Interrupt Priority Register 19 | type NVIC_IPR_Registers is array (0 .. 7) of HAL.UInt32 20 | with Volatile; 21 | 22 | ----------------- 23 | -- Peripherals -- 24 | ----------------- 25 | 26 | type NVIC_Peripheral is record 27 | -- Interrupt Set-Enable Registers 28 | NVIC_ISER : aliased HAL.UInt32; 29 | -- Interrupt Clear-Enable Registers 30 | NVIC_ICER : aliased HAL.UInt32; 31 | -- Interrupt Set-Pending Registers 32 | NVIC_ISPR : aliased HAL.UInt32; 33 | -- Interrupt Clear-Pending Registers 34 | NVIC_ICPR : aliased HAL.UInt32; 35 | -- Interrupt Priority Register 36 | NVIC_IPR : aliased NVIC_IPR_Registers; 37 | end record 38 | with Volatile; 39 | 40 | for NVIC_Peripheral use record 41 | NVIC_ISER at 16#0# range 0 .. 31; 42 | NVIC_ICER at 16#80# range 0 .. 31; 43 | NVIC_ISPR at 16#100# range 0 .. 31; 44 | NVIC_ICPR at 16#180# range 0 .. 31; 45 | NVIC_IPR at 16#300# range 0 .. 255; 46 | end record; 47 | 48 | NVIC_Periph : aliased NVIC_Peripheral 49 | with Import, Address => NVIC_Base; 50 | 51 | end Cortex_M_SVD.NVIC; 52 | -------------------------------------------------------------------------------- /arch/ARM/cortex_m/src/cm0/cortex_m_svd.ads: -------------------------------------------------------------------------------- 1 | -- This spec has been automatically generated from cm0.svd 2 | 3 | pragma Restrictions (No_Elaboration_Code); 4 | pragma Ada_2012; 5 | pragma Style_Checks (Off); 6 | 7 | with System; 8 | 9 | package Cortex_M_SVD is 10 | pragma Preelaborate; 11 | 12 | -------------------- 13 | -- Base addresses -- 14 | -------------------- 15 | 16 | NVIC_Base : constant System.Address := 17 | System'To_Address (16#E000E100#); 18 | SCB_Base : constant System.Address := 19 | System'To_Address (16#E000ED00#); 20 | SysTick_Base : constant System.Address := 21 | System'To_Address (16#E000E010#); 22 | Debug_Base : constant System.Address := 23 | System'To_Address (16#E000ED00#); 24 | DWT_Base : constant System.Address := 25 | System'To_Address (16#E0001000#); 26 | 27 | end Cortex_M_SVD; 28 | -------------------------------------------------------------------------------- /arch/ARM/cortex_m/src/cm4/cortex_m_svd.ads: -------------------------------------------------------------------------------- 1 | -- This spec has been automatically generated from cm4.svd 2 | 3 | pragma Restrictions (No_Elaboration_Code); 4 | pragma Ada_2012; 5 | pragma Style_Checks (Off); 6 | 7 | with System; 8 | 9 | package Cortex_M_SVD is 10 | pragma Preelaborate; 11 | 12 | -------------------- 13 | -- Base addresses -- 14 | -------------------- 15 | 16 | NVIC_Base : constant System.Address := 17 | System'To_Address (16#E000E100#); 18 | SCB_Base : constant System.Address := 19 | System'To_Address (16#E000E000#); 20 | SysTick_Base : constant System.Address := 21 | System'To_Address (16#E000E010#); 22 | MPU_Base : constant System.Address := 23 | System'To_Address (16#E000ED90#); 24 | Debug_Base : constant System.Address := 25 | System'To_Address (16#E000ED00#); 26 | DWT_Base : constant System.Address := 27 | System'To_Address (16#E0001000#); 28 | 29 | end Cortex_M_SVD; 30 | -------------------------------------------------------------------------------- /arch/ARM/cortex_m/src/cm4f/cortex_m_svd.ads: -------------------------------------------------------------------------------- 1 | -- This spec has been automatically generated from cm4f.svd 2 | 3 | pragma Restrictions (No_Elaboration_Code); 4 | pragma Ada_2012; 5 | pragma Style_Checks (Off); 6 | 7 | with System; 8 | 9 | package Cortex_M_SVD is 10 | pragma Preelaborate; 11 | 12 | -------------------- 13 | -- Base addresses -- 14 | -------------------- 15 | 16 | NVIC_Base : constant System.Address := 17 | System'To_Address (16#E000E100#); 18 | SCB_Base : constant System.Address := 19 | System'To_Address (16#E000E000#); 20 | SysTick_Base : constant System.Address := 21 | System'To_Address (16#E000E010#); 22 | FPU_Base : constant System.Address := 23 | System'To_Address (16#E000ED88#); 24 | MPU_Base : constant System.Address := 25 | System'To_Address (16#E000ED90#); 26 | Debug_Base : constant System.Address := 27 | System'To_Address (16#E000ED00#); 28 | DWT_Base : constant System.Address := 29 | System'To_Address (16#E0001000#); 30 | 31 | end Cortex_M_SVD; 32 | -------------------------------------------------------------------------------- /arch/ARM/cortex_m/src/cm7/cortex_m_svd.ads: -------------------------------------------------------------------------------- 1 | -- This spec has been automatically generated from cm7.svd 2 | 3 | pragma Restrictions (No_Elaboration_Code); 4 | pragma Ada_2012; 5 | pragma Style_Checks (Off); 6 | 7 | with System; 8 | 9 | package Cortex_M_SVD is 10 | pragma Preelaborate; 11 | 12 | -------------------- 13 | -- Base addresses -- 14 | -------------------- 15 | 16 | NVIC_Base : constant System.Address := 17 | System'To_Address (16#E000E100#); 18 | SCB_Base : constant System.Address := 19 | System'To_Address (16#E000E000#); 20 | SysTick_Base : constant System.Address := 21 | System'To_Address (16#E000E010#); 22 | FPU_Base : constant System.Address := 23 | System'To_Address (16#E000ED88#); 24 | MPU_Base : constant System.Address := 25 | System'To_Address (16#E000ED90#); 26 | PF_Base : constant System.Address := 27 | System'To_Address (16#E000ED78#); 28 | Cache_Base : constant System.Address := 29 | System'To_Address (16#E000EF50#); 30 | Debug_Base : constant System.Address := 31 | System'To_Address (16#E000ED00#); 32 | DWT_Base : constant System.Address := 33 | System'To_Address (16#E0001000#); 34 | 35 | end Cortex_M_SVD; 36 | -------------------------------------------------------------------------------- /arch/RISC-V/SiFive/svd/FE310/fe310_svd-clint.ads: -------------------------------------------------------------------------------- 1 | -- This spec has been automatically generated from FE310.svd 2 | 3 | pragma Restrictions (No_Elaboration_Code); 4 | pragma Ada_2012; 5 | pragma Style_Checks (Off); 6 | 7 | with HAL; 8 | with System; 9 | 10 | package FE310_SVD.CLINT is 11 | pragma Preelaborate; 12 | 13 | --------------- 14 | -- Registers -- 15 | --------------- 16 | 17 | ----------------- 18 | -- Peripherals -- 19 | ----------------- 20 | 21 | -- Core Local Interruptor. 22 | type CLINT_Peripheral is record 23 | -- Machine Software Interrupt Pending Register. 24 | MSIP : aliased HAL.UInt32; 25 | -- Machine Timer Compare Register Low. 26 | MTIMECMP_LO : aliased HAL.UInt32; 27 | -- Machine Timer Compare Register High. 28 | MTIMECMP_HI : aliased HAL.UInt32; 29 | -- Machine Timer Register Low. 30 | MTIME_LO : aliased HAL.UInt32; 31 | -- Machine Timer Register High. 32 | MTIME_HI : aliased HAL.UInt32; 33 | end record 34 | with Volatile; 35 | 36 | for CLINT_Peripheral use record 37 | MSIP at 16#0# range 0 .. 31; 38 | MTIMECMP_LO at 16#4000# range 0 .. 31; 39 | MTIMECMP_HI at 16#4004# range 0 .. 31; 40 | MTIME_LO at 16#BFF8# range 0 .. 31; 41 | MTIME_HI at 16#BFFC# range 0 .. 31; 42 | end record; 43 | 44 | -- Core Local Interruptor. 45 | CLINT_Periph : aliased CLINT_Peripheral 46 | with Import, Address => System'To_Address (16#2000000#); 47 | 48 | end FE310_SVD.CLINT; 49 | -------------------------------------------------------------------------------- /arch/RISC-V/SiFive/svd/FE310/fe310_svd.ads: -------------------------------------------------------------------------------- 1 | -- This spec has been automatically generated from FE310.svd 2 | 3 | pragma Restrictions (No_Elaboration_Code); 4 | pragma Ada_2012; 5 | pragma Style_Checks (Off); 6 | 7 | with System; 8 | 9 | -- E31 CPU Coreplex, high-performance, 32-bit RV32IMAC core 10 | -- 11 | package FE310_SVD is 12 | pragma Preelaborate; 13 | 14 | -------------------- 15 | -- Base addresses -- 16 | -------------------- 17 | 18 | GPIO0_Base : constant System.Address := 19 | System'To_Address (16#10012000#); 20 | UART0_Base : constant System.Address := 21 | System'To_Address (16#10013000#); 22 | UART1_Base : constant System.Address := 23 | System'To_Address (16#10023000#); 24 | PWM0_Base : constant System.Address := 25 | System'To_Address (16#10015000#); 26 | PWM1_Base : constant System.Address := 27 | System'To_Address (16#10025000#); 28 | PWM2_Base : constant System.Address := 29 | System'To_Address (16#10035000#); 30 | 31 | end FE310_SVD; 32 | -------------------------------------------------------------------------------- /boards/HiFive1/README.md: -------------------------------------------------------------------------------- 1 | See the [example project](../../examples/HiFive1/README.md) for instructions on 2 | how to use the Ada_Drivers_Library on the HiFive1. 3 | -------------------------------------------------------------------------------- /boards/MicroBit/README.md: -------------------------------------------------------------------------------- 1 | See the [example project](../../examples/MicroBit/README.md) for instruction on 2 | how to use the Ada_Drivers_Library on the Micro:Bit. 3 | -------------------------------------------------------------------------------- /boards/MicroBit/src/microbit-ios-neopixel.adb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdaCore/Ada_Drivers_Library/8a62be90b9ef13042ce9dbf2112f453fb6dec777/boards/MicroBit/src/microbit-ios-neopixel.adb -------------------------------------------------------------------------------- /boards/NRF52_DK/README.md: -------------------------------------------------------------------------------- 1 | See the [example project](../../examples/NRF52_DK/README.md) for instructions on 2 | how to use the Ada_Drivers_Library on the NRF52_DK. 3 | -------------------------------------------------------------------------------- /boards/README.md: -------------------------------------------------------------------------------- 1 | These projects represent specific implementations, "boards" such as the 2 | `*_Discovery` kit boards. 3 | 4 | They include the peripheral declarations for their specific MCU device, such as 5 | the GPIO ports and timers on the F405 or F429, as well as declarations specific 6 | to that board, such as the LEDs. 7 | 8 | Use one of these project if that is the specific target you are using. 9 | 10 | Alternatively, if you have some platform that is based on a given MCU device 11 | but is not a specific board (e.g., not one of the `*_Discovery` boards), use 12 | the corresponding MCU device project instead. For example, the Crazyflie 2.0 13 | uses an STM32F405, so project stm32f40x.gpr would be appropriate. With that 14 | approach the hardware that the `*_Discovery` boards include will not be 15 | available, such as the user buttons. 16 | -------------------------------------------------------------------------------- /boards/Unleashed/src/full/adl_config.ads: -------------------------------------------------------------------------------- 1 | -- This package was generated by the Ada_Drivers_Library project wizard script 2 | package ADL_Config is 3 | Architecture : constant String := "RISC-V"; -- From board definition 4 | Board : constant String := "Unleashed"; -- From command line 5 | CPU_Core : constant String := "RISC-V64"; -- From mcu definition 6 | Device_Family : constant String := "U5"; -- From board definition 7 | Device_Name : constant String := "U540"; -- From board definition 8 | Has_Ravenscar_Full_Runtime : constant String := "True"; -- From board definition 9 | Has_Ravenscar_SFP_Runtime : constant String := "True"; -- From board definition 10 | Has_ZFP_Runtime : constant String := "True"; -- From board definition 11 | Max_Mount_Name_Length : constant := 128; -- From default value 12 | Max_Mount_Points : constant := 2; -- From default value 13 | Max_Path_Length : constant := 1024; -- From default value 14 | Number_Of_Interrupts : constant := 0; -- From default value 15 | Runtime_Name : constant String := "embedded-unleashed"; -- From default value 16 | Runtime_Name_Suffix : constant String := "unleashed"; -- From board definition 17 | Runtime_Profile : constant String := "embedded"; -- From command line 18 | Use_Startup_Gen : constant Boolean := False; -- From command line 19 | Vendor : constant String := "SiFive"; -- From board definition 20 | end ADL_Config; 21 | -------------------------------------------------------------------------------- /boards/Unleashed/src/sfp/adl_config.ads: -------------------------------------------------------------------------------- 1 | -- This package was generated by the Ada_Drivers_Library project wizard script 2 | package ADL_Config is 3 | Architecture : constant String := "RISC-V"; -- From board definition 4 | Board : constant String := "Unleashed"; -- From command line 5 | CPU_Core : constant String := "RISC-V64"; -- From mcu definition 6 | Device_Family : constant String := "U5"; -- From board definition 7 | Device_Name : constant String := "U540"; -- From board definition 8 | Has_Ravenscar_Full_Runtime : constant String := "True"; -- From board definition 9 | Has_Ravenscar_SFP_Runtime : constant String := "True"; -- From board definition 10 | Has_ZFP_Runtime : constant String := "True"; -- From board definition 11 | Max_Mount_Name_Length : constant := 128; -- From default value 12 | Max_Mount_Points : constant := 2; -- From default value 13 | Max_Path_Length : constant := 1024; -- From default value 14 | Number_Of_Interrupts : constant := 0; -- From default value 15 | Runtime_Name : constant String := "light-tasking-unleashed"; -- From default value 16 | Runtime_Name_Suffix : constant String := "unleashed"; -- From board definition 17 | Runtime_Profile : constant String := "light-tasking"; -- From command line 18 | Use_Startup_Gen : constant Boolean := False; -- From command line 19 | Vendor : constant String := "SiFive"; -- From board definition 20 | end ADL_Config; 21 | -------------------------------------------------------------------------------- /boards/Unleashed/src/zfp/adl_config.ads: -------------------------------------------------------------------------------- 1 | -- This package was generated by the Ada_Drivers_Library project wizard script 2 | package ADL_Config is 3 | Architecture : constant String := "RISC-V"; -- From board definition 4 | Board : constant String := "Unleashed"; -- From command line 5 | CPU_Core : constant String := "RISC-V64"; -- From mcu definition 6 | Device_Family : constant String := "U5"; -- From board definition 7 | Device_Name : constant String := "U540"; -- From board definition 8 | Has_Ravenscar_Full_Runtime : constant String := "True"; -- From board definition 9 | Has_Ravenscar_SFP_Runtime : constant String := "True"; -- From board definition 10 | Has_ZFP_Runtime : constant String := "True"; -- From board definition 11 | Max_Mount_Name_Length : constant := 128; -- From default value 12 | Max_Mount_Points : constant := 2; -- From default value 13 | Max_Path_Length : constant := 1024; -- From default value 14 | Number_Of_Interrupts : constant := 0; -- From default value 15 | Runtime_Name : constant String := "light-unleashed"; -- From default value 16 | Runtime_Name_Suffix : constant String := "unleashed"; -- From board definition 17 | Runtime_Profile : constant String := "light"; -- From command line 18 | Use_Startup_Gen : constant Boolean := False; -- From command line 19 | Vendor : constant String := "SiFive"; -- From board definition 20 | end ADL_Config; 21 | -------------------------------------------------------------------------------- /boards/native/config_src/adl_config.ads: -------------------------------------------------------------------------------- 1 | -- This package was generated by the Ada_Drivers_Library project wizard script 2 | package ADL_Config is 3 | Architecture : constant String := "Native"; -- From board definition 4 | Board : constant String := "Native"; -- From command line 5 | Has_Ravenscar_Full_Runtime : constant String := "False"; -- From default value 6 | Has_Ravenscar_SFP_Runtime : constant String := "False"; -- From default value 7 | Has_ZFP_Runtime : constant String := "False"; -- From default value 8 | Max_Mount_Name_Length : constant := 128; -- From default value 9 | Max_Mount_Points : constant := 2; -- From default value 10 | Max_Path_Length : constant := 1024; -- From default value 11 | Use_Startup_Gen : constant Boolean := False; -- From command line 12 | end ADL_Config; 13 | -------------------------------------------------------------------------------- /boards/native/src/native.ads: -------------------------------------------------------------------------------- 1 | package Native is 2 | pragma Pure; 3 | end Native; 4 | -------------------------------------------------------------------------------- /components/src/memory/W25Q16/README.md: -------------------------------------------------------------------------------- 1 | # W25Q16 - 2Mbyte SPI flash memory 2 | 3 | [Datasheet](https://www.winbond.com/hq/support/documentation/downloadV2022.jsp?xmlPath=/support/resources/.content/item/DA00-W25Q80-16-32.html) 4 | 5 | There is an example in [examples/stm32f4xx_m/flash/](../../../../examples/stm32f4xx_m/flash/). 6 | -------------------------------------------------------------------------------- /components/src/radio/hm11/README.md: -------------------------------------------------------------------------------- 1 | This directory contains the driver for HM-11/cc2541 bluetooth module. 2 | The cc2541 is 2.4-GHz Bluetooth low energy Compliant and Proprietary 3 | RF System-on-Chip. 4 | 5 | The examples/STM32F429_Discovery/hm11_f429disco.gpr project contains 6 | a simple example. 7 | -------------------------------------------------------------------------------- /components/src/radio/nrf24l01p/README.md: -------------------------------------------------------------------------------- 1 | This directory contains the driver for nRF24L01+ radio module. The nRF24AP2 2 | ICs are low-cost, high-performance 2.4 GHz ISM single-chip connectivity devices 3 | with an embedded ANT protocol stack. 4 | 5 | nRF24L01 can also be driven with some reservations. For example, for Air_Data_Rate 6 | use Rate_250kbps (2Mbps on nRF24L01) or Rate_1Mbps (1Mbps on nRF24L01) only. 7 | Refer to the specifications for more information. 8 | 9 | The examples/STM32F429_Discovery/nrf24l01p_f429disco.gpr project contains 10 | a simple example. 11 | -------------------------------------------------------------------------------- /components/src/radio/nrf24l01p/nrf24l01p.ads: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdaCore/Ada_Drivers_Library/8a62be90b9ef13042ce9dbf2112f453fb6dec777/components/src/radio/nrf24l01p/nrf24l01p.ads -------------------------------------------------------------------------------- /components/src/screen/ili9341/README.md: -------------------------------------------------------------------------------- 1 | # ILI9341 2 | 3 | TFT LCD Single Chip Driver 240RGBx320 Resolution and 262K color. 4 | It has parallel and serial interfaces for MCU. It's also able to 5 | receive data over RGB interface. 6 | 7 | The STM32F429 Discovery board utilizes an RGB interface and stores 8 | graphic data in the main memory. The STM32 F4VE board uses a parallel 9 | interface and employs ILI9341 memory, which significantly slows down 10 | drawing but conserves main memory. When using the parallel interface, 11 | ILI9341 registers are mapped to the MCU's address space through the 12 | memory controller (FSMC), simplifying and speeding up the drawing. 13 | 14 | * [Datasheet](http://www.datasheet-pdf.info/attach/1/3707537954.pdf) 15 | * [Example for RGB interface](../../../../examples/STM32F429_Discovery/draw_stm32f429disco.gpr) for STM32F429 Discovery 16 | * [Example for parallel interface](../../../../examples/stm32_f4ve/lcd) for STM32 F4VE board 17 | -------------------------------------------------------------------------------- /components/src/touch_panel/xpt2046/README.md: -------------------------------------------------------------------------------- 1 | # XPT2046 2 | 3 | The XPT2046 is a 4-wire resistive touch screen controller that incorporates 4 | a 12-bit 125 kHz sampling SAR type A/D converter. Many cheap LCD displays 5 | contain this controller. Typically, it is connected via SPI. 6 | 7 | To align the touch point with the display coordinates, it might be 8 | necessary to calibrate the touch screen. The XPT2046 sensor provides 9 | raw values within the range of 0 to 4095. If you identify the raw 10 | values associated with the screen edges, you can perform touch 11 | panel calibration by invoking the Calibrate procedure. 12 | 13 | ```ada 14 | subtype Sensor_Value is HAL.UInt16 range 0 .. 2 ** 12 - 1; 15 | 16 | procedure Calibrate 17 | (This : in out XPT2046_Device'Class; 18 | Min_X : Sensor_Value; 19 | Max_X : Sensor_Value; 20 | Min_Y : Sensor_Value; 21 | Max_Y : Sensor_Value); 22 | ``` 23 | 24 | * [Datasheet](https://www.datasheet-pdf.info/attach/1/3898350023.pdf) 25 | * [Example for STM32 F4VE board](../../../../examples/stm32_f4ve/lcd) 26 | -------------------------------------------------------------------------------- /docs/Ada_Drivers_Library-vs-bb_runtimes.md: -------------------------------------------------------------------------------- 1 | We understand that there might be some confusion between the two repositories 2 | `Ada_Drivers_Library` and `bb-runtimes`. Who does what? What should go where? 3 | This page will try to provide an answer. 4 | 5 | Don't hesitate to ask more questions on this subject or suggest improvements to 6 | this page. 7 | 8 | # Ada_Drivers_Library vs bb-runtimes 9 | 10 | The run-times (`bb-runtimes` repository) provide an implementation of Ada 11 | language features as defined by the standard. These features may include 12 | interrupt handling, tasking and time services that are usually provided by what 13 | is called an RTOS in the C/C++ world. 14 | 15 | The run-times will need to control a few peripherals to provide those features 16 | (interrupt controller, one timer, some CPU registers), but it won't touch the 17 | other peripherals (I2C, SPI, GPIOs, Ethernet, etc.). 18 | 19 | `Ada_Drivers_Library` on the other side is a library for firmware development 20 | in Ada. It provides drivers for remaining peripherals on the system as well 21 | drivers for external components and also middleware services. Note that 22 | `Ada_Drivers_Library` may rely on Ada run-time features but it does not mean 23 | that the run-time has to be from the `bb-runtimes` repository, there are other 24 | implementation possible depending on the architecture. 25 | 26 | The limit between the two projects is the Ada language standard. 27 | 28 | Even if for most projects `Ada_Drivers_Library` and `bb-runtimes` will be used 29 | together, in the end the two remain independent. You can use the run-times with 30 | your own drivers or bindings to drivers implemented in C. You can also use 31 | `Ada_Drivers_Library` without the `bb-runtimes`, for instance on a Raspberry Pi 32 | running Linux or if you use a third-party RTOS. 33 | -------------------------------------------------------------------------------- /docs/porting_to_a_new_platform.md: -------------------------------------------------------------------------------- 1 | # Porting to a new platform 2 | 3 | ## Porting the run-time 4 | 5 | Porting will always start with the run-time, it is a prerequisite for any Ada 6 | application. 7 | 8 | Porting a run-time will be a different task depending on the CPU architecture 9 | and the run-time profile that you need. 10 | 11 | If your CPU architecture is already supported, for instance ARM Cortex-M4, the 12 | porting effort will be limited to the BSP: startup code, linker script, clock 13 | configuration and interrupt names. 14 | 15 | If the CPU architecture is not already supported, for instance AVR, there 16 | will be more work: context switch, handling interrupts, providing a clock and 17 | timing services, etc. It may also require some compiler development. 18 | 19 | There are three different run-time profiles (ZFP, Ravescar-SFP, Ravenscar-Full) 20 | with increasing set of features: 21 | 22 | - ZFP (stands for Zero FootPrint): The minimum required to run an Ada program 23 | 24 | - Ravenscar-SFP (stands for Small FootPrint): ZFP + the minimum required for Ada 25 | Ravenscar tasking support (task, protected objects, interrupt handling, 26 | clock and timming). 27 | 28 | - Ravenscar-Full: Ravenscar-SFP + Ada exception propagation and standard 29 | library packages like containers. 30 | 31 | If you are only interested in the ZFP profile (no tasking) then porting will be 32 | much simpler. Usually only the startup code an linker script need to be 33 | changed. Note that for the moment, the platform agnostic parts of 34 | `Ada_Drivers_Library` (middleware and components) works on all run-time 35 | profiles starting with ZFP. 36 | 37 | Please go to [AdaCore/bb-runtimes](https://github.com/AdaCore/bb-runtimes) for 38 | detailed instructions on how to port run-times. 39 | 40 | ## Porting Ada_Drivers_Library 41 | 42 | This section is still in a "TODO" state. 43 | -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | gpsauto.gpr 2 | *-loc.xml 3 | gnatinspect.db -------------------------------------------------------------------------------- /examples/HiFive1/README.md: -------------------------------------------------------------------------------- 1 | SiFive's HiFive1 is an Arduino compatible dev kit featuring the RISC-V Freedom 2 | E310 micro-controller. 3 | 4 | You can get it at [sifive.com](https://www.sifive.com/products/hifive1/). 5 | 6 | ## How to setup the Ada development environment for the HiFive1 7 | 8 | You can use GNAT FSF riscv64-elf and GPRbuild releases from the Alire project, 9 | download [here](https://github.com/alire-project/GNAT-FSF-builds/releases). 10 | 11 | A public release of GNAT Studio is also available 12 | [here](https://github.com/AdaCore/gnatstudio/releases). 13 | 14 | ## Building the example 15 | 16 | To build the example, make sure sure you have all the tools in your PATH and 17 | run: 18 | 19 | `$ gprbuild -f -p -P hifive1_example.gpr -XPLATFORM_BUILD=Debug` 20 | 21 | Follow the instructions in the freedom-e-sdk to flash the example on the board 22 | using OpenOCD. 23 | -------------------------------------------------------------------------------- /examples/HiFive1/hifive1_example.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/HiFive1/hifive1_zfp.gpr"; 2 | 3 | project HiFive1_Example is 4 | 5 | for Runtime ("ada") use HiFive1_ZFP'Runtime ("Ada"); 6 | for Target use "riscv64-elf"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames HiFive1_ZFP.Compiler; 14 | 15 | package Linker is 16 | for Default_Switches ("Ada") use 17 | HiFive1_ZFP.Linker_Switches & 18 | ("-Wl,--print-memory-usage", 19 | "-Wl,--gc-sections"); 20 | end Linker; 21 | 22 | package Ide is 23 | for Program_Host use ":3333"; 24 | for Communication_Protocol use "remote"; 25 | end Ide; 26 | 27 | end HiFive1_Example; 28 | -------------------------------------------------------------------------------- /examples/HiFive1_rev_B/README.md: -------------------------------------------------------------------------------- 1 | SiFive's HiFive1 rev B is an Arduino compatible dev kit featuring the RISC-V 2 | Freedom E310-G002 micro-controller. 3 | 4 | You can get it at [sifive.com](https://www.sifive.com/boards/hifive1-rev-b). 5 | 6 | ## How to setup the Ada development environment for the HiFive1 rev B 7 | 8 | You can use GNAT FSF riscv64-elf and GPRbuild releases from the Alire project, 9 | download [here](https://github.com/alire-project/GNAT-FSF-builds/releases). 10 | 11 | A public release of GNAT Studio is also available 12 | [here](https://github.com/AdaCore/gnatstudio/releases). 13 | 14 | ## Building the example 15 | 16 | To build the example, make sure sure you have all the tools in your PATH and 17 | run: 18 | 19 | `$ gprbuild -f -p -P hifive1_rev_B_example.gpr -XPLATFORM_BUILD=Debug` 20 | 21 | This will create a folder named `obj` in the same directory with the elf-formated 22 | binary plus some auxiliary files. Inside this folder run the following command 23 | to create the `hex` file: 24 | 25 | `$ riscv64-elf-objcopy -O ihex main main.hex` 26 | 27 | This new revision of the HiFive board allows the `hex` file to be uploaded 28 | through the USB connection that should appear in your file manager. Just copy 29 | the newly created `main.hex` into the board and press the restart button. 30 | 31 | If you have issues with the board not appearing as a connected device, please 32 | go to the [SiFive Forum](https://forums.sifive.com/) and state your issue. 33 | -------------------------------------------------------------------------------- /examples/HiFive1_rev_B/hifive1_rev_B_example.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/HiFive1_rev_B/hifive1_rev_b_zfp.gpr"; 2 | 3 | project HiFive1_rev_B_Example is 4 | 5 | for Runtime ("ada") use HiFive1_rev_B_ZFP'Runtime ("Ada"); 6 | for Target use "riscv64-elf"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames HiFive1_rev_B_ZFP.Compiler; 14 | 15 | package Linker is 16 | for Default_Switches ("Ada") use 17 | HiFive1_rev_B_ZFP.Linker_Switches & 18 | ("-Wl,--print-memory-usage", 19 | "-Wl,--gc-sections"); 20 | end Linker; 21 | 22 | package Ide is 23 | for Program_Host use ":3333"; 24 | for Communication_Protocol use "remote"; 25 | end Ide; 26 | 27 | end HiFive1_rev_B_Example; 28 | -------------------------------------------------------------------------------- /examples/MicroBit/BLE_beacon/BLE_beacon.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/MicroBit/microbit_zfp.gpr"; 2 | 3 | project BLE_Beacon is 4 | 5 | for Runtime ("ada") use MicroBit_ZFP'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames MicroBit_ZFP.Compiler; 14 | 15 | package Linker is 16 | for Default_Switches ("Ada") use 17 | MicroBit_ZFP.Linker_Switches & 18 | ("-Wl,--print-memory-usage", 19 | "-Wl,--gc-sections"); 20 | end Linker; 21 | 22 | package Ide is 23 | for Program_Host use ":1234"; 24 | for Communication_Protocol use "remote"; 25 | for Connection_Tool use "pyocd"; 26 | end Ide; 27 | 28 | end BLE_Beacon; 29 | -------------------------------------------------------------------------------- /examples/MicroBit/accelerometer/README.md: -------------------------------------------------------------------------------- 1 | Accelerometer Example 2 | ===================== 3 | 4 | In this example we will see how to use the accelerometer of the micro:bit. The 5 | accelerometer can, for instance, be used to know which way the micro:bit is 6 | oriented. 7 | 8 | Code 9 | ==== 10 | 11 | To get the acceleration value for all axes, we will just call the function 12 | `MicroBit.Accelerometer.Data`. This function returns a record with `X`, `Y` 13 | and `Z` field giving the value for each axis. 14 | 15 | 16 | ```ada 17 | declare 18 | 19 | Data : MMA8653.All_Axes_Data; 20 | -- A variable to store the accelerometer data 21 | begin 22 | 23 | -- Read Accelerometer data 24 | Data := Accelerometer.Data; 25 | end; 26 | ``` 27 | 28 | We can then use the value in the record to get some information about the 29 | orientation of the micro:bit. For example, if the Y value is below `-200` 30 | the micro:bit is vertical. 31 | 32 | Note that the type used to store the values of the accelerometer is declared in 33 | the package `MMA8653` (the driver), so we have to `with` and `use` this package 34 | to have access to the operations for this type. 35 | 36 | ```ada 37 | if Data.Y < -200 then 38 | -- The micro:bit is vertical 39 | end if; 40 | ``` 41 | -------------------------------------------------------------------------------- /examples/MicroBit/accelerometer/accelerometer.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/MicroBit/microbit_zfp.gpr"; 2 | 3 | project Accelerometer is 4 | 5 | for Runtime ("ada") use MicroBit_ZFP'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames MicroBit_ZFP.Compiler; 14 | 15 | package Linker is 16 | for Default_Switches ("Ada") use 17 | MicroBit_ZFP.Linker_Switches & 18 | ("-Wl,--print-memory-usage", 19 | "-Wl,--gc-sections"); 20 | end Linker; 21 | 22 | package Ide is 23 | for Program_Host use ":1234"; 24 | for Communication_Protocol use "remote"; 25 | for Connection_Tool use "pyocd"; 26 | end Ide; 27 | 28 | end Accelerometer; 29 | -------------------------------------------------------------------------------- /examples/MicroBit/analog_in/analog_in.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/MicroBit/microbit_zfp.gpr"; 2 | 3 | project Analog_In is 4 | 5 | for Runtime ("ada") use MicroBit_ZFP'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames MicroBit_ZFP.Compiler; 14 | 15 | package Linker is 16 | for Default_Switches ("Ada") use 17 | MicroBit_ZFP.Linker_Switches & 18 | ("-Wl,--print-memory-usage", 19 | "-Wl,--gc-sections"); 20 | end Linker; 21 | 22 | package Ide is 23 | for Program_Host use ":1234"; 24 | for Communication_Protocol use "remote"; 25 | for Connection_Tool use "pyocd"; 26 | end Ide; 27 | 28 | end Analog_In; 29 | -------------------------------------------------------------------------------- /examples/MicroBit/analog_out/analog_out.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/MicroBit/microbit_zfp.gpr"; 2 | 3 | project Analog_Out is 4 | 5 | for Runtime ("ada") use MicroBit_ZFP'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames MicroBit_ZFP.Compiler; 14 | 15 | package Linker is 16 | for Default_Switches ("Ada") use 17 | MicroBit_ZFP.Linker_Switches & 18 | ("-Wl,--print-memory-usage", 19 | "-Wl,--gc-sections"); 20 | end Linker; 21 | 22 | package Ide is 23 | for Program_Host use ":1234"; 24 | for Communication_Protocol use "remote"; 25 | for Connection_Tool use "pyocd"; 26 | end Ide; 27 | 28 | end Analog_Out; 29 | -------------------------------------------------------------------------------- /examples/MicroBit/buttons/README.md: -------------------------------------------------------------------------------- 1 | Buttons Example 2 | =============== 3 | 4 | In this example we will see how to use the two buttons of the micro:bit. 5 | 6 | Code 7 | ==== 8 | 9 | To know if a button is pressed or not, we will use the function `State` of the 10 | `MicroBit.Buttons` package. 11 | 12 | ```ada 13 | type Button_State is (Pressed, Released); 14 | 15 | type Button_Id is (Button_A, Button_B); 16 | 17 | function State (Button : Button_Id) return Button_State; 18 | ``` 19 | 20 | Arguments: 21 | 22 | - Button : The Id of the button that we want to check. There are two Ids: 23 | `Button_A` or `Button_B`. 24 | 25 | Return value: 26 | 27 | The function `State` return the `Button_State` that can be either `Pressed` or 28 | `Released`. 29 | 30 | Here is the code: 31 | ```ada 32 | with MicroBit.Display; 33 | with MicroBit.Buttons; use MicroBit.Buttons; 34 | with MicroBit.Time; 35 | 36 | procedure Main is 37 | begin 38 | 39 | loop 40 | MicroBit.Display.Clear; 41 | 42 | if MicroBit.Buttons.State (Button_A) = Pressed then 43 | -- If button A is pressed 44 | 45 | -- Display the letter A 46 | MicroBit.Display.Display ('A'); 47 | 48 | elsif MicroBit.Buttons.State (Button_B) = Pressed then 49 | -- If button B is pressed 50 | 51 | -- Display the letter B 52 | MicroBit.Display.Display ('B'); 53 | end if; 54 | 55 | MicroBit.Time.Delay_Ms (200); 56 | end loop; 57 | end Main; 58 | ``` 59 | -------------------------------------------------------------------------------- /examples/MicroBit/buttons/buttons.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/MicroBit/microbit_zfp.gpr"; 2 | 3 | project Buttons is 4 | 5 | for Runtime ("ada") use MicroBit_ZFP'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames MicroBit_ZFP.Compiler; 14 | 15 | package Linker is 16 | for Default_Switches ("Ada") use 17 | MicroBit_ZFP.Linker_Switches & 18 | ("-Wl,--print-memory-usage", 19 | "-Wl,--gc-sections"); 20 | end Linker; 21 | 22 | package Ide is 23 | for Program_Host use ":1234"; 24 | for Communication_Protocol use "remote"; 25 | for Connection_Tool use "pyocd"; 26 | end Ide; 27 | 28 | end Buttons; 29 | -------------------------------------------------------------------------------- /examples/MicroBit/digital_in/digital_in.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/MicroBit/microbit_zfp.gpr"; 2 | 3 | project Digital_In is 4 | 5 | for Runtime ("ada") use MicroBit_ZFP'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames MicroBit_ZFP.Compiler; 14 | 15 | package Linker is 16 | for Default_Switches ("Ada") use 17 | MicroBit_ZFP.Linker_Switches & 18 | ("-Wl,--print-memory-usage", 19 | "-Wl,--gc-sections"); 20 | end Linker; 21 | 22 | package Ide is 23 | for Program_Host use ":1234"; 24 | for Communication_Protocol use "remote"; 25 | for Connection_Tool use "pyocd"; 26 | end Ide; 27 | 28 | end Digital_In; 29 | -------------------------------------------------------------------------------- /examples/MicroBit/digital_out/README.md: -------------------------------------------------------------------------------- 1 | Digital Output Example 2 | ====================== 3 | 4 | In this example we will see how to control a pin as digital output by flashing 5 | an external LED. This means that the voltage on the pin connected to the LED 6 | will be either 0 volts or 3.3 volts. 7 | 8 | Wiring Diagram 9 | ============== 10 | 11 | Wiring the LED directly from the output pin to ground will make it burn, so we 12 | have to add a resistor to limit the flow of current. 13 | 14 | Extra hardware: 15 | 16 | - A breadboard 17 | - An LED 18 | - A 470 ohm resistor 19 | 20 | Wiring: 21 | 22 | 23 | 24 | Code 25 | ==== 26 | 27 | To control the IO pin we are going to use the procedure `Set` of the package 28 | `MicroBit.IOs`. 29 | 30 | ```ada 31 | procedure Set (Pin : Pin_Id; Value : Boolean) 32 | with Pre => Supports (Pin, Digital); 33 | ``` 34 | 35 | Arguments: 36 | 37 | - Pin : The id of the pin that we want to control as digital output 38 | - Value : A boolean that says if we want the pin to be high (True) or low 39 | (False) 40 | 41 | Precondition: 42 | 43 | The procedure `Set` has a precondition that the pin must support digital IO. 44 | 45 | We also use the procedure `Delay_Ms` of the package `MicroBit.Time` to stop the 46 | program for a short amount of time. 47 | 48 | Here is the code: 49 | ```ada 50 | with MicroBit.IOs; 51 | with MicroBit.Time; 52 | 53 | procedure Main is 54 | begin 55 | 56 | -- Loop forever 57 | loop 58 | -- Turn on the LED connected to pin 0 59 | MicroBit.IOs.Set (0, True); 60 | 61 | -- Wait 500 milliseconds 62 | MicroBit.Time.Delay_Ms (500); 63 | 64 | -- Turn off the LED connected to pin 0 65 | MicroBit.IOs.Set (0, False); 66 | 67 | -- Wait 500 milliseconds 68 | MicroBit.Time.Delay_Ms (500); 69 | end loop; 70 | end Main; 71 | ``` 72 | -------------------------------------------------------------------------------- /examples/MicroBit/digital_out/digital_out.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/MicroBit/microbit_zfp.gpr"; 2 | 3 | project Digital_Out is 4 | 5 | for Runtime ("ada") use MicroBit_ZFP'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames MicroBit_ZFP.Compiler; 14 | 15 | package Linker is 16 | for Default_Switches ("Ada") use 17 | MicroBit_ZFP.Linker_Switches & 18 | ("-Wl,--print-memory-usage", 19 | "-Wl,--gc-sections"); 20 | end Linker; 21 | 22 | package Ide is 23 | for Program_Host use ":1234"; 24 | for Communication_Protocol use "remote"; 25 | for Connection_Tool use "pyocd"; 26 | end Ide; 27 | 28 | end Digital_Out; 29 | -------------------------------------------------------------------------------- /examples/MicroBit/doc/fritzing_sketches/analog_in.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdaCore/Ada_Drivers_Library/8a62be90b9ef13042ce9dbf2112f453fb6dec777/examples/MicroBit/doc/fritzing_sketches/analog_in.fzz -------------------------------------------------------------------------------- /examples/MicroBit/doc/fritzing_sketches/analog_out.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdaCore/Ada_Drivers_Library/8a62be90b9ef13042ce9dbf2112f453fb6dec777/examples/MicroBit/doc/fritzing_sketches/analog_out.fzz -------------------------------------------------------------------------------- /examples/MicroBit/doc/fritzing_sketches/digital_in.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdaCore/Ada_Drivers_Library/8a62be90b9ef13042ce9dbf2112f453fb6dec777/examples/MicroBit/doc/fritzing_sketches/digital_in.fzz -------------------------------------------------------------------------------- /examples/MicroBit/doc/fritzing_sketches/digital_out.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdaCore/Ada_Drivers_Library/8a62be90b9ef13042ce9dbf2112f453fb6dec777/examples/MicroBit/doc/fritzing_sketches/digital_out.fzz -------------------------------------------------------------------------------- /examples/MicroBit/doc/fritzing_sketches/music.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdaCore/Ada_Drivers_Library/8a62be90b9ef13042ce9dbf2112f453fb6dec777/examples/MicroBit/doc/fritzing_sketches/music.fzz -------------------------------------------------------------------------------- /examples/MicroBit/doc/fritzing_sketches/screenshots/analog_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdaCore/Ada_Drivers_Library/8a62be90b9ef13042ce9dbf2112f453fb6dec777/examples/MicroBit/doc/fritzing_sketches/screenshots/analog_in.png -------------------------------------------------------------------------------- /examples/MicroBit/doc/fritzing_sketches/screenshots/digital_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdaCore/Ada_Drivers_Library/8a62be90b9ef13042ce9dbf2112f453fb6dec777/examples/MicroBit/doc/fritzing_sketches/screenshots/digital_in.png -------------------------------------------------------------------------------- /examples/MicroBit/doc/fritzing_sketches/screenshots/digital_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdaCore/Ada_Drivers_Library/8a62be90b9ef13042ce9dbf2112f453fb6dec777/examples/MicroBit/doc/fritzing_sketches/screenshots/digital_out.png -------------------------------------------------------------------------------- /examples/MicroBit/doc/fritzing_sketches/screenshots/music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdaCore/Ada_Drivers_Library/8a62be90b9ef13042ce9dbf2112f453fb6dec777/examples/MicroBit/doc/fritzing_sketches/screenshots/music.png -------------------------------------------------------------------------------- /examples/MicroBit/follower/README.md: -------------------------------------------------------------------------------- 1 | Line Follower Example 2 | ===================== 3 | 4 | This example builds upon the "servos" and "neopixel" examples to implement 5 | a buggy with line following ability, based on the Kitronik :MOVE line 6 | follower add-on (which provides two optical sensors on the underside of the buggy). 7 | 8 | The control loop is designed to follow a black strip (e.g. 20 mm black tape) 9 | on a light background. If both sensors get dark (e.g. due to a strip of tape 10 | across the main line), the buggy stops. 11 | 12 | The motors are initially stopped. Press button A to start/stop running along 13 | the strip. 14 | 15 | -------------------------------------------------------------------------------- /examples/MicroBit/follower/follower.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/MicroBit/microbit_zfp.gpr"; 2 | 3 | project Follower is 4 | 5 | for Runtime ("ada") use MicroBit_ZFP'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames MicroBit_ZFP.Compiler; 14 | 15 | package Linker is 16 | for Default_Switches ("Ada") use 17 | MicroBit_ZFP.Linker_Switches & 18 | ("-Wl,--print-memory-usage", 19 | "-Wl,--gc-sections"); 20 | end Linker; 21 | 22 | package Ide is 23 | for Program_Host use ":1234"; 24 | for Communication_Protocol use "remote"; 25 | for Connection_Tool use "pyocd"; 26 | end Ide; 27 | 28 | end Follower; 29 | -------------------------------------------------------------------------------- /examples/MicroBit/music/music.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/MicroBit/microbit_zfp.gpr"; 2 | 3 | project Music is 4 | 5 | for Runtime ("ada") use MicroBit_ZFP'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames MicroBit_ZFP.Compiler; 14 | 15 | package Linker is 16 | for Default_Switches ("Ada") use 17 | MicroBit_ZFP.Linker_Switches & 18 | ("-Wl,--print-memory-usage", 19 | "-Wl,--gc-sections"); 20 | end Linker; 21 | 22 | package Ide is 23 | for Program_Host use ":1234"; 24 | for Communication_Protocol use "remote"; 25 | for Connection_Tool use "pyocd"; 26 | end Ide; 27 | 28 | end Music; 29 | -------------------------------------------------------------------------------- /examples/MicroBit/neopixel/README.md: -------------------------------------------------------------------------------- 1 | NeoPixel example 2 | ================ 3 | 4 | In this example we will see how to control a NeoPixel LED strip 5 | such as the one on the Kitronik Servo:Lite board. 6 | 7 | -------------------------------------------------------------------------------- /examples/MicroBit/neopixel/neopixel.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/MicroBit/microbit_zfp.gpr"; 2 | 3 | project NeoPixel is 4 | 5 | for Runtime ("ada") use MicroBit_ZFP'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames MicroBit_ZFP.Compiler; 14 | 15 | package Linker is 16 | for Default_Switches ("Ada") use 17 | MicroBit_ZFP.Linker_Switches & 18 | ("-Wl,--print-memory-usage", 19 | "-Wl,--gc-sections"); 20 | end Linker; 21 | 22 | package Ide is 23 | for Program_Host use ":1234"; 24 | for Communication_Protocol use "remote"; 25 | for Connection_Tool use "pyocd"; 26 | end Ide; 27 | 28 | end NeoPixel; 29 | -------------------------------------------------------------------------------- /examples/MicroBit/servos/README.md: -------------------------------------------------------------------------------- 1 | Servos Example 2 | ============== 3 | 4 | In this example we will see how to control servo-motors. This 5 | is a special case of PWM output where the period is a fixed 50 Hz, 6 | and the pulse width varies from 500 to 1500 µs to denote a setpoint 7 | between 0° and 180°. 8 | 9 | For continuous servos, setpoints 0 and 180 correspond to full speed 10 | in either direction, and 90 corresponds to neutral (stopped). 11 | 12 | -------------------------------------------------------------------------------- /examples/MicroBit/servos/servos.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/MicroBit/microbit_zfp.gpr"; 2 | 3 | project Servos is 4 | 5 | for Runtime ("ada") use MicroBit_ZFP'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames MicroBit_ZFP.Compiler; 14 | 15 | package Linker is 16 | for Default_Switches ("Ada") use 17 | MicroBit_ZFP.Linker_Switches & 18 | ("-Wl,--print-memory-usage", 19 | "-Wl,--gc-sections"); 20 | end Linker; 21 | 22 | package Ide is 23 | for Program_Host use ":1234"; 24 | for Communication_Protocol use "remote"; 25 | for Connection_Tool use "pyocd"; 26 | end Ide; 27 | 28 | end Servos; 29 | -------------------------------------------------------------------------------- /examples/MicroBit/text_scrolling/README.md: -------------------------------------------------------------------------------- 1 | Text Scrolling Example 2 | ====================== 3 | 4 | In this example we will see how to display text on the LED matrix of the 5 | micro:bit. 6 | 7 | Code 8 | ==== 9 | 10 | To display text on the LED matrix, we will use the procedure `Display` of the 11 | `MicroBit.Display` package. 12 | 13 | 14 | ```ada 15 | procedure Display (Str : String) 16 | with Pre => Str'Length <= Scroll_Text_Max_Length; 17 | ``` 18 | 19 | Arguments: 20 | 21 | - Str : The text to be displayed on the LED matrix 22 | 23 | Precondition: 24 | 25 | The procedure `Display` has a precondition that the length of the text cannot 26 | be more than `Scroll_Text_Max_Length` (128 characters). 27 | 28 | Here is the code: 29 | ```ada 30 | with MicroBit.Display; 31 | 32 | procedure Main is 33 | begin 34 | 35 | loop 36 | MicroBit.Display.Display ("Make with Ada! "); 37 | end loop; 38 | end Main; 39 | ``` 40 | -------------------------------------------------------------------------------- /examples/MicroBit/text_scrolling/text_scrolling.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/MicroBit/microbit_zfp.gpr"; 2 | 3 | project Text_Scrolling is 4 | 5 | for Runtime ("ada") use MicroBit_ZFP'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames MicroBit_ZFP.Compiler; 14 | 15 | package Linker is 16 | for Default_Switches ("Ada") use 17 | MicroBit_ZFP.Linker_Switches & 18 | ("-Wl,--print-memory-usage", 19 | "-Wl,--gc-sections", 20 | "-U__gnat_irq_trap"); 21 | end Linker; 22 | 23 | package Ide is 24 | for Program_Host use ":1234"; 25 | for Communication_Protocol use "remote"; 26 | for Connection_Tool use "pyocd"; 27 | end Ide; 28 | 29 | end Text_Scrolling; 30 | -------------------------------------------------------------------------------- /examples/NRF52_DK/BLE_beacon/BLE_beacon.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/NRF52_DK/nrf52_dk_zfp.gpr"; 2 | 3 | project BLE_Beacon is 4 | 5 | for Runtime ("ada") use NRF52_DK_ZFP'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames NRF52_DK_ZFP.Compiler; 14 | 15 | package Linker is 16 | for Default_Switches ("Ada") use 17 | NRF52_DK_ZFP.Linker_Switches & 18 | ("-Wl,--print-memory-usage", 19 | "-Wl,--gc-sections"); 20 | end Linker; 21 | 22 | package Ide is 23 | for Program_Host use ":1234"; 24 | for Communication_Protocol use "remote"; 25 | for Connection_Tool use "pyocd"; 26 | end Ide; 27 | 28 | end BLE_Beacon; 29 | -------------------------------------------------------------------------------- /examples/NRF52_DK/buttons/README.md: -------------------------------------------------------------------------------- 1 | Buttons Example 2 | =============== 3 | 4 | In this example we will see how to use the four buttons of the nRF52 Development Kit. 5 | 6 | Code 7 | ==== 8 | 9 | To know if a button is pressed or not, we will use the procedure `State` of the 10 | `NRF52_DK.Buttons` package. 11 | 12 | ```ada 13 | type Button_State is (Pressed, Released); 14 | 15 | type Button_Id is (Button_1, Button_2, Button_3, Button_4); 16 | 17 | function State (Button : Button_Id) return Button_State; 18 | ``` 19 | 20 | Arguments: 21 | 22 | - Button : The Id of the button that we want to check. There are four Ids: 23 | `Button_1`, `Button_2`, `Button_3`, and `Button_4` which correspond 24 | to the silkscreen on the board. 25 | 26 | Return value: 27 | 28 | The procedure `State` return the `Button_State` that can be either `Pressed` or 29 | `Released`. 30 | 31 | Here is the code: 32 | ```ada 33 | with NRF52_DK.Buttons; use NRF52_DK.Buttons; 34 | with NRF52_DK.LEDs; use NRF52_DK.LEDs; 35 | with NRF52_DK.Time; 36 | 37 | procedure Main is 38 | begin 39 | Initialize_LEDs; 40 | loop 41 | Turn_Off (LED1); 42 | Turn_Off (LED2); 43 | Turn_Off (LED3); 44 | Turn_Off (LED4); 45 | if NRF52_DK.Buttons.State (Button_1) = Pressed then 46 | Turn_On (LED1); 47 | end if; 48 | 49 | if NRF52_DK.Buttons.State (Button_2) = Pressed then 50 | Turn_On (LED2); 51 | end if; 52 | 53 | if NRF52_DK.Buttons.State (Button_3) = Pressed then 54 | Turn_On (LED3); 55 | end if; 56 | 57 | if NRF52_DK.Buttons.State (Button_4) = Pressed then 58 | Turn_On (LED4); 59 | end if; 60 | 61 | NRF52_DK.Time.Delay_Ms (200); 62 | end loop; 63 | end Main; 64 | ``` 65 | -------------------------------------------------------------------------------- /examples/NRF52_DK/buttons/buttons.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/NRF52_DK/nrf52_dk_zfp.gpr"; 2 | 3 | project Buttons is 4 | 5 | for Runtime ("ada") use NRF52_DK_ZFP'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames NRF52_DK_ZFP.Compiler; 14 | 15 | package Linker is 16 | for Default_Switches ("Ada") use 17 | NRF52_DK_ZFP.Linker_Switches & 18 | ("-Wl,--print-memory-usage", 19 | "-Wl,--gc-sections"); 20 | end Linker; 21 | 22 | package Ide is 23 | for Program_Host use ":1234"; 24 | for Communication_Protocol use "remote"; 25 | for Connection_Tool use "pyocd"; 26 | end Ide; 27 | 28 | end Buttons; 29 | -------------------------------------------------------------------------------- /examples/NRF52_DK/digital_out/README.md: -------------------------------------------------------------------------------- 1 | Digital Output Example 2 | ====================== 3 | 4 | In this example we will see how to control a pin as digital output by flashing 5 | an on-board LED. This means that the voltage on the pin connected to the LED 6 | will be either 0 volts or 3.3 volts. 7 | 8 | Code 9 | ==== 10 | 11 | To control the IO pin we are going to use the procedure `Set` of the package 12 | `NRF52_DK.IOs`. 13 | 14 | ```ada 15 | procedure Set (Pin : Pin_Id; Value : Boolean) 16 | with Pre => Supports (Pin, Digital); 17 | ``` 18 | 19 | Arguments: 20 | 21 | - Pin : The id of the pin that we want to control as digital output 22 | - Value : A boolean that says if we want the pin to be high (True) or low 23 | (False) 24 | 25 | Precondition: 26 | 27 | The procedure `Set` has a precondition that the pin must support digital IO. 28 | 29 | We also use the procedure `Delay_Ms` of the package `NRF52_DK.Time` to stop the 30 | program for a short amount of time. 31 | 32 | Here is the code: 33 | ```ada 34 | with NRF52_DK.IOs; 35 | with NRF52_DK.Time; 36 | 37 | procedure Main is 38 | begin 39 | 40 | -- Loop forever 41 | loop 42 | -- Turn on the LED connected to pin 17 43 | NRF52_DK.IOs.Set (17, True); 44 | 45 | -- Wait 500 milliseconds 46 | NRF52_DK.Time.Delay_Ms (500); 47 | 48 | -- Turn off the LED connected to pin 17 49 | NRF52_DK.IOs.Set (17, False); 50 | 51 | -- Wait 500 milliseconds 52 | NRF52_DK.Time.Delay_Ms (500); 53 | end loop; 54 | end Main; 55 | 56 | ``` 57 | -------------------------------------------------------------------------------- /examples/NRF52_DK/digital_out/digital_out.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/NRF52_DK/nrf52_dk_zfp.gpr"; 2 | 3 | project Digital_Out is 4 | 5 | for Runtime ("ada") use NRF52_DK_ZFP'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames NRF52_DK_ZFP.Compiler; 14 | 15 | package Linker is 16 | for Default_Switches ("Ada") use 17 | NRF52_DK_ZFP.Linker_Switches & 18 | ("-Wl,--print-memory-usage", 19 | "-Wl,--gc-sections"); 20 | end Linker; 21 | 22 | package Ide is 23 | for Program_Host use ":1234"; 24 | for Communication_Protocol use "remote"; 25 | for Connection_Tool use "pyocd"; 26 | end Ide; 27 | 28 | end Digital_Out; 29 | -------------------------------------------------------------------------------- /examples/OpenMV2/README.md: -------------------------------------------------------------------------------- 1 | [OpenMV](https://openmv.io/) is the Arduino of computer vision, an STM32F4 2 | combined with a camera module on a small PCB. 3 | 4 | We only support the version 2, which to our knowledge is out of stock... 5 | -------------------------------------------------------------------------------- /examples/OpenMV2/openmv2_example.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/OpenMV2/openmv2_full"; 2 | 3 | project OpenMV2_Example is 4 | 5 | -- OpenMV2 runtime is derived from smt32f429-disco with 6 | -- 7 | -- HSE_Clock_Frequency : constant := 12_000_000; 8 | -- 9 | -- in bsp/s-bbopa.ads 10 | for Runtime ("Ada") use OpenMV2_Full'Runtime ("Ada"); 11 | 12 | for Target use "arm-eabi"; 13 | for Source_Dirs use ("src"); 14 | 15 | for Languages use ("Ada"); 16 | for Object_Dir use "obj"; 17 | for Main use ("main.adb"); 18 | for Create_Missing_Dirs use "True"; 19 | 20 | package Compiler renames OpenMV2_Full.Compiler; 21 | 22 | end OpenMV2_Example; 23 | -------------------------------------------------------------------------------- /examples/STM32F429_Discovery/README.md: -------------------------------------------------------------------------------- 1 | The STM32F429 Discovery is a low cost development kit for the STM32F29 2 | micro-controller. 3 | 4 | You can get it here: 5 | 6 | - [Mouser](http://www.mouser.fr/search/ProductDetail.aspx?R=0virtualkey0virtualkeySTM32F429I-DISC1) 7 | - [Farnell](http://uk.farnell.com/stmicroelectronics/stm32f429i-disc1/dev-board-advanced-line-mcu/dp/2506924) 8 | - [DigiKey](https://www.digikey.fr/product-detail/fr/stmicroelectronics/STM32F429I-DISC1/497-16140-ND/5731713) 9 | -------------------------------------------------------------------------------- /examples/STM32F429_Discovery/blinky_f429disco.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/stm32f429_discovery/stm32f429_discovery_full.gpr"; 2 | 3 | project Blinky_F429Disco extends "../shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("blinky.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("../shared/hello_world_blinky/src"); 10 | for Object_Dir use "../shared/hello_world_blinky/obj/stm32f429disco"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames STM32F429_Discovery_Full.Compiler; 14 | 15 | end Blinky_F429Disco; 16 | -------------------------------------------------------------------------------- /examples/STM32F429_Discovery/dma2d_stm32f429disco.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/stm32f429_discovery/stm32f429_discovery_full.gpr"; 2 | 3 | project Dma2d_STM32F429Disco extends "../shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); 6 | for Object_Dir use "../shared/stm32_dma2d/obj/stm32f429disco"; 7 | 8 | for Main use ("dma2d.adb"); 9 | for Source_Dirs use ("../shared/stm32_dma2d/src"); 10 | for Create_Missing_Dirs use "True"; 11 | 12 | package Linker is 13 | for Default_Switches ("ada") use 14 | ("-Wl,-gc-section", "-Wl,--print-memory-usage"); 15 | end Linker; 16 | 17 | package Compiler renames STM32F429_Discovery_Full.Compiler; 18 | 19 | end Dma2d_STM32F429Disco; 20 | -------------------------------------------------------------------------------- /examples/STM32F429_Discovery/draw_stm32f429disco.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/stm32f429_discovery/stm32f429_discovery_full.gpr"; 2 | 3 | project Draw_STM32F429Disco extends "../shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); 6 | for Object_Dir use "../shared/draw/obj/stm32f429disco"; 7 | for Create_Missing_Dirs use "True"; 8 | 9 | for Main use ("draw.adb"); 10 | for Source_Dirs use ("../shared/draw/src"); 11 | 12 | package Linker is 13 | for Default_Switches ("ada") use 14 | ("-Wl,-gc-section", "-Wl,--print-memory-usage"); 15 | end Linker; 16 | 17 | package Compiler renames STM32F429_Discovery_Full.Compiler; 18 | 19 | end Draw_STM32F429Disco; 20 | -------------------------------------------------------------------------------- /examples/STM32F429_Discovery/hm11_f429disco.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/stm32f429_discovery/stm32f429_discovery_full.gpr"; 2 | 3 | project HM11_F429Disco extends "../shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("hm11_example.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("../shared/hm11/src"); 10 | for Object_Dir use "../shared/hm11/obj/stm32f429disco"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames STM32F429_Discovery_Full.Compiler; 14 | 15 | end HM11_F429Disco; 16 | 17 | -------------------------------------------------------------------------------- /examples/STM32F429_Discovery/nrf24l01p_f429disco.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/stm32f429_discovery/stm32f429_discovery_full.gpr"; 2 | 3 | project nRF24L01p_F429Disco extends "../shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("nrf24l01p_example.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("../shared/nrf24l01p/src"); 10 | for Object_Dir use "../shared/nrf24l01p/obj/stm32f429disco"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames STM32F429_Discovery_Full.Compiler; 14 | 15 | end nRF24L01p_F429Disco; 16 | -------------------------------------------------------------------------------- /examples/STM32F429_Discovery/serial_ports_f429disco.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/stm32f429_discovery/stm32f429_discovery_full.gpr"; 2 | 3 | project Serial_Ports_F429Disco extends "../shared/common/common.gpr" is 4 | 5 | for Languages use ("Ada"); 6 | 7 | for Main use ("demo_serial_port_blocking.adb", "demo_serial_port_nonblocking.adb", "demo_serial_port_streaming"); 8 | 9 | for Source_Dirs use ("../shared/serial_ports/src"); 10 | 11 | for Object_Dir use "../shared/serial_ports/obj/stm32f429disco"; 12 | 13 | for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); 14 | 15 | for Create_Missing_Dirs use "True"; 16 | 17 | package Builder is 18 | for Global_Configuration_Pragmas use "../shared/serial_ports/gnat.adc"; 19 | end Builder; 20 | 21 | package Compiler renames STM32F429_Discovery_Full.Compiler; 22 | 23 | end Serial_Ports_F429Disco; 24 | -------------------------------------------------------------------------------- /examples/STM32F469_Discovery/README.md: -------------------------------------------------------------------------------- 1 | The STM32F469 Discovery is a low cost development kit for the STM32F469 2 | micro-controller. 3 | 4 | 5 | You can get it here: 6 | 7 | - [Mouser](http://www.mouser.fr/ProductDetail/STMicroelectronics/STM32F469I-DISCO) 8 | - [Farnell](http://uk.farnell.com/stmicroelectronics/stm32f469i-disco/dev-board-discovery-arduino/dp/2500227) 9 | - [DigiKey](https://www.digikey.fr/products/fr?keywords=stm32f469%20disco) 10 | 11 | -------------------------------------------------------------------------------- /examples/STM32F469_Discovery/dma2d_stm32f469disco.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/stm32f469_discovery/stm32f469_discovery_full.gpr"; 2 | 3 | project Dma2d_STM32F469Disco extends "../shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32F469_Discovery_Full'Runtime("Ada"); 6 | for Object_Dir use "../shared/stm32_dma2d/obj/stm32f469disco"; 7 | for Create_Missing_Dirs use "True"; 8 | 9 | for Main use ("dma2d.adb"); 10 | for Source_Dirs use ("../shared/stm32_dma2d/src"); 11 | 12 | package Compiler renames STM32F469_Discovery_Full.Compiler; 13 | 14 | end Dma2d_STM32F469Disco; 15 | -------------------------------------------------------------------------------- /examples/STM32F469_Discovery/draw_stm32f469disco.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/stm32f469_discovery/stm32f469_discovery_full.gpr"; 2 | 3 | project Draw_STM32F469Disco extends "../shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32F469_Discovery_Full'Runtime("Ada"); 6 | for Object_Dir use "../shared/draw/obj/stm32f469disco"; 7 | for Create_Missing_Dirs use "True"; 8 | 9 | for Main use ("draw.adb"); 10 | for Source_Dirs use ("../shared/draw/src"); 11 | 12 | package Compiler renames STM32F469_Discovery_Full.Compiler; 13 | 14 | end Draw_STM32F469Disco; 15 | -------------------------------------------------------------------------------- /examples/STM32F469_Discovery/hello_world_tasking_f469disco.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/stm32f469_discovery/stm32f469_discovery_full.gpr"; 2 | 3 | project Hello_World_Tasking_F469Disco extends "../shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32F469_Discovery_Full'Runtime("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("hello_world.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("../shared/hello_world_tasking/src"); 10 | for Object_Dir use "../shared/hello_world_tasking/obj/" & "stm32f469disco"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Builder is 14 | for Global_Configuration_Pragmas use "../shared/hello_world_tasking/gnat.adc"; 15 | end Builder; 16 | 17 | package Compiler renames STM32F469_Discovery_Full.Compiler; 18 | 19 | end Hello_World_Tasking_F469Disco; 20 | -------------------------------------------------------------------------------- /examples/STM32F4_DISCO/README.md: -------------------------------------------------------------------------------- 1 | The STM32F4 DISCO is a low cost development kit for the STM32F407 2 | micro-controller. 3 | 4 | You can get it here: 5 | 6 | - [Mouser](http://www.mouser.fr/search/ProductDetail.aspx?R=0virtualkey0virtualkeySTM32F407G-DISC1) 7 | - [Farnell](http://fr.farnell.com/stmicroelectronics/stm32f411e-disco/carte-de-dev-stm32-discovery/dp/2456732-DISC1) 8 | - [DigiKey](https://www.digikey.fr/product-detail/fr/stmicroelectronics/STM32F407G-DISC1/497-16287-ND/5824404) 9 | -------------------------------------------------------------------------------- /examples/STM32F4_DISCO/accelerometer/accelerometer.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/stm32f407_discovery/stm32f407_discovery_full.gpr"; 2 | 3 | project Accelerometer extends "../../shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32F407_Discovery_Full'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Linker is 14 | for Default_Switches ("Ada") use ("-Wl,--print-memory-usage"); 15 | end Linker; 16 | 17 | package Compiler renames STM32F407_Discovery_Full.Compiler; 18 | 19 | end Accelerometer; 20 | -------------------------------------------------------------------------------- /examples/STM32F4_DISCO/blinky_f4disco.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/stm32f407_discovery/stm32f407_discovery_full.gpr"; 2 | 3 | project Blinky_F4Disco extends "../shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32F407_Discovery_Full'Runtime("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("blinky.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("../shared/hello_world_blinky/src"); 10 | for Object_Dir use "../shared/hello_world_blinky/obj/stm32f407disco"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames STM32F407_Discovery_Full.Compiler; 14 | end Blinky_F4Disco; 15 | -------------------------------------------------------------------------------- /examples/STM32F4_DISCO/filesystem/README.md: -------------------------------------------------------------------------------- 1 | # Filesystem example 2 | 3 | This filesystem example set currently runs only under a unix host. Most of the 4 | other examples in this repository will run under either Windows or Linux, 5 | however this set requires a special build of st-util which is not yet available 6 | for Windows, and the example code looks back to the host computer and expects 7 | to see a unix file system. 8 | 9 | The demo will parse the file on the host and print some basic information about 10 | the file in the same terminal window used to run st-util and then exits. 11 | 12 | 1. stlink and st-util 13 | ---------- 14 | If this command 15 | ``` 16 | st-util --semihosting 17 | ``` 18 | does not generate an error about an unknown option then your st-util is new 19 | enough. If you get the error, please visit github.com/texane/stlink for the 20 | latest source code. 21 | 22 | 2. The disk_8_partitions.img file 23 | ---------- 24 | 25 | This example requires a file named disk_8_partitions.img. This is the target 26 | file about which the application will return some basic information. Copy the 27 | disk_8_partitions.img from testsuite/tests/disk_partitions/ in the /tmp/ 28 | directory on your host computer before you run the code. 29 | 30 | 3. The basics 31 | ---------- 32 | a) In a shell window run the command 33 | ``` 34 | st-util --semihosting 35 | ``` 36 | b) Build the demo and load it onto your stm32 board. 37 | 38 | c) Run the demo on the board and check the outputs in the shell window that you 39 | used for st-util. 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /examples/STM32F4_DISCO/filesystem/filesystem.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/stm32f407_discovery/stm32f407_discovery_full.gpr"; 2 | 3 | project Filesystem extends "../../shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32F407_Discovery_Full'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Linker is 14 | for Default_Switches ("Ada") use ("-Wl,--print-memory-usage"); 15 | end Linker; 16 | 17 | package Compiler renames STM32F407_Discovery_Full.Compiler; 18 | 19 | end Filesystem; 20 | -------------------------------------------------------------------------------- /examples/STM32F4_DISCO/serial_ports_f4disco.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/stm32f407_discovery/stm32f407_discovery_full.gpr"; 2 | 3 | project Serial_Ports_F4Disco extends "../shared/common/common.gpr" is 4 | 5 | for Languages use ("Ada"); 6 | 7 | for Main use ("demo_serial_port_blocking.adb", "demo_serial_port_nonblocking.adb", "demo_serial_port_streaming"); 8 | 9 | for Source_Dirs use ("../shared/serial_ports/src"); 10 | 11 | for Object_Dir use "../shared/serial_ports/obj/stm32f407disco"; 12 | 13 | for Runtime ("Ada") use STM32F407_Discovery_Full'Runtime("Ada"); 14 | 15 | for Create_Missing_Dirs use "True"; 16 | 17 | package Builder is 18 | for Global_Configuration_Pragmas use "../shared/serial_ports/gnat.adc"; 19 | end Builder; 20 | 21 | package Compiler renames STM32F407_Discovery_Full.Compiler; 22 | 23 | end Serial_Ports_F4Disco; 24 | -------------------------------------------------------------------------------- /examples/STM32F4_DISCO/simple_audio/simple_audio.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/stm32f407_discovery/stm32f407_discovery_full.gpr"; 2 | 3 | project Simple_Audio extends "../../shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32F407_Discovery_Full'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Linker is 14 | for Default_Switches ("Ada") use ("-Wl,--print-memory-usage"); 15 | end Linker; 16 | 17 | package Compiler renames STM32F407_Discovery_Full.Compiler; 18 | 19 | end Simple_Audio; 20 | -------------------------------------------------------------------------------- /examples/STM32F746_Discovery/README.md: -------------------------------------------------------------------------------- 1 | The STM32F746 Discovery is a low cost development kit for the STM32F746 2 | micro-controller. 3 | 4 | 5 | You can get it here: 6 | 7 | - [Mouser](http://www.mouser.fr/ProductDetail/STMicroelectronics/STM32F746G-DISCO/) 8 | - [Farnell](http://uk.farnell.com/stmicroelectronics/stm32f746g-disco/dev-board-cortex-m7-discovery/dp/2480961) 9 | - [DigiKey](https://www.digikey.fr/products/fr?keywords=stm32f746%20disco) 10 | 11 | -------------------------------------------------------------------------------- /examples/STM32F746_Discovery/blinky_f7disco.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/stm32f746_discovery/stm32f746_discovery_full.gpr"; 2 | 3 | project Blinky_F7Disco extends "../shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32F746_Discovery_Full'Runtime("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("blinky.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("../shared/hello_world_blinky/src"); 10 | for Object_Dir use "../shared/hello_world_blinky/obj/stm32f7disco"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames STM32F746_Discovery_Full.Compiler; 14 | 15 | end Blinky_F7Disco; 16 | -------------------------------------------------------------------------------- /examples/STM32F746_Discovery/dma2d_stm32f746disco.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/stm32f746_discovery/stm32f746_discovery_full.gpr"; 2 | 3 | project Dma2d_STM32F746Disco extends "../shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32F746_Discovery_Full'Runtime("Ada"); 6 | for Object_Dir use "../shared/stm32_dma2d/obj/stm32f746disco"; 7 | for Create_Missing_Dirs use "True"; 8 | 9 | for Main use ("dma2d.adb"); 10 | for Source_Dirs use ("../shared/stm32_dma2d/src"); 11 | 12 | package Compiler renames STM32F746_Discovery_Full.Compiler; 13 | 14 | end Dma2d_STM32F746Disco; 15 | -------------------------------------------------------------------------------- /examples/STM32F746_Discovery/draw_stm32f746disco.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/stm32f746_discovery/stm32f746_discovery_full.gpr"; 2 | 3 | project Draw_STM32F746Disco extends "../shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32F746_Discovery_Full'Runtime("Ada"); 6 | for Object_Dir use "../shared/draw/obj/stm32f746disco"; 7 | for Create_Missing_Dirs use "True"; 8 | 9 | for Main use ("draw.adb"); 10 | for Source_Dirs use ("../shared/draw/src"); 11 | 12 | package Compiler renames STM32F746_Discovery_Full.Compiler; 13 | 14 | end Draw_STM32F746Disco; 15 | -------------------------------------------------------------------------------- /examples/STM32F769_Discovery/README.md: -------------------------------------------------------------------------------- 1 | The STM32F769 Discovery is a low cost development kit for the STM32F769 2 | micro-controller. 3 | 4 | You can get it here: 5 | 6 | - [Mouser](http://www.mouser.fr/ProductDetail/STMicroelectronics/STM32F769I-DISCO/) 7 | - [Farnell](http://uk.farnell.com/stmicroelectronics/stm32f769i-disco/discovery-board-mcu/dp/2546570) 8 | - [DigiKey](https://www.digikey.fr/product-detail/fr/stmicroelectronics/STM32F769I-DISCO/497-16524-ND/6004739) 9 | 10 | -------------------------------------------------------------------------------- /examples/STM32F769_Discovery/dma2d_stm32f769disco.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/stm32f769_discovery/stm32f769_discovery_full.gpr"; 2 | 3 | project Dma2d_STM32F769Disco extends "../shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32F769_Discovery_Full'Runtime("Ada"); 6 | for Object_Dir use "../shared/stm32_dma2d/obj/stm32f769disco"; 7 | for Create_Missing_Dirs use "True"; 8 | 9 | for Main use ("dma2d.adb"); 10 | for Source_Dirs use ("../shared/stm32_dma2d/src"); 11 | 12 | package Compiler renames STM32F769_Discovery_Full.Compiler; 13 | 14 | end Dma2d_STM32F769Disco; 15 | -------------------------------------------------------------------------------- /examples/STM32F769_Discovery/draw_stm32f769disco.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/stm32f769_discovery/stm32f769_discovery_full.gpr"; 2 | 3 | project Draw_STM32F769Disco extends "../shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32F769_Discovery_Full'Runtime("Ada"); 6 | for Object_Dir use "../shared/draw/obj/stm32f769disco"; 7 | for Create_Missing_Dirs use "True"; 8 | 9 | for Main use ("draw.adb"); 10 | for Source_Dirs use ("../shared/draw/src"); 11 | 12 | package Compiler renames STM32F769_Discovery_Full.Compiler; 13 | 14 | end Draw_STM32F769Disco; 15 | -------------------------------------------------------------------------------- /examples/Unleashed/blinky/unleashed_blinky.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/Unleashed/unleashed_sfp.gpr"; 2 | 3 | project Unleashed_Blinky Is 4 | 5 | for Runtime ("Ada") use Unleashed_SFP'Runtime ("Ada"); 6 | for Target use "riscv64-elf"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames Unleashed_SFP.Compiler; 14 | 15 | package Linker is 16 | for Default_Switches ("Ada") use ("-Wl,--print-memory-usage", 17 | "-Wl,--gc-sections"); 18 | end Linker; 19 | 20 | package Ide is 21 | for Program_Host use ":3333"; 22 | for Communication_Protocol use "remote"; 23 | end Ide; 24 | 25 | end Unleashed_Blinky; 26 | -------------------------------------------------------------------------------- /examples/feather_stm32f405/blinky/blinky.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/feather_stm32f405/feather_stm32f405_full.gpr"; 2 | 3 | project Blinky is 4 | 5 | for Runtime ("Ada") use Feather_STM32F405_Full'Runtime("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj/"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames Feather_STM32F405_Full.Compiler; 14 | end Blinky; 15 | -------------------------------------------------------------------------------- /examples/feather_stm32f405/charlie_wing/charlie_wing.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/feather_stm32f405/feather_stm32f405_full.gpr"; 2 | 3 | project Charlie_Wing is 4 | 5 | for Runtime ("Ada") use Feather_STM32F405_Full'Runtime("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj/"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames Feather_STM32F405_Full.Compiler; 14 | end Charlie_Wing; 15 | -------------------------------------------------------------------------------- /examples/nucleo_f446ze/blinky_f446ze.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/nucleo_f446ze/nucleo_f446ze_full.gpr"; 2 | 3 | project Blinky_F446ZE extends "../shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use NUCLEO_F446ZE_Full'Runtime("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("blinky.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("../shared/hello_world_blinky/src"); 10 | for Object_Dir use "../shared/hello_world_blinky/obj/nucleo_f446ze"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames NUCLEO_F446ZE_Full.Compiler; 14 | end Blinky_F446ZE; 15 | -------------------------------------------------------------------------------- /examples/shared/README.md: -------------------------------------------------------------------------------- 1 | This directory contains sources for examples running on multiple different 2 | boards. Please use the project files in the [examples](../examples/) sub-dir 3 | corresponding to your board. 4 | -------------------------------------------------------------------------------- /examples/shared/common/common.gpr: -------------------------------------------------------------------------------- 1 | project Common is 2 | 3 | type LOADER_Type is 4 | ("RAM", "ROM"); 5 | LOADER : LOADER_Type := external ("LOADER", "ROM"); 6 | 7 | type RTS_Type is ("ravenscar-sfp", "ravenscar-full"); 8 | RTS : RTS_Type := External ("RTS_Profile", "ravenscar-sfp"); 9 | 10 | type LCH_Type is ("led", "lcd"); 11 | LCH : LCH_Type := external ("LCH", "led"); 12 | 13 | for Languages use ("Ada"); 14 | for Target use "arm-eabi"; 15 | for Source_Dirs use ("gui"); 16 | 17 | case RTS is 18 | when "ravenscar-sfp" => 19 | for Source_Dirs use Project'Source_Dirs & ("lch_sfp"); 20 | case LCH is 21 | when "led" => 22 | for Source_Dirs use Project'Source_Dirs & ("lch_sfp/led"); 23 | when "lcd" => 24 | for Source_Dirs use Project'Source_Dirs & ("lch_sfp/lcd"); 25 | end case; 26 | when "ravenscar-full" => 27 | for Source_Dirs use Project'Source_Dirs & ("lch_full"); 28 | case LCH is 29 | when "led" => 30 | for Source_Dirs use Project'Source_Dirs & ("lch_full/led"); 31 | when "lcd" => 32 | for Source_Dirs use Project'Source_Dirs & ("lch_full/lcd"); 33 | end case; 34 | end case; 35 | 36 | package Linker is 37 | for Default_Switches ("Ada") use 38 | ("-Wl,--gc-sections", 39 | "-Wl,--print-memory-usage"); 40 | end Linker; 41 | 42 | package Ide is 43 | for Gnat use "arm-eabi-gnat"; 44 | for Gnatlist use "arm-eabi-gnatls"; 45 | for Debugger_Command use "arm-eabi-gdb"; 46 | for Program_Host use "localhost:4242"; 47 | for Communication_Protocol use "remote"; 48 | for Connection_Tool use "st-util"; 49 | end Ide; 50 | 51 | end Common; 52 | -------------------------------------------------------------------------------- /examples/shared/hello_world_blinky/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /examples/shared/hello_world_blinky/readme.md: -------------------------------------------------------------------------------- 1 | A simple example that blinks all the LEDs simultaneously, indefinitely. 2 | It does not use the convenience routine defined in the STM32.Boards 3 | packages to initialize the LEDs, but instead directly invokes the GPIO 4 | package to configure them, for the sake of illustration. 5 | 6 | NOTE: some of the demos require the "ravenscar-full" runtime libraries 7 | so you will have to set the RTS scenario varible accordingly. 8 | 9 | These demos are independent of the specific MCU device and board 10 | in use because it refers to the LED(s) with a name that is common across 11 | all boards that have user-controlled LEDs available. Specifically, the 12 | name "All_LEDs" refers to different LEDs (GPIO pins) on different boards, 13 | and indeed defines a different number of LEDs on different boards. Some 14 | boards have four, some two, some only one (the F7 Disco board, for example). 15 | Not all boards have user-controllable LEDs, of course, but those that do, 16 | have the name "All_LEDs" defined to indicate all of them. 17 | 18 | The gpr file determines which board is actually used. Invoke the builder 19 | and/or GPS with the one that corresponds to the board you have available, 20 | or modify one to match your specific hardware. 21 | -------------------------------------------------------------------------------- /examples/shared/hello_world_tasking/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /examples/shared/hello_world_tasking/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /examples/shared/hello_world_tasking/readme.md: -------------------------------------------------------------------------------- 1 | A simple example that blinks all the LEDs sequentially, indefinitely. 2 | 3 | The purpose of the example is to illustrate the architecture of a 4 | Ravenscar-based application using a periodic task and an interrupt 5 | handler. This architecture is idiomatic of Ravenscar-based applications. 6 | 7 | Specifically, there is a periodic task that blinks the LEDs on the board 8 | in a sequence. The blue User button generates an interrupt that is used 9 | to reverse the order of that sequence. 10 | 11 | This example is independent of the specific MCU device and board in use 12 | but it does require that the board provide four LEDs so that a sequence 13 | can be discerned by the viewer. 14 | 15 | The gpr file determines which board is actually used. Invoke the builder 16 | and/or GPS with the one that corresponds to the board you have available, 17 | or modify one to match your specific hardware. 18 | -------------------------------------------------------------------------------- /examples/shared/hm11/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /examples/shared/hm11/README.md: -------------------------------------------------------------------------------- 1 | This is a simple test/example for HM-11/cc2541 with 2 | STM32F429Disco. HM-11/cc2541 should be connected 3 | to the following board's pins: 4 | 5 | | Pheri STM | 6 | |-------|-----| 7 | | RX(4) | PC12| 8 | | TX(2) | PD2 | 9 | -------------------------------------------------------------------------------- /examples/shared/nrf24l01p/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /examples/shared/nrf24l01p/README.md: -------------------------------------------------------------------------------- 1 | This is a simple test/example for nRF24L01+ with 2 | STM32F429Disco. Two nRF24L01+ should be connected 3 | to the following board's pins: 4 | 5 | | TX: | | 6 | |------|-----| 7 | | CE | PB7 | 8 | | CSN | PE3 | 9 | | SCK | PE2 | 10 | | MISO | PE5 | 11 | | MOSI | PE6 | 12 | 13 | | RX: | | 14 | |------|------| 15 | | CE | PC11 | 16 | | CSN | PC12 | 17 | | IRQ | PB4 | 18 | | SCK | PE2 | 19 | | MISO | PE5 | 20 | | MOSI | PE6 | 21 | 22 | to communicate with each other. 23 | -------------------------------------------------------------------------------- /examples/shared/serial_ports/.gdbinit: -------------------------------------------------------------------------------- 1 | # This command file will cause a Cortex-M3 or -M4 board to automatically 2 | # reset immediately after a GDB "load" command executes. Note that GPS 3 | # issues that command as part of the Debug->Init menu invocation. Manual 4 | # "load" command invocations will also trigger the action. 5 | # 6 | # The reset is achieved by writing to the "Application Interrupt and Reset 7 | # Control" register located at address 0xE000ED0C. 8 | # 9 | # Both the processor and the peripherals can be reset by writing a value 10 | # of 0x05FA0004. That value will write to the SYSRESETREQ bit. If you want 11 | # to avoid resetting the peripherals, change the value to 0x05FA0001. That 12 | # value will write to the VECTRESET bit. Do *not* use a value that sets both 13 | # bits. 14 | # 15 | # In both cases, any on-board debug hardware is not reset. 16 | # 17 | # See the book "The Definitive Guide to the ARM Cortex-M3 and Cortex-M4 18 | # Processors" by Joseph Yiu, 3rd edition, pp 262-263 for further details. 19 | 20 | define hookpost-load 21 | echo Resetting the processor and peripherals...\n 22 | set *0xE000ED0C := 0x05FA0004 23 | echo Reset complete\n 24 | end -------------------------------------------------------------------------------- /examples/shared/serial_ports/gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Partition_Elaboration_Policy (Sequential); 2 | 3 | -------------------------------------------------------------------------------- /examples/shared/serial_ports/host_app/build_host_app.gpr: -------------------------------------------------------------------------------- 1 | -- This project builds the host application that works with the "streams" 2 | -- version of the serial ports. Specifically, it runs on the host and 3 | -- communicates with the Demo_Serial_Port_Streaming program running on a 4 | -- target board. 5 | 6 | -- It is to be built with a native compiler. 7 | 8 | project Build_Host_App is 9 | 10 | for Languages use ("Ada"); 11 | 12 | for Main use ("host"); 13 | 14 | for Object_Dir use "obj"; 15 | 16 | for Exec_Dir use "."; 17 | 18 | for Create_Missing_Dirs use "True"; 19 | 20 | end Build_Host_App; 21 | -------------------------------------------------------------------------------- /examples/stm32_f4ve/README.md: -------------------------------------------------------------------------------- 1 | The [STM32 F4VE](https://stm32-base.org/boards/STM32F407VET6-STM32-F4VE-V2.0) is 2 | a low cost development kit for the STM32F407 micro-controller. 3 | Typically, it can be purchased together with a 2.8" or 3.2" TFT LCD with a touchscreen. 4 | 5 | 6 | You can get it here: 7 | 8 | - [Ebay](https://www.ebay.com/itm/295082465827) 9 | - [AliExpress](https://www.aliexpress.com/item/4000953664266.html) 10 | 11 | -------------------------------------------------------------------------------- /examples/stm32_f4ve/blinky_stm32_f4ve.gpr: -------------------------------------------------------------------------------- 1 | with "../../boards/stm32_f4ve/stm32_f4ve_full.gpr"; 2 | 3 | project Blinky_STM32_F4VE extends "../shared/common/common.gpr" is 4 | 5 | for Runtime ("Ada") use STM32_F4VE_Full'Runtime("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("blinky.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("../shared/hello_world_blinky/src"); 10 | for Object_Dir use "../shared/hello_world_blinky/obj/stm32_f4ve"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames STM32_F4VE_Full.Compiler; 14 | 15 | end Blinky_STM32_F4VE; 16 | -------------------------------------------------------------------------------- /examples/stm32_f4ve/draw/README.md: -------------------------------------------------------------------------------- 1 | # Draw on the screen 2 | 3 | This example is a modified version of the draw example for 4 | STM32F429 Discovery. Unlike the original, it does not use 5 | the Framebuffer interface. Touch the screen to draw. The 6 | thickness of points and lines during drawing depends on 7 | the pressure applied and what you touch on the screen. 8 | 9 | Press the K-UP button for a demo of drawing primitives. 10 | 11 | For this demo, you need an LCD with a touch panel, which 12 | is usually sold as part of the STM32 F4VE board kit. 13 | -------------------------------------------------------------------------------- /examples/stm32_f4ve/draw/draw.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/stm32_f4ve/stm32_f4ve_full.gpr"; 2 | 3 | project Draw is 4 | 5 | for Runtime ("Ada") use STM32_f4VE_Full'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("draw.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use (".", "../../shared/common/gui"); 10 | for Object_Dir use "obj/"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames STM32_F4VE_Full.Compiler; 14 | 15 | package Ide is 16 | for Program_Host use "localhost:4242"; 17 | for Communication_Protocol use "remote"; 18 | for Connection_Tool use "st-util"; 19 | end Ide; 20 | end Draw; 21 | -------------------------------------------------------------------------------- /examples/stm32_f4ve/lcd/README.md: -------------------------------------------------------------------------------- 1 | # LCD demo 2 | 3 | This example demonstrates working with the LCD using the 4 | HAL.Bitmap.Bitmap_Buffer interface. 5 | Colorful rectangles are displayed on the screen, and their 6 | colors change based on the X and Y coordinates. 7 | 8 | For this demo, you need an LCD, which is usually sold as 9 | part of the STM32 F4VE board kit. 10 | -------------------------------------------------------------------------------- /examples/stm32_f4ve/lcd/lcd.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/stm32_f4ve/stm32_f4ve_full.gpr"; 2 | 3 | project LCD is 4 | 5 | for Runtime ("Ada") use STM32_f4VE_Full'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("."); 10 | for Object_Dir use "obj/"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames STM32_F4VE_Full.Compiler; 14 | 15 | package Ide is 16 | for Program_Host use "localhost:4242"; 17 | for Communication_Protocol use "remote"; 18 | for Connection_Tool use "st-util"; 19 | end Ide; 20 | end LCD; 21 | -------------------------------------------------------------------------------- /examples/stm32_f4ve/lcd_spi/README.md: -------------------------------------------------------------------------------- 1 | # LCD demo 2 | 3 | This example demonstrates working with the LCD using the 4 | HAL.Bitmap.Bitmap_Buffer interface. 5 | Colorful rectangles are displayed on the screen, and their 6 | colors change based on the X and Y coordinates. 7 | 8 | For this demo, you need an LCD, (which is usually sold as 9 | part of the STM32 F4VE board kit) connected as SPI: 10 | 11 | * PA1 LCD RESET 12 | * PA2 LCD D/C 13 | * PA3 LCD BKL 14 | * PA4 SPI1 NSS 15 | * PA5 SPI1 SCK 16 | * PA6 SPI1 MISO 17 | * PA7 SPI1 MOSI 18 | 19 | -------------------------------------------------------------------------------- /examples/stm32_f4ve/lcd_spi/lcd_spi.gpr: -------------------------------------------------------------------------------- 1 | with "stm32_f4ve_full_spi.gpr"; 2 | 3 | project LCD_SPI is 4 | 5 | for Runtime ("Ada") use STM32_f4VE_Full'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("."); 10 | for Object_Dir use "obj/"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames STM32_F4VE_Full.Compiler; 14 | 15 | package Ide is 16 | for Program_Host use "localhost:4242"; 17 | for Communication_Protocol use "remote"; 18 | for Connection_Tool use "st-util"; 19 | end Ide; 20 | end LCD_SPI; 21 | -------------------------------------------------------------------------------- /examples/stm32_f4ve/lcd_spi/stm32_f4ve_full_spi.gpr: -------------------------------------------------------------------------------- 1 | library project STM32_F4VE_Full_SPI 2 | extends "../../../boards/stm32_f4ve/stm32_f4ve_full.gpr" 3 | is 4 | for Source_Dirs use ("spi"); 5 | for Library_Dir use "obj/spi_lib"; 6 | for Object_Dir use "obj/spi_obj"; 7 | 8 | end STM32_F4VE_Full_SPI; 9 | -------------------------------------------------------------------------------- /examples/stm32_h405/blinky/blinky.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/stm32_h405/stm32_h405_full.gpr"; 2 | 3 | project Blinky is 4 | 5 | for Runtime ("Ada") use STM32_H405_Full'Runtime("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj/"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames STM32_H405_Full.Compiler; 14 | end Blinky; 15 | -------------------------------------------------------------------------------- /examples/stm32_h405/lcd_test/lcd_test.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/stm32_h405/stm32_h405_full.gpr"; 2 | 3 | project LCD_Test is 4 | 5 | for Runtime ("Ada") use STM32_H405_Full'Runtime("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("lcd_test.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj/"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames STM32_H405_Full.Compiler; 14 | end LCD_Test; 15 | -------------------------------------------------------------------------------- /examples/stm32f4xx_m/README.md: -------------------------------------------------------------------------------- 1 | The [STM32F4XX M](https://stm32-base.org/boards/STM32F407VGT6-STM32F4XX-M) is 2 | a low cost development kit for the STM32F407 micro-controller. 3 | 4 | You can get it here: 5 | 6 | - [AliExpress](https://www.aliexpress.com/item/4000602517153.html) 7 | - [ebay](https://www.ebay.com/itm/385792548401) 8 | -------------------------------------------------------------------------------- /examples/stm32f4xx_m/blinky/blinky.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/stm32f4xx_m/stm32f4xx_m_full.gpr"; 2 | 3 | project Blinky is 4 | 5 | for Runtime ("Ada") use STM32F4XX_M_Full'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj/"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames STM32F4XX_M_Full.Compiler; 14 | 15 | package Ide is 16 | for Program_Host use "localhost:4242"; 17 | for Communication_Protocol use "remote"; 18 | for Connection_Tool use "st-util"; 19 | end Ide; 20 | end Blinky; 21 | -------------------------------------------------------------------------------- /examples/stm32f4xx_m/flash/README.md: -------------------------------------------------------------------------------- 1 | # Flash memory erase/write/read example 2 | 3 | In this example we erase and flash part of the W25Q16 flash memory 4 | when K1 button is pressed on reset. If the button is not pressed, the 5 | program reads the flash memory and checks its content. If everything is 6 | OK, the program blinks the green LED slowly (1 Hz), but otherwise it blinks 7 | the LED faster (5 Hz). 8 | -------------------------------------------------------------------------------- /examples/stm32f4xx_m/flash/flash.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/stm32f4xx_m/stm32f4xx_m_full.gpr"; 2 | 3 | project Flash is 4 | 5 | for Runtime ("Ada") use STM32F4XX_M_Full'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj/"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames STM32F4XX_M_Full.Compiler; 14 | 15 | package Ide is 16 | for Program_Host use "localhost:4242"; 17 | for Communication_Protocol use "remote"; 18 | for Connection_Tool use "st-util"; 19 | end Ide; 20 | end Flash; 21 | -------------------------------------------------------------------------------- /examples/stm32f4xx_m/sdcard_fs/README.md: -------------------------------------------------------------------------------- 1 | # SD card filesystem example 2 | 3 | Turns on the LED and waits for the SD card. Then, it mounts the first FAT 4 | partition as '/card/', opens the `/file.txt` file and reads 512 bytes from 5 | it. If everything is okay, the program blinks the green LED slowly 6 | at a rate of 1 Hz. Otherwise, it blinks the LED faster at 5 Hz. 7 | -------------------------------------------------------------------------------- /examples/stm32f4xx_m/sdcard_fs/sdcard_fs.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/stm32f4xx_m/stm32f4xx_m_full.gpr"; 2 | 3 | project SDCard_FS is 4 | 5 | for Runtime ("Ada") use STM32F4XX_M_Full'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj/"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames STM32F4XX_M_Full.Compiler; 14 | 15 | package Ide is 16 | for Program_Host use "localhost:4242"; 17 | for Communication_Protocol use "remote"; 18 | for Connection_Tool use "st-util"; 19 | end Ide; 20 | end SDCard_FS; 21 | -------------------------------------------------------------------------------- /examples/stm32f4xx_m/sdcard_raw_io/README.md: -------------------------------------------------------------------------------- 1 | # SD card read example 2 | 3 | Turns on the LED and waits for the SD card. Then, it reads the first 512 4 | bytes from the SD card and checks for the 0x55 0xAA pattern at the end of 5 | the block. If everything is okay, the program blinks the green LED slowly 6 | at a rate of 1 Hz. Otherwise, it blinks the LED faster at 5 Hz. 7 | -------------------------------------------------------------------------------- /examples/stm32f4xx_m/sdcard_raw_io/sdcard_raw_io.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/stm32f4xx_m/stm32f4xx_m_full.gpr"; 2 | 3 | project SDCard_Raw_IO is 4 | 5 | for Runtime ("Ada") use STM32F4XX_M_Full'Runtime ("Ada"); 6 | for Target use "arm-eabi"; 7 | for Main use ("main.adb"); 8 | for Languages use ("Ada"); 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj/"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames STM32F4XX_M_Full.Compiler; 14 | 15 | package Ide is 16 | for Program_Host use "localhost:4242"; 17 | for Communication_Protocol use "remote"; 18 | for Connection_Tool use "st-util"; 19 | end Ide; 20 | end SDCard_Raw_IO; 21 | -------------------------------------------------------------------------------- /middleware/src/BLE/bluetooth_low_energy.adb: -------------------------------------------------------------------------------- 1 | package body Bluetooth_Low_Energy is 2 | 3 | --------------- 4 | -- Make_UUID -- 5 | --------------- 6 | 7 | function Make_UUID (UUID : UInt16) return BLE_UUID is 8 | begin 9 | return (Kind => UUID_16bits, 10 | UUID_16 => UUID); 11 | end Make_UUID; 12 | 13 | --------------- 14 | -- Make_UUID -- 15 | --------------- 16 | 17 | function Make_UUID (UUID : UInt32) return BLE_UUID is 18 | begin 19 | return (Kind => UUID_32bits, 20 | UUID_32 => UUID); 21 | end Make_UUID; 22 | 23 | --------------- 24 | -- Make_UUID -- 25 | --------------- 26 | 27 | function Make_UUID (UUID : BLE_16UInt8s_UUID) return BLE_UUID is 28 | begin 29 | return (Kind => UUID_16UInt8s, 30 | UUID_16_UInt8s => UUID); 31 | end Make_UUID; 32 | 33 | end Bluetooth_Low_Energy; 34 | -------------------------------------------------------------------------------- /scripts/check_readme.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python3 2 | 3 | import os 4 | import sys 5 | import config 6 | import config.user_input.console 7 | from build_all_examples import run_program 8 | 9 | from config.boards import list_of_boards 10 | 11 | script_dir = os.path.dirname(__file__) 12 | ADL_root_dir = os.path.abspath(os.path.join(script_dir, "..")) 13 | top_readme_file = os.path.join(ADL_root_dir, "README.md") 14 | 15 | undocumented = [] 16 | 17 | error = \ 18 | """Next boards were not mentioned in the top README.md file! 19 | Please, append each of them to the table in the Board List section. 20 | """ 21 | 22 | with open(top_readme_file, 'r', encoding='utf-8') as file: 23 | lines = [line for line in file] 24 | 25 | # No error on Custom_Board: 26 | lines.append("[Custom_Board]") 27 | 28 | for board in list_of_boards(): 29 | text = f"[{board}]" 30 | found = [line for line in lines if text in line] 31 | if not found: 32 | undocumented.append(board) 33 | 34 | if undocumented: 35 | print(error) 36 | print(undocumented) 37 | sys.exit(1) 38 | -------------------------------------------------------------------------------- /scripts/config/archs.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | 4 | def list_of_archs(config): 5 | return ["ARM", "RISC-V", "Native"] 6 | 7 | 8 | def load_cpu_config(config): 9 | cpu = config.get_config("CPU_Core") 10 | origin = 'arch definition' 11 | 12 | if cpu == "ARM Cortex-M0": 13 | config.add_source_dir('arch/ARM/cortex_m/src', origin) 14 | config.add_source_dir('arch/ARM/cortex_m/src/cm0', origin) 15 | config.add_source_dir('arch/ARM/cortex_m/src/nocache', origin) 16 | config.add_source_dir('arch/ARM/cortex_m/src/nvic_cm0', origin) 17 | 18 | elif cpu == "ARM Cortex-M4F": 19 | config.add_source_dir('arch/ARM/cortex_m/src', origin) 20 | config.add_source_dir('arch/ARM/cortex_m/src/cm4f', origin) 21 | config.add_source_dir('arch/ARM/cortex_m/src/fpu', origin) 22 | config.add_source_dir('arch/ARM/cortex_m/src/nocache', origin) 23 | config.add_source_dir('arch/ARM/cortex_m/src/nvic_cm4_cm7', origin) 24 | 25 | elif cpu == "ARM Cortex-M7F": 26 | config.add_source_dir('arch/ARM/cortex_m/src', origin) 27 | config.add_source_dir('arch/ARM/cortex_m/src/cm7', origin) 28 | config.add_source_dir('arch/ARM/cortex_m/src/fpu', origin) 29 | config.add_source_dir('arch/ARM/cortex_m/src/cache', origin) 30 | config.add_source_dir('arch/ARM/cortex_m/src/nvic_cm4_cm7', origin) 31 | 32 | elif cpu == "RISC-V32": 33 | config.add_source_dir('arch/RISC-V/src/', origin) 34 | config.add_source_dir('arch/RISC-V/src/rv32', origin) 35 | 36 | elif cpu == "RISC-V64": 37 | config.add_source_dir('arch/RISC-V/src/', origin) 38 | config.add_source_dir('arch/RISC-V/src/rv64', origin) 39 | 40 | else: 41 | print("Unknown CPU core %s." % cpu) 42 | -------------------------------------------------------------------------------- /scripts/config/user_input/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdaCore/Ada_Drivers_Library/8a62be90b9ef13042ce9dbf2112f453fb6dec777/scripts/config/user_input/__init__.py -------------------------------------------------------------------------------- /testsuite/.gitignore: -------------------------------------------------------------------------------- 1 | obj 2 | bin 3 | -------------------------------------------------------------------------------- /testsuite/README.md: -------------------------------------------------------------------------------- 1 | Ada_Drivers_Library testsuite 2 | ============================= 3 | 4 | Without nice emulator support, testing bare-board code is hard. The goal of 5 | this testsuite is to leverage the native support packages in this repository to 6 | test services and components that rely on native implementations for HAL 7 | interfaces. 8 | 9 | 10 | How to run the testsuite 11 | ------------------------ 12 | 13 | First, make sure you have a Python 3 interpreter available, and then run: 14 | 15 | ./run.py 16 | 17 | The standard output report should be obvious to read. In order to restrict the 18 | set of executed tests, run instead: 19 | 20 | ./run.py foo bar 21 | 22 | This will execute all tests that have either ``foo`` or ``bar`` in their name 23 | 24 | If Valgrind is available, add a ``--valgrind`` switch to detect memory issues 25 | such as invalid operations or leaks. 26 | 27 | 28 | How to write testcases 29 | ---------------------- 30 | 31 | Every subdirectory in ``tests/`` that contains a ``tc.gpr`` file is a testcase. 32 | Each testcase embeds one or more test drivers (i.e. Ada programs) that run test 33 | code and write to their standard output to demonstrate that some feature is 34 | correctly implemented. For each test driver X, the project file must build an 35 | executable as ``bin/X`` and there must be a ``X.out`` file next to the 36 | ``tc.gpr`` project file that states what the test driver output should be for 37 | the test to pass. 38 | -------------------------------------------------------------------------------- /testsuite/tests/bitmap_drawing/ref.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdaCore/Ada_Drivers_Library/8a62be90b9ef13042ce9dbf2112f453fb6dec777/testsuite/tests/bitmap_drawing/ref.bmp -------------------------------------------------------------------------------- /testsuite/tests/bitmap_drawing/tc.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/native/native.gpr"; 2 | 3 | project TC extends "../../utils/test_utils.gpr" is 4 | 5 | for Languages use ("Ada"); 6 | for Source_Dirs use Test_Utils'Source_Dirs & ("src"); 7 | for Main use 8 | ("tc_bitmap_drawing.adb"); 9 | for Object_Dir use "obj"; 10 | for Exec_Dir use "bin"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames Native.Compiler; 14 | 15 | end TC; 16 | -------------------------------------------------------------------------------- /testsuite/tests/bitmap_drawing/tc_bitmap_drawing.out: -------------------------------------------------------------------------------- 1 | Bitmap drawing test OK 2 | -------------------------------------------------------------------------------- /testsuite/tests/command_line/src/tc_cmd_builtins.adb: -------------------------------------------------------------------------------- 1 | with Ada.Text_IO; use Ada.Text_IO; 2 | 3 | with Command_Line; 4 | 5 | procedure TC_CMD_Builtins is 6 | 7 | Cmd_1 : aliased constant String := "help"; 8 | Cmd_2 : aliased constant String := "help echo"; 9 | Cmd_3 : aliased constant String := "echo -n test"; 10 | Cmd_4 : aliased constant String := "echo test"; 11 | begin 12 | Ada.Text_IO.Put_Line ("$ " & Cmd_1); 13 | Command_Line.Run (Cmd_1, Put'Access, Put_Line'Access); 14 | Ada.Text_IO.Put_Line ("$ " & Cmd_2); 15 | Command_Line.Run (Cmd_2, Put'Access, Put_Line'Access); 16 | Ada.Text_IO.Put_Line ("$ " & Cmd_3); 17 | Command_Line.Run (Cmd_3, Put'Access, Put_Line'Access); 18 | Ada.Text_IO.Put_Line ("$ " & Cmd_4); 19 | Command_Line.Run (Cmd_4, Put'Access, Put_Line'Access); 20 | end TC_CMD_Builtins; 21 | -------------------------------------------------------------------------------- /testsuite/tests/command_line/src/tc_cmd_filesystem.adb: -------------------------------------------------------------------------------- 1 | with Ada.Text_IO; use Ada.Text_IO; 2 | 3 | with Command_Line; 4 | with Command_Line.Filesystem; 5 | with Test_Directories; 6 | 7 | procedure TC_CMD_Filesystem is 8 | 9 | Cmd_1 : aliased constant String := "help"; 10 | Cmd_2 : aliased constant String := "help ls"; 11 | Cmd_3 : aliased constant String := "ls /test_dir/test_material"; 12 | Cmd_4 : aliased constant String := "ls -r /test_dir/test_material"; 13 | Cmd_5 : aliased constant String := "ls -r -a /test_dir/test_material"; 14 | Cmd_6 : aliased constant String := "cat /test_dir/test_material/test.txt"; 15 | begin 16 | 17 | Test_Directories.Mount_Test_Directory; 18 | 19 | Command_Line.Filesystem.Register_All; 20 | 21 | Ada.Text_IO.Put_Line ("$ " & Cmd_1); 22 | Command_Line.Run (Cmd_1, Put'Access, Put_Line'Access); 23 | Ada.Text_IO.Put_Line ("$ " & Cmd_2); 24 | Command_Line.Run (Cmd_2, Put'Access, Put_Line'Access); 25 | Ada.Text_IO.Put_Line ("$ " & Cmd_3); 26 | Command_Line.Run (Cmd_3, Put'Access, Put_Line'Access); 27 | Ada.Text_IO.Put_Line ("$ " & Cmd_4); 28 | Command_Line.Run (Cmd_4, Put'Access, Put_Line'Access); 29 | Ada.Text_IO.Put_Line ("$ " & Cmd_5); 30 | Command_Line.Run (Cmd_5, Put'Access, Put_Line'Access); 31 | Ada.Text_IO.Put_Line ("$ " & Cmd_6); 32 | Command_Line.Run (Cmd_6, Put'Access, Put_Line'Access); 33 | end TC_CMD_Filesystem; 34 | 35 | -------------------------------------------------------------------------------- /testsuite/tests/command_line/tc.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/native/native.gpr"; 2 | 3 | project TC extends "../../utils/test_utils.gpr" is 4 | 5 | for Languages use ("Ada"); 6 | for Source_Dirs use ("src"); 7 | for Main use 8 | ("tc_cmd_builtins.adb", 9 | "tc_cmd_filesystem.adb"); 10 | for Object_Dir use "obj"; 11 | for Exec_Dir use "bin"; 12 | for Create_Missing_Dirs use "True"; 13 | 14 | package Compiler renames Native.Compiler; 15 | 16 | end TC; 17 | -------------------------------------------------------------------------------- /testsuite/tests/command_line/tc_cmd_builtins.out: -------------------------------------------------------------------------------- 1 | $ help 2 | Here is the list of commands available: 3 | - help 4 | - echo 5 | Use 'help ' for more information. 6 | $ help echo 7 | Usage: echo [-n] [STRING]... 8 | Display text. 9 | -n : Do no output the trailing newline 10 | $ echo -n test 11 | test$ echo test 12 | test 13 | -------------------------------------------------------------------------------- /testsuite/tests/command_line/tc_cmd_filesystem.out: -------------------------------------------------------------------------------- 1 | $ help 2 | Here is the list of commands available: 3 | - cat 4 | - touch 5 | - rmdir 6 | - ls 7 | - help 8 | - echo 9 | Use 'help ' for more information. 10 | $ help ls 11 | Usage: ls [-a] [-r|-R] [FILE]... 12 | List information about files and directories. 13 | -a : do not ignore hidden files or directories 14 | -r, -R : list subdirectories recursively 15 | $ ls /test_dir/test_material 16 | sub1 sub2 test.txt 17 | $ ls -r /test_dir/test_material 18 | /test_dir/test_material: 19 | sub1 sub2 test.txt 20 | /test_dir/test_material/sub1: 21 | test.txt 22 | /test_dir/test_material/sub2: 23 | sub2-1 test.txt 24 | /test_dir/test_material/sub2/sub2-1: 25 | test.txt 26 | $ ls -r -a /test_dir/test_material 27 | /test_dir/test_material: 28 | sub1 sub2 test.txt 29 | /test_dir/test_material/sub1: 30 | test.txt 31 | /test_dir/test_material/sub2: 32 | sub2-1 test.txt 33 | /test_dir/test_material/sub2/sub2-1: 34 | test.txt 35 | $ cat /test_dir/test_material/test.txt 36 | Text in a file 37 | 38 | -------------------------------------------------------------------------------- /testsuite/tests/command_line/test_material/sub1/test.txt: -------------------------------------------------------------------------------- 1 | Text in a file 2 | -------------------------------------------------------------------------------- /testsuite/tests/command_line/test_material/sub2/sub2-1/test.txt: -------------------------------------------------------------------------------- 1 | Text in a file 2 | -------------------------------------------------------------------------------- /testsuite/tests/command_line/test_material/sub2/test.txt: -------------------------------------------------------------------------------- 1 | Text in a file 2 | -------------------------------------------------------------------------------- /testsuite/tests/command_line/test_material/test.txt: -------------------------------------------------------------------------------- 1 | Text in a file 2 | -------------------------------------------------------------------------------- /testsuite/tests/disk_partitions/disk_8_partitions.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdaCore/Ada_Drivers_Library/8a62be90b9ef13042ce9dbf2112f453fb6dec777/testsuite/tests/disk_partitions/disk_8_partitions.img -------------------------------------------------------------------------------- /testsuite/tests/disk_partitions/tc.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/native/native.gpr"; 2 | 3 | project TC extends "../../utils/test_utils.gpr" is 4 | 5 | for Languages use ("Ada"); 6 | for Source_Dirs use ("src"); 7 | for Main use 8 | ("tc_read_partitions.adb"); 9 | for Object_Dir use "obj"; 10 | for Exec_Dir use "bin"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames Native.Compiler; 14 | 15 | end TC; 16 | -------------------------------------------------------------------------------- /testsuite/tests/disk_partitions/tc_read_partitions.out: -------------------------------------------------------------------------------- 1 | Disk '/test_dir/disk_8_partitions.img' has 8 parition(s) 2 | - partition : 1 3 | Status: 128 4 | Kind: 1 5 | LBA: 1 6 | Number of sectors: 2 7 | - partition : 2 8 | Status: 0 9 | Kind: 4 10 | LBA: 3 11 | Number of sectors: 2 12 | - partition : 3 13 | Status: 0 14 | Kind: 7 15 | LBA: 5 16 | Number of sectors: 2 17 | - partition : 4 18 | Status: 0 19 | Kind: 5 20 | LBA: 7 21 | Number of sectors: 13 22 | - partition : 5 23 | Status: 0 24 | Kind: 6 25 | LBA: 1 26 | Number of sectors: 2 27 | - partition : 6 28 | Status: 0 29 | Kind: 11 30 | LBA: 1 31 | Number of sectors: 2 32 | - partition : 7 33 | Status: 0 34 | Kind: 12 35 | LBA: 1 36 | Number of sectors: 2 37 | - partition : 8 38 | Status: 0 39 | Kind: 131 40 | LBA: 1 41 | Number of sectors: 3 42 | -------------------------------------------------------------------------------- /testsuite/tests/fat_driver/create_disk_image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script creates a FAT disk image containing files in different 4 | # directories and sub-directories. The files contain random data and are named 5 | # with the md5 hash of their content. 6 | # 7 | # This disk image is meant to be used for FAT driver testing. The test should 8 | # look for all the file in the 'read_test' sub-tree and compare the file name 9 | # with the md5 hash of it's content. 10 | # 11 | # There's also a file named 'number_of_files_to_check' that the test read to 12 | # check that it processed all the required files. 13 | 14 | 15 | number_of_files=0 16 | 17 | create_test_file() { 18 | dir=$1 19 | tmp_file=$dir/tmp 20 | dd if=/dev/urandom of=$tmp_file bs=1 count=$(((RANDOM % 200 ) + 500)) 21 | md5=`md5sum $tmp_file | cut -d' ' -f1` 22 | echo $md5 23 | mv $tmp_file $dir/$md5 24 | number_of_files=$(($number_of_files + 1)) 25 | } 26 | 27 | create_test_dir() { 28 | dir=$1 29 | mkdir $dir 30 | create_test_file $dir 31 | } 32 | 33 | SIZE=64 34 | dd if=/dev/zero of=fat.fs bs=1024 count=$SIZE 35 | 36 | mkfs.vfat -F 32 fat.fs 37 | mkdir mnt 38 | fusefat -o rw+ fat.fs mnt 39 | sleep 1 40 | 41 | mkdir mnt/read_test 42 | create_test_file mnt/read_test/ 43 | create_test_dir mnt/read_test/lvl1_a 44 | create_test_dir mnt/read_test/lvl1_b 45 | create_test_dir mnt/read_test/lvl1_b/lvl2_a_directory_with_a_long_name_to_check_if_this_is_correctly_handled_by_the_fat_driver 46 | create_test_dir mnt/read_test/lvl1_c 47 | create_test_dir mnt/read_test/lvl1_c/lvl2_b 48 | create_test_dir mnt/read_test/lvl1_c/lvl2_b/lvl3_a 49 | echo $number_of_files > mnt/number_of_files_to_check 50 | 51 | tree -h mnt 52 | fusermount -u mnt 53 | rmdir mnt 54 | -------------------------------------------------------------------------------- /testsuite/tests/fat_driver/fat.fs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdaCore/Ada_Drivers_Library/8a62be90b9ef13042ce9dbf2112f453fb6dec777/testsuite/tests/fat_driver/fat.fs -------------------------------------------------------------------------------- /testsuite/tests/fat_driver/tc.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/native/native.gpr"; 2 | 3 | project TC extends "../../utils/test_utils.gpr" is 4 | 5 | for Languages use ("Ada"); 6 | for Source_Dirs use ("src"); 7 | for Main use 8 | ("tc_fat_read.adb", 9 | "tc_fat_write.adb"); 10 | for Object_Dir use "obj"; 11 | for Exec_Dir use "bin"; 12 | for Create_Missing_Dirs use "True"; 13 | 14 | package Compiler renames Native.Compiler; 15 | 16 | end TC; 17 | -------------------------------------------------------------------------------- /testsuite/tests/fat_driver/tc_fat_read.out: -------------------------------------------------------------------------------- 1 | Checking directory: '/disk_img/read_test' 2 | Checking directory: '/disk_img/read_test/lvl1_a' 3 | Checking directory: '/disk_img/read_test/lvl1_b' 4 | Checking directory: '/disk_img/read_test/lvl1_b/lvl2_a_directory_with_a_long_name_to_check_if_this_is_correctly_handled_by_the_fat_driver' 5 | Checking directory: '/disk_img/read_test/lvl1_c' 6 | Checking directory: '/disk_img/read_test/lvl1_c/lvl2_b' 7 | Checking directory: '/disk_img/read_test/lvl1_c/lvl2_b/lvl3_a' 8 | PASS 9 | -------------------------------------------------------------------------------- /testsuite/tests/fat_driver/tc_fat_write.out: -------------------------------------------------------------------------------- 1 | PASS 2 | PASS 3 | PASS 4 | -------------------------------------------------------------------------------- /testsuite/tests/hexdump/src/tc_hexdump.adb: -------------------------------------------------------------------------------- 1 | with Ada.Text_IO; 2 | with HAL; use HAL; 3 | with Hex_Dump; 4 | 5 | procedure TC_Hexdump is 6 | 7 | Data : UInt8_Array (1 .. 650); 8 | Cnt : UInt8 := 0; 9 | begin 10 | 11 | for Elt of Data loop 12 | Elt := Cnt; 13 | Cnt := Cnt + 1; 14 | end loop; 15 | 16 | Hex_Dump.Hex_Dump (Data => Data, 17 | Put_Line => Ada.Text_IO.Put_Line'Access, 18 | Base_Addr => 16#1_0000#); 19 | end TC_Hexdump; 20 | -------------------------------------------------------------------------------- /testsuite/tests/hexdump/tc.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/native/native.gpr"; 2 | 3 | project TC extends "../../utils/test_utils.gpr" is 4 | 5 | for Languages use ("Ada"); 6 | for Source_Dirs use Test_Utils'Source_Dirs & ("src"); 7 | for Main use 8 | ("tc_hexdump.adb"); 9 | for Object_Dir use "obj"; 10 | for Exec_Dir use "bin"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames Native.Compiler; 14 | 15 | end TC; 16 | -------------------------------------------------------------------------------- /testsuite/tests/logging/tc.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/native/native.gpr"; 2 | 3 | project TC extends "../../utils/test_utils.gpr" is 4 | 5 | for Languages use ("Ada"); 6 | for Source_Dirs use Test_Utils'Source_Dirs & ("src"); 7 | for Main use 8 | ("tc_log_filtering.adb", 9 | "tc_log_priorities.adb", 10 | "tc_log_prio_and_cat.adb"); 11 | for Object_Dir use "obj"; 12 | for Exec_Dir use "bin"; 13 | for Create_Missing_Dirs use "True"; 14 | 15 | package Compiler renames Native.Compiler; 16 | 17 | end TC; 18 | -------------------------------------------------------------------------------- /testsuite/tests/logging/tc_log_filtering.out: -------------------------------------------------------------------------------- 1 | --- Log test begin --- 2 | Prio: 0 -> This Debug should print 3 | Prio: 0 -> This Warning should print 4 | Prio: 0 -> This Error should print 5 | Prio: 1 -> This Debug should print prio 1 6 | Prio: 2 -> This Warning should print prio 2 7 | Prio: 3 -> This Error should print prio 3 8 | Prio: 1 -> DEBUG: This Debug should print with prefix 9 | Prio: 2 -> This Warning should print without prefix 10 | Prio: 3 -> This Error should print without prefix 11 | Prio: 2 -> WARNING: This Warning should print with prefix 12 | Prio: 3 -> This Error should print without prefix 13 | Prio: 3 -> ERROR: This Error should print with prefix 14 | Prio: 3 -> ERROR: This should print in the Error category 15 | --- Log test end --- 16 | -------------------------------------------------------------------------------- /testsuite/tests/logging/tc_log_prio_and_cat.out: -------------------------------------------------------------------------------- 1 | --- Log test begin --- 2 | Prio: 3 -> ERROR: Error, prio 3 3 | Prio: 2 -> WARNING: Warning, prio 2 4 | Prio: 1 -> DEBUG: Debug, prio 1 5 | Prio: 0 -> DEBUG: Debug, prio 0 6 | Prio: 0 -> WARNING: Warning, prio 0 7 | Prio: 0 -> ERROR: Error, prio 0 8 | Pop : The queue is empty 9 | --- Log test end --- 10 | -------------------------------------------------------------------------------- /testsuite/tests/logging/tc_log_priorities.out: -------------------------------------------------------------------------------- 1 | --- Log test begin --- 2 | --- Test priorities --- 3 | Pop : The queue is empty 4 | Prio: 8 -> Prio 8 - 1 5 | Prio: 5 -> Prio 5 - 1 6 | Prio: 5 -> Prio 5 - 2 7 | Prio: 2 -> Prio 2 - 1 8 | Prio: 1 -> Prio 1 - 1 9 | Prio: 1 -> Prio 1 - 2 10 | Pop : The queue is empty 11 | --- Test insert lower prio in full queue --- 12 | Prio: 8 -> Prio 8 - 1 13 | Prio: 5 -> Prio 5 - 1 14 | Prio: 5 -> Prio 5 - 2 15 | Prio: 2 -> Prio 2 - 1 16 | Prio: 1 -> Prio 1 - 1 17 | Prio: 1 -> Prio 1 - 2 18 | Pop : The queue is empty 19 | --- Test insert low prio in full queue --- 20 | Prio: 8 -> Prio 8 - 1 21 | Prio: 5 -> Prio 5 - 1 22 | Prio: 5 -> Prio 5 - 2 23 | Prio: 2 -> Prio 2 - 1 24 | Prio: 1 -> Prio 1 - 1 25 | Prio: 1 -> Prio 1 - 2 26 | Pop : The queue is empty 27 | --- Test insert high prio in full queue --- 28 | Prio: 9 -> Prio 9 - This message should be accepted 29 | Prio: 8 -> Prio 8 - 1 30 | Prio: 5 -> Prio 5 - 1 31 | Prio: 5 -> Prio 5 - 2 32 | Prio: 2 -> Prio 2 - 1 33 | Prio: 1 -> Prio 1 - 1 34 | Pop : The queue is empty 35 | --- Test insert too long message --- 36 | Prio: 8 -> Prio 8 - 1 37 | Prio: 5 -> Prio 5 - 1 38 | Prio: 5 -> Prio 5 - 2 39 | Prio: 2 -> Prio 2 - 1 40 | Prio: 1 -> Prio 1 - 1 41 | Prio: 1 -> Prio 1 - 2 42 | Pop : The queue is empty 43 | --- Log test end --- 44 | -------------------------------------------------------------------------------- /testsuite/tests/monitors/src/dummy_block_driver.adb: -------------------------------------------------------------------------------- 1 | package body Dummy_Block_Driver is 2 | 3 | ---------- 4 | -- Read -- 5 | ---------- 6 | 7 | overriding function Read 8 | (This : in out Dummy_BD; 9 | Block_Number : UInt64; 10 | Data : out Block) 11 | return Boolean 12 | is 13 | pragma Unreferenced (Block_Number); 14 | begin 15 | if This.Should_Fail then 16 | return False; 17 | else 18 | Data := (others => 16#DE#); 19 | return True; 20 | end if; 21 | end Read; 22 | 23 | ----------- 24 | -- Write -- 25 | ----------- 26 | 27 | overriding function Write 28 | (This : in out Dummy_BD; 29 | Block_Number : UInt64; 30 | Data : Block) 31 | return Boolean 32 | is 33 | pragma Unreferenced (Block_Number, Data); 34 | begin 35 | return not This.Should_Fail; 36 | end Write; 37 | 38 | end Dummy_Block_Driver; 39 | -------------------------------------------------------------------------------- /testsuite/tests/monitors/src/dummy_block_driver.ads: -------------------------------------------------------------------------------- 1 | with HAL; use HAL; 2 | with HAL.Block_Drivers; use HAL.Block_Drivers; 3 | 4 | package Dummy_Block_Driver is 5 | 6 | type Dummy_BD is new Block_Driver with record 7 | Should_Fail : Boolean; 8 | end record; 9 | 10 | overriding 11 | function Read 12 | (This : in out Dummy_BD; 13 | Block_Number : UInt64; 14 | Data : out Block) 15 | return Boolean; 16 | 17 | overriding 18 | function Write 19 | (This : in out Dummy_BD; 20 | Block_Number : UInt64; 21 | Data : Block) 22 | return Boolean; 23 | 24 | end Dummy_Block_Driver; 25 | -------------------------------------------------------------------------------- /testsuite/tests/monitors/src/tc_block_driver.adb: -------------------------------------------------------------------------------- 1 | with Ada.Text_IO; use Ada.Text_IO; 2 | 3 | with HAL.Block_Drivers; 4 | with Monitor.Block_Drivers; use Monitor.Block_Drivers; 5 | with Dummy_Block_Driver; use Dummy_Block_Driver; 6 | 7 | procedure TC_Block_Driver is 8 | BD : aliased Dummy_BD; 9 | Mon : Block_Driver_Monitor (BD'Unchecked_Access, 10 | Put_Line'Access); 11 | 12 | Data : HAL.Block_Drivers.Block (1 .. 512); 13 | 14 | Unref : Boolean with Unreferenced; 15 | begin 16 | 17 | Data := (others => 0); 18 | 19 | BD.Should_Fail := True; 20 | Unref := Mon.Read (0, Data); 21 | Unref := Mon.Write (1, Data); 22 | 23 | BD.Should_Fail := False; 24 | Unref := Mon.Read (2, Data); 25 | Unref := Mon.Write (3, Data); 26 | end TC_Block_Driver; 27 | -------------------------------------------------------------------------------- /testsuite/tests/monitors/tc.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/native/native.gpr"; 2 | 3 | project TC extends "../../utils/test_utils.gpr" is 4 | 5 | for Languages use ("Ada"); 6 | for Source_Dirs use Test_Utils'Source_Dirs & ("src"); 7 | for Main use 8 | ("tc_block_driver.adb"); 9 | for Object_Dir use "obj"; 10 | for Exec_Dir use "bin"; 11 | for Create_Missing_Dirs use "True"; 12 | 13 | package Compiler renames Native.Compiler; 14 | 15 | end TC; 16 | -------------------------------------------------------------------------------- /testsuite/tests/wire_simulation/tc.gpr: -------------------------------------------------------------------------------- 1 | with "../../../boards/native/native.gpr"; 2 | 3 | project TC extends "../../utils/test_utils.gpr" is 4 | 5 | for Languages use ("Ada"); 6 | for Source_Dirs use ("src"); 7 | for Main use ("tc_virtual_wire.adb"); 8 | for Object_Dir use "obj"; 9 | for Exec_Dir use "bin"; 10 | for Create_Missing_Dirs use "True"; 11 | 12 | package Compiler renames Native.Compiler; 13 | 14 | end TC; 15 | -------------------------------------------------------------------------------- /testsuite/tests/wire_simulation/tc_virtual_wire.out: -------------------------------------------------------------------------------- 1 | Expected exception on oppposite pull (1) 2 | Expected exception on oppposite pull (2) 3 | Expected exception on multiple output points 4 | Expected exception on unknown state 5 | -------------------------------------------------------------------------------- /testsuite/utils/test_utils.gpr: -------------------------------------------------------------------------------- 1 | project Test_Utils is 2 | 3 | for Source_Dirs use ("src"); 4 | for Languages use ("Ada"); 5 | for Object_Dir use "obj/"; 6 | for Create_Missing_Dirs use "True"; 7 | 8 | end Test_Utils; 9 | --------------------------------------------------------------------------------