- Minor changes to variable names, comments & formatting
- Removed obsolete parameter previously used in program_mode - Added correction constant regarding base pwm measurement - Revised GPIO definitions (shared.h)
This commit is contained in:
1 parent
bae6fff659
commit
0219963dd7
5 files changed
+106
-98
No files matched your search
@@ -14,23 +14,27 @@
|
||||
#include "hardware/adc.h"
|
||||
#include "hardware/flash.h"
|
||||
#include "hardware/irq.h"
|
||||
|
||||
// Constant Value of 125 x 10⁶
|
||||
#define _125M 125000000
|
||||
|
||||
// GPIO used for DCC-Signal, Motor PWM or ADC
|
||||
#define DCC_INPUT_PIN 21u
|
||||
#define MOTOR_FWD_PIN 23u
|
||||
#define MOTOR_REV_PIN 22u
|
||||
#define FWD_V_EMF_ADC_PIN 28u
|
||||
#define REV_V_EMF_ADC_PIN 29u
|
||||
//Aux output pins (GPIO 24,25,26,27)
|
||||
#define AUX_PIN_MASK (1u<<24) | (1u<<25) | (1u<<26) | (1u<<27)
|
||||
//GPIO pins configured as inputs (Input functionality not implemented yet)
|
||||
#define GPIO_INPUT_MASK 0b00000000000000000000000000000000
|
||||
//GPIO pins configured as outputs
|
||||
#define GPIO_OUTPUT_MASK 0b00000000000000000000000000000000
|
||||
//GPIO pin mask to prevent setting illegal GPIOs (ADC, Motor, DCC Input Pin)
|
||||
|
||||
// GPIO used directly (GPIO 0-5 incl.) as outputs or to switch auxiliary output transistors (GPIO 24-27 incl.)
|
||||
#define GPIO_OUTPUT_PIN_MASK (1u<<24) | (1u<<25) | (1u<<26) | (1u<<27) | (1u<<5) | (1u<<4) | (1u<<3) | (1u<<2) | (1u<<1) | (1u<<0)
|
||||
// GPIO pin mask to prevent setting illegal GPIOs (ADC, Motor, DCC Input Pin)
|
||||
#define GPIO_ILLEGAL_MASK (1u<<DCC_INPUT_PIN) | (1u<<MOTOR_FWD_PIN) | (1u<<MOTOR_REV_PIN) | (1u<<FWD_V_EMF_ADC_PIN) | (1u<<REV_V_EMF_ADC_PIN)
|
||||
//GPIO pin mask with allowed outputs (AUX & GPIO (configured as outputs))
|
||||
#define GPIO_ALLOWED_OUTPUTS (GPIO_OUTPUT_MASK|AUX_PIN_MASK) & ~(GPIO_ILLEGAL_MASK)
|
||||
#define FLASH_TARGET_OFFSET (PICO_FLASH_SIZE_BYTES-FLASH_SECTOR_SIZE) //This Offset should be far enough away from program data
|
||||
|
||||
// GPIO pin mask with allowed outputs (AUX & GPIO (configured as outputs))
|
||||
#define GPIO_ALLOWED_OUTPUTS (GPIO_OUTPUT_PIN_MASK) & ~(GPIO_ILLEGAL_MASK)
|
||||
|
||||
// Offset from base address used for saving CV_ARRAY_FLASH
|
||||
#define FLASH_TARGET_OFFSET (PICO_FLASH_SIZE_BYTES-FLASH_SECTOR_SIZE)
|
||||
|
||||
extern repeating_timer_t pid_control_timer;
|
||||
extern repeating_timer_t speed_helper_timer;
|
||||
|
||||
Reference in new issue
Block a user