|
|
@ -51,8 +51,8 @@ |
|
|
|
* It contains: |
|
|
|
* - name of the signal |
|
|
|
* - the Ard_num assigned by the pins_YOUR_BOARD.h file using the platform defines. |
|
|
|
* EXAMPLE: "#define KILL_PIN PB1" results in Ard_num of 57. 57 is then used as an |
|
|
|
* index into digitalPin[] to get the Port_pin number |
|
|
|
* EXAMPLE: "#define KILL_PIN PB1" results in Ard_num of 57. 57 is then used as the |
|
|
|
* argument to digitalPinToPinName(IO) to get the Port_pin number |
|
|
|
* - if it is a digital or analog signal. PWMs are considered digital here. |
|
|
|
* |
|
|
|
* pin_xref is a structure generated by this header file. It is generated by the |
|
|
@ -68,8 +68,6 @@ |
|
|
|
* signal. The Arduino pin number is listed by the M43 I command. |
|
|
|
*/ |
|
|
|
|
|
|
|
extern const PinName digitalPin[]; // provided by the platform
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// make a list of the Arduino pin numbers in the Port/Pin order
|
|
|
@ -137,7 +135,7 @@ const XrefInfo pin_xref[] PROGMEM = { |
|
|
|
|
|
|
|
uint8_t get_pin_mode(const pin_t Ard_num) { |
|
|
|
uint32_t mode_all = 0; |
|
|
|
const PinName dp = digitalPin[Ard_num]; |
|
|
|
const PinName dp = digitalPinToPinName(Ard_num); |
|
|
|
switch (PORT_ALPHA(dp)) { |
|
|
|
case 'A' : mode_all = GPIOA->MODER; break; |
|
|
|
case 'B' : mode_all = GPIOB->MODER; break; |
|
|
@ -218,7 +216,7 @@ bool pwm_status(const pin_t Ard_num) { |
|
|
|
void pwm_details(const pin_t Ard_num) { |
|
|
|
if (pwm_status(Ard_num)) { |
|
|
|
uint32_t alt_all = 0; |
|
|
|
const PinName dp = digitalPin[Ard_num]; |
|
|
|
const PinName dp = digitalPinToPinName(Ard_num); |
|
|
|
pin_t pin_number = uint8_t(PIN_NUM(dp)); |
|
|
|
const bool over_7 = pin_number >= 8; |
|
|
|
const uint8_t ind = over_7 ? 1 : 0; |
|
|
|