Skip to content

Commit

Permalink
Made svb300 compile
Browse files Browse the repository at this point in the history
  • Loading branch information
giseburt committed Jun 7, 2018
1 parent fed9c9e commit fbad7f5
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 32 deletions.
63 changes: 33 additions & 30 deletions g2core/board/sbv300/board_gpio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,40 +56,43 @@

/**** Setup Actual Objects ****/

gpioDigitalInputPin<IRQPin<Motate::kInput1_PinNumber>> din1 {DI1_MODE, 1};
gpioDigitalInputPin<IRQPin<Motate::kInput2_PinNumber>> din2 {DI2_MODE, 2};
gpioDigitalInputPin<IRQPin<Motate::kInput3_PinNumber>> din3 {DI3_MODE, 3};
gpioDigitalInputPin<IRQPin<Motate::kInput4_PinNumber>> din4 {DI4_MODE, 4};
gpioDigitalInputPin<IRQPin<Motate::kInput5_PinNumber>> din5 {DI5_MODE, 5};
gpioDigitalInputPin<IRQPin<Motate::kInput6_PinNumber>> din6 {DI6_MODE, 6};
gpioDigitalInputPin<IRQPin<Motate::kInput7_PinNumber>> din7 {DI7_MODE, 7};
gpioDigitalInputPin<IRQPin<Motate::kInput8_PinNumber>> din8 {DI8_MODE, 8};
gpioDigitalInputPin<IRQPin<Motate::kInput9_PinNumber>> din9 {DI9_MODE, 9};
// gpioDigitalInputPin<IRQPin<Motate::kInput10_PinNumber>> din10 {DI10_MODE, 10};
// gpioDigitalInputPin<IRQPin<Motate::kInput11_PinNumber>> din11 {DI11_MODE, 11};
// gpioDigitalInputPin<IRQPin<Motate::kInput12_PinNumber>> din12 {DI12_MODE, 12};

gpioDigitalOutputPin<OutputType<OUTPUT1_PWM, Motate::kOutput1_PinNumber>> dout1 { DO1_MODE, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT2_PWM, Motate::kOutput2_PinNumber>> dout2 { DO2_MODE, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT3_PWM, Motate::kOutput3_PinNumber>> dout3 { DO3_MODE, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT4_PWM, Motate::kOutput4_PinNumber>> dout4 { DO4_MODE, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT5_PWM, Motate::kOutput5_PinNumber>> dout5 { DO5_MODE, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT6_PWM, Motate::kOutput6_PinNumber>> dout6 { DO6_MODE, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT7_PWM, Motate::kOutput7_PinNumber>> dout7 { DO7_MODE, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT8_PWM, Motate::kOutput8_PinNumber>> dout8 { DO8_MODE, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT9_PWM, Motate::kOutput9_PinNumber>> dout9 { DO9_MODE, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT10_PWM, Motate::kOutput10_PinNumber>> dout10 { DO10_MODE, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT11_PWM, Motate::kOutput11_PinNumber>> dout11 { DO11_MODE, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT12_PWM, Motate::kOutput12_PinNumber>> dout12 { DO12_MODE, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT13_PWM, Motate::kOutput13_PinNumber>> dout13 { DO13_MODE, (uint32_t)200000 };

/**** Setup Arrays - these are extern and MUST match the board_gpio.h ****/
gpioDigitalInputPin<IRQPin<Motate::kInput1_PinNumber>> din1 {DI1_ENABLED, DI1_POLARITY, 1, DI1_EXTERNAL_NUMBER};
gpioDigitalInputPin<IRQPin<Motate::kInput2_PinNumber>> din2 {DI2_ENABLED, DI2_POLARITY, 2, DI2_EXTERNAL_NUMBER};
gpioDigitalInputPin<IRQPin<Motate::kInput3_PinNumber>> din3 {DI3_ENABLED, DI3_POLARITY, 3, DI3_EXTERNAL_NUMBER};
gpioDigitalInputPin<IRQPin<Motate::kInput4_PinNumber>> din4 {DI4_ENABLED, DI4_POLARITY, 4, DI4_EXTERNAL_NUMBER};
gpioDigitalInputPin<IRQPin<Motate::kInput5_PinNumber>> din5 {DI5_ENABLED, DI5_POLARITY, 5, DI5_EXTERNAL_NUMBER};
gpioDigitalInputPin<IRQPin<Motate::kInput6_PinNumber>> din6 {DI6_ENABLED, DI6_POLARITY, 6, DI6_EXTERNAL_NUMBER};
gpioDigitalInputPin<IRQPin<Motate::kInput7_PinNumber>> din7 {DI7_ENABLED, DI7_POLARITY, 7, DI7_EXTERNAL_NUMBER};
gpioDigitalInputPin<IRQPin<Motate::kInput8_PinNumber>> din8 {DI8_ENABLED, DI8_POLARITY, 8, DI8_EXTERNAL_NUMBER};
gpioDigitalInputPin<IRQPin<Motate::kInput9_PinNumber>> din9 {DI9_ENABLED, DI9_POLARITY, 9, DI9_EXTERNAL_NUMBER};
// gpioDigitalInputPin<IRQPin<Motate::kInput10_PinNumber>> din10 {DI10ENABLEDE, DI10_POLARITY, 10, DI10_EXTERNAL_NUMBER};
// gpioDigitalInputPin<IRQPin<Motate::kInput11_PinNumber>> din11 {DI11ENABLEDE, DI11_POLARITY, 11, DI11_EXTERNAL_NUMBER};
// gpioDigitalInputPin<IRQPin<Motate::kInput12_PinNumber>> din12 {DI12ENABLEDE, DI12_POLARITY, 12, DI12_EXTERNAL_NUMBER};

gpioDigitalInput* const d_in[] = {&din1, &din2, &din3, &din4, &din5, &din6, &din7, &din8, &din9};


gpioDigitalOutputPin<OutputType<OUTPUT1_PWM, Motate::kOutput1_PinNumber>> dout1 { DO1_ENABLED, DO1_POLARITY, DO1_EXTERNAL_NUMBER, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT2_PWM, Motate::kOutput2_PinNumber>> dout2 { DO2_ENABLED, DO2_POLARITY, DO2_EXTERNAL_NUMBER, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT3_PWM, Motate::kOutput3_PinNumber>> dout3 { DO3_ENABLED, DO3_POLARITY, DO3_EXTERNAL_NUMBER, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT4_PWM, Motate::kOutput4_PinNumber>> dout4 { DO4_ENABLED, DO4_POLARITY, DO4_EXTERNAL_NUMBER, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT5_PWM, Motate::kOutput5_PinNumber>> dout5 { DO5_ENABLED, DO5_POLARITY, DO5_EXTERNAL_NUMBER, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT6_PWM, Motate::kOutput6_PinNumber>> dout6 { DO6_ENABLED, DO6_POLARITY, DO6_EXTERNAL_NUMBER, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT7_PWM, Motate::kOutput7_PinNumber>> dout7 { DO7_ENABLED, DO7_POLARITY, DO7_EXTERNAL_NUMBER, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT8_PWM, Motate::kOutput8_PinNumber>> dout8 { DO8_ENABLED, DO8_POLARITY, DO8_EXTERNAL_NUMBER, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT9_PWM, Motate::kOutput9_PinNumber>> dout9 { DO9_ENABLED, DO9_POLARITY, DO9_EXTERNAL_NUMBER, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT10_PWM, Motate::kOutput10_PinNumber>> dout10 { DO10_ENABLED, DO10_POLARITY, DO10_EXTERNAL_NUMBER, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT11_PWM, Motate::kOutput11_PinNumber>> dout11 { DO11_ENABLED, DO11_POLARITY, DO11_EXTERNAL_NUMBER, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT12_PWM, Motate::kOutput12_PinNumber>> dout12 { DO12_ENABLED, DO12_POLARITY, DO12_EXTERNAL_NUMBER, (uint32_t)200000 };
gpioDigitalOutputPin<OutputType<OUTPUT13_PWM, Motate::kOutput13_PinNumber>> dout13 { DO13_ENABLED, DO13_POLARITY, DO13_EXTERNAL_NUMBER, (uint32_t)200000 };

gpioDigitalOutput* const d_out[] = {&dout1, &dout2, &dout3, &dout4, &dout5, &dout6, &dout7, &dout8, &dout9, &dout10, &dout11, &dout12, &dout13};


/**** Setup Arrays - these are extern and MUST match the board_gpio.h ****/

// not yet used
// gpioAnalogInput* a_in[A_IN_CHANNELS];
// gpioAnalogOutput* a_out[A_OUT_CHANNELS];
gpioAnalogInput* const a_in[] = {};

/************************************************************************************
**** CODE **************************************************************************
Expand Down
6 changes: 6 additions & 0 deletions g2core/board/sbv300/board_gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ extern gpioDigitalInputPin<IRQPin<Motate::kInput9_PinNumber>> din9;
// extern gpioDigitalInputPin<IRQPin<Motate::kInput11_PinNumber>> din11;
// extern gpioDigitalInputPin<IRQPin<Motate::kInput12_PinNumber>> din12;

extern gpioDigitalInput* const d_in[D_IN_CHANNELS];


extern gpioDigitalOutputPin<OutputType<OUTPUT1_PWM, Motate::kOutput1_PinNumber>> dout1;
extern gpioDigitalOutputPin<OutputType<OUTPUT2_PWM, Motate::kOutput2_PinNumber>> dout2;
extern gpioDigitalOutputPin<OutputType<OUTPUT3_PWM, Motate::kOutput3_PinNumber>> dout3;
Expand All @@ -86,5 +89,8 @@ extern gpioDigitalOutputPin<OutputType<OUTPUT11_PWM, Motate::kOutput11_PinNumber
extern gpioDigitalOutputPin<OutputType<OUTPUT12_PWM, Motate::kOutput12_PinNumber>> dout12;
extern gpioDigitalOutputPin<OutputType<OUTPUT13_PWM, Motate::kOutput13_PinNumber>> dout13;

extern gpioDigitalOutput* const d_out[D_OUT_CHANNELS];

extern gpioAnalogInput* const a_in[A_IN_CHANNELS];

#endif // End of include guard: BOARD_GPIO_H_ONCE
4 changes: 2 additions & 2 deletions g2core/board/sbv300/board_xio.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
#include "MotateUSBCDC.h"

#if USB_SERIAL_PORTS_EXPOSED == 1
typedef Motate::USBDevice< USBDeviceHardware, , Motate::USBCDC > XIOUSBDevice_t;
typedef Motate::USBDevice< Motate::USBDeviceHardware, Motate::USBCDC > XIOUSBDevice_t;
#endif
#if USB_SERIAL_PORTS_EXPOSED == 2
typedef Motate::USBDevice< USBDeviceHardware, Motate::USBCDC, Motate::USBCDC > XIOUSBDevice_t;
typedef Motate::USBDevice< Motate::USBDeviceHardware, Motate::USBCDC, Motate::USBCDC > XIOUSBDevice_t;
#endif

extern XIOUSBDevice_t usb;
Expand Down

0 comments on commit fbad7f5

Please sign in to comment.