-
大小: 6.53MB文件类型: .rar金币: 1下载: 0 次发布日期: 2023-09-24
- 语言: 其他
- 标签: Grbl-STM32
资源简介
1.Grbl-v9.0j移植到开发板STM32F107VC(旺宝金龙开发板);
2.旺宝金龙STM32F107VC开发板,使用串口2(如果需要可以修改到串口1);
3.通过keil5编译测试通过(使用标准F10x标准库-库版本v3.5.0);
代码片段和文件信息
/*
coolant_control.c - coolant control methods
Part of Grbl
Copyright (c) 2012-2015 Sungeun K. Jeon
Grbl is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation either version 3 of the License or
(at your option) any later version.
Grbl is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Grbl. If not see .
*/
#include “grbl.h“
#if defined(CPU_MAP_ATMEGA328P) || defined(CPU_MAP_ATMEGA2560)
void coolant_init(void)
{
COOLANT_FLOOD_DDR |= (1 << COOLANT_FLOOD_BIT);
#ifdef ENABLE_M7
COOLANT_MIST_DDR |= (1 << COOLANT_MIST_BIT);
#endif
coolant_stop();
}
void coolant_stop(void)
{
COOLANT_FLOOD_PORT &= ~(1 << COOLANT_FLOOD_BIT);
#ifdef ENABLE_M7
COOLANT_MIST_PORT &= ~(1 << COOLANT_MIST_BIT);
#endif
}
void coolant_set_state(uint8_t mode)
{
if (mode == COOLANT_FLOOD_ENABLE) {
COOLANT_FLOOD_PORT |= (1 << COOLANT_FLOOD_BIT);
#ifdef ENABLE_M7
} else if (mode == COOLANT_MIST_ENABLE) {
COOLANT_MIST_PORT |= (1 << COOLANT_MIST_BIT);
#endif
} else {
coolant_stop();
}
}
#endif //end of CPU_MAP_ATMEGA328P & CPU_MAP_ATMEGA2560
#if defined(CPU_MAP_STM32F10X)
void coolant_init(void) //冷却引脚初始化
{
HW_GPIO_Init_Out(COOLANT_FLOOD_GPIO_CLKCOOLANT_FLOOD_GPIOCOOLANT_FLOOD_GPIO_PIN);
#ifdef ENABLE_M7
HW_GPIO_Init_Out(COOLANT_MIST_GPIO_CLKCOOLANT_MIST_GPIOCOOLANT_MIST_GPIO_PIN);
#endif
coolant_stop();
}
void coolant_stop(void) //冷却关闭
{
HW_GPIO_Write(COOLANT_FLOOD_GPIOCOOLANT_FLOOD_GPIO_PIN0); //流冷却引脚置0
#ifdef ENABLE_M7
HW_GPIO_Write(COOLANT_MIST_GPIOCOOLANT_MIST_GPIO_PIN0); //雾冷却引脚置0
#endif
}
void coolant_set_state(uint8_t mode) //冷却设置状态
{
if (mode == COOLANT_FLOOD_ENABLE) {
HW_GPIO_Write(COOLANT_FLOOD_GPIOCOOLANT_FLOOD_GPIO_PIN1); //流冷却引脚置1
#ifdef ENABLE_M7
} else if (mode == COOLANT_MIST_ENABLE) {
HW_GPIO_Write(COOLANT_MIST_GPIOCOOLANT_MIST_GPIO_PIN1); //雾冷却引脚置1
#endif
} else {
coolant_stop();
}
}
#endif //end of CPU_MAP_STM32F10X
void coolant_run(uint8_t mode)
{
if (sys.state == STATE_CHECK_MODE) { return; }
protocol_buffer_synchronize(); // Ensure coolant turns on when specified in program.
coolant_set_state(mode);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 498 2014-03-21 10:25 STM32_USART_GRBL-v9.0\Doc\information.txt
文件 49282 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\config.h
文件 2680 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\coolant_control.c
文件 906 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\coolant_control.h
文件 5577 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\cpu_map\cpu_map_atmega2560.h
文件 6328 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\cpu_map\cpu_map_atmega328p.h
文件 6803 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\cpu_map\cpu_map_stm32f10x.h
文件 1792 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\cpu_map.h
文件 2812 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\defaults\defaults_generic.h
文件 2851 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\defaults\defaults_oxcnc.h
文件 3262 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\defaults\defaults_shapeoko.h
文件 3221 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\defaults\defaults_shapeoko2.h
文件 3167 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\defaults\defaults_shapeoko3.h
文件 3194 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\defaults\defaults_sherline.h
文件 2895 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\defaults\defaults_simulator.h
文件 3233 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\defaults\defaults_x_carve_1000mm.h
文件 3233 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\defaults\defaults_x_carve_500mm.h
文件 3251 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\defaults\defaults_zen_toolworks_7x7.h
文件 3542 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\defaults.h
文件 6445 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\eeprom.c
文件 1062 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\eeprom.h
文件 59882 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\gcode.c
文件 8136 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\gcode.h
文件 1867 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\grbl.h
文件 21259 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\limits.c
文件 1246 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\limits.h
文件 3297 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\main.txt
文件 17902 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\motion_control.c
文件 2752 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\motion_control.h
文件 4310 2017-04-08 01:40 STM32_USART_GRBL-v9.0\GRBL\nuts_bolts.c
............此处省略295个文件信息
- 上一篇:P400-840数传使用调试手册
- 下一篇:随机信号分析与处理课件罗鹏飞
评论
共有 条评论