资源简介
移植自GIT上开源的GRBL代码,众所周知,GRBL官方代码是在AVR328P上运行的,328P极不方便调试,这里移植到stm32,方便调试,仿真,编译有些警告,无大碍,程序可以直接使用。
代码片段和文件信息
/*
coolant_control.c - coolant control methods
Part of Grbl
The MIT License (MIT)
GRBL(tm) - embedded CNC g-code interpreter and motion-controller
Copyright (c) 2012 Sungeun K. Jeon
Permission is hereby granted free of charge to any person obtaining a copy
of this software and associated documentation files (the “Software“) to deal
in the Software without restriction including without limitation the rights
to use copy modify merge publish distribute sublicense and/or sell
copies of the Software and to permit persons to whom the Software is
furnished to do so subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR
IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
//#include “coolant_control.h“
//#include “settings.h“
//#include “config.h“
//#include “planner.h“
#include “include.h“
//#include
static uint8_t current_coolant_mode;
void coolant_init()
{
current_coolant_mode = COOLANT_DISABLE;
//==========================================
// #if ENABLE_M7
// COOLANT_MIST_DDR |= (1 << COOLANT_MIST_BIT);
// #endif
// COOLANT_FLOOD_DDR |= (1 << COOLANT_FLOOD_BIT);
/*-------HW_GPIO_Init()--------*/
//==========================================
coolant_stop();
}
void coolant_stop()
{
#ifdef ENABLE_M7
//==========================================
// COOLANT_MIST_PORT &= ~(1 << COOLANT_MIST_BIT); //喷雾控制引脚=0
HW_GPIO_OUT(COOLANT_GPIOxCOOLANT_MIST_PIN0);
//==========================================
#endif
//==========================================
// COOLANT_FLOOD_PORT &= ~(1 << COOLANT_FLOOD_BIT); //冷却流控制引脚=0
HW_GPIO_OUT(COOLANT_GPIOxCOOLANT_FLOOD_PIN0);
//==========================================
}
void coolant_run(uint8_t mode)
{
if (mode != current_coolant_mode)
{
plan_synchronize(); // Ensure coolant turns on when specified in program.
if (mode == COOLANT_FLOOD_ENABLE) {
//==========================================
// COOLANT_FLOOD_PORT |= (1 << COOLANT_FLOOD_BIT); //冷却流控制引脚=1
HW_GPIO_OUT(COOLANT_GPIOxCOOLANT_FLOOD_PIN1);
//==========================================
#ifdef ENABLE_M7
} else if (mode == COOLANT_MIST_ENABLE) {
//==========================================
// COOLANT_MIST_PORT |= (1 << COOLANT_MIST_BIT); //喷雾控制引脚=1
HW_GPIO_OUT(COOLANT_GPIOxCOOLANT_MIST_PIN1);
//==========================================
#endif
} else {
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 10308 2008-09-21 13:21 start\cortexm3_macro.s
文件 12871 2008-09-21 13:21 start\stm32f10x_vector.s
文件 3681 2015-12-26 02:02 SYSTEM\delay.c
文件 640 2015-12-26 02:02 SYSTEM\delay.h
文件 3596 2015-12-24 14:14 SYSTEM\system.c
文件 2872 2015-12-24 14:14 SYSTEM\system.h
文件 3002 2015-12-31 00:51 user\main.c
文件 25304 2015-12-24 19:01 user\stm32f10x_it.c
文件 3842 2008-09-21 13:21 user\stm32f10x_it.h
文件 20861 2018-06-11 18:13 temp.uvproj
文件 12653 2015-12-31 00:02 GRBL\config.h
文件 3094 2015-12-26 01:58 GRBL\coolant_control.c
文件 1549 2015-12-26 02:47 GRBL\coolant_control.h
文件 9425 2015-12-29 22:26 GRBL\defaults.h
文件 6129 2015-12-26 02:08 GRBL\eeprom.c
文件 1598 2015-12-26 03:14 GRBL\eeprom.h
文件 29216 2015-12-27 18:07 GRBL\gcode.c
文件 5086 2015-12-26 02:47 GRBL\gcode.h
文件 4579 2015-12-20 23:37 GRBL\GRBL_main_.txt
文件 4019 2018-06-11 18:12 GRBL\include.h
文件 15128 2015-12-28 02:46 GRBL\limits.c
文件 1476 2015-12-26 02:48 GRBL\limits.h
文件 15351 2015-12-26 13:46 GRBL\motion_control.c
文件 2558 2015-12-26 02:47 GRBL\motion_control.h
文件 4934 2015-12-26 03:12 GRBL\nuts_bolts.c
文件 5222 2015-12-26 02:45 GRBL\nuts_bolts.h
文件 11261 2015-12-26 13:25 GRBL\pin_map.h
文件 25927 2015-12-27 01:15 GRBL\planner.c
文件 4511 2015-12-26 02:43 GRBL\planner.h
文件 4326 2015-12-27 22:47 GRBL\print.c
............此处省略90个文件信息
相关资源
- STM32 led 时钟
- STM32 2.4G通信例程
- 直流无刷电机方波驱动 stm32 例程代码
- STM32中文资料
- STM32蓝牙和串口程序
- STM32f103超声波模块例程
- stm32f103c8t6 4 oled.rar
- stm32f030 IAP Demo(原创)
- STM32基于rt_thread操作系统的SDHC卡文件
- NRF24L01实现51与STM32双向通讯
- STM32F103 串口程序(完整版)
- stm32 ds18b20 温度传感器 测试通过
- stm32官方例程
- STM32F103定时器中断程序
- [免费]基于stm32f103ze 的OLED驱动代码
- STM32F103RBT6驱动UC1698控制芯片的160160黑
- STM32F103 DS18B20 V3.5.0固件库驱动程序工
- STM32定时器使用入门。看了这个程序会
- SIM908 SDIO FSMC STM32 FIFO
- STM32F103 CC2500完整驱动(模拟SPI)
- AD7606采集程序
- stm32 用SPI 方式读写 SDHC
- stm32通过DMA方式采集ADC数据
- 意法半导体STM全系列微控制器STM32ST
- 基于STM32芯片的SX1278 驱动 LORA.rar
- STM32的PCB封装库,以及原理图库,48
- SX1280.rar
- STM32 DS3231驱动.zip
- STM32F103C8T6+NRF24l01无线通信
- 21天学会嵌入式开发STM32.zip
评论
共有 条评论