暂存
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,4 @@
|
||||
# dot files
|
||||
/.vscode/launch.json
|
||||
/.settings
|
||||
/.eide/log
|
||||
/.eide.usr.ctx.json
|
||||
|
||||
19
.vscode/launch.json
vendored
Normal file
19
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"cwd": "${workspaceRoot}",
|
||||
"type": "cortex-debug",
|
||||
"request": "launch",
|
||||
"name": "openocd",
|
||||
"servertype": "openocd",
|
||||
"executable": "build\\BC3D\\BC3D.elf",
|
||||
"runToEntryPoint": "main",
|
||||
"configFiles": [
|
||||
"interface/cmsis-dap.cfg",
|
||||
"target/at32f413xx.cfg"
|
||||
],
|
||||
"toolchainPrefix": "arm-none-eabi",
|
||||
}
|
||||
]
|
||||
}
|
||||
44
BC3D.ATWP
44
BC3D.ATWP
@@ -18,6 +18,14 @@
|
||||
<ParametersSub name="RSAW" value="CAN_RSAW_1TQ"/>
|
||||
</Parameters>
|
||||
</CAN1>
|
||||
<CRM>
|
||||
<Mode>
|
||||
<ModeSub name="HEXT" value="HEXT-External-Oscillator"/>
|
||||
</Mode>
|
||||
<Parameters>
|
||||
<ParametersSub name="HEXT" value="HEXT_CRYSTAL"/>
|
||||
</Parameters>
|
||||
</CRM>
|
||||
<DEBUG>
|
||||
<Mode>
|
||||
<ModeSub name="Debug interface" value="SWD"/>
|
||||
@@ -39,14 +47,6 @@
|
||||
<ModeSub name="Activated" value="TRUE"/>
|
||||
</Mode>
|
||||
</TMR3>
|
||||
<TMR9>
|
||||
<Mode>
|
||||
<ModeSub name="Channel2 mode" value="Output_CH2"/>
|
||||
<ModeSub name="Subordinate mode" value="Clock Mode"/>
|
||||
<ModeSub name="Sub-mode input selection" value="SubModeInput_IS2"/>
|
||||
<ModeSub name="Activated" value="TRUE"/>
|
||||
</Mode>
|
||||
</TMR9>
|
||||
<TMR10>
|
||||
<Mode>
|
||||
<ModeSub name="Channel1 mode" value="Output_without_pin"/>
|
||||
@@ -75,12 +75,6 @@
|
||||
<USART2_IRQHandler>0;0;0</USART2_IRQHandler>
|
||||
</NVIC>
|
||||
<GPIO>
|
||||
<Signal SignalName="GPIO_Input" PinName="PB10">
|
||||
<Parameters name="Label" value="SW_IN2"/>
|
||||
</Signal>
|
||||
<Signal SignalName="GPIO_Input" PinName="PB11">
|
||||
<Parameters name="Label" value="SW_IN1"/>
|
||||
</Signal>
|
||||
<Signal SignalName="GPIO_Output" PinName="PB12">
|
||||
<Parameters name="Label" value="MODE2"/>
|
||||
</Signal>
|
||||
@@ -90,22 +84,22 @@
|
||||
<Signal SignalName="GPIO_Output" PinName="PB14">
|
||||
<Parameters name="Label" value="MODE0"/>
|
||||
</Signal>
|
||||
<Signal SignalName="TMR9_CH2" PinName="PB15">
|
||||
<Parameters name="Label" value="STEP"/>
|
||||
<Signal SignalName="GPIO_Output" PinName="PB15">
|
||||
<Parameters name="Label" value="CLK"/>
|
||||
</Signal>
|
||||
<Signal SignalName="GPIO_Output" PinName="PA8">
|
||||
<Parameters name="Label" value="DIR"/>
|
||||
</Signal>
|
||||
<Signal SignalName="GPIO_Analog" PinName="PA9">
|
||||
<Signal SignalName="GPIO_Output" PinName="PA9">
|
||||
<Parameters name="Label" value="EN"/>
|
||||
</Signal>
|
||||
</GPIO>
|
||||
<ClockConfiguration>
|
||||
<rtcsel>0</rtcsel>
|
||||
<hext>8.000000</hext>
|
||||
<pllhextdiv>0</pllhextdiv>
|
||||
<pllrcs>1</pllrcs>
|
||||
<pllmult>50</pllmult>
|
||||
<hext>16.000000</hext>
|
||||
<pllhextdiv>1</pllhextdiv>
|
||||
<pllrcs>0</pllrcs>
|
||||
<pllmult>25</pllmult>
|
||||
<sclkselect>1</sclkselect>
|
||||
<ahbdiv>1</ahbdiv>
|
||||
<apb1div>2</apb1div>
|
||||
@@ -118,6 +112,8 @@
|
||||
<adcdiv>4</adcdiv>
|
||||
</ClockConfiguration>
|
||||
<PINInfo>
|
||||
<PinSub pinname="PD0/HEXT_IN" signalname="CRM_HEXT_IN" signaltype="2"/>
|
||||
<PinSub pinname="PD1/HEXT_OUT" signalname="CRM_HEXT_OUT" signaltype="2"/>
|
||||
<PinSub pinname="PA2" signalname="USART2_TX" signaltype="2"/>
|
||||
<PinSub pinname="PA3" signalname="USART2_RX" signaltype="2"/>
|
||||
<PinSub pinname="PA5" signalname="EXINT5" signaltype="3"/>
|
||||
@@ -128,9 +124,9 @@
|
||||
<PinSub pinname="PB12" signalname="GPIO_Output" signaltype="3"/>
|
||||
<PinSub pinname="PB13" signalname="GPIO_Output" signaltype="3"/>
|
||||
<PinSub pinname="PB14" signalname="GPIO_Output" signaltype="3"/>
|
||||
<PinSub pinname="PB15" signalname="TMR9_CH2" signaltype="2"/>
|
||||
<PinSub pinname="PB15" signalname="GPIO_Output" signaltype="3"/>
|
||||
<PinSub pinname="PA8" signalname="GPIO_Output" signaltype="3"/>
|
||||
<PinSub pinname="PA9" signalname="GPIO_Analog" signaltype="3"/>
|
||||
<PinSub pinname="PA9" signalname="GPIO_Output" signaltype="3"/>
|
||||
<PinSub pinname="PA13" signalname="DEBUG_JTMS_SWDIO" signaltype="2"/>
|
||||
<PinSub pinname="PA14" signalname="DEBUG_JTCK_SWCLK" signaltype="2"/>
|
||||
<PinSub pinname="PB8" signalname="CAN1_RX" signaltype="2"/>
|
||||
@@ -143,7 +139,7 @@
|
||||
<KeepUserCode>true</KeepUserCode>
|
||||
<MinHeapSize>0x200</MinHeapSize>
|
||||
<MinStackSize>0x400</MinStackSize>
|
||||
<UseFirmware>true</UseFirmware>
|
||||
<UseFirmware>false</UseFirmware>
|
||||
<PackageVersion>V2.1.3</PackageVersion>
|
||||
</ProjectInfomation>
|
||||
</Root>
|
||||
|
||||
41
app/by_stepper.c
Normal file
41
app/by_stepper.c
Normal file
@@ -0,0 +1,41 @@
|
||||
#include "by_stepper.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <dwt_delay.h>
|
||||
#include "by_debug.h"
|
||||
|
||||
// TODO 是否增加一个动作列表?一般都比较简单吧
|
||||
|
||||
struct by_stepper_t {
|
||||
uint8_t dir;
|
||||
stepper_speed_t speed;
|
||||
};
|
||||
|
||||
struct by_stepper_t by_stepper;
|
||||
|
||||
void by_stepper_init(void)
|
||||
{
|
||||
memset(&by_stepper, 0x00, sizeof(by_stepper));
|
||||
}
|
||||
|
||||
void by_stepper_set_dir(uint8_t dir)
|
||||
{
|
||||
by_stepper.dir = dir;
|
||||
}
|
||||
|
||||
void by_stepper_set_speed(stepper_speed_t speed)
|
||||
{
|
||||
by_stepper.speed = speed;
|
||||
}
|
||||
|
||||
void by_stepper_run(void)
|
||||
{
|
||||
// 根据预设条件发送脉冲
|
||||
gpio_bits_write(GPIOA, GPIO_PINS_8, by_stepper.dir ? TRUE : FALSE); // DIR
|
||||
gpio_bits_write(GPIOB, GPIO_PINS_15, !gpio_output_data_bit_read(GPIOB, GPIO_PINS_15)); // CLK
|
||||
DWT_Delay(40U * (uint16_t)by_stepper.speed);
|
||||
}
|
||||
|
||||
void by_stepper_stop(void)
|
||||
{
|
||||
}
|
||||
10
app/by_stepper.h
Normal file
10
app/by_stepper.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#include "at32f413.h"
|
||||
|
||||
typedef enum stepper_speed_t {
|
||||
STEPPER_SPEED_DIV0 = 0,
|
||||
STEPPER_SPEED_DIV2 = 2,
|
||||
STEPPER_SPEED_DIV4 = 4,
|
||||
STEPPER_SPEED_DIV8 = 8,
|
||||
STEPPER_SPEED_DIV16 = 16,
|
||||
STEPPER_SPEED_DIV32 = 32
|
||||
} stepper_speed_t;
|
||||
@@ -39,7 +39,7 @@ extern "C" {
|
||||
*
|
||||
*/
|
||||
#if !defined HEXT_VALUE
|
||||
#define HEXT_VALUE ((uint32_t)8000000) /*!< value of the high speed exernal crystal in hz */
|
||||
#define HEXT_VALUE ((uint32_t)16000000) /*!< value of the high speed exernal crystal in hz */
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -56,18 +56,14 @@ extern "C" {
|
||||
/* add user code end exported macro */
|
||||
|
||||
/* Private defines -------------------------------------------------------------*/
|
||||
#define SW_IN2_PIN GPIO_PINS_10
|
||||
#define SW_IN2_GPIO_PORT GPIOB
|
||||
#define SW_IN1_PIN GPIO_PINS_11
|
||||
#define SW_IN1_GPIO_PORT GPIOB
|
||||
#define MODE2_PIN GPIO_PINS_12
|
||||
#define MODE2_GPIO_PORT GPIOB
|
||||
#define MODE1_PIN GPIO_PINS_13
|
||||
#define MODE1_GPIO_PORT GPIOB
|
||||
#define MODE0_PIN GPIO_PINS_14
|
||||
#define MODE0_GPIO_PORT GPIOB
|
||||
#define STEP_PIN GPIO_PINS_15
|
||||
#define STEP_GPIO_PORT GPIOB
|
||||
#define CLK_PIN GPIO_PINS_15
|
||||
#define CLK_GPIO_PORT GPIOB
|
||||
#define DIR_PIN GPIO_PINS_8
|
||||
#define DIR_GPIO_PORT GPIOA
|
||||
#define EN_PIN GPIO_PINS_9
|
||||
@@ -104,9 +100,6 @@ extern "C" {
|
||||
/* init tmr3 function. */
|
||||
void wk_tmr3_init(void);
|
||||
|
||||
/* init tmr9 function. */
|
||||
void wk_tmr9_init(void);
|
||||
|
||||
/* init tmr10 function. */
|
||||
void wk_tmr10_init(void);
|
||||
|
||||
|
||||
@@ -64,8 +64,9 @@
|
||||
/**
|
||||
* @brief system clock config program
|
||||
* @note the system clock is configured as follow:
|
||||
* system clock (sclk) = hick / 12 * pll_mult
|
||||
* system clock source = HICK_VALUE
|
||||
* system clock (sclk) = hext / 2 * pll_mult
|
||||
* system clock source = HEXT_VALUE
|
||||
* - hext = HEXT_VALUE
|
||||
* - sclk = 200000000
|
||||
* - ahbdiv = 1
|
||||
* - ahbclk = 200000000
|
||||
@@ -73,7 +74,7 @@
|
||||
* - apb1clk = 100000000
|
||||
* - apb2div = 2
|
||||
* - apb2clk = 100000000
|
||||
* - pll_mult = 50
|
||||
* - pll_mult = 25
|
||||
* - pll_range = GT72MHZ (greater than 72 mhz)
|
||||
* @param none
|
||||
* @retval none
|
||||
@@ -91,6 +92,14 @@ void wk_system_clock_config(void)
|
||||
{
|
||||
}
|
||||
|
||||
/* enable hext */
|
||||
crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
|
||||
|
||||
/* wait till hext is ready */
|
||||
while(crm_hext_stable_wait() == ERROR)
|
||||
{
|
||||
}
|
||||
|
||||
/* enable hick */
|
||||
crm_clock_source_enable(CRM_CLOCK_SOURCE_HICK, TRUE);
|
||||
|
||||
@@ -100,7 +109,7 @@ void wk_system_clock_config(void)
|
||||
}
|
||||
|
||||
/* config pll clock resource */
|
||||
crm_pll_config(CRM_PLL_SOURCE_HICK, CRM_PLL_MULT_50, CRM_PLL_OUTPUT_RANGE_GT72MHZ);
|
||||
crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_25, CRM_PLL_OUTPUT_RANGE_GT72MHZ);
|
||||
|
||||
/* enable pll */
|
||||
crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
|
||||
@@ -153,12 +162,12 @@ void wk_periph_clock_config(void)
|
||||
/* enable gpiob periph clock */
|
||||
crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
|
||||
|
||||
/* enable gpiod periph clock */
|
||||
crm_periph_clock_enable(CRM_GPIOD_PERIPH_CLOCK, TRUE);
|
||||
|
||||
/* enable tmr1 periph clock */
|
||||
crm_periph_clock_enable(CRM_TMR1_PERIPH_CLOCK, TRUE);
|
||||
|
||||
/* enable tmr9 periph clock */
|
||||
crm_periph_clock_enable(CRM_TMR9_PERIPH_CLOCK, TRUE);
|
||||
|
||||
/* enable tmr10 periph clock */
|
||||
crm_periph_clock_enable(CRM_TMR10_PERIPH_CLOCK, TRUE);
|
||||
|
||||
@@ -213,33 +222,27 @@ void wk_gpio_config(void)
|
||||
|
||||
/* gpio input config */
|
||||
gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
|
||||
gpio_init_struct.gpio_pins = SW_IN2_PIN | SW_IN1_PIN;
|
||||
gpio_init_struct.gpio_pins = GPIO_PINS_10 | GPIO_PINS_11;
|
||||
gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
|
||||
gpio_init(GPIOB, &gpio_init_struct);
|
||||
|
||||
/* gpio output config */
|
||||
gpio_bits_reset(GPIOB, MODE2_PIN | MODE1_PIN | MODE0_PIN);
|
||||
gpio_bits_reset(DIR_GPIO_PORT, DIR_PIN);
|
||||
gpio_bits_reset(GPIOB, MODE2_PIN | MODE1_PIN | MODE0_PIN | CLK_PIN);
|
||||
gpio_bits_reset(GPIOA, DIR_PIN | EN_PIN);
|
||||
|
||||
gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_MODERATE;
|
||||
gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
|
||||
gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
|
||||
gpio_init_struct.gpio_pins = MODE2_PIN | MODE1_PIN | MODE0_PIN;
|
||||
gpio_init_struct.gpio_pins = MODE2_PIN | MODE1_PIN | MODE0_PIN | CLK_PIN;
|
||||
gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
|
||||
gpio_init(GPIOB, &gpio_init_struct);
|
||||
|
||||
gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_MODERATE;
|
||||
gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
|
||||
gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
|
||||
gpio_init_struct.gpio_pins = DIR_PIN;
|
||||
gpio_init_struct.gpio_pins = DIR_PIN | EN_PIN;
|
||||
gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
|
||||
gpio_init(DIR_GPIO_PORT, &gpio_init_struct);
|
||||
|
||||
/* gpio analog config */
|
||||
gpio_init_struct.gpio_mode = GPIO_MODE_ANALOG;
|
||||
gpio_init_struct.gpio_pins = EN_PIN;
|
||||
gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
|
||||
gpio_init(EN_GPIO_PORT, &gpio_init_struct);
|
||||
gpio_init(GPIOA, &gpio_init_struct);
|
||||
|
||||
/* add user code begin gpio_config 2 */
|
||||
|
||||
@@ -436,67 +439,6 @@ void wk_tmr3_init(void)
|
||||
/* add user code end tmr3_init 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief init tmr9 function.
|
||||
* @param none
|
||||
* @retval none
|
||||
*/
|
||||
void wk_tmr9_init(void)
|
||||
{
|
||||
/* add user code begin tmr9_init 0 */
|
||||
|
||||
/* add user code end tmr9_init 0 */
|
||||
|
||||
gpio_init_type gpio_init_struct;
|
||||
tmr_output_config_type tmr_output_struct;
|
||||
gpio_default_para_init(&gpio_init_struct);
|
||||
|
||||
/* add user code begin tmr9_init 1 */
|
||||
|
||||
/* add user code end tmr9_init 1 */
|
||||
|
||||
/* configure the CH2 pin */
|
||||
gpio_init_struct.gpio_pins = STEP_PIN;
|
||||
gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
|
||||
gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
|
||||
gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
|
||||
gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_MODERATE;
|
||||
gpio_init(STEP_GPIO_PORT, &gpio_init_struct);
|
||||
|
||||
/* GPIO PIN remap */
|
||||
gpio_pin_remap_config(TMR9_GMUX, TRUE);
|
||||
|
||||
/* configure counter settings */
|
||||
tmr_base_init(TMR9, 65535, 0);
|
||||
tmr_cnt_dir_set(TMR9, TMR_COUNT_UP);
|
||||
tmr_clock_source_div_set(TMR9, TMR_CLOCK_DIV1);
|
||||
tmr_period_buffer_enable(TMR9, FALSE);
|
||||
|
||||
/* configure sub-mode */
|
||||
tmr_sub_mode_select(TMR9, TMR_SUB_EXTERNAL_CLOCK_MODE_A);
|
||||
|
||||
/* configure sub-mode input */
|
||||
tmr_trigger_input_select(TMR9, TMR_SUB_INPUT_SEL_IS2);
|
||||
|
||||
/* configure channel 2 output settings */
|
||||
tmr_output_struct.oc_mode = TMR_OUTPUT_CONTROL_OFF;
|
||||
tmr_output_struct.oc_output_state = TRUE;
|
||||
tmr_output_struct.occ_output_state = FALSE;
|
||||
tmr_output_struct.oc_polarity = TMR_OUTPUT_ACTIVE_HIGH;
|
||||
tmr_output_struct.occ_polarity = TMR_OUTPUT_ACTIVE_HIGH;
|
||||
tmr_output_struct.oc_idle_state = FALSE;
|
||||
tmr_output_struct.occ_idle_state = FALSE;
|
||||
tmr_output_channel_config(TMR9, TMR_SELECT_CHANNEL_2, &tmr_output_struct);
|
||||
tmr_channel_value_set(TMR9, TMR_SELECT_CHANNEL_2, 0);
|
||||
tmr_output_channel_buffer_enable(TMR9, TMR_SELECT_CHANNEL_2, FALSE);
|
||||
|
||||
tmr_counter_enable(TMR9, TRUE);
|
||||
|
||||
/* add user code begin tmr9_init 2 */
|
||||
|
||||
/* add user code end tmr9_init 2 */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief init tmr10 function.
|
||||
* @param none
|
||||
|
||||
@@ -29,7 +29,10 @@
|
||||
|
||||
/* private includes ----------------------------------------------------------*/
|
||||
/* add user code begin private includes */
|
||||
#include "dwt_delay.h"
|
||||
|
||||
#include "by_debug.h"
|
||||
#include "by_can.h"
|
||||
/* add user code end private includes */
|
||||
|
||||
/* private typedef -----------------------------------------------------------*/
|
||||
@@ -63,59 +66,66 @@
|
||||
/* add user code end 0 */
|
||||
|
||||
/**
|
||||
* @brief main function.
|
||||
* @param none
|
||||
* @retval none
|
||||
*/
|
||||
* @brief main function.
|
||||
* @param none
|
||||
* @retval none
|
||||
*/
|
||||
int main(void)
|
||||
{
|
||||
/* add user code begin 1 */
|
||||
/* add user code begin 1 */
|
||||
by_debug_init();
|
||||
/* add user code end 1 */
|
||||
|
||||
/* system clock config. */
|
||||
wk_system_clock_config();
|
||||
/* system clock config. */
|
||||
wk_system_clock_config();
|
||||
|
||||
/* config periph clock. */
|
||||
wk_periph_clock_config();
|
||||
/* config periph clock. */
|
||||
wk_periph_clock_config();
|
||||
|
||||
/* init debug function. */
|
||||
wk_debug_config();
|
||||
/* init debug function. */
|
||||
wk_debug_config();
|
||||
|
||||
/* nvic config. */
|
||||
wk_nvic_config();
|
||||
/* nvic config. */
|
||||
wk_nvic_config();
|
||||
|
||||
/* init usart2 function. */
|
||||
wk_usart2_init();
|
||||
/* init usart2 function. */
|
||||
wk_usart2_init();
|
||||
|
||||
/* init exint function. */
|
||||
wk_exint_config();
|
||||
/* init exint function. */
|
||||
wk_exint_config();
|
||||
|
||||
/* init tmr1 function. */
|
||||
wk_tmr1_init();
|
||||
/* init tmr1 function. */
|
||||
wk_tmr1_init();
|
||||
|
||||
/* init tmr3 function. */
|
||||
wk_tmr3_init();
|
||||
/* init tmr3 function. */
|
||||
wk_tmr3_init();
|
||||
|
||||
/* init tmr9 function. */
|
||||
wk_tmr9_init();
|
||||
/* init tmr10 function. */
|
||||
wk_tmr10_init();
|
||||
|
||||
/* init tmr10 function. */
|
||||
wk_tmr10_init();
|
||||
/* init can1 function. */
|
||||
wk_can1_init();
|
||||
|
||||
/* init can1 function. */
|
||||
wk_can1_init();
|
||||
/* init gpio function. */
|
||||
wk_gpio_config();
|
||||
|
||||
/* init gpio function. */
|
||||
wk_gpio_config();
|
||||
/* add user code begin 2 */
|
||||
DWT_Init();
|
||||
|
||||
/* add user code begin 2 */
|
||||
LOGD("hello world");
|
||||
/* add user code end 2 */
|
||||
|
||||
while (1) {
|
||||
/* add user code begin 3 */
|
||||
gpio_bits_write(GPIOB, GPIO_PINS_12, FALSE); // MODE2
|
||||
gpio_bits_write(GPIOB, GPIO_PINS_13, TRUE); // MODE1
|
||||
gpio_bits_write(GPIOB, GPIO_PINS_14, TRUE); // MODE0
|
||||
gpio_bits_write(GPIOA, GPIO_PINS_9, FALSE); // EN
|
||||
gpio_bits_write(GPIOA, GPIO_PINS_8, TRUE); // DIR
|
||||
gpio_bits_write(GPIOB, GPIO_PINS_15, TRUE); // CLK
|
||||
/* add user code end 2 */
|
||||
|
||||
while(1)
|
||||
{
|
||||
/* add user code begin 3 */
|
||||
DWT_Delay(40);
|
||||
/* add user code end 3 */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user