37 lines
870 B
C
37 lines
870 B
C
#ifndef HC_04_H
|
|
#define HC_04_H
|
|
|
|
/* Scheduler include files. */
|
|
#include "FreeRTOS.h"
|
|
#include "task.h"
|
|
#include "semphr.h"
|
|
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include "pico/stdlib.h"
|
|
#include "hardware/gpio.h"
|
|
#include "hardware/clocks.h"
|
|
#include "hardware/watchdog.h"
|
|
#include "pico/multicore.h"
|
|
#include "hardware/i2c.h"
|
|
#include "pico/binary_info.h"
|
|
#include "hardware/uart.h"
|
|
#include "hardware/pwm.h"
|
|
#include "hardware/adc.h"
|
|
#include "uart_rx.pio.h"
|
|
#include "uart_tx.pio.h"
|
|
|
|
#define HC_04_PIO pio0
|
|
#define HC_04_PIO_TX_PIN 12 // 接 HC-04 (RX) PIN (需要反着接)
|
|
#define HC_04_PIO_RX_PIN 13 // 接 HC-04 (TX) PIN
|
|
#define HC_04_PIO_SM_TX 2
|
|
#define HC_04_PIO_SM_RX 3
|
|
#define HC_04_PIO_SERIAL_BAUD 9600
|
|
|
|
extern int HC_04_UART_INIT();
|
|
extern void HC_04_UART_WRITE(void *p);
|
|
extern void HC_04_UART_READ(void *p);
|
|
extern void HC_04(void *p);
|
|
|
|
#endif
|