Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean variants files #167

Merged
merged 1 commit into from
Dec 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions cores/arduino/pins_arduino_var.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,54 @@ uint32_t pinNametoDigitalPin(PinName p);
(digitalPinFirstOccurence(p) == PIN_SERIAL_TX))
#endif

// Default Definitions, could be redefined in variant.h
#ifndef ADC_RESOLUTION
#define ADC_RESOLUTION 12
#endif
#ifndef DACC_RESOLUTION
#define DACC_RESOLUTION 12
#endif
#ifndef PWM_RESOLUTION
#define PWM_RESOLUTION 8
#endif
#ifndef PWM_FREQUENCY
#define PWM_FREQUENCY 1000
#endif
#ifndef PWM_MAX_DUTY_CYCLE
#define PWM_MAX_DUTY_CYCLE 255
#endif

// Default for Arduino connector compatibility
// SPI Definitions
#ifndef SS
#define SS 10
#endif
#ifndef SS1
#define SS1 4
#endif
#ifndef SS2
#define SS2 7
#endif
#ifndef SS3
#define SS3 8
#endif
#ifndef MOSI
#define MOSI 11
#endif
#ifndef MISO
#define MISO 12
#endif
#ifndef SCK
#define SCK 13
#endif
// I2C Definitions
#ifndef SDA
#define SDA 14
#endif
#ifndef SCL
#define SCL 15
#endif

#ifdef __cplusplus
}
#endif
Expand Down
50 changes: 20 additions & 30 deletions variants/DISCO_F100RB/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,42 +112,32 @@ enum {
AEND
};

//ADC resolution is 12bits
#define ADC_RESOLUTION 12
#define DACC_RESOLUTION 12

//PWR resolution
#define PWM_RESOLUTION 8
#define PWM_FREQUENCY 1000
#define PWM_MAX_DUTY_CYCLE 255

//On-board LED pin number
#define LED_BUILTIN 21
// On-board LED pin number
#define LED_BUILTIN PC9
#define LED_GREEN LED_BUILTIN
#define LED_BLUE 20
#define LED_BLUE PC8

//On-board user button
// On-board user button
#define USER_BTN 5

//SPI definitions
#define SS 43
#define SS1 40
#define SS2 41
#define SS3 42
#define MOSI 46
#define MISO 45
#define SCK 44

//I2C Definitions
#define SDA 38
#define SCL 37

//Timer Definitions
//Do not use timer used by PWM pins when possible. See PinMap_PWM.
// SPI Definitions
#define SS PB12
#define SS1 PB9
#define SS2 PB10
#define SS3 PB11
#define MOSI PB15
#define MISO PB14
#define SCK PB13

// I2C Definitions
#define SDA PB7
#define SCL PB6

// Timer Definitions
// Do not use timer used by PWM pins when possible. See PinMap_PWM.
#define TIMER_TONE TIM15
#define TIMER_UART_EMULATED TIM16

//Do not use basic timer: OC is required
// Do not use basic timer: OC is required
#define TIMER_SERVO TIM17 //TODO: advanced-control timers don't work

// UART Definitions
Expand Down
44 changes: 14 additions & 30 deletions variants/DISCO_F407VG/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,49 +137,33 @@ enum {
AEND
};

//ADC resolution is 12bits
#define ADC_RESOLUTION 12
#define DACC_RESOLUTION 12

//PWR resolution
#define PWM_RESOLUTION 8
#define PWM_FREQUENCY 1000
#define PWM_MAX_DUTY_CYCLE 255

//On-board LED pin number
#define LED_BUILTIN 18
// On-board LED pin number
#define LED_BUILTIN PD12
#define LED_GREEN LED_BUILTIN
#define LED_BLUE 58
#define LED_RED 19
#define LED_ORANGE 57
#define LED_BLUE PD15
#define LED_RED PD14
#define LED_ORANGE PD13

//On-board user button
// On-board user button
#define USER_BTN 2


//SPI definitions
#define SS 10
#define SS1 4
// SPI Definitions
#define SS2 14
#define MOSI 44
#define MOSI PA7
#define MISO 5
#define SCK 43
#define SCK PA5

//I2C Definitions
#define SDA 66
#define SCL 26
// I2C Definitions
#define SDA PB7
#define SCL PB8

//Timer Definitions
//Do not use timer used by PWM pin. See PinMap_PWM.
// Timer Definitions
// Do not use timer used by PWM pin. See PinMap_PWM.
#define TIMER_TONE TIM6
#define TIMER_SERVO TIM7
#define TIMER_UART_EMULATED TIM6

// UART Definitions
#define SERIAL_UART_INSTANCE 2 //Connected to ST-Link
// UART Emulation
#define UART_EMUL_RX PE_9
#define UART_EMUL_TX PE_11

// Default pin used for 'Serial' instance (ex: ST-Link)
// Mandatory for Firmata
Expand Down
36 changes: 6 additions & 30 deletions variants/DISCO_F746NG/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,42 +69,18 @@ enum {
AEND
};

//ADC resolution is 12bits
#define ADC_RESOLUTION 12
#define DACC_RESOLUTION 12

//PWR resolution
#define PWM_RESOLUTION 8
#define PWM_FREQUENCY 1000
#define PWM_MAX_DUTY_CYCLE 255

//On-board LED pin number
// On-board LED pin number
#define LED_BUILTIN 13
#define LED_GREEN LED_BUILTIN

//On-board user button
#define USER_BTN 22


//SPI definitions
#define SS 10
#define SS1 4
#define SS2 7
#define SS3 8
#define MOSI 11
#define MISO 12
#define SCK 13

//I2C Definitions
#define SDA 14
#define SCL 15
// On-board user button
#define USER_BTN PI11

//Timer Definitions
//Do not use timer used by PWM pins when possible. See PinMap_PWM.
// Timer Definitions
// Do not use timer used by PWM pins when possible. See PinMap_PWM.
#define TIMER_TONE TIM6
#define TIMER_UART_EMULATED TIM7

//Do not use basic timer: OC is required
// Do not use basic timer: OC is required
#define TIMER_SERVO TIM2 //TODO: advanced-control timers don't work

// UART Definitions
Expand Down
33 changes: 5 additions & 28 deletions variants/DISCO_L072CZ_LRWAN1/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,7 @@ enum {
AEND
};

//ADC resolution is 12bits
#define ADC_RESOLUTION 12
#define DACC_RESOLUTION 12

//PWR resolution
#define PWM_RESOLUTION 8
#define PWM_FREQUENCY 1000
#define PWM_MAX_DUTY_CYCLE 255

//On-board LED pin number
// On-board LED pin number
#define LED_BUILTIN PA5
#define LED_LD2 LED_BUILTIN
#define LED_GREEN2 LED_BUILTIN
Expand All @@ -99,28 +90,14 @@ enum {
#define LED_RED 5
#define LED_LD4 LED_RED

//On-board user button
// On-board user button
#define USER_BTN 6


//SPI definitions
#define SS 10
#define SS1 4
#define SS2 7
#define SS3 8
#define MOSI 11
#define MISO 12
#define SCK 13

//I2C Definitions
#define SDA 14
#define SCL 15

//Timer Definitions
//Do not use timer used by PWM pins when possible. See PinMap_PWM.
// Timer Definitions
// Do not use timer used by PWM pins when possible. See PinMap_PWM.
#define TIMER_TONE TIM22

//Do not use basic timer: OC is required
// Do not use basic timer: OC is required
#define TIMER_SERVO TIM2 //TODO: advanced-control timers don't work

// UART Definitions
Expand Down
34 changes: 5 additions & 29 deletions variants/DISCO_L475VG_IOT/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,45 +139,21 @@ enum {
AEND
};

//ADC resolution is 12bits
#define ADC_RESOLUTION 12
#define DACC_RESOLUTION 12

//PWR resolution
#define PWM_RESOLUTION 8
#define PWM_FREQUENCY 1000
#define PWM_MAX_DUTY_CYCLE 255

//On-board LED pin number
// On-board LED pin number
#define LED_BUILTIN 13
#define LED1 LED_BUILTIN
#define LED2 PB14
#define LED3 PC9
#define LED4 LED3

//On-board user button
// On-board user button
#define USER_BTN PC13


//SPI definitions
#define SS 10
#define SS1 4
#define SS2 7
#define SS3 8
#define MOSI 11
#define MISO 12
#define SCK 13

//I2C Definitions
#define SDA 14
#define SCL 15

//Timer Definitions
//Do not use timer used by PWM pins when possible. See PinMap_PWM.
// Timer Definitions
// Do not use timer used by PWM pins when possible. See PinMap_PWM.
#define TIMER_TONE TIM6
#define TIMER_UART_EMULATED TIM7

//Do not use basic timer: OC is required
// Do not use basic timer: OC is required
#define TIMER_SERVO TIM2 //TODO: advanced-control timers don't work

// UART Definitions
Expand Down
34 changes: 6 additions & 28 deletions variants/NUCLEO_F030R8/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,40 +112,18 @@ enum {
AEND
};

//ADC resolution is 12bits
#define ADC_RESOLUTION 12

//PWR resolution
#define PWM_RESOLUTION 8
#define PWM_FREQUENCY 1000
#define PWM_MAX_DUTY_CYCLE 255

//On-board LED pin number
// On-board LED pin number
#define LED_BUILTIN 13
#define LED_GREEN LED_BUILTIN

//On-board user button
#define USER_BTN 24


//SPI definitions
#define SS 10
#define SS1 4
#define SS2 7
#define SS3 8
#define MOSI 11
#define MISO 12
#define SCK 13

//I2C Definitions
#define SDA 14
#define SCL 15
// On-board user button
#define USER_BTN PC13

//Timer Definitions
//Do not use timer used by PWM pins when possible. See PinMap_PWM.
// Timer Definitions
// Do not use timer used by PWM pins when possible. See PinMap_PWM.
#define TIMER_TONE TIM6

//Do not use basic timer: OC is required
// Do not use basic timer: OC is required
#define TIMER_SERVO TIM3 //TODO: advanced-control timers don't work

// UART Definitions
Expand Down
Loading