Renamed folders
This commit is contained in:
parent
a6fd4104b9
commit
62ce3126a3
|
|
@ -1,101 +1,2 @@
|
||||||
# ---> C
|
program/main_controller/build
|
||||||
# Prerequisites
|
program/motion_controller/build
|
||||||
*.d
|
|
||||||
|
|
||||||
# Object files
|
|
||||||
*.o
|
|
||||||
*.ko
|
|
||||||
*.obj
|
|
||||||
*.elf
|
|
||||||
|
|
||||||
# Linker output
|
|
||||||
*.ilk
|
|
||||||
*.map
|
|
||||||
*.exp
|
|
||||||
|
|
||||||
# Precompiled Headers
|
|
||||||
*.gch
|
|
||||||
*.pch
|
|
||||||
|
|
||||||
# Libraries
|
|
||||||
*.lib
|
|
||||||
*.a
|
|
||||||
*.la
|
|
||||||
*.lo
|
|
||||||
|
|
||||||
# Shared objects (inc. Windows DLLs)
|
|
||||||
*.dll
|
|
||||||
*.so
|
|
||||||
*.so.*
|
|
||||||
*.dylib
|
|
||||||
|
|
||||||
# Executables
|
|
||||||
*.exe
|
|
||||||
*.out
|
|
||||||
*.app
|
|
||||||
*.i*86
|
|
||||||
*.x86_64
|
|
||||||
*.hex
|
|
||||||
|
|
||||||
# Debug files
|
|
||||||
*.dSYM/
|
|
||||||
*.su
|
|
||||||
*.idb
|
|
||||||
*.pdb
|
|
||||||
|
|
||||||
# Kernel Module Compile Results
|
|
||||||
*.mod*
|
|
||||||
*.cmd
|
|
||||||
.tmp_versions/
|
|
||||||
modules.order
|
|
||||||
Module.symvers
|
|
||||||
Mkfile.old
|
|
||||||
dkms.conf
|
|
||||||
|
|
||||||
# ---> C++
|
|
||||||
# Prerequisites
|
|
||||||
*.d
|
|
||||||
|
|
||||||
# Compiled Object files
|
|
||||||
*.slo
|
|
||||||
*.lo
|
|
||||||
*.o
|
|
||||||
*.obj
|
|
||||||
|
|
||||||
# Precompiled Headers
|
|
||||||
*.gch
|
|
||||||
*.pch
|
|
||||||
|
|
||||||
# Compiled Dynamic libraries
|
|
||||||
*.so
|
|
||||||
*.dylib
|
|
||||||
*.dll
|
|
||||||
|
|
||||||
# Fortran module files
|
|
||||||
*.mod
|
|
||||||
*.smod
|
|
||||||
|
|
||||||
# Compiled Static libraries
|
|
||||||
*.lai
|
|
||||||
*.la
|
|
||||||
*.a
|
|
||||||
*.lib
|
|
||||||
|
|
||||||
# Executables
|
|
||||||
*.exe
|
|
||||||
*.out
|
|
||||||
*.app
|
|
||||||
|
|
||||||
# ---> CMake
|
|
||||||
CMakeLists.txt.user
|
|
||||||
CMakeCache.txt
|
|
||||||
CMakeFiles
|
|
||||||
CMakeScripts
|
|
||||||
Testing
|
|
||||||
Makefile
|
|
||||||
cmake_install.cmake
|
|
||||||
install_manifest.txt
|
|
||||||
compile_commands.json
|
|
||||||
CTestTestfile.cmake
|
|
||||||
_deps
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{"hostname":"thinkpad","username":"ulysse-cura"}
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
// AUTOGENERATED FROM PICO_CONFIG_HEADER_FILES and then PICO_<PLATFORM>_CONFIG_HEADER_FILES
|
|
||||||
// DO NOT EDIT!
|
|
||||||
|
|
||||||
|
|
||||||
// based on PICO_CONFIG_HEADER_FILES:
|
|
||||||
|
|
||||||
#include "/home/ulysse-cura/.local/share/pico-sdk/src/boards/include/boards/pico_w.h"
|
|
||||||
#include "/home/ulysse-cura/.local/share/pico-sdk/src/rp2_common/cmsis/include/cmsis/rename_exceptions.h"
|
|
||||||
|
|
||||||
// based on PICO_RP2040_CONFIG_HEADER_FILES:
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
*/
|
|
||||||
|
|
||||||
// ---------------------------------------
|
|
||||||
// THIS FILE IS AUTOGENERATED; DO NOT EDIT
|
|
||||||
// ---------------------------------------
|
|
||||||
|
|
||||||
#ifndef _PICO_VERSION_H
|
|
||||||
#define _PICO_VERSION_H
|
|
||||||
|
|
||||||
#define PICO_SDK_VERSION_MAJOR 2
|
|
||||||
#define PICO_SDK_VERSION_MINOR 2
|
|
||||||
#define PICO_SDK_VERSION_REVISION 0
|
|
||||||
#define PICO_SDK_VERSION_STRING "2.2.0"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
|
@ -1,117 +0,0 @@
|
||||||
// THIS HEADER FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Copyright (c) 2024 Raspberry Pi Ltd.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
*/
|
|
||||||
#ifndef _DREQ_H
|
|
||||||
#define _DREQ_H
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file rp2040/dreq.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef __ASSEMBLER__
|
|
||||||
#define DREQ_PIO0_TX0 0
|
|
||||||
#define DREQ_PIO0_TX1 1
|
|
||||||
#define DREQ_PIO0_TX2 2
|
|
||||||
#define DREQ_PIO0_TX3 3
|
|
||||||
#define DREQ_PIO0_RX0 4
|
|
||||||
#define DREQ_PIO0_RX1 5
|
|
||||||
#define DREQ_PIO0_RX2 6
|
|
||||||
#define DREQ_PIO0_RX3 7
|
|
||||||
#define DREQ_PIO1_TX0 8
|
|
||||||
#define DREQ_PIO1_TX1 9
|
|
||||||
#define DREQ_PIO1_TX2 10
|
|
||||||
#define DREQ_PIO1_TX3 11
|
|
||||||
#define DREQ_PIO1_RX0 12
|
|
||||||
#define DREQ_PIO1_RX1 13
|
|
||||||
#define DREQ_PIO1_RX2 14
|
|
||||||
#define DREQ_PIO1_RX3 15
|
|
||||||
#define DREQ_SPI0_TX 16
|
|
||||||
#define DREQ_SPI0_RX 17
|
|
||||||
#define DREQ_SPI1_TX 18
|
|
||||||
#define DREQ_SPI1_RX 19
|
|
||||||
#define DREQ_UART0_TX 20
|
|
||||||
#define DREQ_UART0_RX 21
|
|
||||||
#define DREQ_UART1_TX 22
|
|
||||||
#define DREQ_UART1_RX 23
|
|
||||||
#define DREQ_PWM_WRAP0 24
|
|
||||||
#define DREQ_PWM_WRAP1 25
|
|
||||||
#define DREQ_PWM_WRAP2 26
|
|
||||||
#define DREQ_PWM_WRAP3 27
|
|
||||||
#define DREQ_PWM_WRAP4 28
|
|
||||||
#define DREQ_PWM_WRAP5 29
|
|
||||||
#define DREQ_PWM_WRAP6 30
|
|
||||||
#define DREQ_PWM_WRAP7 31
|
|
||||||
#define DREQ_I2C0_TX 32
|
|
||||||
#define DREQ_I2C0_RX 33
|
|
||||||
#define DREQ_I2C1_TX 34
|
|
||||||
#define DREQ_I2C1_RX 35
|
|
||||||
#define DREQ_ADC 36
|
|
||||||
#define DREQ_XIP_STREAM 37
|
|
||||||
#define DREQ_XIP_SSITX 38
|
|
||||||
#define DREQ_XIP_SSIRX 39
|
|
||||||
#define DREQ_DMA_TIMER0 59
|
|
||||||
#define DREQ_DMA_TIMER1 60
|
|
||||||
#define DREQ_DMA_TIMER2 61
|
|
||||||
#define DREQ_DMA_TIMER3 62
|
|
||||||
#define DREQ_FORCE 63
|
|
||||||
#else
|
|
||||||
/**
|
|
||||||
* \brief DREQ numbers for DMA pacing on RP2040 (used as typedef \ref dreq_num_t)
|
|
||||||
* \ingroup hardware_dma
|
|
||||||
*/
|
|
||||||
typedef enum dreq_num_rp2040 {
|
|
||||||
DREQ_PIO0_TX0 = 0, ///< Select PIO0's TX FIFO 0 as DREQ
|
|
||||||
DREQ_PIO0_TX1 = 1, ///< Select PIO0's TX FIFO 1 as DREQ
|
|
||||||
DREQ_PIO0_TX2 = 2, ///< Select PIO0's TX FIFO 2 as DREQ
|
|
||||||
DREQ_PIO0_TX3 = 3, ///< Select PIO0's TX FIFO 3 as DREQ
|
|
||||||
DREQ_PIO0_RX0 = 4, ///< Select PIO0's RX FIFO 0 as DREQ
|
|
||||||
DREQ_PIO0_RX1 = 5, ///< Select PIO0's RX FIFO 1 as DREQ
|
|
||||||
DREQ_PIO0_RX2 = 6, ///< Select PIO0's RX FIFO 2 as DREQ
|
|
||||||
DREQ_PIO0_RX3 = 7, ///< Select PIO0's RX FIFO 3 as DREQ
|
|
||||||
DREQ_PIO1_TX0 = 8, ///< Select PIO1's TX FIFO 0 as DREQ
|
|
||||||
DREQ_PIO1_TX1 = 9, ///< Select PIO1's TX FIFO 1 as DREQ
|
|
||||||
DREQ_PIO1_TX2 = 10, ///< Select PIO1's TX FIFO 2 as DREQ
|
|
||||||
DREQ_PIO1_TX3 = 11, ///< Select PIO1's TX FIFO 3 as DREQ
|
|
||||||
DREQ_PIO1_RX0 = 12, ///< Select PIO1's RX FIFO 0 as DREQ
|
|
||||||
DREQ_PIO1_RX1 = 13, ///< Select PIO1's RX FIFO 1 as DREQ
|
|
||||||
DREQ_PIO1_RX2 = 14, ///< Select PIO1's RX FIFO 2 as DREQ
|
|
||||||
DREQ_PIO1_RX3 = 15, ///< Select PIO1's RX FIFO 3 as DREQ
|
|
||||||
DREQ_SPI0_TX = 16, ///< Select SPI0's TX FIFO as DREQ
|
|
||||||
DREQ_SPI0_RX = 17, ///< Select SPI0's RX FIFO as DREQ
|
|
||||||
DREQ_SPI1_TX = 18, ///< Select SPI1's TX FIFO as DREQ
|
|
||||||
DREQ_SPI1_RX = 19, ///< Select SPI1's RX FIFO as DREQ
|
|
||||||
DREQ_UART0_TX = 20, ///< Select UART0's TX FIFO as DREQ
|
|
||||||
DREQ_UART0_RX = 21, ///< Select UART0's RX FIFO as DREQ
|
|
||||||
DREQ_UART1_TX = 22, ///< Select UART1's TX FIFO as DREQ
|
|
||||||
DREQ_UART1_RX = 23, ///< Select UART1's RX FIFO as DREQ
|
|
||||||
DREQ_PWM_WRAP0 = 24, ///< Select PWM Counter 0's Wrap Value as DREQ
|
|
||||||
DREQ_PWM_WRAP1 = 25, ///< Select PWM Counter 1's Wrap Value as DREQ
|
|
||||||
DREQ_PWM_WRAP2 = 26, ///< Select PWM Counter 2's Wrap Value as DREQ
|
|
||||||
DREQ_PWM_WRAP3 = 27, ///< Select PWM Counter 3's Wrap Value as DREQ
|
|
||||||
DREQ_PWM_WRAP4 = 28, ///< Select PWM Counter 4's Wrap Value as DREQ
|
|
||||||
DREQ_PWM_WRAP5 = 29, ///< Select PWM Counter 5's Wrap Value as DREQ
|
|
||||||
DREQ_PWM_WRAP6 = 30, ///< Select PWM Counter 6's Wrap Value as DREQ
|
|
||||||
DREQ_PWM_WRAP7 = 31, ///< Select PWM Counter 7's Wrap Value as DREQ
|
|
||||||
DREQ_I2C0_TX = 32, ///< Select I2C0's TX FIFO as DREQ
|
|
||||||
DREQ_I2C0_RX = 33, ///< Select I2C0's RX FIFO as DREQ
|
|
||||||
DREQ_I2C1_TX = 34, ///< Select I2C1's TX FIFO as DREQ
|
|
||||||
DREQ_I2C1_RX = 35, ///< Select I2C1's RX FIFO as DREQ
|
|
||||||
DREQ_ADC = 36, ///< Select the ADC as DREQ
|
|
||||||
DREQ_XIP_STREAM = 37, ///< Select the XIP Streaming FIFO as DREQ
|
|
||||||
DREQ_XIP_SSITX = 38, ///< Select the XIP SSI TX FIFO as DREQ
|
|
||||||
DREQ_XIP_SSIRX = 39, ///< Select the XIP SSI RX FIFO as DREQ
|
|
||||||
DREQ_DMA_TIMER0 = 59, ///< Select DMA_TIMER0 as DREQ
|
|
||||||
DREQ_DMA_TIMER1 = 60, ///< Select DMA_TIMER0 as DREQ
|
|
||||||
DREQ_DMA_TIMER2 = 61, ///< Select DMA_TIMER1 as DREQ
|
|
||||||
DREQ_DMA_TIMER3 = 62, ///< Select DMA_TIMER3 as DREQ
|
|
||||||
DREQ_FORCE = 63, ///< Select FORCE as DREQ
|
|
||||||
DREQ_COUNT
|
|
||||||
} dreq_num_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // _DREQ_H
|
|
||||||
|
|
||||||
|
|
@ -1,124 +0,0 @@
|
||||||
// THIS HEADER FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Copyright (c) 2024 Raspberry Pi Ltd.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
*/
|
|
||||||
#ifndef _INTCTRL_H
|
|
||||||
#define _INTCTRL_H
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file rp2040/intctrl.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef __ASSEMBLER__
|
|
||||||
#define TIMER_IRQ_0 0
|
|
||||||
#define TIMER_IRQ_1 1
|
|
||||||
#define TIMER_IRQ_2 2
|
|
||||||
#define TIMER_IRQ_3 3
|
|
||||||
#define PWM_IRQ_WRAP 4
|
|
||||||
#define USBCTRL_IRQ 5
|
|
||||||
#define XIP_IRQ 6
|
|
||||||
#define PIO0_IRQ_0 7
|
|
||||||
#define PIO0_IRQ_1 8
|
|
||||||
#define PIO1_IRQ_0 9
|
|
||||||
#define PIO1_IRQ_1 10
|
|
||||||
#define DMA_IRQ_0 11
|
|
||||||
#define DMA_IRQ_1 12
|
|
||||||
#define IO_IRQ_BANK0 13
|
|
||||||
#define IO_IRQ_QSPI 14
|
|
||||||
#define SIO_IRQ_PROC0 15
|
|
||||||
#define SIO_IRQ_PROC1 16
|
|
||||||
#define CLOCKS_IRQ 17
|
|
||||||
#define SPI0_IRQ 18
|
|
||||||
#define SPI1_IRQ 19
|
|
||||||
#define UART0_IRQ 20
|
|
||||||
#define UART1_IRQ 21
|
|
||||||
#define ADC_IRQ_FIFO 22
|
|
||||||
#define I2C0_IRQ 23
|
|
||||||
#define I2C1_IRQ 24
|
|
||||||
#define RTC_IRQ 25
|
|
||||||
#define SPARE_IRQ_0 26
|
|
||||||
#define SPARE_IRQ_1 27
|
|
||||||
#define SPARE_IRQ_2 28
|
|
||||||
#define SPARE_IRQ_3 29
|
|
||||||
#define SPARE_IRQ_4 30
|
|
||||||
#define SPARE_IRQ_5 31
|
|
||||||
#else
|
|
||||||
/**
|
|
||||||
* \brief Interrupt numbers on RP2040 (used as typedef \ref irq_num_t)
|
|
||||||
* \ingroup hardware_irq
|
|
||||||
*/
|
|
||||||
typedef enum irq_num_rp2040 {
|
|
||||||
TIMER_IRQ_0 = 0, ///< Select TIMER's IRQ 0 output
|
|
||||||
TIMER_IRQ_1 = 1, ///< Select TIMER's IRQ 1 output
|
|
||||||
TIMER_IRQ_2 = 2, ///< Select TIMER's IRQ 2 output
|
|
||||||
TIMER_IRQ_3 = 3, ///< Select TIMER's IRQ 3 output
|
|
||||||
PWM_IRQ_WRAP = 4, ///< Select PWM's IRQ_WRAP output
|
|
||||||
USBCTRL_IRQ = 5, ///< Select USBCTRL's IRQ output
|
|
||||||
XIP_IRQ = 6, ///< Select XIP's IRQ output
|
|
||||||
PIO0_IRQ_0 = 7, ///< Select PIO0's IRQ 0 output
|
|
||||||
PIO0_IRQ_1 = 8, ///< Select PIO0's IRQ 1 output
|
|
||||||
PIO1_IRQ_0 = 9, ///< Select PIO1's IRQ 0 output
|
|
||||||
PIO1_IRQ_1 = 10, ///< Select PIO1's IRQ 1 output
|
|
||||||
DMA_IRQ_0 = 11, ///< Select DMA's IRQ 0 output
|
|
||||||
DMA_IRQ_1 = 12, ///< Select DMA's IRQ 1 output
|
|
||||||
IO_IRQ_BANK0 = 13, ///< Select IO_BANK0's IRQ output
|
|
||||||
IO_IRQ_QSPI = 14, ///< Select IO_QSPI's IRQ output
|
|
||||||
SIO_IRQ_PROC0 = 15, ///< Select SIO_PROC0's IRQ output
|
|
||||||
SIO_IRQ_PROC1 = 16, ///< Select SIO_PROC1's IRQ output
|
|
||||||
CLOCKS_IRQ = 17, ///< Select CLOCKS's IRQ output
|
|
||||||
SPI0_IRQ = 18, ///< Select SPI0's IRQ output
|
|
||||||
SPI1_IRQ = 19, ///< Select SPI1's IRQ output
|
|
||||||
UART0_IRQ = 20, ///< Select UART0's IRQ output
|
|
||||||
UART1_IRQ = 21, ///< Select UART1's IRQ output
|
|
||||||
ADC_IRQ_FIFO = 22, ///< Select ADC's IRQ_FIFO output
|
|
||||||
I2C0_IRQ = 23, ///< Select I2C0's IRQ output
|
|
||||||
I2C1_IRQ = 24, ///< Select I2C1's IRQ output
|
|
||||||
RTC_IRQ = 25, ///< Select RTC's IRQ output
|
|
||||||
SPARE_IRQ_0 = 26, ///< Select SPARE IRQ 0
|
|
||||||
SPARE_IRQ_1 = 27, ///< Select SPARE IRQ 1
|
|
||||||
SPARE_IRQ_2 = 28, ///< Select SPARE IRQ 2
|
|
||||||
SPARE_IRQ_3 = 29, ///< Select SPARE IRQ 3
|
|
||||||
SPARE_IRQ_4 = 30, ///< Select SPARE IRQ 4
|
|
||||||
SPARE_IRQ_5 = 31, ///< Select SPARE IRQ 5
|
|
||||||
IRQ_COUNT
|
|
||||||
} irq_num_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define isr_timer_0 isr_irq0
|
|
||||||
#define isr_timer_1 isr_irq1
|
|
||||||
#define isr_timer_2 isr_irq2
|
|
||||||
#define isr_timer_3 isr_irq3
|
|
||||||
#define isr_pwm_wrap isr_irq4
|
|
||||||
#define isr_usbctrl isr_irq5
|
|
||||||
#define isr_xip isr_irq6
|
|
||||||
#define isr_pio0_0 isr_irq7
|
|
||||||
#define isr_pio0_1 isr_irq8
|
|
||||||
#define isr_pio1_0 isr_irq9
|
|
||||||
#define isr_pio1_1 isr_irq10
|
|
||||||
#define isr_dma_0 isr_irq11
|
|
||||||
#define isr_dma_1 isr_irq12
|
|
||||||
#define isr_io_bank0 isr_irq13
|
|
||||||
#define isr_io_qspi isr_irq14
|
|
||||||
#define isr_sio_proc0 isr_irq15
|
|
||||||
#define isr_sio_proc1 isr_irq16
|
|
||||||
#define isr_clocks isr_irq17
|
|
||||||
#define isr_spi0 isr_irq18
|
|
||||||
#define isr_spi1 isr_irq19
|
|
||||||
#define isr_uart0 isr_irq20
|
|
||||||
#define isr_uart1 isr_irq21
|
|
||||||
#define isr_adc_fifo isr_irq22
|
|
||||||
#define isr_i2c0 isr_irq23
|
|
||||||
#define isr_i2c1 isr_irq24
|
|
||||||
#define isr_rtc isr_irq25
|
|
||||||
#define isr_spare_0 isr_irq26
|
|
||||||
#define isr_spare_1 isr_irq27
|
|
||||||
#define isr_spare_2 isr_irq28
|
|
||||||
#define isr_spare_3 isr_irq29
|
|
||||||
#define isr_spare_4 isr_irq30
|
|
||||||
#define isr_spare_5 isr_irq31
|
|
||||||
|
|
||||||
#endif // _INTCTRL_H
|
|
||||||
|
|
||||||
Binary file not shown.
|
|
@ -1,150 +0,0 @@
|
||||||
|
|
||||||
/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pico-sdk/src/rp2040/boot_stage2/bs2_default.elf: file format elf32-littlearm
|
|
||||||
|
|
||||||
Sections:
|
|
||||||
Idx Name Size VMA LMA File off Algn
|
|
||||||
0 .text 000000f0 20041f00 20041f00 00001f00 2**2
|
|
||||||
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
|
||||||
1 .ARM.attributes 00000022 00000000 00000000 00001ff0 2**0
|
|
||||||
CONTENTS, READONLY
|
|
||||||
2 .debug_line 000000ed 00000000 00000000 00002012 2**0
|
|
||||||
CONTENTS, READONLY, DEBUGGING, OCTETS
|
|
||||||
3 .debug_line_str 0000016b 00000000 00000000 000020ff 2**0
|
|
||||||
CONTENTS, READONLY, DEBUGGING, OCTETS
|
|
||||||
4 .debug_info 00000025 00000000 00000000 0000226a 2**0
|
|
||||||
CONTENTS, READONLY, DEBUGGING, OCTETS
|
|
||||||
5 .debug_abbrev 00000014 00000000 00000000 0000228f 2**0
|
|
||||||
CONTENTS, READONLY, DEBUGGING, OCTETS
|
|
||||||
6 .debug_aranges 00000020 00000000 00000000 000022a8 2**3
|
|
||||||
CONTENTS, READONLY, DEBUGGING, OCTETS
|
|
||||||
7 .debug_str 000000ea 00000000 00000000 000022c8 2**0
|
|
||||||
CONTENTS, READONLY, DEBUGGING, OCTETS
|
|
||||||
|
|
||||||
/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pico-sdk/src/rp2040/boot_stage2/bs2_default.elf: file format elf32-littlearm
|
|
||||||
|
|
||||||
|
|
||||||
Disassembly of section .text:
|
|
||||||
|
|
||||||
20041f00 <_stage2_boot>:
|
|
||||||
20041f00: b500 push {lr}
|
|
||||||
20041f02: 4b32 ldr r3, [pc, #200] @ (20041fcc <literals>)
|
|
||||||
20041f04: 2021 movs r0, #33 @ 0x21
|
|
||||||
20041f06: 6058 str r0, [r3, #4]
|
|
||||||
20041f08: 6898 ldr r0, [r3, #8]
|
|
||||||
20041f0a: 2102 movs r1, #2
|
|
||||||
20041f0c: 4388 bics r0, r1
|
|
||||||
20041f0e: 6098 str r0, [r3, #8]
|
|
||||||
20041f10: 60d8 str r0, [r3, #12]
|
|
||||||
20041f12: 6118 str r0, [r3, #16]
|
|
||||||
20041f14: 6158 str r0, [r3, #20]
|
|
||||||
20041f16: 4b2e ldr r3, [pc, #184] @ (20041fd0 <literals+0x4>)
|
|
||||||
20041f18: 2100 movs r1, #0
|
|
||||||
20041f1a: 6099 str r1, [r3, #8]
|
|
||||||
20041f1c: 2102 movs r1, #2
|
|
||||||
20041f1e: 6159 str r1, [r3, #20]
|
|
||||||
20041f20: 2101 movs r1, #1
|
|
||||||
20041f22: 22f0 movs r2, #240 @ 0xf0
|
|
||||||
20041f24: 5099 str r1, [r3, r2]
|
|
||||||
|
|
||||||
20041f26 <program_sregs>:
|
|
||||||
20041f26: 492b ldr r1, [pc, #172] @ (20041fd4 <literals+0x8>)
|
|
||||||
20041f28: 6019 str r1, [r3, #0]
|
|
||||||
20041f2a: 2101 movs r1, #1
|
|
||||||
20041f2c: 6099 str r1, [r3, #8]
|
|
||||||
20041f2e: 2035 movs r0, #53 @ 0x35
|
|
||||||
20041f30: f000 f844 bl 20041fbc <read_flash_sreg>
|
|
||||||
20041f34: 2202 movs r2, #2
|
|
||||||
20041f36: 4290 cmp r0, r2
|
|
||||||
20041f38: d014 beq.n 20041f64 <skip_sreg_programming>
|
|
||||||
20041f3a: 2106 movs r1, #6
|
|
||||||
20041f3c: 6619 str r1, [r3, #96] @ 0x60
|
|
||||||
20041f3e: f000 f834 bl 20041faa <wait_ssi_ready>
|
|
||||||
20041f42: 6e19 ldr r1, [r3, #96] @ 0x60
|
|
||||||
20041f44: 2101 movs r1, #1
|
|
||||||
20041f46: 6619 str r1, [r3, #96] @ 0x60
|
|
||||||
20041f48: 2000 movs r0, #0
|
|
||||||
20041f4a: 6618 str r0, [r3, #96] @ 0x60
|
|
||||||
20041f4c: 661a str r2, [r3, #96] @ 0x60
|
|
||||||
20041f4e: f000 f82c bl 20041faa <wait_ssi_ready>
|
|
||||||
20041f52: 6e19 ldr r1, [r3, #96] @ 0x60
|
|
||||||
20041f54: 6e19 ldr r1, [r3, #96] @ 0x60
|
|
||||||
20041f56: 6e19 ldr r1, [r3, #96] @ 0x60
|
|
||||||
20041f58: 2005 movs r0, #5
|
|
||||||
20041f5a: f000 f82f bl 20041fbc <read_flash_sreg>
|
|
||||||
20041f5e: 2101 movs r1, #1
|
|
||||||
20041f60: 4208 tst r0, r1
|
|
||||||
20041f62: d1f9 bne.n 20041f58 <program_sregs+0x32>
|
|
||||||
|
|
||||||
20041f64 <skip_sreg_programming>:
|
|
||||||
20041f64: 2100 movs r1, #0
|
|
||||||
20041f66: 6099 str r1, [r3, #8]
|
|
||||||
|
|
||||||
20041f68 <dummy_read>:
|
|
||||||
20041f68: 491b ldr r1, [pc, #108] @ (20041fd8 <literals+0xc>)
|
|
||||||
20041f6a: 6019 str r1, [r3, #0]
|
|
||||||
20041f6c: 2100 movs r1, #0
|
|
||||||
20041f6e: 6059 str r1, [r3, #4]
|
|
||||||
20041f70: 491a ldr r1, [pc, #104] @ (20041fdc <literals+0x10>)
|
|
||||||
20041f72: 481b ldr r0, [pc, #108] @ (20041fe0 <literals+0x14>)
|
|
||||||
20041f74: 6001 str r1, [r0, #0]
|
|
||||||
20041f76: 2101 movs r1, #1
|
|
||||||
20041f78: 6099 str r1, [r3, #8]
|
|
||||||
20041f7a: 21eb movs r1, #235 @ 0xeb
|
|
||||||
20041f7c: 6619 str r1, [r3, #96] @ 0x60
|
|
||||||
20041f7e: 21a0 movs r1, #160 @ 0xa0
|
|
||||||
20041f80: 6619 str r1, [r3, #96] @ 0x60
|
|
||||||
20041f82: f000 f812 bl 20041faa <wait_ssi_ready>
|
|
||||||
20041f86: 2100 movs r1, #0
|
|
||||||
20041f88: 6099 str r1, [r3, #8]
|
|
||||||
|
|
||||||
20041f8a <configure_ssi>:
|
|
||||||
20041f8a: 4916 ldr r1, [pc, #88] @ (20041fe4 <literals+0x18>)
|
|
||||||
20041f8c: 4814 ldr r0, [pc, #80] @ (20041fe0 <literals+0x14>)
|
|
||||||
20041f8e: 6001 str r1, [r0, #0]
|
|
||||||
20041f90: 2101 movs r1, #1
|
|
||||||
20041f92: 6099 str r1, [r3, #8]
|
|
||||||
|
|
||||||
20041f94 <check_return>:
|
|
||||||
20041f94: bc01 pop {r0}
|
|
||||||
20041f96: 2800 cmp r0, #0
|
|
||||||
20041f98: d000 beq.n 20041f9c <vector_into_flash>
|
|
||||||
20041f9a: 4700 bx r0
|
|
||||||
|
|
||||||
20041f9c <vector_into_flash>:
|
|
||||||
20041f9c: 4812 ldr r0, [pc, #72] @ (20041fe8 <literals+0x1c>)
|
|
||||||
20041f9e: 4913 ldr r1, [pc, #76] @ (20041fec <literals+0x20>)
|
|
||||||
20041fa0: 6008 str r0, [r1, #0]
|
|
||||||
20041fa2: c803 ldmia r0, {r0, r1}
|
|
||||||
20041fa4: f380 8808 msr MSP, r0
|
|
||||||
20041fa8: 4708 bx r1
|
|
||||||
|
|
||||||
20041faa <wait_ssi_ready>:
|
|
||||||
20041faa: b503 push {r0, r1, lr}
|
|
||||||
20041fac: 6a99 ldr r1, [r3, #40] @ 0x28
|
|
||||||
20041fae: 2004 movs r0, #4
|
|
||||||
20041fb0: 4201 tst r1, r0
|
|
||||||
20041fb2: d0fb beq.n 20041fac <wait_ssi_ready+0x2>
|
|
||||||
20041fb4: 2001 movs r0, #1
|
|
||||||
20041fb6: 4201 tst r1, r0
|
|
||||||
20041fb8: d1f8 bne.n 20041fac <wait_ssi_ready+0x2>
|
|
||||||
20041fba: bd03 pop {r0, r1, pc}
|
|
||||||
|
|
||||||
20041fbc <read_flash_sreg>:
|
|
||||||
20041fbc: b502 push {r1, lr}
|
|
||||||
20041fbe: 6618 str r0, [r3, #96] @ 0x60
|
|
||||||
20041fc0: 6618 str r0, [r3, #96] @ 0x60
|
|
||||||
20041fc2: f7ff fff2 bl 20041faa <wait_ssi_ready>
|
|
||||||
20041fc6: 6e18 ldr r0, [r3, #96] @ 0x60
|
|
||||||
20041fc8: 6e18 ldr r0, [r3, #96] @ 0x60
|
|
||||||
20041fca: bd02 pop {r1, pc}
|
|
||||||
|
|
||||||
20041fcc <literals>:
|
|
||||||
20041fcc: 40020000 .word 0x40020000
|
|
||||||
20041fd0: 18000000 .word 0x18000000
|
|
||||||
20041fd4: 00070000 .word 0x00070000
|
|
||||||
20041fd8: 005f0300 .word 0x005f0300
|
|
||||||
20041fdc: 00002221 .word 0x00002221
|
|
||||||
20041fe0: 180000f4 .word 0x180000f4
|
|
||||||
20041fe4: a0002022 .word 0xa0002022
|
|
||||||
20041fe8: 10000100 .word 0x10000100
|
|
||||||
20041fec: e000ed08 .word 0xe000ed08
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
// Padded and checksummed version of: /home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pico-sdk/src/rp2040/boot_stage2/bs2_default.bin
|
|
||||||
|
|
||||||
.cpu cortex-m0plus
|
|
||||||
.thumb
|
|
||||||
|
|
||||||
.section .boot2, "ax"
|
|
||||||
|
|
||||||
.byte 0x00, 0xb5, 0x32, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21, 0x88, 0x43, 0x98, 0x60
|
|
||||||
.byte 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2e, 0x4b, 0x00, 0x21, 0x99, 0x60, 0x02, 0x21, 0x59, 0x61
|
|
||||||
.byte 0x01, 0x21, 0xf0, 0x22, 0x99, 0x50, 0x2b, 0x49, 0x19, 0x60, 0x01, 0x21, 0x99, 0x60, 0x35, 0x20
|
|
||||||
.byte 0x00, 0xf0, 0x44, 0xf8, 0x02, 0x22, 0x90, 0x42, 0x14, 0xd0, 0x06, 0x21, 0x19, 0x66, 0x00, 0xf0
|
|
||||||
.byte 0x34, 0xf8, 0x19, 0x6e, 0x01, 0x21, 0x19, 0x66, 0x00, 0x20, 0x18, 0x66, 0x1a, 0x66, 0x00, 0xf0
|
|
||||||
.byte 0x2c, 0xf8, 0x19, 0x6e, 0x19, 0x6e, 0x19, 0x6e, 0x05, 0x20, 0x00, 0xf0, 0x2f, 0xf8, 0x01, 0x21
|
|
||||||
.byte 0x08, 0x42, 0xf9, 0xd1, 0x00, 0x21, 0x99, 0x60, 0x1b, 0x49, 0x19, 0x60, 0x00, 0x21, 0x59, 0x60
|
|
||||||
.byte 0x1a, 0x49, 0x1b, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, 0xeb, 0x21, 0x19, 0x66, 0xa0, 0x21
|
|
||||||
.byte 0x19, 0x66, 0x00, 0xf0, 0x12, 0xf8, 0x00, 0x21, 0x99, 0x60, 0x16, 0x49, 0x14, 0x48, 0x01, 0x60
|
|
||||||
.byte 0x01, 0x21, 0x99, 0x60, 0x01, 0xbc, 0x00, 0x28, 0x00, 0xd0, 0x00, 0x47, 0x12, 0x48, 0x13, 0x49
|
|
||||||
.byte 0x08, 0x60, 0x03, 0xc8, 0x80, 0xf3, 0x08, 0x88, 0x08, 0x47, 0x03, 0xb5, 0x99, 0x6a, 0x04, 0x20
|
|
||||||
.byte 0x01, 0x42, 0xfb, 0xd0, 0x01, 0x20, 0x01, 0x42, 0xf8, 0xd1, 0x03, 0xbd, 0x02, 0xb5, 0x18, 0x66
|
|
||||||
.byte 0x18, 0x66, 0xff, 0xf7, 0xf2, 0xff, 0x18, 0x6e, 0x18, 0x6e, 0x02, 0xbd, 0x00, 0x00, 0x02, 0x40
|
|
||||||
.byte 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x07, 0x00, 0x00, 0x03, 0x5f, 0x00, 0x21, 0x22, 0x00, 0x00
|
|
||||||
.byte 0xf4, 0x00, 0x00, 0x18, 0x22, 0x20, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x10, 0x08, 0xed, 0x00, 0xe0
|
|
||||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0xb2, 0x4e, 0x7a
|
|
||||||
|
|
@ -1,173 +0,0 @@
|
||||||
// ---------------------------------------------------------------- //
|
|
||||||
// This file is autogenerated by pioasm version 2.2.0; do not edit! //
|
|
||||||
// ---------------------------------------------------------------- //
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#if !PICO_NO_HARDWARE
|
|
||||||
#include "hardware/pio.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ---------------- //
|
|
||||||
// spi_gap0_sample1 //
|
|
||||||
// ---------------- //
|
|
||||||
|
|
||||||
#define spi_gap0_sample1_wrap_target 0
|
|
||||||
#define spi_gap0_sample1_wrap 4
|
|
||||||
#define spi_gap0_sample1_pio_version 0
|
|
||||||
|
|
||||||
#define spi_gap0_sample1_offset_lp1_end 2u
|
|
||||||
#define spi_gap0_sample1_offset_end 5u
|
|
||||||
|
|
||||||
static const uint16_t spi_gap0_sample1_program_instructions[] = {
|
|
||||||
// .wrap_target
|
|
||||||
0x6001, // 0: out pins, 1 side 0
|
|
||||||
0x1040, // 1: jmp x--, 0 side 1
|
|
||||||
0xe080, // 2: set pindirs, 0 side 0
|
|
||||||
0x5001, // 3: in pins, 1 side 1
|
|
||||||
0x0083, // 4: jmp y--, 3 side 0
|
|
||||||
// .wrap
|
|
||||||
};
|
|
||||||
|
|
||||||
#if !PICO_NO_HARDWARE
|
|
||||||
static const struct pio_program spi_gap0_sample1_program = {
|
|
||||||
.instructions = spi_gap0_sample1_program_instructions,
|
|
||||||
.length = 5,
|
|
||||||
.origin = -1,
|
|
||||||
.pio_version = spi_gap0_sample1_pio_version,
|
|
||||||
#if PICO_PIO_VERSION > 0
|
|
||||||
.used_gpio_ranges = 0x0
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
static inline pio_sm_config spi_gap0_sample1_program_get_default_config(uint offset) {
|
|
||||||
pio_sm_config c = pio_get_default_sm_config();
|
|
||||||
sm_config_set_wrap(&c, offset + spi_gap0_sample1_wrap_target, offset + spi_gap0_sample1_wrap);
|
|
||||||
sm_config_set_sideset(&c, 1, false, false);
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ----------------- //
|
|
||||||
// spi_gap01_sample0 //
|
|
||||||
// ----------------- //
|
|
||||||
|
|
||||||
#define spi_gap01_sample0_wrap_target 0
|
|
||||||
#define spi_gap01_sample0_wrap 5
|
|
||||||
#define spi_gap01_sample0_pio_version 0
|
|
||||||
|
|
||||||
#define spi_gap01_sample0_offset_lp1_end 2u
|
|
||||||
#define spi_gap01_sample0_offset_end 6u
|
|
||||||
|
|
||||||
static const uint16_t spi_gap01_sample0_program_instructions[] = {
|
|
||||||
// .wrap_target
|
|
||||||
0x6001, // 0: out pins, 1 side 0
|
|
||||||
0x1040, // 1: jmp x--, 0 side 1
|
|
||||||
0xe080, // 2: set pindirs, 0 side 0
|
|
||||||
0xb042, // 3: nop side 1
|
|
||||||
0x4001, // 4: in pins, 1 side 0
|
|
||||||
0x1084, // 5: jmp y--, 4 side 1
|
|
||||||
// .wrap
|
|
||||||
};
|
|
||||||
|
|
||||||
#if !PICO_NO_HARDWARE
|
|
||||||
static const struct pio_program spi_gap01_sample0_program = {
|
|
||||||
.instructions = spi_gap01_sample0_program_instructions,
|
|
||||||
.length = 6,
|
|
||||||
.origin = -1,
|
|
||||||
.pio_version = spi_gap01_sample0_pio_version,
|
|
||||||
#if PICO_PIO_VERSION > 0
|
|
||||||
.used_gpio_ranges = 0x0
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
static inline pio_sm_config spi_gap01_sample0_program_get_default_config(uint offset) {
|
|
||||||
pio_sm_config c = pio_get_default_sm_config();
|
|
||||||
sm_config_set_wrap(&c, offset + spi_gap01_sample0_wrap_target, offset + spi_gap01_sample0_wrap);
|
|
||||||
sm_config_set_sideset(&c, 1, false, false);
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ------------------ //
|
|
||||||
// spi_gap010_sample1 //
|
|
||||||
// ------------------ //
|
|
||||||
|
|
||||||
#define spi_gap010_sample1_wrap_target 0
|
|
||||||
#define spi_gap010_sample1_wrap 6
|
|
||||||
#define spi_gap010_sample1_pio_version 0
|
|
||||||
|
|
||||||
#define spi_gap010_sample1_offset_lp1_end 2u
|
|
||||||
#define spi_gap010_sample1_offset_end 7u
|
|
||||||
|
|
||||||
static const uint16_t spi_gap010_sample1_program_instructions[] = {
|
|
||||||
// .wrap_target
|
|
||||||
0x6001, // 0: out pins, 1 side 0
|
|
||||||
0x1040, // 1: jmp x--, 0 side 1
|
|
||||||
0xe080, // 2: set pindirs, 0 side 0
|
|
||||||
0xb042, // 3: nop side 1
|
|
||||||
0xa042, // 4: nop side 0
|
|
||||||
0x5001, // 5: in pins, 1 side 1
|
|
||||||
0x0085, // 6: jmp y--, 5 side 0
|
|
||||||
// .wrap
|
|
||||||
};
|
|
||||||
|
|
||||||
#if !PICO_NO_HARDWARE
|
|
||||||
static const struct pio_program spi_gap010_sample1_program = {
|
|
||||||
.instructions = spi_gap010_sample1_program_instructions,
|
|
||||||
.length = 7,
|
|
||||||
.origin = -1,
|
|
||||||
.pio_version = spi_gap010_sample1_pio_version,
|
|
||||||
#if PICO_PIO_VERSION > 0
|
|
||||||
.used_gpio_ranges = 0x0
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
static inline pio_sm_config spi_gap010_sample1_program_get_default_config(uint offset) {
|
|
||||||
pio_sm_config c = pio_get_default_sm_config();
|
|
||||||
sm_config_set_wrap(&c, offset + spi_gap010_sample1_wrap_target, offset + spi_gap010_sample1_wrap);
|
|
||||||
sm_config_set_sideset(&c, 1, false, false);
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ------------------------ //
|
|
||||||
// spi_gap0_sample1_regular //
|
|
||||||
// ------------------------ //
|
|
||||||
|
|
||||||
#define spi_gap0_sample1_regular_wrap_target 0
|
|
||||||
#define spi_gap0_sample1_regular_wrap 4
|
|
||||||
#define spi_gap0_sample1_regular_pio_version 0
|
|
||||||
|
|
||||||
#define spi_gap0_sample1_regular_offset_lp1_end 2u
|
|
||||||
#define spi_gap0_sample1_regular_offset_end 5u
|
|
||||||
|
|
||||||
static const uint16_t spi_gap0_sample1_regular_program_instructions[] = {
|
|
||||||
// .wrap_target
|
|
||||||
0x6001, // 0: out pins, 1 side 0
|
|
||||||
0x1040, // 1: jmp x--, 0 side 1
|
|
||||||
0xe080, // 2: set pindirs, 0 side 0
|
|
||||||
0x5001, // 3: in pins, 1 side 1
|
|
||||||
0x0083, // 4: jmp y--, 3 side 0
|
|
||||||
// .wrap
|
|
||||||
};
|
|
||||||
|
|
||||||
#if !PICO_NO_HARDWARE
|
|
||||||
static const struct pio_program spi_gap0_sample1_regular_program = {
|
|
||||||
.instructions = spi_gap0_sample1_regular_program_instructions,
|
|
||||||
.length = 5,
|
|
||||||
.origin = -1,
|
|
||||||
.pio_version = spi_gap0_sample1_regular_pio_version,
|
|
||||||
#if PICO_PIO_VERSION > 0
|
|
||||||
.used_gpio_ranges = 0x0
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
static inline pio_sm_config spi_gap0_sample1_regular_program_get_default_config(uint offset) {
|
|
||||||
pio_sm_config c = pio_get_default_sm_config();
|
|
||||||
sm_config_set_wrap(&c, offset + spi_gap0_sample1_regular_wrap_target, offset + spi_gap0_sample1_regular_wrap);
|
|
||||||
sm_config_set_sideset(&c, 1, false, false);
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
# This is a generated file and its contents are an internal implementation detail.
|
|
||||||
# The update step will be re-executed if anything in this file changes.
|
|
||||||
# No other meaning or use of this file is supported.
|
|
||||||
|
|
||||||
command=
|
|
||||||
work_dir=
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
# This is a generated file and its contents are an internal implementation detail.
|
|
||||||
# The download step will be re-executed if anything in this file changes.
|
|
||||||
# No other meaning or use of this file is supported.
|
|
||||||
|
|
||||||
method=source_dir
|
|
||||||
command=
|
|
||||||
source_dir=/home/ulysse-cura/.local/share/pico-sdk/tools/pioasm
|
|
||||||
work_dir=
|
|
||||||
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
# This is a generated file and its contents are an internal implementation detail.
|
|
||||||
# The patch step will be re-executed if anything in this file changes.
|
|
||||||
# No other meaning or use of this file is supported.
|
|
||||||
|
|
||||||
command (connected)=
|
|
||||||
command (disconnected)=
|
|
||||||
work_dir=
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
|
|
||||||
set(PIOASM_EXTRA_SOURCE_FILES "" CACHE STRING "Initial cache" FORCE)
|
|
||||||
set(PIOASM_VERSION_STRING "2.2.0" CACHE STRING "Initial cache" FORCE)
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
cmd='/usr/bin/cmake;--no-warn-unused-cli;-DCMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/gmake;-DPIOASM_FLAT_INSTALL=1;-DCMAKE_INSTALL_PREFIX=/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pioasm-install;-DCMAKE_RULE_MESSAGES=OFF;-DCMAKE_INSTALL_MESSAGE=NEVER;-GUnix Makefiles;-C<TMP_DIR>/pioasmBuild-cache-$<CONFIG>.cmake;-S;<SOURCE_DIR><SOURCE_SUBDIR>;-B;<BINARY_DIR>'
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
||||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION ${CMAKE_VERSION}) # this file comes with cmake
|
|
||||||
|
|
||||||
# If CMAKE_DISABLE_SOURCE_CHANGES is set to true and the source directory is an
|
|
||||||
# existing directory in our source tree, calling file(MAKE_DIRECTORY) on it
|
|
||||||
# would cause a fatal error, even though it would be a no-op.
|
|
||||||
if(NOT EXISTS "/home/ulysse-cura/.local/share/pico-sdk/tools/pioasm")
|
|
||||||
file(MAKE_DIRECTORY "/home/ulysse-cura/.local/share/pico-sdk/tools/pioasm")
|
|
||||||
endif()
|
|
||||||
file(MAKE_DIRECTORY
|
|
||||||
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pioasm"
|
|
||||||
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pioasm-install"
|
|
||||||
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/tmp"
|
|
||||||
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src/pioasmBuild-stamp"
|
|
||||||
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src"
|
|
||||||
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src/pioasmBuild-stamp"
|
|
||||||
)
|
|
||||||
|
|
||||||
set(configSubDirs )
|
|
||||||
foreach(subDir IN LISTS configSubDirs)
|
|
||||||
file(MAKE_DIRECTORY "/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src/pioasmBuild-stamp/${subDir}")
|
|
||||||
endforeach()
|
|
||||||
if(cfgdir)
|
|
||||||
file(MAKE_DIRECTORY "/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src/pioasmBuild-stamp${cfgdir}") # cfgdir has leading slash
|
|
||||||
endif()
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
FLASH(rx) : ORIGIN = 0x10000000, LENGTH = (2 * 1024 * 1024)
|
|
||||||
Binary file not shown.
|
|
@ -1,3 +0,0 @@
|
||||||
if (NOT TARGET pioasm)
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/pioasmTargets.cmake")
|
|
||||||
endif()
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
# This is a basic version file for the Config-mode of find_package().
|
|
||||||
# It is used by write_basic_package_version_file() as input file for configure_file()
|
|
||||||
# to create a version-file which can be installed along a config.cmake file.
|
|
||||||
#
|
|
||||||
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
|
|
||||||
# the requested version string are exactly the same and it sets
|
|
||||||
# PACKAGE_VERSION_COMPATIBLE if the current version is equal to the requested version.
|
|
||||||
# The tweak version component is ignored.
|
|
||||||
# The variable CVF_VERSION must be set before calling configure_file().
|
|
||||||
|
|
||||||
|
|
||||||
if (PACKAGE_FIND_VERSION_RANGE)
|
|
||||||
message(AUTHOR_WARNING
|
|
||||||
"`find_package()` specify a version range but the version strategy "
|
|
||||||
"(ExactVersion) of the module `${PACKAGE_FIND_NAME}` is incompatible "
|
|
||||||
"with this request. Only the lower endpoint of the range will be used.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(PACKAGE_VERSION "2.2.0")
|
|
||||||
|
|
||||||
if("2.2.0" MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)") # strip the tweak version
|
|
||||||
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
|
||||||
set(CVF_VERSION_MINOR "${CMAKE_MATCH_2}")
|
|
||||||
set(CVF_VERSION_PATCH "${CMAKE_MATCH_3}")
|
|
||||||
|
|
||||||
if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
|
|
||||||
string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
|
|
||||||
endif()
|
|
||||||
if(NOT CVF_VERSION_MINOR VERSION_EQUAL 0)
|
|
||||||
string(REGEX REPLACE "^0+" "" CVF_VERSION_MINOR "${CVF_VERSION_MINOR}")
|
|
||||||
endif()
|
|
||||||
if(NOT CVF_VERSION_PATCH VERSION_EQUAL 0)
|
|
||||||
string(REGEX REPLACE "^0+" "" CVF_VERSION_PATCH "${CVF_VERSION_PATCH}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(CVF_VERSION_NO_TWEAK "${CVF_VERSION_MAJOR}.${CVF_VERSION_MINOR}.${CVF_VERSION_PATCH}")
|
|
||||||
else()
|
|
||||||
set(CVF_VERSION_NO_TWEAK "2.2.0")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(PACKAGE_FIND_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)") # strip the tweak version
|
|
||||||
set(REQUESTED_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
|
||||||
set(REQUESTED_VERSION_MINOR "${CMAKE_MATCH_2}")
|
|
||||||
set(REQUESTED_VERSION_PATCH "${CMAKE_MATCH_3}")
|
|
||||||
|
|
||||||
if(NOT REQUESTED_VERSION_MAJOR VERSION_EQUAL 0)
|
|
||||||
string(REGEX REPLACE "^0+" "" REQUESTED_VERSION_MAJOR "${REQUESTED_VERSION_MAJOR}")
|
|
||||||
endif()
|
|
||||||
if(NOT REQUESTED_VERSION_MINOR VERSION_EQUAL 0)
|
|
||||||
string(REGEX REPLACE "^0+" "" REQUESTED_VERSION_MINOR "${REQUESTED_VERSION_MINOR}")
|
|
||||||
endif()
|
|
||||||
if(NOT REQUESTED_VERSION_PATCH VERSION_EQUAL 0)
|
|
||||||
string(REGEX REPLACE "^0+" "" REQUESTED_VERSION_PATCH "${REQUESTED_VERSION_PATCH}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(REQUESTED_VERSION_NO_TWEAK
|
|
||||||
"${REQUESTED_VERSION_MAJOR}.${REQUESTED_VERSION_MINOR}.${REQUESTED_VERSION_PATCH}")
|
|
||||||
else()
|
|
||||||
set(REQUESTED_VERSION_NO_TWEAK "${PACKAGE_FIND_VERSION}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(REQUESTED_VERSION_NO_TWEAK STREQUAL CVF_VERSION_NO_TWEAK)
|
|
||||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
|
||||||
else()
|
|
||||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
|
|
||||||
set(PACKAGE_VERSION_EXACT TRUE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
#----------------------------------------------------------------
|
|
||||||
# Generated CMake target import file for configuration "Release".
|
|
||||||
#----------------------------------------------------------------
|
|
||||||
|
|
||||||
# Commands may need to know the format version.
|
|
||||||
set(CMAKE_IMPORT_FILE_VERSION 1)
|
|
||||||
|
|
||||||
# Import target "pioasm" for configuration "Release"
|
|
||||||
set_property(TARGET pioasm APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
|
||||||
set_target_properties(pioasm PROPERTIES
|
|
||||||
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/pioasm/pioasm"
|
|
||||||
)
|
|
||||||
|
|
||||||
list(APPEND _cmake_import_check_targets pioasm )
|
|
||||||
list(APPEND _cmake_import_check_files_for_pioasm "${_IMPORT_PREFIX}/pioasm/pioasm" )
|
|
||||||
|
|
||||||
# Commands beyond this point should not need to know the version.
|
|
||||||
set(CMAKE_IMPORT_FILE_VERSION)
|
|
||||||
|
|
@ -1,100 +0,0 @@
|
||||||
# Generated by CMake
|
|
||||||
|
|
||||||
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
|
|
||||||
message(FATAL_ERROR "CMake >= 2.8.3 required")
|
|
||||||
endif()
|
|
||||||
if(CMAKE_VERSION VERSION_LESS "2.8.3")
|
|
||||||
message(FATAL_ERROR "CMake >= 2.8.3 required")
|
|
||||||
endif()
|
|
||||||
cmake_policy(PUSH)
|
|
||||||
cmake_policy(VERSION 2.8.3...3.29)
|
|
||||||
#----------------------------------------------------------------
|
|
||||||
# Generated CMake target import file.
|
|
||||||
#----------------------------------------------------------------
|
|
||||||
|
|
||||||
# Commands may need to know the format version.
|
|
||||||
set(CMAKE_IMPORT_FILE_VERSION 1)
|
|
||||||
|
|
||||||
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
|
|
||||||
set(_cmake_targets_defined "")
|
|
||||||
set(_cmake_targets_not_defined "")
|
|
||||||
set(_cmake_expected_targets "")
|
|
||||||
foreach(_cmake_expected_target IN ITEMS pioasm)
|
|
||||||
list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
|
|
||||||
if(TARGET "${_cmake_expected_target}")
|
|
||||||
list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
|
|
||||||
else()
|
|
||||||
list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
unset(_cmake_expected_target)
|
|
||||||
if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
|
|
||||||
unset(_cmake_targets_defined)
|
|
||||||
unset(_cmake_targets_not_defined)
|
|
||||||
unset(_cmake_expected_targets)
|
|
||||||
unset(CMAKE_IMPORT_FILE_VERSION)
|
|
||||||
cmake_policy(POP)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
if(NOT _cmake_targets_defined STREQUAL "")
|
|
||||||
string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
|
|
||||||
string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
|
|
||||||
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
|
|
||||||
endif()
|
|
||||||
unset(_cmake_targets_defined)
|
|
||||||
unset(_cmake_targets_not_defined)
|
|
||||||
unset(_cmake_expected_targets)
|
|
||||||
|
|
||||||
|
|
||||||
# Compute the installation prefix relative to this file.
|
|
||||||
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
|
||||||
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
|
|
||||||
if(_IMPORT_PREFIX STREQUAL "/")
|
|
||||||
set(_IMPORT_PREFIX "")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Create imported target pioasm
|
|
||||||
add_executable(pioasm IMPORTED)
|
|
||||||
|
|
||||||
# Load information for each installed configuration.
|
|
||||||
file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/pioasmTargets-*.cmake")
|
|
||||||
foreach(_cmake_config_file IN LISTS _cmake_config_files)
|
|
||||||
include("${_cmake_config_file}")
|
|
||||||
endforeach()
|
|
||||||
unset(_cmake_config_file)
|
|
||||||
unset(_cmake_config_files)
|
|
||||||
|
|
||||||
# Cleanup temporary variables.
|
|
||||||
set(_IMPORT_PREFIX)
|
|
||||||
|
|
||||||
# Loop over all imported files and verify that they actually exist
|
|
||||||
foreach(_cmake_target IN LISTS _cmake_import_check_targets)
|
|
||||||
if(CMAKE_VERSION VERSION_LESS "3.28"
|
|
||||||
OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target}
|
|
||||||
OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}")
|
|
||||||
foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
|
|
||||||
if(NOT EXISTS "${_cmake_file}")
|
|
||||||
message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
|
|
||||||
\"${_cmake_file}\"
|
|
||||||
but this file does not exist. Possible reasons include:
|
|
||||||
* The file was deleted, renamed, or moved to another location.
|
|
||||||
* An install or uninstall procedure did not complete successfully.
|
|
||||||
* The installation package was faulty and contained
|
|
||||||
\"${CMAKE_CURRENT_LIST_FILE}\"
|
|
||||||
but not all the files it references.
|
|
||||||
")
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
unset(_cmake_file)
|
|
||||||
unset("_cmake_import_check_files_for_${_cmake_target}")
|
|
||||||
endforeach()
|
|
||||||
unset(_cmake_target)
|
|
||||||
unset(_cmake_import_check_targets)
|
|
||||||
|
|
||||||
# This file does not depend on other imported targets which have
|
|
||||||
# been exported from the same project but in a separate export set.
|
|
||||||
|
|
||||||
# Commands beyond this point should not need to know the version.
|
|
||||||
set(CMAKE_IMPORT_FILE_VERSION)
|
|
||||||
cmake_policy(POP)
|
|
||||||
Binary file not shown.
|
|
@ -1,3 +0,0 @@
|
||||||
if (NOT TARGET pioasm)
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/pioasmTargets.cmake")
|
|
||||||
endif()
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
# This is a basic version file for the Config-mode of find_package().
|
|
||||||
# It is used by write_basic_package_version_file() as input file for configure_file()
|
|
||||||
# to create a version-file which can be installed along a config.cmake file.
|
|
||||||
#
|
|
||||||
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
|
|
||||||
# the requested version string are exactly the same and it sets
|
|
||||||
# PACKAGE_VERSION_COMPATIBLE if the current version is equal to the requested version.
|
|
||||||
# The tweak version component is ignored.
|
|
||||||
# The variable CVF_VERSION must be set before calling configure_file().
|
|
||||||
|
|
||||||
|
|
||||||
if (PACKAGE_FIND_VERSION_RANGE)
|
|
||||||
message(AUTHOR_WARNING
|
|
||||||
"`find_package()` specify a version range but the version strategy "
|
|
||||||
"(ExactVersion) of the module `${PACKAGE_FIND_NAME}` is incompatible "
|
|
||||||
"with this request. Only the lower endpoint of the range will be used.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(PACKAGE_VERSION "2.2.0")
|
|
||||||
|
|
||||||
if("2.2.0" MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)") # strip the tweak version
|
|
||||||
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
|
||||||
set(CVF_VERSION_MINOR "${CMAKE_MATCH_2}")
|
|
||||||
set(CVF_VERSION_PATCH "${CMAKE_MATCH_3}")
|
|
||||||
|
|
||||||
if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
|
|
||||||
string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
|
|
||||||
endif()
|
|
||||||
if(NOT CVF_VERSION_MINOR VERSION_EQUAL 0)
|
|
||||||
string(REGEX REPLACE "^0+" "" CVF_VERSION_MINOR "${CVF_VERSION_MINOR}")
|
|
||||||
endif()
|
|
||||||
if(NOT CVF_VERSION_PATCH VERSION_EQUAL 0)
|
|
||||||
string(REGEX REPLACE "^0+" "" CVF_VERSION_PATCH "${CVF_VERSION_PATCH}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(CVF_VERSION_NO_TWEAK "${CVF_VERSION_MAJOR}.${CVF_VERSION_MINOR}.${CVF_VERSION_PATCH}")
|
|
||||||
else()
|
|
||||||
set(CVF_VERSION_NO_TWEAK "2.2.0")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(PACKAGE_FIND_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)") # strip the tweak version
|
|
||||||
set(REQUESTED_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
|
||||||
set(REQUESTED_VERSION_MINOR "${CMAKE_MATCH_2}")
|
|
||||||
set(REQUESTED_VERSION_PATCH "${CMAKE_MATCH_3}")
|
|
||||||
|
|
||||||
if(NOT REQUESTED_VERSION_MAJOR VERSION_EQUAL 0)
|
|
||||||
string(REGEX REPLACE "^0+" "" REQUESTED_VERSION_MAJOR "${REQUESTED_VERSION_MAJOR}")
|
|
||||||
endif()
|
|
||||||
if(NOT REQUESTED_VERSION_MINOR VERSION_EQUAL 0)
|
|
||||||
string(REGEX REPLACE "^0+" "" REQUESTED_VERSION_MINOR "${REQUESTED_VERSION_MINOR}")
|
|
||||||
endif()
|
|
||||||
if(NOT REQUESTED_VERSION_PATCH VERSION_EQUAL 0)
|
|
||||||
string(REGEX REPLACE "^0+" "" REQUESTED_VERSION_PATCH "${REQUESTED_VERSION_PATCH}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(REQUESTED_VERSION_NO_TWEAK
|
|
||||||
"${REQUESTED_VERSION_MAJOR}.${REQUESTED_VERSION_MINOR}.${REQUESTED_VERSION_PATCH}")
|
|
||||||
else()
|
|
||||||
set(REQUESTED_VERSION_NO_TWEAK "${PACKAGE_FIND_VERSION}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(REQUESTED_VERSION_NO_TWEAK STREQUAL CVF_VERSION_NO_TWEAK)
|
|
||||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
|
||||||
else()
|
|
||||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
|
|
||||||
set(PACKAGE_VERSION_EXACT TRUE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2025 Raspberry Pi (Trading) Ltd.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
*/
|
|
||||||
|
|
||||||
// ---------------------------------------
|
|
||||||
// THIS FILE IS AUTOGENERATED; DO NOT EDIT
|
|
||||||
// ---------------------------------------
|
|
||||||
|
|
||||||
#ifndef _PIOASM_VERSION_H
|
|
||||||
#define _PIOASM_VERSION_H
|
|
||||||
|
|
||||||
#define PIOASM_VERSION_STRING "2.2.0"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
#ifndef I2C_MASTER_H
|
|
||||||
#define I2C_MASTER_H
|
|
||||||
|
|
||||||
#include <hardware/i2c.h>
|
|
||||||
|
|
||||||
#define I2C_MASTER_SDA_PIN 16
|
|
||||||
#define I2C_MASTER_SCL_PIN 17
|
|
||||||
#define I2C_MASTER_INSTANCE i2c0
|
|
||||||
#define I2C_MASTER_BAUD_RATE 300 * 1000
|
|
||||||
|
|
||||||
// Init master i2c
|
|
||||||
void i2c_master_init(void);
|
|
||||||
// Deinit master i2c
|
|
||||||
void i2c_master_deinit(void);
|
|
||||||
// Send [src] of [len] to [address] and close communication
|
|
||||||
void i2c_master_write(uint8_t address, const uint8_t *src, size_t len);
|
|
||||||
// Send [reg] and [src] of [len] to [address] and close communication
|
|
||||||
void i2c_master_write_reg(uint8_t address, uint8_t reg, const uint8_t *src, size_t len);
|
|
||||||
// Receive [dst] of [len] from [address] and close communication
|
|
||||||
void i2c_master_read(uint8_t address, uint8_t *dst, size_t len);
|
|
||||||
// Send [reg] and receive data in [dst] and close communition
|
|
||||||
void i2c_master_read_reg(uint8_t address, uint8_t reg, uint8_t *dst, size_t len);
|
|
||||||
|
|
||||||
#endif // I2C_MASTER_H
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
#include "headers/i2c_master.h"
|
|
||||||
|
|
||||||
#include <pico/stdlib.h>
|
|
||||||
#include <hardware/i2c.h>
|
|
||||||
|
|
||||||
void i2c_master_init(void)
|
|
||||||
{
|
|
||||||
gpio_set_function(I2C_MASTER_SDA_PIN, GPIO_FUNC_I2C);
|
|
||||||
gpio_set_function(I2C_MASTER_SCL_PIN, GPIO_FUNC_I2C);
|
|
||||||
|
|
||||||
gpio_pull_up(I2C_MASTER_SDA_PIN);
|
|
||||||
gpio_pull_up(I2C_MASTER_SCL_PIN);
|
|
||||||
|
|
||||||
i2c_init(I2C_MASTER_INSTANCE, I2C_MASTER_BAUD_RATE);
|
|
||||||
}
|
|
||||||
|
|
||||||
void i2c_master_deinit(void)
|
|
||||||
{
|
|
||||||
i2c_deinit(I2C_MASTER_INSTANCE);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void i2c_master_write(uint8_t address, const uint8_t *src, size_t len)
|
|
||||||
{
|
|
||||||
i2c_write_blocking(I2C_MASTER_INSTANCE, address, src, len, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void i2c_master_write_reg(uint8_t address, uint8_t reg, const uint8_t *src, size_t len)
|
|
||||||
{
|
|
||||||
i2c_write_blocking(I2C_MASTER_INSTANCE, address, ®, 1, true);
|
|
||||||
i2c_write_blocking(I2C_MASTER_INSTANCE, address, src, len, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void i2c_master_read(uint8_t address, uint8_t *dst, size_t len)
|
|
||||||
{
|
|
||||||
i2c_read_blocking(I2C_MASTER_INSTANCE, address, dst, len, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void i2c_master_read_reg(uint8_t address, uint8_t reg, uint8_t *dst, size_t len)
|
|
||||||
{
|
|
||||||
i2c_write_blocking(I2C_MASTER_INSTANCE, address, ®, 1, true);
|
|
||||||
i2c_master_read(address, dst, len);
|
|
||||||
}
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
||||||
#include "headers/mcp23017.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <assert.h>
|
|
||||||
#include "headers/i2c_master.h"
|
|
||||||
#include "headers/robot.h"
|
|
||||||
|
|
||||||
int init_mcp23017(void)
|
|
||||||
{
|
|
||||||
// IOCON
|
|
||||||
const uint8_t IOCON_REG = 0x0A;
|
|
||||||
const uint8_t IOCON_CONFIG = 0x00;
|
|
||||||
|
|
||||||
i2c_master_write_reg(I2C_MCP23017_ADDRESS, IOCON_REG, &IOCON_CONFIG, 1);
|
|
||||||
|
|
||||||
uint8_t iocon_config_verif;
|
|
||||||
i2c_master_read_reg(I2C_MCP23017_ADDRESS, IOCON_REG, &(iocon_config_verif), 1);
|
|
||||||
printf("mcp23017 config: 0x%x\n", iocon_config_verif);
|
|
||||||
|
|
||||||
if(IOCON_CONFIG != iocon_config_verif)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
const uint8_t IODIR_REG = 0x00;
|
|
||||||
const uint8_t IODIR_CONFIG[GPIO_NB_BANKS] = {0x00, 0x00};
|
|
||||||
|
|
||||||
i2c_master_write_reg(I2C_MCP23017_ADDRESS, IODIR_REG, IODIR_CONFIG, GPIO_NB_BANKS);
|
|
||||||
|
|
||||||
uint8_t iodir_config_verif[GPIO_NB_BANKS];
|
|
||||||
i2c_master_read_reg(I2C_MCP23017_ADDRESS, IODIR_REG, iodir_config_verif, GPIO_NB_BANKS);
|
|
||||||
printf("mcp23017 io dir config: 0x%x, 0x%x\n", iodir_config_verif[0], iodir_config_verif[1]);
|
|
||||||
|
|
||||||
if(IODIR_CONFIG[0] != iodir_config_verif[0] || IODIR_CONFIG[1] != iodir_config_verif[1])
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void mcp23017_gpio_put(uint gpio_num, bool state)
|
|
||||||
{
|
|
||||||
assert(gpio_num < 16);
|
|
||||||
|
|
||||||
uint8_t gpio_bank = GPIO_BANK0;
|
|
||||||
|
|
||||||
if(gpio_num > 7)
|
|
||||||
{
|
|
||||||
gpio_bank++;
|
|
||||||
gpio_num -= 0x0008;
|
|
||||||
}
|
|
||||||
|
|
||||||
robot.mcp23017_data.gpio_state[gpio_bank] = (robot.mcp23017_data.gpio_state[gpio_bank] & ~(0x1 << gpio_num)) | (state << gpio_num);
|
|
||||||
}
|
|
||||||
|
|
||||||
void mcp23017_update(void)
|
|
||||||
{
|
|
||||||
i2c_master_write_reg(I2C_MCP23017_ADDRESS, GPIO_REG, robot.mcp23017_data.gpio_state, GPIO_NB_BANKS);
|
|
||||||
|
|
||||||
uint8_t gpio_state[GPIO_NB_BANKS];
|
|
||||||
i2c_master_read_reg(I2C_MCP23017_ADDRESS, GPIO_REG, gpio_state, GPIO_NB_BANKS);
|
|
||||||
printf("gpio states: 0x%x, 0x%x\n", gpio_state[0], gpio_state[1]);
|
|
||||||
}
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
#include "headers/motors.h"
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "headers/i2c_master.h"
|
|
||||||
|
|
||||||
const motor_def_t MOTORS_DEFS[] = {
|
|
||||||
{0, 4, 5, 0x00},
|
|
||||||
{1, 6, 7, 0x01},
|
|
||||||
{2, 8, 9, 0x02},
|
|
||||||
{3, 10, 11, 0x03},
|
|
||||||
};
|
|
||||||
|
|
||||||
const servo_motor_def_t SERVO_MOTORS_DEFS[] = {
|
|
||||||
{12, 0, 25000, 0x04},
|
|
||||||
{13, 0, 25000, 0x05},
|
|
||||||
{14, 0, 25000, 0x06},
|
|
||||||
{15, 0, 25000, 0x07},
|
|
||||||
};
|
|
||||||
|
|
||||||
void i2c_set_motor(motors_enum_t motor, int8_t value)
|
|
||||||
{
|
|
||||||
const motor_def_t *MOTOR_DEF = &MOTORS_DEFS[motor];
|
|
||||||
|
|
||||||
uint8_t x = *(uint8_t *)&value;
|
|
||||||
uint8_t data[] = {MOTOR_DEF->buffer_reg, x};
|
|
||||||
|
|
||||||
i2c_master_write(I2C_MOTION_CONTROLLER_ADDRESS, data, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
int8_t i2c_get_motor(motors_enum_t motor)
|
|
||||||
{
|
|
||||||
const motor_def_t *MOTOR_DEF = &MOTORS_DEFS[motor];
|
|
||||||
|
|
||||||
uint8_t data;
|
|
||||||
i2c_master_read_reg(I2C_MOTION_CONTROLLER_ADDRESS, MOTOR_DEF->buffer_reg, &data, 1);
|
|
||||||
|
|
||||||
int8_t value = *(int8_t *)&data;
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void i2c_set_servo_motor(servo_motors_enum_t servo_motor, uint8_t value)
|
|
||||||
{
|
|
||||||
const servo_motor_def_t *SERVO_MOTOR_DEF = &SERVO_MOTORS_DEFS[servo_motor];
|
|
||||||
|
|
||||||
uint8_t data[] = {SERVO_MOTOR_DEF->buffer_reg_and_payload_byte, value};
|
|
||||||
|
|
||||||
i2c_master_write(I2C_MOTION_CONTROLLER_ADDRESS, data, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t i2c_get_servo_motor(servo_motors_enum_t servo_motor)
|
|
||||||
{
|
|
||||||
const servo_motor_def_t *servo_motor_def = &SERVO_MOTORS_DEFS[servo_motor];
|
|
||||||
|
|
||||||
uint8_t value;
|
|
||||||
i2c_master_read_reg(I2C_MOTION_CONTROLLER_ADDRESS, servo_motor_def->buffer_reg_and_payload_byte, &value, 1);
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
@ -8,8 +8,8 @@
|
||||||
"${env:PICO_SDK_PATH}/lib/**/include/",
|
"${env:PICO_SDK_PATH}/lib/**/include/",
|
||||||
"${env:PICO_SDK_PATH}/lib/**/src/",
|
"${env:PICO_SDK_PATH}/lib/**/src/",
|
||||||
"${workspaceFolder}/build/generated/pico_base/",
|
"${workspaceFolder}/build/generated/pico_base/",
|
||||||
"${workspaceFolder}/src/",
|
"${workspaceFolder}/src/wifi/headers/",
|
||||||
"${workspaceFolder}/src/wifi/headers/"
|
"${workspaceFolder}/src/"
|
||||||
],
|
],
|
||||||
"compilerPath": "/usr/bin/arm-none-eabi-gcc",
|
"compilerPath": "/usr/bin/arm-none-eabi-gcc",
|
||||||
"cStandard": "c11",
|
"cStandard": "c11",
|
||||||
|
|
@ -1,19 +1,17 @@
|
||||||
cmake_minimum_required(VERSION 3.13)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
|
||||||
include(pico_sdk_import.cmake)
|
|
||||||
|
|
||||||
project(main_controller C CXX ASM)
|
|
||||||
set(CMAKE_C_STANDARD 11)
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
|
||||||
|
|
||||||
#set(PICO_EXAMPLES_PATH ${PROJECT_SOURCE_DIR})
|
|
||||||
|
|
||||||
# Définir explicitement la carte comme Pico W
|
# Définir explicitement la carte comme Pico W
|
||||||
set(PICO_BOARD pico_w)
|
set(PICO_BOARD pico_w)
|
||||||
if(NOT DEFINED PICO_BOARD)
|
if(NOT DEFINED PICO_BOARD)
|
||||||
add_definitions(-DPICO_BOARD=${PICO_BOARD})
|
add_definitions(-DPICO_BOARD=${PICO_BOARD})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
include(pico_sdk_import.cmake)
|
||||||
|
|
||||||
|
project(main_controller C CXX ASM)
|
||||||
|
set(CMAKE_C_STANDARD 11)
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
|
||||||
pico_sdk_init()
|
pico_sdk_init()
|
||||||
|
|
||||||
add_executable(main_controller
|
add_executable(main_controller
|
||||||
|
|
@ -30,15 +28,15 @@ add_executable(main_controller
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(main_controller PRIVATE
|
target_include_directories(main_controller PRIVATE
|
||||||
${CMAKE_CURRENT_LIST_DIR}/src/
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/src/wifi/headers/
|
${CMAKE_CURRENT_LIST_DIR}/src/wifi/headers/
|
||||||
|
${CMAKE_CURRENT_LIST_DIR}/src/
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(main_controller
|
target_link_libraries(main_controller
|
||||||
|
pico_stdlib
|
||||||
hardware_i2c
|
hardware_i2c
|
||||||
hardware_pwm
|
hardware_pwm
|
||||||
hardware_uart
|
hardware_uart
|
||||||
pico_stdlib
|
|
||||||
pico_cyw43_arch_lwip_poll
|
pico_cyw43_arch_lwip_poll
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -49,5 +47,6 @@ pico_add_extra_outputs(main_controller)
|
||||||
|
|
||||||
add_custom_target(Flash
|
add_custom_target(Flash
|
||||||
DEPENDS main_controller
|
DEPENDS main_controller
|
||||||
|
|
||||||
COMMAND sudo picotool load -f ${PROJECT_BINARY_DIR}/main_controller.uf2
|
COMMAND sudo picotool load -f ${PROJECT_BINARY_DIR}/main_controller.uf2
|
||||||
)
|
)
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -4,11 +4,12 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "i2c/headers/motors.h"
|
#include "i2c/headers/motors.h"
|
||||||
|
|
||||||
|
#define I2C_MOTION_CONTROLLER_ADDRESS 0x09
|
||||||
|
|
||||||
typedef struct motion_control_data_t {
|
typedef struct motion_control_data_t {
|
||||||
int16_t angle;
|
int16_t angle;
|
||||||
int8_t x_axis_speed;
|
int8_t x_axis_speed;
|
||||||
int8_t y_axis_speed;
|
int8_t y_axis_speed;
|
||||||
uint8_t servo_motors_pos[NB_SERVO_MOTORS];
|
|
||||||
} motion_control_data_t;
|
} motion_control_data_t;
|
||||||
|
|
||||||
// Init values for motion control
|
// Init values for motion control
|
||||||
|
|
@ -12,7 +12,7 @@ typedef struct robot_t {
|
||||||
motion_control_data_t motion_control_data;
|
motion_control_data_t motion_control_data;
|
||||||
|
|
||||||
bool is_running;
|
bool is_running;
|
||||||
double delta_time_ms;
|
float delta_time_ms;
|
||||||
} robot_t;
|
} robot_t;
|
||||||
|
|
||||||
extern robot_t robot;
|
extern robot_t robot;
|
||||||
|
|
@ -11,43 +11,35 @@
|
||||||
|
|
||||||
// #include <stdio.h>
|
// #include <stdio.h>
|
||||||
|
|
||||||
#define SAMPLE_MIN_ELAPSED_TIME 2 // ms
|
#define SAMPLE_MIN_ELAPSED_TIME_MS 1.0f
|
||||||
#define DPS_PER_DIGIT 0.00875f
|
#define DPS_PER_DIGIT 0.00875f
|
||||||
|
|
||||||
int init_gyro(void)
|
void gyro_init(void)
|
||||||
{
|
{
|
||||||
// Verify gyro powering
|
// Reset gyro
|
||||||
uint8_t data;
|
const uint8_t PWR_MGMT_REG = 0x6B;
|
||||||
i2c_master_read_reg(I2C_GYRO_ADDRESS, 0x0F, &data, 1);
|
const uint8_t PWR_MGMT_CONFIG = 0b10000000; // Reset bit set to 1
|
||||||
|
uint8_t buf[] = {PWR_MGMT_REG, PWR_MGMT_CONFIG};
|
||||||
|
i2c_write_blocking(I2C_MASTER_INSTANCE, I2C_GYRO_ADDRESS, buf, 2, false);
|
||||||
|
|
||||||
if(data != 0xd7) return -1;
|
robot.gyro_data.x_offset = 0.0f;
|
||||||
|
robot.gyro_data.y_offset = 0.0f;
|
||||||
// Configure gyro
|
robot.gyro_data.z_offset = 0.0f;
|
||||||
const uint8_t CTRL1_REG = 0x20;
|
|
||||||
const uint8_t CTRL1_CONFIG = 0b11101111; // DR : 11 // BW : 10 // PD : 1 // Zen : 1 // Xen : 1 // Yen : 1 //
|
|
||||||
|
|
||||||
i2c_master_write_reg(I2C_GYRO_ADDRESS, CTRL1_REG, &CTRL1_CONFIG, 1);
|
|
||||||
|
|
||||||
uint8_t config_verification;
|
|
||||||
i2c_master_read_reg(I2C_GYRO_ADDRESS, CTRL1_REG, &config_verification, 1);
|
|
||||||
|
|
||||||
if(config_verification != CTRL1_CONFIG) return -1;
|
|
||||||
|
|
||||||
robot.gyro_data.x_angle = 0.0f;
|
robot.gyro_data.x_angle = 0.0f;
|
||||||
robot.gyro_data.y_angle = 0.0f;
|
robot.gyro_data.y_angle = 0.0f;
|
||||||
robot.gyro_data.z_angle = 0.0f;
|
robot.gyro_data.z_angle = 0.0f;
|
||||||
|
|
||||||
sleep_ms(1000);
|
sleep_ms(100);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void __attribute__((always_inline)) gyro_read(int16_t *x, int16_t *y, int16_t *z)
|
static inline void __attribute__((always_inline)) gyro_read(int16_t *x, int16_t *y, int16_t *z)
|
||||||
{
|
{
|
||||||
const uint8_t X_OUT_L_REG = 0x28;
|
const uint8_t GYRO_XOUT_H_REG = 0x43;
|
||||||
|
|
||||||
uint8_t data[6];
|
uint8_t data[6];
|
||||||
i2c_master_read_reg(I2C_GYRO_ADDRESS, X_OUT_L_REG | 0x80, data, 6); // 0x80 for auto incrementing
|
i2c_write_blocking(I2C_MASTER_INSTANCE, I2C_GYRO_ADDRESS, &GYRO_XOUT_H_REG, 1, true);
|
||||||
|
i2c_read_blocking(I2C_MASTER_INSTANCE, I2C_GYRO_ADDRESS, data, 6, false);
|
||||||
|
|
||||||
*x = (int16_t)((data[1] << 8) | data[0]);
|
*x = (int16_t)((data[1] << 8) | data[0]);
|
||||||
*y = (int16_t)((data[3] << 8) | data[2]);
|
*y = (int16_t)((data[3] << 8) | data[2]);
|
||||||
|
|
@ -56,12 +48,12 @@ static inline void __attribute__((always_inline)) gyro_read(int16_t *x, int16_t
|
||||||
|
|
||||||
void gyro_calibrate(void)
|
void gyro_calibrate(void)
|
||||||
{
|
{
|
||||||
const uint nb_samples = 1000;
|
const size_t NB_SAMPLES = 2000;
|
||||||
|
|
||||||
int16_t x, y, z;
|
int16_t x, y, z;
|
||||||
int32_t x_sum = 0, y_sum = 0, z_sum = 0;
|
int32_t x_sum = 0, y_sum = 0, z_sum = 0;
|
||||||
|
|
||||||
for(uint i = 0; i < nb_samples; i++)
|
for(uint i = 0; i < NB_SAMPLES; i++)
|
||||||
{
|
{
|
||||||
gyro_read(&x, &y, &z);
|
gyro_read(&x, &y, &z);
|
||||||
|
|
||||||
|
|
@ -69,23 +61,23 @@ void gyro_calibrate(void)
|
||||||
y_sum += y;
|
y_sum += y;
|
||||||
z_sum += z;
|
z_sum += z;
|
||||||
|
|
||||||
sleep_ms(SAMPLE_MIN_ELAPSED_TIME);
|
sleep_us(SAMPLE_MIN_ELAPSED_TIME_MS * 1000);
|
||||||
|
|
||||||
//printf(">cal_x:%d\n", x);
|
//printf(">cal_x:%d\n", x);
|
||||||
//printf(">cal_y:%d\n", y);
|
//printf(">cal_y:%d\n", y);
|
||||||
//printf(">cal_z:%d\n", z);
|
//printf(">cal_z:%d\n", z);
|
||||||
}
|
}
|
||||||
|
|
||||||
robot.gyro_data.x_offset = (float)x_sum / (float)nb_samples * DPS_PER_DIGIT;
|
robot.gyro_data.x_offset = (float)x_sum / (float)NB_SAMPLES * DPS_PER_DIGIT;
|
||||||
robot.gyro_data.y_offset = (float)y_sum / (float)nb_samples * DPS_PER_DIGIT;
|
robot.gyro_data.y_offset = (float)y_sum / (float)NB_SAMPLES * DPS_PER_DIGIT;
|
||||||
robot.gyro_data.z_offset = (float)z_sum / (float)nb_samples * DPS_PER_DIGIT;
|
robot.gyro_data.z_offset = (float)z_sum / (float)NB_SAMPLES * DPS_PER_DIGIT;
|
||||||
|
|
||||||
//printf("\nx_cal:%.5f\n", robot.gyro_data.x_offset);
|
//printf("\nx_cal:%.5f\n", robot.gyro_data.x_offset);
|
||||||
//printf("\ny_cal:%.5f\n", robot.gyro_data.y_offset);
|
//printf("\ny_cal:%.5f\n", robot.gyro_data.y_offset);
|
||||||
//printf("\nz_cal:%.5f\n", robot.gyro_data.z_offset);
|
//printf("\nz_cal:%.5f\n", robot.gyro_data.z_offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void __attribute__((always_inline)) gyro_get_dps(double* x_dps, double* y_dps, double* z_dps)
|
static inline void __attribute__((always_inline)) gyro_get_dps(float *x_dps, float *y_dps, float *z_dps)
|
||||||
{
|
{
|
||||||
int16_t x, y, z;
|
int16_t x, y, z;
|
||||||
gyro_read(&x, &y, &z);
|
gyro_read(&x, &y, &z);
|
||||||
|
|
@ -101,13 +93,13 @@ static inline void __attribute__((always_inline)) gyro_get_dps(double* x_dps, do
|
||||||
|
|
||||||
void gyro_update(void)
|
void gyro_update(void)
|
||||||
{
|
{
|
||||||
static double elapsed_since_sample_ms = 10.0;
|
static float elapsed_since_sample_ms = SAMPLE_MIN_ELAPSED_TIME_MS;
|
||||||
|
|
||||||
elapsed_since_sample_ms += robot.delta_time_ms;
|
elapsed_since_sample_ms += robot.delta_time_ms;
|
||||||
|
|
||||||
if(elapsed_since_sample_ms >= SAMPLE_MIN_ELAPSED_TIME)
|
if(elapsed_since_sample_ms >= SAMPLE_MIN_ELAPSED_TIME_MS)
|
||||||
{
|
{
|
||||||
double x_dps, y_dps, z_dps;
|
float x_dps, y_dps, z_dps;
|
||||||
gyro_get_dps(&x_dps, &y_dps, &z_dps);
|
gyro_get_dps(&x_dps, &y_dps, &z_dps);
|
||||||
|
|
||||||
x_dps -= robot.gyro_data.x_offset;
|
x_dps -= robot.gyro_data.x_offset;
|
||||||
|
|
@ -9,7 +9,7 @@ typedef struct gyro_data_t {
|
||||||
} gyro_data_t;
|
} gyro_data_t;
|
||||||
|
|
||||||
// Check if gyro has correctly initialised and configure it for simple use
|
// Check if gyro has correctly initialised and configure it for simple use
|
||||||
int init_gyro(void);
|
void gyro_init(void);
|
||||||
// Calibrate gyro
|
// Calibrate gyro
|
||||||
void gyro_calibrate(void);
|
void gyro_calibrate(void);
|
||||||
// Update gyro data
|
// Update gyro data
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
#ifndef I2C_MASTER_H
|
||||||
|
#define I2C_MASTER_H
|
||||||
|
|
||||||
|
#include <hardware/i2c.h>
|
||||||
|
|
||||||
|
#define I2C_MASTER_SDA_PIN 16
|
||||||
|
#define I2C_MASTER_SCL_PIN 17
|
||||||
|
#define I2C_MASTER_INSTANCE i2c0
|
||||||
|
#define I2C_MASTER_BAUD_RATE 300 * 1000
|
||||||
|
|
||||||
|
// Init master i2c
|
||||||
|
void i2c_master_init(void);
|
||||||
|
// Deinit master i2c
|
||||||
|
void i2c_master_deinit(void);
|
||||||
|
|
||||||
|
#endif // I2C_MASTER_H
|
||||||
|
|
@ -6,23 +6,17 @@
|
||||||
|
|
||||||
#define I2C_MCP23017_ADDRESS 0x20
|
#define I2C_MCP23017_ADDRESS 0x20
|
||||||
|
|
||||||
#define GPIO_REG 0x12
|
|
||||||
|
|
||||||
typedef enum gpio_bank_t {
|
|
||||||
GPIO_BANK0,
|
|
||||||
GPIO_BANK1,
|
|
||||||
GPIO_NB_BANKS
|
|
||||||
} gpio_bank_t;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct mcp23017_data_t {
|
typedef struct mcp23017_data_t {
|
||||||
uint8_t gpio_state[GPIO_NB_BANKS];
|
uint8_t gpio_state[2];
|
||||||
} mcp23017_data_t;
|
} mcp23017_data_t;
|
||||||
|
|
||||||
// Init mpu23017 device with default settings over I2C
|
// Init mpu23017 device with default settings over I2C
|
||||||
int init_mcp23017(void);
|
void mcp23017_init(void);
|
||||||
// Set GPIO on mpc23017
|
// Set GPIO buffer
|
||||||
void mcp23017_gpio_put(unsigned int gpio_num, bool state);
|
void mcp23017_gpio_put(unsigned int gpio_num, bool state);
|
||||||
|
// Set GPIO on mcp23017
|
||||||
|
void mcp23017_gpio_put_imediate(unsigned int gpio_num, bool state);
|
||||||
// Uppdate mcp23017 GPIOs
|
// Uppdate mcp23017 GPIOs
|
||||||
void mcp23017_update(void);
|
void mcp23017_update(void);
|
||||||
|
|
||||||
|
|
@ -3,8 +3,6 @@
|
||||||
|
|
||||||
#include <pico/types.h>
|
#include <pico/types.h>
|
||||||
|
|
||||||
#define I2C_MOTION_CONTROLLER_ADDRESS 0x09
|
|
||||||
|
|
||||||
// Motors
|
// Motors
|
||||||
typedef enum motors_enum_t {
|
typedef enum motors_enum_t {
|
||||||
MOTOR1,
|
MOTOR1,
|
||||||
|
|
@ -45,11 +43,7 @@ extern const servo_motor_def_t SERVO_MOTORS_DEFS[];
|
||||||
|
|
||||||
// Send [motor] to [value] through i2c to motion controller
|
// Send [motor] to [value] through i2c to motion controller
|
||||||
void i2c_set_motor(motors_enum_t motor, int8_t value);
|
void i2c_set_motor(motors_enum_t motor, int8_t value);
|
||||||
// Get [motor] speed from motion controller through i2c
|
|
||||||
int8_t i2c_get_motor(motors_enum_t motor);
|
|
||||||
// Set [servo motor] to [value] through i2c
|
// Set [servo motor] to [value] through i2c
|
||||||
void i2c_set_servo_motor(servo_motors_enum_t servo_motor, uint8_t value);
|
void i2c_set_servo_motor(servo_motors_enum_t servo_motor, uint8_t value);
|
||||||
// Get [servo motor] value from i2c
|
|
||||||
uint8_t i2c_get_servo_motor(servo_motors_enum_t servo_motor);
|
|
||||||
|
|
||||||
#endif // MOTORS_H
|
#endif // MOTORS_H
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
#include "headers/i2c_master.h"
|
||||||
|
|
||||||
|
#include <pico/stdlib.h>
|
||||||
|
#include <hardware/i2c.h>
|
||||||
|
|
||||||
|
void i2c_master_init(void)
|
||||||
|
{
|
||||||
|
gpio_set_function(I2C_MASTER_SDA_PIN, GPIO_FUNC_I2C);
|
||||||
|
gpio_set_function(I2C_MASTER_SCL_PIN, GPIO_FUNC_I2C);
|
||||||
|
|
||||||
|
i2c_init(I2C_MASTER_INSTANCE, I2C_MASTER_BAUD_RATE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void i2c_master_deinit(void)
|
||||||
|
{
|
||||||
|
i2c_deinit(I2C_MASTER_INSTANCE);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
#include "headers/mcp23017.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <assert.h>
|
||||||
|
#include "headers/i2c_master.h"
|
||||||
|
#include "headers/robot.h"
|
||||||
|
|
||||||
|
void mcp23017_init(void)
|
||||||
|
{
|
||||||
|
// IODIR
|
||||||
|
const uint8_t IODIR_REG = 0x00;
|
||||||
|
const uint8_t IODIR_CONFIG[2] = {0x00, 0x00};
|
||||||
|
|
||||||
|
uint8_t buf[] = {IODIR_REG, IODIR_CONFIG[0], IODIR_CONFIG[1]};
|
||||||
|
i2c_write_blocking(I2C_MASTER_INSTANCE, I2C_MCP23017_ADDRESS, buf, 3, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void mcp23017_gpio_put(uint gpio_num, bool state)
|
||||||
|
{
|
||||||
|
assert(gpio_num < 16);
|
||||||
|
|
||||||
|
uint8_t gpio_bank = 0;
|
||||||
|
|
||||||
|
if(gpio_num > 7)
|
||||||
|
{
|
||||||
|
gpio_bank = 1;
|
||||||
|
gpio_num -= 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
robot.mcp23017_data.gpio_state[gpio_bank] = (robot.mcp23017_data.gpio_state[gpio_bank] & ~(0x1 << gpio_num)) | (state << gpio_num);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void mcp23017_update(void)
|
||||||
|
{
|
||||||
|
const uint GPIO_REG = 0x12;
|
||||||
|
|
||||||
|
uint8_t buf[] = {GPIO_REG, robot.mcp23017_data.gpio_state[0], robot.mcp23017_data.gpio_state[1]};
|
||||||
|
i2c_write_blocking(I2C_MASTER_INSTANCE, I2C_MCP23017_ADDRESS, buf, 3, false);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
#include "headers/motors.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "headers/i2c_master.h"
|
||||||
|
#include "headers/motion_control.h"
|
||||||
|
|
||||||
|
const motor_def_t MOTORS_DEFS[] = {
|
||||||
|
{0, 4, 5, 0x00},
|
||||||
|
{1, 6, 7, 0x01},
|
||||||
|
{2, 8, 9, 0x02},
|
||||||
|
{3, 10, 11, 0x03},
|
||||||
|
};
|
||||||
|
|
||||||
|
const servo_motor_def_t SERVO_MOTORS_DEFS[] = {
|
||||||
|
{12, 0, 25000, 0x04},
|
||||||
|
{13, 0, 25000, 0x05},
|
||||||
|
{14, 0, 25000, 0x06},
|
||||||
|
{15, 0, 25000, 0x07},
|
||||||
|
};
|
||||||
|
|
||||||
|
void i2c_set_motor(motors_enum_t motor, int8_t value)
|
||||||
|
{
|
||||||
|
const motor_def_t *MOTOR_DEF = &MOTORS_DEFS[motor];
|
||||||
|
|
||||||
|
uint8_t buf[] = {MOTOR_DEF->buffer_reg, *(uint8_t *)&value};
|
||||||
|
i2c_write_blocking(I2C_MASTER_INSTANCE, I2C_MOTION_CONTROLLER_ADDRESS, buf, 2, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void i2c_set_servo_motor(servo_motors_enum_t servo_motor, uint8_t value)
|
||||||
|
{
|
||||||
|
const servo_motor_def_t *SERVO_MOTOR_DEF = &SERVO_MOTORS_DEFS[servo_motor];
|
||||||
|
|
||||||
|
uint8_t buf[] = {SERVO_MOTOR_DEF->buffer_reg_and_payload_byte, *(uint8_t *)&value};
|
||||||
|
i2c_write_blocking(I2C_MASTER_INSTANCE, I2C_MOTION_CONTROLLER_ADDRESS, buf, 2, false);
|
||||||
|
}
|
||||||
|
|
@ -62,6 +62,6 @@ void i2c_update_motion_control(void)
|
||||||
|
|
||||||
void i2c_update_servo_motors(void)
|
void i2c_update_servo_motors(void)
|
||||||
{
|
{
|
||||||
for(servo_motors_enum_t actual_servo_motor = SERVO_MOTOR1; actual_servo_motor < NB_SERVO_MOTORS; actual_servo_motor++)
|
//for(servo_motors_enum_t actual_servo_motor = SERVO_MOTOR1; actual_servo_motor < NB_SERVO_MOTORS; actual_servo_motor++)
|
||||||
i2c_set_servo_motor(actual_servo_motor, robot.motion_control_data.servo_motors_pos[actual_servo_motor]);
|
// i2c_set_servo_motor(actual_servo_motor, robot.motion_control_data.servo_motors_pos[actual_servo_motor]);
|
||||||
}
|
}
|
||||||
|
|
@ -20,48 +20,50 @@ void robot_init(void)
|
||||||
if(cyw43_arch_init())
|
if(cyw43_arch_init())
|
||||||
robot.is_running = false;
|
robot.is_running = false;
|
||||||
|
|
||||||
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 1);
|
mutex_enter_blocking(&wifi_mutex);
|
||||||
|
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, true);
|
||||||
|
mutex_exit(&wifi_mutex);
|
||||||
|
|
||||||
//wifi_operator_init();
|
//i2c_master_init();
|
||||||
//udp_client_init();
|
|
||||||
|
|
||||||
i2c_master_init();
|
//mcp23017_init();
|
||||||
/*
|
|
||||||
if(init_mcp23017())
|
//gyro_init();
|
||||||
robot.is_running = false;
|
|
||||||
*/
|
//gyro_calibrate();
|
||||||
/*
|
|
||||||
if(init_gyro())
|
|
||||||
robot.is_running = false;
|
|
||||||
|
|
||||||
gyro_calibrate();
|
|
||||||
*/
|
|
||||||
//init_motion_control();
|
//init_motion_control();
|
||||||
|
|
||||||
|
init_wifi_operator();
|
||||||
|
udp_client_init();
|
||||||
|
|
||||||
// Initialisation ended
|
// Initialisation ended
|
||||||
bool led_state = false;
|
for(uint i = 0, led_state = true; i < 5; i++)
|
||||||
for(uint i = 0, state = true; i < 5; i++)
|
|
||||||
{
|
{
|
||||||
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, state);
|
mutex_enter_blocking(&wifi_mutex);
|
||||||
|
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, led_state);
|
||||||
|
mutex_exit(&wifi_mutex);
|
||||||
|
|
||||||
sleep_ms(100);
|
sleep_ms(100);
|
||||||
state = !state;
|
|
||||||
|
led_state = !led_state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void update_time(void)
|
static inline void update_time(void)
|
||||||
{
|
{
|
||||||
static bool led_state = false;
|
static float last_time = 0.0;
|
||||||
static double last_time = 0.0;
|
float start_time = (float)clock() * 1000.0f / (float)CLOCKS_PER_SEC;
|
||||||
double start_time = (double)clock() * 1000.0 / (double)CLOCKS_PER_SEC;
|
|
||||||
robot.delta_time_ms = start_time - last_time;
|
robot.delta_time_ms = start_time - last_time;
|
||||||
last_time = start_time;
|
last_time = start_time;
|
||||||
|
|
||||||
static double elapsed_time = 0.0;
|
static float elapsed_time = 0.0f;
|
||||||
elapsed_time += robot.delta_time_ms;
|
elapsed_time += robot.delta_time_ms;
|
||||||
|
|
||||||
if(elapsed_time >= 1000.0)
|
static bool led_state = false;
|
||||||
|
if(elapsed_time >= 1000.0f)
|
||||||
{
|
{
|
||||||
elapsed_time = 0.0;
|
elapsed_time = 0.0f;
|
||||||
|
|
||||||
mutex_enter_blocking(&wifi_mutex);
|
mutex_enter_blocking(&wifi_mutex);
|
||||||
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, led_state);
|
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, led_state);
|
||||||
|
|
@ -73,9 +75,9 @@ static inline void update_time(void)
|
||||||
|
|
||||||
void robot_handle_inputs_outputs(void)
|
void robot_handle_inputs_outputs(void)
|
||||||
{
|
{
|
||||||
//mutex_enter_blocking(&wifi_mutex);
|
mutex_enter_blocking(&wifi_mutex);
|
||||||
//cyw43_arch_poll();
|
cyw43_arch_poll();
|
||||||
//mutex_exit(&wifi_mutex);
|
mutex_exit(&wifi_mutex);
|
||||||
|
|
||||||
update_time();
|
update_time();
|
||||||
|
|
||||||
|
|
@ -85,13 +87,13 @@ void robot_handle_inputs_outputs(void)
|
||||||
|
|
||||||
//i2c_update_servo_motors();
|
//i2c_update_servo_motors();
|
||||||
|
|
||||||
mcp23017_update();
|
//mcp23017_update();
|
||||||
|
|
||||||
tight_loop_contents();
|
tight_loop_contents();
|
||||||
}
|
}
|
||||||
|
|
||||||
void robot_deinit(void)
|
void robot_deinit(void)
|
||||||
{
|
{
|
||||||
udp_client_exit();
|
udp_client_deinit();
|
||||||
i2c_master_deinit();
|
//i2c_master_deinit();
|
||||||
}
|
}
|
||||||
|
|
@ -11,18 +11,18 @@
|
||||||
// Message callback deffinition
|
// Message callback deffinition
|
||||||
typedef void (*message_callback_t)(uint8_t *payload, uint16_t len, const ip_addr_t *addr, uint16_t port);
|
typedef void (*message_callback_t)(uint8_t *payload, uint16_t len, const ip_addr_t *addr, uint16_t port);
|
||||||
|
|
||||||
// Data in here is used by the hardware
|
// Data in here is used by the SDK
|
||||||
typedef struct udp_client_t {
|
typedef struct udp_client_t {
|
||||||
struct udp_pcb *pcb; // Like this
|
struct udp_pcb *pcb; // like this
|
||||||
ip_addr_t local_addr; // Or this
|
ip_addr_t local_addr; // or this...
|
||||||
uint16_t local_port; // So don't remove them, even if they are not used explicitely in the program
|
uint16_t local_port; // So don't remove them, even if they are not used explicitely in the program
|
||||||
uint8_t recv_buffer[BUFFER_SIZE]; // Please (Not even change their position)
|
uint8_t recv_buffer[BUFFER_SIZE]; // Please (Do not even change their position)
|
||||||
message_callback_t message_callback;
|
message_callback_t message_callback;
|
||||||
} udp_client_t;
|
} udp_client_t;
|
||||||
|
|
||||||
// Init udp client, set callback to NULL for the default callback
|
// Init udp client, set callback to NULL for the default callback
|
||||||
void udp_client_init(void);
|
void udp_client_init(void);
|
||||||
// Exit udp client
|
// Exit udp client
|
||||||
void udp_client_exit(void);
|
void udp_client_deinit(void);
|
||||||
|
|
||||||
#endif // UDP_CLIENT_H
|
#endif // UDP_CLIENT_H
|
||||||
|
|
@ -3,9 +3,7 @@
|
||||||
|
|
||||||
#define WIFI_OPERATOR_SSID "RiombotiqueAP"
|
#define WIFI_OPERATOR_SSID "RiombotiqueAP"
|
||||||
#define WIFI_OPERATOR_PASSWORD "x4ptSLpPuJFcpzbLEhDoZ5J7dz"
|
#define WIFI_OPERATOR_PASSWORD "x4ptSLpPuJFcpzbLEhDoZ5J7dz"
|
||||||
//#define WIFI_OPERATOR_SSID "thinkpad"
|
|
||||||
//#define WIFI_OPERATOR_PASSWORD "CDuKaka2000!"
|
|
||||||
|
|
||||||
void wifi_operator_init(void);
|
void init_wifi_operator(void);
|
||||||
|
|
||||||
#endif // WIFI_OPERATOR_H
|
#endif // WIFI_OPERATOR_H
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
#ifndef WIFI_OPERATOR_H
|
||||||
|
#define WIFI_OPERATOR_H
|
||||||
|
|
||||||
|
#define WIFI_OPERATOR_SSID "RiombotiqueAP"
|
||||||
|
#define WIFI_OPERATOR_PASSWORD "x4ptSLpPuJFcpzbLEhDoZ5J7dz"
|
||||||
|
|
||||||
|
void init_wifi_operator(void);
|
||||||
|
|
||||||
|
#endif // WIFI_OPERATOR_H
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
udp_client_t udp_client;
|
udp_client_t udp_client;
|
||||||
|
|
||||||
static inline void __not_in_flash_func(handle_receive)(struct pbuf *p, const ip_addr_t *addr, u16_t port)
|
static inline void handle_receive(struct pbuf *p, const ip_addr_t *addr, u16_t port)
|
||||||
{
|
{
|
||||||
if(p->len >= 2)
|
if(p->len >= 2)
|
||||||
{
|
{
|
||||||
|
|
@ -27,14 +27,14 @@ static void __not_in_flash_func(udp_receive_callback)(void *arg, struct udp_pcb
|
||||||
// Default callback func
|
// Default callback func
|
||||||
static void __not_in_flash_func(default_message_callback)(uint8_t *payload, uint16_t len, const ip_addr_t *addr, uint16_t port)
|
static void __not_in_flash_func(default_message_callback)(uint8_t *payload, uint16_t len, const ip_addr_t *addr, uint16_t port)
|
||||||
{
|
{
|
||||||
//printf("Received: len=%d from %s:%d\n", len, ipaddr_ntoa(addr), port);
|
printf("Received: len=%d from %s:%d\n", len, ipaddr_ntoa(addr), port);
|
||||||
|
|
||||||
//for(uint i = 0; i < len; i++) printf("payload[%d]=%d | ", i, payload[i]);
|
for(uint i = 0; i < len; i++) printf("payload[%d]=%d | ", i, payload[i]);
|
||||||
//puts("\n");
|
puts("\n");
|
||||||
|
|
||||||
printf(">Robot angle : %d\n", (int16_t)((payload[UDP_PAYLOAD_ANGLE_H_BYTE] << 8) | payload[UDP_PAYLOAD_ANGLE_L_BYTE]));
|
//printf(">Robot angle : %d\n", (int16_t)((payload[UDP_PAYLOAD_ANGLE_H_BYTE] << 8) | payload[UDP_PAYLOAD_ANGLE_L_BYTE]));
|
||||||
printf(">Robot x speed : %d\n", (int8_t)payload[UDP_PAYLOAD_X_AXIS_SPEED_BYTE]);
|
//printf(">Robot x speed : %d\n", (int8_t)payload[UDP_PAYLOAD_X_AXIS_SPEED_BYTE]);
|
||||||
printf(">Robot y speed : %d\n", (int8_t)payload[UDP_PAYLOAD_Y_AXIS_SPEED_BYTE]);
|
//printf(">Robot y speed : %d\n", (int8_t)payload[UDP_PAYLOAD_Y_AXIS_SPEED_BYTE]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void udp_client_init(void)
|
void udp_client_init(void)
|
||||||
|
|
@ -54,14 +54,14 @@ void udp_client_init(void)
|
||||||
err_t err = udp_bind(udp_client.pcb, IP_ADDR_ANY, UDP_CLIENT_PORT);
|
err_t err = udp_bind(udp_client.pcb, IP_ADDR_ANY, UDP_CLIENT_PORT);
|
||||||
if(err != ERR_OK)
|
if(err != ERR_OK)
|
||||||
{
|
{
|
||||||
printf("Erreur bind UDP client: %d\n", err);
|
printf("Error bind UDP client: %d\n", err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("UDP client started on port %d\n", UDP_CLIENT_PORT);
|
printf("UDP client started on port %d\n", UDP_CLIENT_PORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void udp_client_exit(void)
|
void udp_client_deinit(void)
|
||||||
{
|
{
|
||||||
if(udp_client.pcb)
|
if(udp_client.pcb)
|
||||||
{
|
{
|
||||||
|
|
@ -11,11 +11,11 @@ void __not_in_flash_func(udp_client_message_handler)(uint8_t *payload, uint16_t
|
||||||
|
|
||||||
robot.motion_control_data.x_axis_speed = payload[UDP_PAYLOAD_X_AXIS_SPEED_BYTE];
|
robot.motion_control_data.x_axis_speed = payload[UDP_PAYLOAD_X_AXIS_SPEED_BYTE];
|
||||||
robot.motion_control_data.y_axis_speed = payload[UDP_PAYLOAD_Y_AXIS_SPEED_BYTE];
|
robot.motion_control_data.y_axis_speed = payload[UDP_PAYLOAD_Y_AXIS_SPEED_BYTE];
|
||||||
|
/*
|
||||||
for(servo_motors_enum_t actual_servo_motor = SERVO_MOTOR1; actual_servo_motor < NB_SERVO_MOTORS; actual_servo_motor++)
|
for(servo_motors_enum_t actual_servo_motor = SERVO_MOTOR1; actual_servo_motor < NB_SERVO_MOTORS; actual_servo_motor++)
|
||||||
{
|
{
|
||||||
const servo_motor_def_t *SERVO_MOTOR_DEF = &SERVO_MOTORS_DEFS[actual_servo_motor];
|
const servo_motor_def_t *SERVO_MOTOR_DEF = &SERVO_MOTORS_DEFS[actual_servo_motor];
|
||||||
|
|
||||||
robot.motion_control_data.servo_motors_pos[actual_servo_motor] = payload[SERVO_MOTOR_DEF->buffer_reg_and_payload_byte];
|
robot.motion_control_data.servo_motors_pos[actual_servo_motor] = payload[SERVO_MOTOR_DEF->buffer_reg_and_payload_byte];
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
#include <lwip/netif.h>
|
#include <lwip/netif.h>
|
||||||
#include <lwip/ip4_addr.h>
|
#include <lwip/ip4_addr.h>
|
||||||
|
|
||||||
void wifi_operator_init(void)
|
void init_wifi_operator(void)
|
||||||
{
|
{
|
||||||
// Mode client
|
// Mode client
|
||||||
cyw43_arch_enable_sta_mode();
|
cyw43_arch_enable_sta_mode();
|
||||||
|
|
@ -23,14 +23,15 @@ void wifi_operator_init(void)
|
||||||
netif_set_up(netif_default);
|
netif_set_up(netif_default);
|
||||||
netif_set_addr(netif_default, &ip, &netmask, &gateway);
|
netif_set_addr(netif_default, &ip, &netmask, &gateway);
|
||||||
|
|
||||||
puts("Configuration IP effectuée");
|
puts("IP config done");
|
||||||
|
sleep_ms(300); // Wait for wifi to be initialized
|
||||||
|
|
||||||
// Tentativs de connexion
|
// Tentativs de connexion
|
||||||
for(int error_code; ; !error_code)
|
for(int error_code; !error_code;)
|
||||||
{
|
{
|
||||||
// Afficher les paramètres de connexion
|
// Afficher les paramètres de connexion
|
||||||
printf("Tentative de connexion à: SSID='%s'\n", WIFI_OPERATOR_SSID);
|
printf("Trying to connect to '%s'\n", WIFI_OPERATOR_SSID);
|
||||||
int error_code = cyw43_arch_wifi_connect_timeout_ms(WIFI_OPERATOR_SSID, WIFI_OPERATOR_PASSWORD, CYW43_AUTH_WPA2_AES_PSK, 10000);
|
error_code = cyw43_arch_wifi_connect_timeout_ms(WIFI_OPERATOR_SSID, WIFI_OPERATOR_PASSWORD, CYW43_AUTH_WPA2_AES_PSK, 10000);
|
||||||
|
|
||||||
if(error_code)
|
if(error_code)
|
||||||
{
|
{
|
||||||
|
|
@ -39,11 +40,11 @@ void wifi_operator_init(void)
|
||||||
switch(error_code)
|
switch(error_code)
|
||||||
{
|
{
|
||||||
case -1:
|
case -1:
|
||||||
error_description = "General error";
|
error_description = "Error Generic";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case -2:
|
case -2:
|
||||||
error_description = "Point d'accès non trouvé";
|
error_description = "Acces point not found";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case -3:
|
case -3:
|
||||||
|
|
@ -59,7 +60,7 @@ void wifi_operator_init(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configuration de l'interface réseau
|
// Configuration de l'interface réseau
|
||||||
if(!netif_default)
|
if(netif_default == NULL)
|
||||||
{
|
{
|
||||||
puts("Error: WiFi interface isn't accessible");
|
puts("Error: WiFi interface isn't accessible");
|
||||||
return;
|
return;
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
// AUTOGENERATED FROM PICO_CONFIG_HEADER_FILES and then PICO_<PLATFORM>_CONFIG_HEADER_FILES
|
|
||||||
// DO NOT EDIT!
|
|
||||||
|
|
||||||
|
|
||||||
// based on PICO_CONFIG_HEADER_FILES:
|
|
||||||
|
|
||||||
#include "/home/ulysse-cura/.local/share/pico-sdk/src/boards/include/boards/pico.h"
|
|
||||||
#include "/home/ulysse-cura/.local/share/pico-sdk/src/rp2_common/cmsis/include/cmsis/rename_exceptions.h"
|
|
||||||
|
|
||||||
// based on PICO_RP2040_CONFIG_HEADER_FILES:
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
*/
|
|
||||||
|
|
||||||
// ---------------------------------------
|
|
||||||
// THIS FILE IS AUTOGENERATED; DO NOT EDIT
|
|
||||||
// ---------------------------------------
|
|
||||||
|
|
||||||
#ifndef _PICO_VERSION_H
|
|
||||||
#define _PICO_VERSION_H
|
|
||||||
|
|
||||||
#define PICO_SDK_VERSION_MAJOR 2
|
|
||||||
#define PICO_SDK_VERSION_MINOR 2
|
|
||||||
#define PICO_SDK_VERSION_REVISION 0
|
|
||||||
#define PICO_SDK_VERSION_STRING "2.2.0"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
|
@ -1,117 +0,0 @@
|
||||||
// THIS HEADER FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Copyright (c) 2024 Raspberry Pi Ltd.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
*/
|
|
||||||
#ifndef _DREQ_H
|
|
||||||
#define _DREQ_H
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file rp2040/dreq.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef __ASSEMBLER__
|
|
||||||
#define DREQ_PIO0_TX0 0
|
|
||||||
#define DREQ_PIO0_TX1 1
|
|
||||||
#define DREQ_PIO0_TX2 2
|
|
||||||
#define DREQ_PIO0_TX3 3
|
|
||||||
#define DREQ_PIO0_RX0 4
|
|
||||||
#define DREQ_PIO0_RX1 5
|
|
||||||
#define DREQ_PIO0_RX2 6
|
|
||||||
#define DREQ_PIO0_RX3 7
|
|
||||||
#define DREQ_PIO1_TX0 8
|
|
||||||
#define DREQ_PIO1_TX1 9
|
|
||||||
#define DREQ_PIO1_TX2 10
|
|
||||||
#define DREQ_PIO1_TX3 11
|
|
||||||
#define DREQ_PIO1_RX0 12
|
|
||||||
#define DREQ_PIO1_RX1 13
|
|
||||||
#define DREQ_PIO1_RX2 14
|
|
||||||
#define DREQ_PIO1_RX3 15
|
|
||||||
#define DREQ_SPI0_TX 16
|
|
||||||
#define DREQ_SPI0_RX 17
|
|
||||||
#define DREQ_SPI1_TX 18
|
|
||||||
#define DREQ_SPI1_RX 19
|
|
||||||
#define DREQ_UART0_TX 20
|
|
||||||
#define DREQ_UART0_RX 21
|
|
||||||
#define DREQ_UART1_TX 22
|
|
||||||
#define DREQ_UART1_RX 23
|
|
||||||
#define DREQ_PWM_WRAP0 24
|
|
||||||
#define DREQ_PWM_WRAP1 25
|
|
||||||
#define DREQ_PWM_WRAP2 26
|
|
||||||
#define DREQ_PWM_WRAP3 27
|
|
||||||
#define DREQ_PWM_WRAP4 28
|
|
||||||
#define DREQ_PWM_WRAP5 29
|
|
||||||
#define DREQ_PWM_WRAP6 30
|
|
||||||
#define DREQ_PWM_WRAP7 31
|
|
||||||
#define DREQ_I2C0_TX 32
|
|
||||||
#define DREQ_I2C0_RX 33
|
|
||||||
#define DREQ_I2C1_TX 34
|
|
||||||
#define DREQ_I2C1_RX 35
|
|
||||||
#define DREQ_ADC 36
|
|
||||||
#define DREQ_XIP_STREAM 37
|
|
||||||
#define DREQ_XIP_SSITX 38
|
|
||||||
#define DREQ_XIP_SSIRX 39
|
|
||||||
#define DREQ_DMA_TIMER0 59
|
|
||||||
#define DREQ_DMA_TIMER1 60
|
|
||||||
#define DREQ_DMA_TIMER2 61
|
|
||||||
#define DREQ_DMA_TIMER3 62
|
|
||||||
#define DREQ_FORCE 63
|
|
||||||
#else
|
|
||||||
/**
|
|
||||||
* \brief DREQ numbers for DMA pacing on RP2040 (used as typedef \ref dreq_num_t)
|
|
||||||
* \ingroup hardware_dma
|
|
||||||
*/
|
|
||||||
typedef enum dreq_num_rp2040 {
|
|
||||||
DREQ_PIO0_TX0 = 0, ///< Select PIO0's TX FIFO 0 as DREQ
|
|
||||||
DREQ_PIO0_TX1 = 1, ///< Select PIO0's TX FIFO 1 as DREQ
|
|
||||||
DREQ_PIO0_TX2 = 2, ///< Select PIO0's TX FIFO 2 as DREQ
|
|
||||||
DREQ_PIO0_TX3 = 3, ///< Select PIO0's TX FIFO 3 as DREQ
|
|
||||||
DREQ_PIO0_RX0 = 4, ///< Select PIO0's RX FIFO 0 as DREQ
|
|
||||||
DREQ_PIO0_RX1 = 5, ///< Select PIO0's RX FIFO 1 as DREQ
|
|
||||||
DREQ_PIO0_RX2 = 6, ///< Select PIO0's RX FIFO 2 as DREQ
|
|
||||||
DREQ_PIO0_RX3 = 7, ///< Select PIO0's RX FIFO 3 as DREQ
|
|
||||||
DREQ_PIO1_TX0 = 8, ///< Select PIO1's TX FIFO 0 as DREQ
|
|
||||||
DREQ_PIO1_TX1 = 9, ///< Select PIO1's TX FIFO 1 as DREQ
|
|
||||||
DREQ_PIO1_TX2 = 10, ///< Select PIO1's TX FIFO 2 as DREQ
|
|
||||||
DREQ_PIO1_TX3 = 11, ///< Select PIO1's TX FIFO 3 as DREQ
|
|
||||||
DREQ_PIO1_RX0 = 12, ///< Select PIO1's RX FIFO 0 as DREQ
|
|
||||||
DREQ_PIO1_RX1 = 13, ///< Select PIO1's RX FIFO 1 as DREQ
|
|
||||||
DREQ_PIO1_RX2 = 14, ///< Select PIO1's RX FIFO 2 as DREQ
|
|
||||||
DREQ_PIO1_RX3 = 15, ///< Select PIO1's RX FIFO 3 as DREQ
|
|
||||||
DREQ_SPI0_TX = 16, ///< Select SPI0's TX FIFO as DREQ
|
|
||||||
DREQ_SPI0_RX = 17, ///< Select SPI0's RX FIFO as DREQ
|
|
||||||
DREQ_SPI1_TX = 18, ///< Select SPI1's TX FIFO as DREQ
|
|
||||||
DREQ_SPI1_RX = 19, ///< Select SPI1's RX FIFO as DREQ
|
|
||||||
DREQ_UART0_TX = 20, ///< Select UART0's TX FIFO as DREQ
|
|
||||||
DREQ_UART0_RX = 21, ///< Select UART0's RX FIFO as DREQ
|
|
||||||
DREQ_UART1_TX = 22, ///< Select UART1's TX FIFO as DREQ
|
|
||||||
DREQ_UART1_RX = 23, ///< Select UART1's RX FIFO as DREQ
|
|
||||||
DREQ_PWM_WRAP0 = 24, ///< Select PWM Counter 0's Wrap Value as DREQ
|
|
||||||
DREQ_PWM_WRAP1 = 25, ///< Select PWM Counter 1's Wrap Value as DREQ
|
|
||||||
DREQ_PWM_WRAP2 = 26, ///< Select PWM Counter 2's Wrap Value as DREQ
|
|
||||||
DREQ_PWM_WRAP3 = 27, ///< Select PWM Counter 3's Wrap Value as DREQ
|
|
||||||
DREQ_PWM_WRAP4 = 28, ///< Select PWM Counter 4's Wrap Value as DREQ
|
|
||||||
DREQ_PWM_WRAP5 = 29, ///< Select PWM Counter 5's Wrap Value as DREQ
|
|
||||||
DREQ_PWM_WRAP6 = 30, ///< Select PWM Counter 6's Wrap Value as DREQ
|
|
||||||
DREQ_PWM_WRAP7 = 31, ///< Select PWM Counter 7's Wrap Value as DREQ
|
|
||||||
DREQ_I2C0_TX = 32, ///< Select I2C0's TX FIFO as DREQ
|
|
||||||
DREQ_I2C0_RX = 33, ///< Select I2C0's RX FIFO as DREQ
|
|
||||||
DREQ_I2C1_TX = 34, ///< Select I2C1's TX FIFO as DREQ
|
|
||||||
DREQ_I2C1_RX = 35, ///< Select I2C1's RX FIFO as DREQ
|
|
||||||
DREQ_ADC = 36, ///< Select the ADC as DREQ
|
|
||||||
DREQ_XIP_STREAM = 37, ///< Select the XIP Streaming FIFO as DREQ
|
|
||||||
DREQ_XIP_SSITX = 38, ///< Select the XIP SSI TX FIFO as DREQ
|
|
||||||
DREQ_XIP_SSIRX = 39, ///< Select the XIP SSI RX FIFO as DREQ
|
|
||||||
DREQ_DMA_TIMER0 = 59, ///< Select DMA_TIMER0 as DREQ
|
|
||||||
DREQ_DMA_TIMER1 = 60, ///< Select DMA_TIMER0 as DREQ
|
|
||||||
DREQ_DMA_TIMER2 = 61, ///< Select DMA_TIMER1 as DREQ
|
|
||||||
DREQ_DMA_TIMER3 = 62, ///< Select DMA_TIMER3 as DREQ
|
|
||||||
DREQ_FORCE = 63, ///< Select FORCE as DREQ
|
|
||||||
DREQ_COUNT
|
|
||||||
} dreq_num_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // _DREQ_H
|
|
||||||
|
|
||||||
|
|
@ -1,124 +0,0 @@
|
||||||
// THIS HEADER FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Copyright (c) 2024 Raspberry Pi Ltd.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
*/
|
|
||||||
#ifndef _INTCTRL_H
|
|
||||||
#define _INTCTRL_H
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file rp2040/intctrl.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef __ASSEMBLER__
|
|
||||||
#define TIMER_IRQ_0 0
|
|
||||||
#define TIMER_IRQ_1 1
|
|
||||||
#define TIMER_IRQ_2 2
|
|
||||||
#define TIMER_IRQ_3 3
|
|
||||||
#define PWM_IRQ_WRAP 4
|
|
||||||
#define USBCTRL_IRQ 5
|
|
||||||
#define XIP_IRQ 6
|
|
||||||
#define PIO0_IRQ_0 7
|
|
||||||
#define PIO0_IRQ_1 8
|
|
||||||
#define PIO1_IRQ_0 9
|
|
||||||
#define PIO1_IRQ_1 10
|
|
||||||
#define DMA_IRQ_0 11
|
|
||||||
#define DMA_IRQ_1 12
|
|
||||||
#define IO_IRQ_BANK0 13
|
|
||||||
#define IO_IRQ_QSPI 14
|
|
||||||
#define SIO_IRQ_PROC0 15
|
|
||||||
#define SIO_IRQ_PROC1 16
|
|
||||||
#define CLOCKS_IRQ 17
|
|
||||||
#define SPI0_IRQ 18
|
|
||||||
#define SPI1_IRQ 19
|
|
||||||
#define UART0_IRQ 20
|
|
||||||
#define UART1_IRQ 21
|
|
||||||
#define ADC_IRQ_FIFO 22
|
|
||||||
#define I2C0_IRQ 23
|
|
||||||
#define I2C1_IRQ 24
|
|
||||||
#define RTC_IRQ 25
|
|
||||||
#define SPARE_IRQ_0 26
|
|
||||||
#define SPARE_IRQ_1 27
|
|
||||||
#define SPARE_IRQ_2 28
|
|
||||||
#define SPARE_IRQ_3 29
|
|
||||||
#define SPARE_IRQ_4 30
|
|
||||||
#define SPARE_IRQ_5 31
|
|
||||||
#else
|
|
||||||
/**
|
|
||||||
* \brief Interrupt numbers on RP2040 (used as typedef \ref irq_num_t)
|
|
||||||
* \ingroup hardware_irq
|
|
||||||
*/
|
|
||||||
typedef enum irq_num_rp2040 {
|
|
||||||
TIMER_IRQ_0 = 0, ///< Select TIMER's IRQ 0 output
|
|
||||||
TIMER_IRQ_1 = 1, ///< Select TIMER's IRQ 1 output
|
|
||||||
TIMER_IRQ_2 = 2, ///< Select TIMER's IRQ 2 output
|
|
||||||
TIMER_IRQ_3 = 3, ///< Select TIMER's IRQ 3 output
|
|
||||||
PWM_IRQ_WRAP = 4, ///< Select PWM's IRQ_WRAP output
|
|
||||||
USBCTRL_IRQ = 5, ///< Select USBCTRL's IRQ output
|
|
||||||
XIP_IRQ = 6, ///< Select XIP's IRQ output
|
|
||||||
PIO0_IRQ_0 = 7, ///< Select PIO0's IRQ 0 output
|
|
||||||
PIO0_IRQ_1 = 8, ///< Select PIO0's IRQ 1 output
|
|
||||||
PIO1_IRQ_0 = 9, ///< Select PIO1's IRQ 0 output
|
|
||||||
PIO1_IRQ_1 = 10, ///< Select PIO1's IRQ 1 output
|
|
||||||
DMA_IRQ_0 = 11, ///< Select DMA's IRQ 0 output
|
|
||||||
DMA_IRQ_1 = 12, ///< Select DMA's IRQ 1 output
|
|
||||||
IO_IRQ_BANK0 = 13, ///< Select IO_BANK0's IRQ output
|
|
||||||
IO_IRQ_QSPI = 14, ///< Select IO_QSPI's IRQ output
|
|
||||||
SIO_IRQ_PROC0 = 15, ///< Select SIO_PROC0's IRQ output
|
|
||||||
SIO_IRQ_PROC1 = 16, ///< Select SIO_PROC1's IRQ output
|
|
||||||
CLOCKS_IRQ = 17, ///< Select CLOCKS's IRQ output
|
|
||||||
SPI0_IRQ = 18, ///< Select SPI0's IRQ output
|
|
||||||
SPI1_IRQ = 19, ///< Select SPI1's IRQ output
|
|
||||||
UART0_IRQ = 20, ///< Select UART0's IRQ output
|
|
||||||
UART1_IRQ = 21, ///< Select UART1's IRQ output
|
|
||||||
ADC_IRQ_FIFO = 22, ///< Select ADC's IRQ_FIFO output
|
|
||||||
I2C0_IRQ = 23, ///< Select I2C0's IRQ output
|
|
||||||
I2C1_IRQ = 24, ///< Select I2C1's IRQ output
|
|
||||||
RTC_IRQ = 25, ///< Select RTC's IRQ output
|
|
||||||
SPARE_IRQ_0 = 26, ///< Select SPARE IRQ 0
|
|
||||||
SPARE_IRQ_1 = 27, ///< Select SPARE IRQ 1
|
|
||||||
SPARE_IRQ_2 = 28, ///< Select SPARE IRQ 2
|
|
||||||
SPARE_IRQ_3 = 29, ///< Select SPARE IRQ 3
|
|
||||||
SPARE_IRQ_4 = 30, ///< Select SPARE IRQ 4
|
|
||||||
SPARE_IRQ_5 = 31, ///< Select SPARE IRQ 5
|
|
||||||
IRQ_COUNT
|
|
||||||
} irq_num_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define isr_timer_0 isr_irq0
|
|
||||||
#define isr_timer_1 isr_irq1
|
|
||||||
#define isr_timer_2 isr_irq2
|
|
||||||
#define isr_timer_3 isr_irq3
|
|
||||||
#define isr_pwm_wrap isr_irq4
|
|
||||||
#define isr_usbctrl isr_irq5
|
|
||||||
#define isr_xip isr_irq6
|
|
||||||
#define isr_pio0_0 isr_irq7
|
|
||||||
#define isr_pio0_1 isr_irq8
|
|
||||||
#define isr_pio1_0 isr_irq9
|
|
||||||
#define isr_pio1_1 isr_irq10
|
|
||||||
#define isr_dma_0 isr_irq11
|
|
||||||
#define isr_dma_1 isr_irq12
|
|
||||||
#define isr_io_bank0 isr_irq13
|
|
||||||
#define isr_io_qspi isr_irq14
|
|
||||||
#define isr_sio_proc0 isr_irq15
|
|
||||||
#define isr_sio_proc1 isr_irq16
|
|
||||||
#define isr_clocks isr_irq17
|
|
||||||
#define isr_spi0 isr_irq18
|
|
||||||
#define isr_spi1 isr_irq19
|
|
||||||
#define isr_uart0 isr_irq20
|
|
||||||
#define isr_uart1 isr_irq21
|
|
||||||
#define isr_adc_fifo isr_irq22
|
|
||||||
#define isr_i2c0 isr_irq23
|
|
||||||
#define isr_i2c1 isr_irq24
|
|
||||||
#define isr_rtc isr_irq25
|
|
||||||
#define isr_spare_0 isr_irq26
|
|
||||||
#define isr_spare_1 isr_irq27
|
|
||||||
#define isr_spare_2 isr_irq28
|
|
||||||
#define isr_spare_3 isr_irq29
|
|
||||||
#define isr_spare_4 isr_irq30
|
|
||||||
#define isr_spare_5 isr_irq31
|
|
||||||
|
|
||||||
#endif // _INTCTRL_H
|
|
||||||
|
|
||||||
Binary file not shown.
|
|
@ -1,150 +0,0 @@
|
||||||
|
|
||||||
/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pico-sdk/src/rp2040/boot_stage2/bs2_default.elf: file format elf32-littlearm
|
|
||||||
|
|
||||||
Sections:
|
|
||||||
Idx Name Size VMA LMA File off Algn
|
|
||||||
0 .text 000000f0 20041f00 20041f00 00001f00 2**2
|
|
||||||
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
|
||||||
1 .ARM.attributes 00000022 00000000 00000000 00001ff0 2**0
|
|
||||||
CONTENTS, READONLY
|
|
||||||
2 .debug_line 000000ed 00000000 00000000 00002012 2**0
|
|
||||||
CONTENTS, READONLY, DEBUGGING, OCTETS
|
|
||||||
3 .debug_line_str 0000016d 00000000 00000000 000020ff 2**0
|
|
||||||
CONTENTS, READONLY, DEBUGGING, OCTETS
|
|
||||||
4 .debug_info 00000025 00000000 00000000 0000226c 2**0
|
|
||||||
CONTENTS, READONLY, DEBUGGING, OCTETS
|
|
||||||
5 .debug_abbrev 00000014 00000000 00000000 00002291 2**0
|
|
||||||
CONTENTS, READONLY, DEBUGGING, OCTETS
|
|
||||||
6 .debug_aranges 00000020 00000000 00000000 000022a8 2**3
|
|
||||||
CONTENTS, READONLY, DEBUGGING, OCTETS
|
|
||||||
7 .debug_str 000000ec 00000000 00000000 000022c8 2**0
|
|
||||||
CONTENTS, READONLY, DEBUGGING, OCTETS
|
|
||||||
|
|
||||||
/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pico-sdk/src/rp2040/boot_stage2/bs2_default.elf: file format elf32-littlearm
|
|
||||||
|
|
||||||
|
|
||||||
Disassembly of section .text:
|
|
||||||
|
|
||||||
20041f00 <_stage2_boot>:
|
|
||||||
20041f00: b500 push {lr}
|
|
||||||
20041f02: 4b32 ldr r3, [pc, #200] @ (20041fcc <literals>)
|
|
||||||
20041f04: 2021 movs r0, #33 @ 0x21
|
|
||||||
20041f06: 6058 str r0, [r3, #4]
|
|
||||||
20041f08: 6898 ldr r0, [r3, #8]
|
|
||||||
20041f0a: 2102 movs r1, #2
|
|
||||||
20041f0c: 4388 bics r0, r1
|
|
||||||
20041f0e: 6098 str r0, [r3, #8]
|
|
||||||
20041f10: 60d8 str r0, [r3, #12]
|
|
||||||
20041f12: 6118 str r0, [r3, #16]
|
|
||||||
20041f14: 6158 str r0, [r3, #20]
|
|
||||||
20041f16: 4b2e ldr r3, [pc, #184] @ (20041fd0 <literals+0x4>)
|
|
||||||
20041f18: 2100 movs r1, #0
|
|
||||||
20041f1a: 6099 str r1, [r3, #8]
|
|
||||||
20041f1c: 2102 movs r1, #2
|
|
||||||
20041f1e: 6159 str r1, [r3, #20]
|
|
||||||
20041f20: 2101 movs r1, #1
|
|
||||||
20041f22: 22f0 movs r2, #240 @ 0xf0
|
|
||||||
20041f24: 5099 str r1, [r3, r2]
|
|
||||||
|
|
||||||
20041f26 <program_sregs>:
|
|
||||||
20041f26: 492b ldr r1, [pc, #172] @ (20041fd4 <literals+0x8>)
|
|
||||||
20041f28: 6019 str r1, [r3, #0]
|
|
||||||
20041f2a: 2101 movs r1, #1
|
|
||||||
20041f2c: 6099 str r1, [r3, #8]
|
|
||||||
20041f2e: 2035 movs r0, #53 @ 0x35
|
|
||||||
20041f30: f000 f844 bl 20041fbc <read_flash_sreg>
|
|
||||||
20041f34: 2202 movs r2, #2
|
|
||||||
20041f36: 4290 cmp r0, r2
|
|
||||||
20041f38: d014 beq.n 20041f64 <skip_sreg_programming>
|
|
||||||
20041f3a: 2106 movs r1, #6
|
|
||||||
20041f3c: 6619 str r1, [r3, #96] @ 0x60
|
|
||||||
20041f3e: f000 f834 bl 20041faa <wait_ssi_ready>
|
|
||||||
20041f42: 6e19 ldr r1, [r3, #96] @ 0x60
|
|
||||||
20041f44: 2101 movs r1, #1
|
|
||||||
20041f46: 6619 str r1, [r3, #96] @ 0x60
|
|
||||||
20041f48: 2000 movs r0, #0
|
|
||||||
20041f4a: 6618 str r0, [r3, #96] @ 0x60
|
|
||||||
20041f4c: 661a str r2, [r3, #96] @ 0x60
|
|
||||||
20041f4e: f000 f82c bl 20041faa <wait_ssi_ready>
|
|
||||||
20041f52: 6e19 ldr r1, [r3, #96] @ 0x60
|
|
||||||
20041f54: 6e19 ldr r1, [r3, #96] @ 0x60
|
|
||||||
20041f56: 6e19 ldr r1, [r3, #96] @ 0x60
|
|
||||||
20041f58: 2005 movs r0, #5
|
|
||||||
20041f5a: f000 f82f bl 20041fbc <read_flash_sreg>
|
|
||||||
20041f5e: 2101 movs r1, #1
|
|
||||||
20041f60: 4208 tst r0, r1
|
|
||||||
20041f62: d1f9 bne.n 20041f58 <program_sregs+0x32>
|
|
||||||
|
|
||||||
20041f64 <skip_sreg_programming>:
|
|
||||||
20041f64: 2100 movs r1, #0
|
|
||||||
20041f66: 6099 str r1, [r3, #8]
|
|
||||||
|
|
||||||
20041f68 <dummy_read>:
|
|
||||||
20041f68: 491b ldr r1, [pc, #108] @ (20041fd8 <literals+0xc>)
|
|
||||||
20041f6a: 6019 str r1, [r3, #0]
|
|
||||||
20041f6c: 2100 movs r1, #0
|
|
||||||
20041f6e: 6059 str r1, [r3, #4]
|
|
||||||
20041f70: 491a ldr r1, [pc, #104] @ (20041fdc <literals+0x10>)
|
|
||||||
20041f72: 481b ldr r0, [pc, #108] @ (20041fe0 <literals+0x14>)
|
|
||||||
20041f74: 6001 str r1, [r0, #0]
|
|
||||||
20041f76: 2101 movs r1, #1
|
|
||||||
20041f78: 6099 str r1, [r3, #8]
|
|
||||||
20041f7a: 21eb movs r1, #235 @ 0xeb
|
|
||||||
20041f7c: 6619 str r1, [r3, #96] @ 0x60
|
|
||||||
20041f7e: 21a0 movs r1, #160 @ 0xa0
|
|
||||||
20041f80: 6619 str r1, [r3, #96] @ 0x60
|
|
||||||
20041f82: f000 f812 bl 20041faa <wait_ssi_ready>
|
|
||||||
20041f86: 2100 movs r1, #0
|
|
||||||
20041f88: 6099 str r1, [r3, #8]
|
|
||||||
|
|
||||||
20041f8a <configure_ssi>:
|
|
||||||
20041f8a: 4916 ldr r1, [pc, #88] @ (20041fe4 <literals+0x18>)
|
|
||||||
20041f8c: 4814 ldr r0, [pc, #80] @ (20041fe0 <literals+0x14>)
|
|
||||||
20041f8e: 6001 str r1, [r0, #0]
|
|
||||||
20041f90: 2101 movs r1, #1
|
|
||||||
20041f92: 6099 str r1, [r3, #8]
|
|
||||||
|
|
||||||
20041f94 <check_return>:
|
|
||||||
20041f94: bc01 pop {r0}
|
|
||||||
20041f96: 2800 cmp r0, #0
|
|
||||||
20041f98: d000 beq.n 20041f9c <vector_into_flash>
|
|
||||||
20041f9a: 4700 bx r0
|
|
||||||
|
|
||||||
20041f9c <vector_into_flash>:
|
|
||||||
20041f9c: 4812 ldr r0, [pc, #72] @ (20041fe8 <literals+0x1c>)
|
|
||||||
20041f9e: 4913 ldr r1, [pc, #76] @ (20041fec <literals+0x20>)
|
|
||||||
20041fa0: 6008 str r0, [r1, #0]
|
|
||||||
20041fa2: c803 ldmia r0, {r0, r1}
|
|
||||||
20041fa4: f380 8808 msr MSP, r0
|
|
||||||
20041fa8: 4708 bx r1
|
|
||||||
|
|
||||||
20041faa <wait_ssi_ready>:
|
|
||||||
20041faa: b503 push {r0, r1, lr}
|
|
||||||
20041fac: 6a99 ldr r1, [r3, #40] @ 0x28
|
|
||||||
20041fae: 2004 movs r0, #4
|
|
||||||
20041fb0: 4201 tst r1, r0
|
|
||||||
20041fb2: d0fb beq.n 20041fac <wait_ssi_ready+0x2>
|
|
||||||
20041fb4: 2001 movs r0, #1
|
|
||||||
20041fb6: 4201 tst r1, r0
|
|
||||||
20041fb8: d1f8 bne.n 20041fac <wait_ssi_ready+0x2>
|
|
||||||
20041fba: bd03 pop {r0, r1, pc}
|
|
||||||
|
|
||||||
20041fbc <read_flash_sreg>:
|
|
||||||
20041fbc: b502 push {r1, lr}
|
|
||||||
20041fbe: 6618 str r0, [r3, #96] @ 0x60
|
|
||||||
20041fc0: 6618 str r0, [r3, #96] @ 0x60
|
|
||||||
20041fc2: f7ff fff2 bl 20041faa <wait_ssi_ready>
|
|
||||||
20041fc6: 6e18 ldr r0, [r3, #96] @ 0x60
|
|
||||||
20041fc8: 6e18 ldr r0, [r3, #96] @ 0x60
|
|
||||||
20041fca: bd02 pop {r1, pc}
|
|
||||||
|
|
||||||
20041fcc <literals>:
|
|
||||||
20041fcc: 40020000 .word 0x40020000
|
|
||||||
20041fd0: 18000000 .word 0x18000000
|
|
||||||
20041fd4: 00070000 .word 0x00070000
|
|
||||||
20041fd8: 005f0300 .word 0x005f0300
|
|
||||||
20041fdc: 00002221 .word 0x00002221
|
|
||||||
20041fe0: 180000f4 .word 0x180000f4
|
|
||||||
20041fe4: a0002022 .word 0xa0002022
|
|
||||||
20041fe8: 10000100 .word 0x10000100
|
|
||||||
20041fec: e000ed08 .word 0xe000ed08
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
// Padded and checksummed version of: /home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pico-sdk/src/rp2040/boot_stage2/bs2_default.bin
|
|
||||||
|
|
||||||
.cpu cortex-m0plus
|
|
||||||
.thumb
|
|
||||||
|
|
||||||
.section .boot2, "ax"
|
|
||||||
|
|
||||||
.byte 0x00, 0xb5, 0x32, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21, 0x88, 0x43, 0x98, 0x60
|
|
||||||
.byte 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2e, 0x4b, 0x00, 0x21, 0x99, 0x60, 0x02, 0x21, 0x59, 0x61
|
|
||||||
.byte 0x01, 0x21, 0xf0, 0x22, 0x99, 0x50, 0x2b, 0x49, 0x19, 0x60, 0x01, 0x21, 0x99, 0x60, 0x35, 0x20
|
|
||||||
.byte 0x00, 0xf0, 0x44, 0xf8, 0x02, 0x22, 0x90, 0x42, 0x14, 0xd0, 0x06, 0x21, 0x19, 0x66, 0x00, 0xf0
|
|
||||||
.byte 0x34, 0xf8, 0x19, 0x6e, 0x01, 0x21, 0x19, 0x66, 0x00, 0x20, 0x18, 0x66, 0x1a, 0x66, 0x00, 0xf0
|
|
||||||
.byte 0x2c, 0xf8, 0x19, 0x6e, 0x19, 0x6e, 0x19, 0x6e, 0x05, 0x20, 0x00, 0xf0, 0x2f, 0xf8, 0x01, 0x21
|
|
||||||
.byte 0x08, 0x42, 0xf9, 0xd1, 0x00, 0x21, 0x99, 0x60, 0x1b, 0x49, 0x19, 0x60, 0x00, 0x21, 0x59, 0x60
|
|
||||||
.byte 0x1a, 0x49, 0x1b, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, 0xeb, 0x21, 0x19, 0x66, 0xa0, 0x21
|
|
||||||
.byte 0x19, 0x66, 0x00, 0xf0, 0x12, 0xf8, 0x00, 0x21, 0x99, 0x60, 0x16, 0x49, 0x14, 0x48, 0x01, 0x60
|
|
||||||
.byte 0x01, 0x21, 0x99, 0x60, 0x01, 0xbc, 0x00, 0x28, 0x00, 0xd0, 0x00, 0x47, 0x12, 0x48, 0x13, 0x49
|
|
||||||
.byte 0x08, 0x60, 0x03, 0xc8, 0x80, 0xf3, 0x08, 0x88, 0x08, 0x47, 0x03, 0xb5, 0x99, 0x6a, 0x04, 0x20
|
|
||||||
.byte 0x01, 0x42, 0xfb, 0xd0, 0x01, 0x20, 0x01, 0x42, 0xf8, 0xd1, 0x03, 0xbd, 0x02, 0xb5, 0x18, 0x66
|
|
||||||
.byte 0x18, 0x66, 0xff, 0xf7, 0xf2, 0xff, 0x18, 0x6e, 0x18, 0x6e, 0x02, 0xbd, 0x00, 0x00, 0x02, 0x40
|
|
||||||
.byte 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x07, 0x00, 0x00, 0x03, 0x5f, 0x00, 0x21, 0x22, 0x00, 0x00
|
|
||||||
.byte 0xf4, 0x00, 0x00, 0x18, 0x22, 0x20, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x10, 0x08, 0xed, 0x00, 0xe0
|
|
||||||
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0xb2, 0x4e, 0x7a
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
# This is a generated file and its contents are an internal implementation detail.
|
|
||||||
# The update step will be re-executed if anything in this file changes.
|
|
||||||
# No other meaning or use of this file is supported.
|
|
||||||
|
|
||||||
command=
|
|
||||||
work_dir=
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
# This is a generated file and its contents are an internal implementation detail.
|
|
||||||
# The download step will be re-executed if anything in this file changes.
|
|
||||||
# No other meaning or use of this file is supported.
|
|
||||||
|
|
||||||
method=source_dir
|
|
||||||
command=
|
|
||||||
source_dir=/home/ulysse-cura/.local/share/pico-sdk/tools/pioasm
|
|
||||||
work_dir=
|
|
||||||
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
# This is a generated file and its contents are an internal implementation detail.
|
|
||||||
# The patch step will be re-executed if anything in this file changes.
|
|
||||||
# No other meaning or use of this file is supported.
|
|
||||||
|
|
||||||
command (connected)=
|
|
||||||
command (disconnected)=
|
|
||||||
work_dir=
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
|
|
||||||
set(PIOASM_EXTRA_SOURCE_FILES "" CACHE STRING "Initial cache" FORCE)
|
|
||||||
set(PIOASM_VERSION_STRING "2.2.0" CACHE STRING "Initial cache" FORCE)
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
cmd='/usr/bin/cmake;--no-warn-unused-cli;-DCMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/gmake;-DPIOASM_FLAT_INSTALL=1;-DCMAKE_INSTALL_PREFIX=/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pioasm-install;-DCMAKE_RULE_MESSAGES=OFF;-DCMAKE_INSTALL_MESSAGE=NEVER;-GUnix Makefiles;-C<TMP_DIR>/pioasmBuild-cache-$<CONFIG>.cmake;-S;<SOURCE_DIR><SOURCE_SUBDIR>;-B;<BINARY_DIR>'
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
||||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION ${CMAKE_VERSION}) # this file comes with cmake
|
|
||||||
|
|
||||||
# If CMAKE_DISABLE_SOURCE_CHANGES is set to true and the source directory is an
|
|
||||||
# existing directory in our source tree, calling file(MAKE_DIRECTORY) on it
|
|
||||||
# would cause a fatal error, even though it would be a no-op.
|
|
||||||
if(NOT EXISTS "/home/ulysse-cura/.local/share/pico-sdk/tools/pioasm")
|
|
||||||
file(MAKE_DIRECTORY "/home/ulysse-cura/.local/share/pico-sdk/tools/pioasm")
|
|
||||||
endif()
|
|
||||||
file(MAKE_DIRECTORY
|
|
||||||
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pioasm"
|
|
||||||
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pioasm-install"
|
|
||||||
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/tmp"
|
|
||||||
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src/pioasmBuild-stamp"
|
|
||||||
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src"
|
|
||||||
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src/pioasmBuild-stamp"
|
|
||||||
)
|
|
||||||
|
|
||||||
set(configSubDirs )
|
|
||||||
foreach(subDir IN LISTS configSubDirs)
|
|
||||||
file(MAKE_DIRECTORY "/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src/pioasmBuild-stamp/${subDir}")
|
|
||||||
endforeach()
|
|
||||||
if(cfgdir)
|
|
||||||
file(MAKE_DIRECTORY "/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src/pioasmBuild-stamp${cfgdir}") # cfgdir has leading slash
|
|
||||||
endif()
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
FLASH(rx) : ORIGIN = 0x10000000, LENGTH = (2 * 1024 * 1024)
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
#ifndef I2C_BUFFER_H
|
|
||||||
#define I2C_BUFFER_H
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include "i2c_slave.h"
|
|
||||||
|
|
||||||
typedef struct i2c_buffer_t {
|
|
||||||
uint8_t buffer[256];
|
|
||||||
uint8_t buffer_reg;
|
|
||||||
bool buffer_reg_written;
|
|
||||||
} i2c_buffer_t;
|
|
||||||
|
|
||||||
// I2c slave buffer handler for writing and reading data to the buffer
|
|
||||||
void __not_in_flash_func(i2c_slave_buffer_handler)(i2c_slave_event_t event);
|
|
||||||
|
|
||||||
#endif // I2C_BUFFER_H
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2021 Valentin Milea <valentin.milea@gmail.com>
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef I2C_SLAVE_H
|
|
||||||
#define I2C_SLAVE_H
|
|
||||||
|
|
||||||
#include <hardware/i2c.h>
|
|
||||||
|
|
||||||
#define I2C_SLAVE_SDA_PIN 16
|
|
||||||
#define I2C_SLAVE_SCL_PIN 17
|
|
||||||
#define I2C_SLAVE_INSTANCE i2c0
|
|
||||||
#define I2C_SLAVE_ADDRESS 0x09
|
|
||||||
|
|
||||||
typedef enum i2c_slave_event_t {
|
|
||||||
I2C_SLAVE_RECEIVE, // < Data from master is available for reading. Slave must read from Rx FIFO.
|
|
||||||
I2C_SLAVE_REQUEST, // < Master is requesting data. Slave must write into Tx FIFO.
|
|
||||||
I2C_SLAVE_FINISH, // < Master has sent a Stop or Restart signal. Slave may prepare for the next transfer.
|
|
||||||
} i2c_slave_event_t;
|
|
||||||
|
|
||||||
uint8_t i2c_slave_read_byte(void);
|
|
||||||
|
|
||||||
void i2c_slave_write_byte(uint8_t byte);
|
|
||||||
|
|
||||||
// Init I2C with default parameters
|
|
||||||
void i2c_slave_init(void);
|
|
||||||
|
|
||||||
// Deinit I2C with default parameters
|
|
||||||
void i2c_slave_deinit(void);
|
|
||||||
|
|
||||||
#endif // I2C_SLAVE_H
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
#include "headers/i2c_buffer.h"
|
|
||||||
|
|
||||||
#include "headers/robot.h"
|
|
||||||
#include "headers/motors.h"
|
|
||||||
|
|
||||||
void __not_in_flash_func(i2c_slave_buffer_handler)(i2c_slave_event_t event)
|
|
||||||
{
|
|
||||||
switch(event)
|
|
||||||
{
|
|
||||||
case I2C_SLAVE_RECEIVE: // master has written some data
|
|
||||||
if(!robot.i2c_buffer.buffer_reg_written)
|
|
||||||
{
|
|
||||||
// writes always start with the memory address
|
|
||||||
robot.i2c_buffer.buffer_reg = i2c_slave_read_byte();
|
|
||||||
robot.i2c_buffer.buffer_reg_written = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// save into memory
|
|
||||||
robot.i2c_buffer.buffer[robot.i2c_buffer.buffer_reg] = i2c_slave_read_byte();
|
|
||||||
robot.i2c_buffer.buffer_reg++;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case I2C_SLAVE_REQUEST: // master is requesting data
|
|
||||||
// load from memory
|
|
||||||
i2c_slave_write_byte(robot.i2c_buffer.buffer[robot.i2c_buffer.buffer_reg]);
|
|
||||||
robot.i2c_buffer.buffer_reg++;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case I2C_SLAVE_FINISH: // master has signalled Stop / Restart
|
|
||||||
robot.i2c_buffer.buffer_reg_written = false;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,114 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2021 Valentin Milea <valentin.milea@gmail.com>
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "headers/i2c_slave.h"
|
|
||||||
|
|
||||||
//#include <pico/stdlib.h>
|
|
||||||
#include <hardware/irq.h>
|
|
||||||
#include "headers/i2c_buffer.h"
|
|
||||||
|
|
||||||
static bool transfer_in_progress;
|
|
||||||
|
|
||||||
inline uint8_t i2c_slave_read_byte(void)
|
|
||||||
{
|
|
||||||
i2c_hw_t *hw = i2c_get_hw(I2C_SLAVE_INSTANCE);
|
|
||||||
assert(hw->status & I2C_IC_STATUS_RFNE_BITS); // Rx FIFO must not be empty
|
|
||||||
return (uint8_t)hw->data_cmd;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void i2c_slave_write_byte(uint8_t byte)
|
|
||||||
{
|
|
||||||
i2c_hw_t *hw = i2c_get_hw(I2C_SLAVE_INSTANCE);
|
|
||||||
assert(hw->status & I2C_IC_STATUS_TFNF_BITS); // Tx FIFO must not be full
|
|
||||||
hw->data_cmd = byte;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void finish_transfer(void)
|
|
||||||
{
|
|
||||||
if(transfer_in_progress)
|
|
||||||
{
|
|
||||||
i2c_slave_buffer_handler(I2C_SLAVE_FINISH);
|
|
||||||
transfer_in_progress = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void __not_in_flash_func(i2c_slave_irq_handler)(void)
|
|
||||||
{
|
|
||||||
i2c_hw_t *hw = i2c_get_hw(I2C_SLAVE_INSTANCE);
|
|
||||||
|
|
||||||
uint32_t intr_stat = hw->intr_stat;
|
|
||||||
|
|
||||||
if(intr_stat == 0)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(intr_stat & I2C_IC_INTR_STAT_R_TX_ABRT_BITS)
|
|
||||||
{
|
|
||||||
hw->clr_tx_abrt;
|
|
||||||
finish_transfer();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(intr_stat & I2C_IC_INTR_STAT_R_START_DET_BITS)
|
|
||||||
{
|
|
||||||
hw->clr_start_det;
|
|
||||||
finish_transfer();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(intr_stat & I2C_IC_INTR_STAT_R_STOP_DET_BITS)
|
|
||||||
{
|
|
||||||
hw->clr_stop_det;
|
|
||||||
finish_transfer();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(intr_stat & I2C_IC_INTR_STAT_R_RX_FULL_BITS)
|
|
||||||
{
|
|
||||||
transfer_in_progress = true;
|
|
||||||
i2c_slave_buffer_handler(I2C_SLAVE_RECEIVE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(intr_stat & I2C_IC_INTR_STAT_R_RD_REQ_BITS)
|
|
||||||
{
|
|
||||||
hw->clr_rd_req;
|
|
||||||
transfer_in_progress = true;
|
|
||||||
i2c_slave_buffer_handler(I2C_SLAVE_REQUEST);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void i2c_slave_init(void)
|
|
||||||
{
|
|
||||||
// Init GPIO pins
|
|
||||||
gpio_set_function(I2C_SLAVE_SDA_PIN, GPIO_FUNC_I2C);
|
|
||||||
gpio_set_function(I2C_SLAVE_SCL_PIN, GPIO_FUNC_I2C);
|
|
||||||
|
|
||||||
// Note: The I2C slave does clock stretching implicitly after a RD_REQ, while the Tx FIFO is empty.
|
|
||||||
// There is also an option to enable clock stretching while the Rx FIFO is full, but we leave it
|
|
||||||
// disabled since the Rx FIFO should never fill up (unless i2c_slave.handler() is way too slow).
|
|
||||||
i2c_set_slave_mode(I2C_SLAVE_INSTANCE, true, I2C_SLAVE_ADDRESS);
|
|
||||||
|
|
||||||
i2c_hw_t *hw = i2c_get_hw(I2C_SLAVE_INSTANCE);
|
|
||||||
// unmask necessary interrupts
|
|
||||||
hw->intr_mask = I2C_IC_INTR_MASK_M_RX_FULL_BITS | I2C_IC_INTR_MASK_M_RD_REQ_BITS | I2C_IC_RAW_INTR_STAT_TX_ABRT_BITS | I2C_IC_INTR_MASK_M_STOP_DET_BITS | I2C_IC_INTR_MASK_M_START_DET_BITS;
|
|
||||||
|
|
||||||
// enable interrupt for current core
|
|
||||||
const uint IRQ_INDEX = I2C0_IRQ + i2c_get_index(I2C_SLAVE_INSTANCE);
|
|
||||||
irq_set_exclusive_handler(IRQ_INDEX, i2c_slave_irq_handler);
|
|
||||||
irq_set_enabled(IRQ_INDEX, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void i2c_slave_deinit(void)
|
|
||||||
{
|
|
||||||
const uint IRQ_INDEX = I2C0_IRQ + i2c_get_index(I2C_SLAVE_INSTANCE);
|
|
||||||
irq_set_enabled(IRQ_INDEX, false);
|
|
||||||
irq_remove_handler(IRQ_INDEX, i2c_slave_irq_handler);
|
|
||||||
|
|
||||||
i2c_set_slave_mode(I2C_SLAVE_INSTANCE, false, 0);
|
|
||||||
|
|
||||||
transfer_in_progress = false;
|
|
||||||
|
|
||||||
i2c_hw_t *hw = i2c_get_hw(I2C_SLAVE_INSTANCE);
|
|
||||||
hw->intr_mask = I2C_IC_INTR_MASK_RESET;
|
|
||||||
}
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
#include "headers/robot.h"
|
|
||||||
|
|
||||||
#include <pico/stdlib.h>
|
|
||||||
#include "headers/motors.h"
|
|
||||||
#include "i2c/headers/i2c_slave.h"
|
|
||||||
|
|
||||||
void robot_init(void)
|
|
||||||
{
|
|
||||||
stdio_init_all();
|
|
||||||
|
|
||||||
//init_motors();
|
|
||||||
//init_servo_motors();
|
|
||||||
i2c_slave_init();
|
|
||||||
|
|
||||||
robot.is_running = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void robot_handle_inputs_outputs(void)
|
|
||||||
{
|
|
||||||
//update_motors_from_buffer();
|
|
||||||
}
|
|
||||||
|
|
||||||
void robot_deinit(void)
|
|
||||||
{
|
|
||||||
i2c_slave_deinit();
|
|
||||||
}
|
|
||||||
|
|
@ -5,8 +5,9 @@
|
||||||
"intelliSenseMode": "linux-gcc-arm",
|
"intelliSenseMode": "linux-gcc-arm",
|
||||||
"includePath": [
|
"includePath": [
|
||||||
"${env:PICO_SDK_PATH}/src/**/include/",
|
"${env:PICO_SDK_PATH}/src/**/include/",
|
||||||
|
"${env:PICO_SDK_PATH}/lib/**/include/",
|
||||||
|
"${env:PICO_SDK_PATH}/lib/**/src/",
|
||||||
"${workspaceFolder}/build/generated/pico_base/",
|
"${workspaceFolder}/build/generated/pico_base/",
|
||||||
"${workspaceFolder}/build/",
|
|
||||||
"${workspaceFolder}/src/"
|
"${workspaceFolder}/src/"
|
||||||
],
|
],
|
||||||
"compilerPath": "/usr/bin/arm-none-eabi-gcc",
|
"compilerPath": "/usr/bin/arm-none-eabi-gcc",
|
||||||
|
|
@ -13,9 +13,8 @@ pico_sdk_init()
|
||||||
add_executable(motion_controller
|
add_executable(motion_controller
|
||||||
src/main.c
|
src/main.c
|
||||||
src/robot.c
|
src/robot.c
|
||||||
src/motors.c
|
|
||||||
src/i2c/i2c_buffer.c
|
|
||||||
src/i2c/i2c_slave.c
|
src/i2c/i2c_slave.c
|
||||||
|
src/motors.c
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(motion_controller PRIVATE
|
target_include_directories(motion_controller PRIVATE
|
||||||
|
|
@ -26,6 +25,7 @@ target_link_libraries(motion_controller
|
||||||
pico_stdlib
|
pico_stdlib
|
||||||
hardware_uart
|
hardware_uart
|
||||||
hardware_i2c
|
hardware_i2c
|
||||||
|
pico_i2c_slave
|
||||||
hardware_pwm
|
hardware_pwm
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -7,8 +7,6 @@
|
||||||
typedef enum motors_enum_t {
|
typedef enum motors_enum_t {
|
||||||
MOTOR1,
|
MOTOR1,
|
||||||
MOTOR2,
|
MOTOR2,
|
||||||
MOTOR3,
|
|
||||||
MOTOR4,
|
|
||||||
|
|
||||||
NB_MOTORS
|
NB_MOTORS
|
||||||
} motors_enum_t;
|
} motors_enum_t;
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef ROBOT_H
|
#ifndef ROBOT_H
|
||||||
#define ROBOT_H
|
#define ROBOT_H
|
||||||
|
|
||||||
#include "i2c/headers/i2c_buffer.h"
|
#include "i2c/headers/i2c_slave.h"
|
||||||
|
|
||||||
typedef struct robot_t {
|
typedef struct robot_t {
|
||||||
i2c_buffer_t i2c_buffer;
|
i2c_buffer_t i2c_buffer;
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2021 Valentin Milea <valentin.milea@gmail.com>
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef I2C_SLAVE_H
|
||||||
|
#define I2C_SLAVE_H
|
||||||
|
|
||||||
|
#include <hardware/i2c.h>
|
||||||
|
|
||||||
|
#define I2C_SLAVE_SDA_PIN 16
|
||||||
|
#define I2C_SLAVE_SCL_PIN 17
|
||||||
|
#define I2C_SLAVE_INSTANCE i2c0
|
||||||
|
#define I2C_SLAVE_ADDRESS 0x09
|
||||||
|
|
||||||
|
typedef struct i2c_buffer_t {
|
||||||
|
uint8_t buffer[256];
|
||||||
|
uint8_t buffer_reg;
|
||||||
|
bool buffer_reg_written;
|
||||||
|
} i2c_buffer_t;
|
||||||
|
|
||||||
|
// Init i2c slave with default parameters
|
||||||
|
void init_i2c_slave(void);
|
||||||
|
// Deinit i2c slave
|
||||||
|
void deinit_i2c_slave(void);
|
||||||
|
|
||||||
|
#endif // I2C_SLAVE_H
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2021 Valentin Milea <valentin.milea@gmail.com>
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "headers/i2c_slave.h"
|
||||||
|
|
||||||
|
#include <hardware/gpio.h>
|
||||||
|
#include <hardware/i2c.h>
|
||||||
|
#include <pico/i2c_slave.h>
|
||||||
|
#include <headers/robot.h>
|
||||||
|
|
||||||
|
void i2c_slave_buffer_handler(i2c_inst_t *i2c, i2c_slave_event_t event)
|
||||||
|
{
|
||||||
|
switch(event)
|
||||||
|
{
|
||||||
|
case I2C_SLAVE_RECEIVE: // master has written some data
|
||||||
|
if(!robot.i2c_buffer.buffer_reg_written)
|
||||||
|
{
|
||||||
|
// writes always start with the memory address
|
||||||
|
robot.i2c_buffer.buffer_reg = i2c_read_byte_raw(I2C_SLAVE_INSTANCE);
|
||||||
|
robot.i2c_buffer.buffer_reg_written = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// save into memory
|
||||||
|
robot.i2c_buffer.buffer[robot.i2c_buffer.buffer_reg] = i2c_read_byte_raw(I2C_SLAVE_INSTANCE);
|
||||||
|
robot.i2c_buffer.buffer_reg++;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case I2C_SLAVE_REQUEST: // master is requesting data
|
||||||
|
// load from memory
|
||||||
|
i2c_write_byte_raw(I2C_SLAVE_INSTANCE, robot.i2c_buffer.buffer[robot.i2c_buffer.buffer_reg]);
|
||||||
|
robot.i2c_buffer.buffer_reg++;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case I2C_SLAVE_FINISH: // master has signalled Stop / Restart
|
||||||
|
robot.i2c_buffer.buffer_reg_written = false;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void init_i2c_slave(void)
|
||||||
|
{
|
||||||
|
// Init GPIO pins
|
||||||
|
gpio_init(I2C_SLAVE_SDA_PIN);
|
||||||
|
gpio_init(I2C_SLAVE_SCL_PIN);
|
||||||
|
gpio_set_function(I2C_SLAVE_SDA_PIN, GPIO_FUNC_I2C);
|
||||||
|
gpio_set_function(I2C_SLAVE_SCL_PIN, GPIO_FUNC_I2C);
|
||||||
|
|
||||||
|
i2c_init(I2C_SLAVE_INSTANCE, 0);
|
||||||
|
// New SDK method to init i2c slave
|
||||||
|
i2c_slave_init(I2C_SLAVE_INSTANCE, I2C_SLAVE_ADDRESS, &i2c_slave_buffer_handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
void deinit_i2c_slave(void)
|
||||||
|
{
|
||||||
|
// Reset GPIO pins
|
||||||
|
gpio_set_function(I2C_SLAVE_SDA_PIN, GPIO_FUNC_NULL);
|
||||||
|
gpio_set_function(I2C_SLAVE_SCL_PIN, GPIO_FUNC_NULL);
|
||||||
|
|
||||||
|
// New SDK method to reset i2c slave
|
||||||
|
i2c_slave_deinit(I2C_SLAVE_INSTANCE);
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue