2026.3.14
这个提交包含在:
266
src/drivers/encoder.c
普通文件
266
src/drivers/encoder.c
普通文件
@ -0,0 +1,266 @@
|
||||
|
||||
#include "encoder.h"
|
||||
|
||||
static volatile int16_t _encoder_delta[ENCODER_COUNT] = {0};
|
||||
|
||||
static void _encoder_gpio_init(void);
|
||||
static void _encoder_exti_init(void);
|
||||
static void _encoder_nvic_init(void);
|
||||
static void _encoder_handle_isr(uint8_t idx, uint16_t pin_a, uint16_t pin_b);
|
||||
|
||||
err_code_t encoder_init(void)
|
||||
{
|
||||
_encoder_gpio_init();
|
||||
_encoder_exti_init();
|
||||
_encoder_nvic_init();
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
static void _encoder_gpio_init(void)
|
||||
{
|
||||
GPIO_InitTypeDef gpio_init_struct;
|
||||
|
||||
RCC_APB2PeriphClockCmd(ENCODER_GPIO_CLK, ENABLE);
|
||||
RCC_APB2PeriphClockCmd(ENCODER_AFIO_CLK, ENABLE);
|
||||
|
||||
gpio_init_struct.GPIO_Mode = GPIO_Mode_IPU;
|
||||
gpio_init_struct.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
gpio_init_struct.GPIO_Pin = ENCODER_0_PIN_A | ENCODER_0_PIN_B |
|
||||
ENCODER_1_PIN_A | ENCODER_1_PIN_B |
|
||||
ENCODER_2_PIN_A | ENCODER_2_PIN_B |
|
||||
ENCODER_3_PIN_A | ENCODER_3_PIN_B |
|
||||
ENCODER_4_PIN_A | ENCODER_4_PIN_B |
|
||||
ENCODER_5_PIN_A | ENCODER_5_PIN_B;
|
||||
|
||||
GPIO_Init(ENCODER_GPIO_PORT, &gpio_init_struct);
|
||||
}
|
||||
|
||||
static void _encoder_exti_init(void)
|
||||
{
|
||||
EXTI_InitTypeDef exti_init_struct;
|
||||
|
||||
GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource0);
|
||||
GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource1);
|
||||
GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource2);
|
||||
GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource3);
|
||||
GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource4);
|
||||
GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource5);
|
||||
GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource6);
|
||||
GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource7);
|
||||
GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource10);
|
||||
GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource11);
|
||||
GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource12);
|
||||
GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource13);
|
||||
|
||||
exti_init_struct.EXTI_Line = EXTI_Line0 | EXTI_Line1 | EXTI_Line2 |
|
||||
EXTI_Line3 | EXTI_Line4 | EXTI_Line5 |
|
||||
EXTI_Line6 | EXTI_Line7 | EXTI_Line10 |
|
||||
EXTI_Line11 | EXTI_Line12 | EXTI_Line13;
|
||||
exti_init_struct.EXTI_LineCmd = ENABLE;
|
||||
exti_init_struct.EXTI_Mode = EXTI_Mode_Interrupt;
|
||||
exti_init_struct.EXTI_Trigger = EXTI_Trigger_Falling;
|
||||
|
||||
EXTI_Init(&exti_init_struct);
|
||||
}
|
||||
|
||||
static void _encoder_nvic_init(void)
|
||||
{
|
||||
NVIC_InitTypeDef nvic_init_struct;
|
||||
|
||||
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
|
||||
|
||||
nvic_init_struct.NVIC_IRQChannel = EXTI0_IRQn;
|
||||
nvic_init_struct.NVIC_IRQChannelCmd = ENABLE;
|
||||
nvic_init_struct.NVIC_IRQChannelPreemptionPriority = 1;
|
||||
nvic_init_struct.NVIC_IRQChannelSubPriority = 1;
|
||||
NVIC_Init(&nvic_init_struct);
|
||||
|
||||
nvic_init_struct.NVIC_IRQChannel = EXTI1_IRQn;
|
||||
nvic_init_struct.NVIC_IRQChannelSubPriority = 2;
|
||||
NVIC_Init(&nvic_init_struct);
|
||||
|
||||
nvic_init_struct.NVIC_IRQChannel = EXTI2_IRQn;
|
||||
nvic_init_struct.NVIC_IRQChannelSubPriority = 1;
|
||||
NVIC_Init(&nvic_init_struct);
|
||||
|
||||
nvic_init_struct.NVIC_IRQChannel = EXTI3_IRQn;
|
||||
nvic_init_struct.NVIC_IRQChannelSubPriority = 2;
|
||||
NVIC_Init(&nvic_init_struct);
|
||||
|
||||
nvic_init_struct.NVIC_IRQChannel = EXTI4_IRQn;
|
||||
nvic_init_struct.NVIC_IRQChannelSubPriority = 1;
|
||||
NVIC_Init(&nvic_init_struct);
|
||||
|
||||
nvic_init_struct.NVIC_IRQChannel = EXTI9_5_IRQn;
|
||||
nvic_init_struct.NVIC_IRQChannelSubPriority = 2;
|
||||
NVIC_Init(&nvic_init_struct);
|
||||
|
||||
nvic_init_struct.NVIC_IRQChannel = EXTI15_10_IRQn;
|
||||
nvic_init_struct.NVIC_IRQChannelSubPriority = 2;
|
||||
NVIC_Init(&nvic_init_struct);
|
||||
}
|
||||
|
||||
int16_t encoder_get_delta(encoder_idx_t idx)
|
||||
{
|
||||
int16_t temp;
|
||||
|
||||
if (idx >= ENCODER_COUNT)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
temp = _encoder_delta[idx];
|
||||
_encoder_delta[idx] = 0;
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
void encoder_clear_delta(encoder_idx_t idx)
|
||||
{
|
||||
if (idx < ENCODER_COUNT)
|
||||
{
|
||||
_encoder_delta[idx] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void _encoder_handle_isr(uint8_t idx, uint16_t pin_a, uint16_t pin_b)
|
||||
{
|
||||
if (GPIO_ReadInputDataBit(ENCODER_GPIO_PORT, pin_a) == RESET)
|
||||
{
|
||||
if (GPIO_ReadInputDataBit(ENCODER_GPIO_PORT, pin_b) == RESET)
|
||||
{
|
||||
_encoder_delta[idx]--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EXTI0_IRQHandler(void)
|
||||
{
|
||||
if (EXTI_GetITStatus(EXTI_Line0) == SET)
|
||||
{
|
||||
_encoder_handle_isr(0, ENCODER_0_PIN_A, ENCODER_0_PIN_B);
|
||||
EXTI_ClearITPendingBit(EXTI_Line0);
|
||||
}
|
||||
}
|
||||
|
||||
void EXTI1_IRQHandler(void)
|
||||
{
|
||||
if (EXTI_GetITStatus(EXTI_Line1) == SET)
|
||||
{
|
||||
if (GPIO_ReadInputDataBit(ENCODER_GPIO_PORT, ENCODER_0_PIN_B) == RESET)
|
||||
{
|
||||
if (GPIO_ReadInputDataBit(ENCODER_GPIO_PORT, ENCODER_0_PIN_A) == RESET)
|
||||
{
|
||||
_encoder_delta[0]++;
|
||||
}
|
||||
}
|
||||
EXTI_ClearITPendingBit(EXTI_Line1);
|
||||
}
|
||||
}
|
||||
|
||||
void EXTI2_IRQHandler(void)
|
||||
{
|
||||
if (EXTI_GetITStatus(EXTI_Line2) == SET)
|
||||
{
|
||||
_encoder_handle_isr(1, ENCODER_1_PIN_A, ENCODER_1_PIN_B);
|
||||
EXTI_ClearITPendingBit(EXTI_Line2);
|
||||
}
|
||||
}
|
||||
|
||||
void EXTI3_IRQHandler(void)
|
||||
{
|
||||
if (EXTI_GetITStatus(EXTI_Line3) == SET)
|
||||
{
|
||||
if (GPIO_ReadInputDataBit(ENCODER_GPIO_PORT, ENCODER_1_PIN_B) == RESET)
|
||||
{
|
||||
if (GPIO_ReadInputDataBit(ENCODER_GPIO_PORT, ENCODER_1_PIN_A) == RESET)
|
||||
{
|
||||
_encoder_delta[1]++;
|
||||
}
|
||||
}
|
||||
EXTI_ClearITPendingBit(EXTI_Line3);
|
||||
}
|
||||
}
|
||||
|
||||
void EXTI4_IRQHandler(void)
|
||||
{
|
||||
if (EXTI_GetITStatus(EXTI_Line4) == SET)
|
||||
{
|
||||
_encoder_handle_isr(2, ENCODER_2_PIN_A, ENCODER_2_PIN_B);
|
||||
EXTI_ClearITPendingBit(EXTI_Line4);
|
||||
}
|
||||
}
|
||||
|
||||
void EXTI9_5_IRQHandler(void)
|
||||
{
|
||||
if (EXTI_GetITStatus(EXTI_Line5) == SET)
|
||||
{
|
||||
if (GPIO_ReadInputDataBit(ENCODER_GPIO_PORT, ENCODER_2_PIN_B) == RESET)
|
||||
{
|
||||
if (GPIO_ReadInputDataBit(ENCODER_GPIO_PORT, ENCODER_2_PIN_A) == RESET)
|
||||
{
|
||||
_encoder_delta[2]++;
|
||||
}
|
||||
}
|
||||
EXTI_ClearITPendingBit(EXTI_Line5);
|
||||
}
|
||||
|
||||
if (EXTI_GetITStatus(EXTI_Line6) == SET)
|
||||
{
|
||||
_encoder_handle_isr(3, ENCODER_3_PIN_A, ENCODER_3_PIN_B);
|
||||
EXTI_ClearITPendingBit(EXTI_Line6);
|
||||
}
|
||||
|
||||
if (EXTI_GetITStatus(EXTI_Line7) == SET)
|
||||
{
|
||||
if (GPIO_ReadInputDataBit(ENCODER_GPIO_PORT, ENCODER_3_PIN_B) == RESET)
|
||||
{
|
||||
if (GPIO_ReadInputDataBit(ENCODER_GPIO_PORT, ENCODER_3_PIN_A) == RESET)
|
||||
{
|
||||
_encoder_delta[3]++;
|
||||
}
|
||||
}
|
||||
EXTI_ClearITPendingBit(EXTI_Line7);
|
||||
}
|
||||
}
|
||||
|
||||
void EXTI15_10_IRQHandler(void)
|
||||
{
|
||||
if (EXTI_GetITStatus(EXTI_Line10) == SET)
|
||||
{
|
||||
_encoder_handle_isr(4, ENCODER_4_PIN_A, ENCODER_4_PIN_B);
|
||||
EXTI_ClearITPendingBit(EXTI_Line10);
|
||||
}
|
||||
|
||||
if (EXTI_GetITStatus(EXTI_Line11) == SET)
|
||||
{
|
||||
if (GPIO_ReadInputDataBit(ENCODER_GPIO_PORT, ENCODER_4_PIN_B) == RESET)
|
||||
{
|
||||
if (GPIO_ReadInputDataBit(ENCODER_GPIO_PORT, ENCODER_4_PIN_A) == RESET)
|
||||
{
|
||||
_encoder_delta[4]++;
|
||||
}
|
||||
}
|
||||
EXTI_ClearITPendingBit(EXTI_Line11);
|
||||
}
|
||||
|
||||
if (EXTI_GetITStatus(EXTI_Line12) == SET)
|
||||
{
|
||||
_encoder_handle_isr(5, ENCODER_5_PIN_A, ENCODER_5_PIN_B);
|
||||
EXTI_ClearITPendingBit(EXTI_Line12);
|
||||
}
|
||||
|
||||
if (EXTI_GetITStatus(EXTI_Line13) == SET)
|
||||
{
|
||||
if (GPIO_ReadInputDataBit(ENCODER_GPIO_PORT, ENCODER_5_PIN_B) == RESET)
|
||||
{
|
||||
if (GPIO_ReadInputDataBit(ENCODER_GPIO_PORT, ENCODER_5_PIN_A) == RESET)
|
||||
{
|
||||
_encoder_delta[5]++;
|
||||
}
|
||||
}
|
||||
EXTI_ClearITPendingBit(EXTI_Line13);
|
||||
}
|
||||
}
|
||||
|
||||
42
src/drivers/encoder.h
普通文件
42
src/drivers/encoder.h
普通文件
@ -0,0 +1,42 @@
|
||||
|
||||
#ifndef __ENCODER_H
|
||||
#define __ENCODER_H
|
||||
|
||||
#include "stm32f10x.h"
|
||||
#include "../../common.h"
|
||||
|
||||
#define ENCODER_COUNT 6
|
||||
|
||||
#define ENCODER_GPIO_CLK RCC_APB2Periph_GPIOA
|
||||
#define ENCODER_AFIO_CLK RCC_APB2Periph_AFIO
|
||||
|
||||
#define ENCODER_0_PIN_A GPIO_Pin_0
|
||||
#define ENCODER_0_PIN_B GPIO_Pin_1
|
||||
#define ENCODER_1_PIN_A GPIO_Pin_2
|
||||
#define ENCODER_1_PIN_B GPIO_Pin_3
|
||||
#define ENCODER_2_PIN_A GPIO_Pin_4
|
||||
#define ENCODER_2_PIN_B GPIO_Pin_5
|
||||
#define ENCODER_3_PIN_A GPIO_Pin_6
|
||||
#define ENCODER_3_PIN_B GPIO_Pin_7
|
||||
#define ENCODER_4_PIN_A GPIO_Pin_10
|
||||
#define ENCODER_4_PIN_B GPIO_Pin_11
|
||||
#define ENCODER_5_PIN_A GPIO_Pin_12
|
||||
#define ENCODER_5_PIN_B GPIO_Pin_13
|
||||
|
||||
#define ENCODER_GPIO_PORT GPIOA
|
||||
|
||||
typedef enum {
|
||||
ENCODER_0 = 0,
|
||||
ENCODER_1 = 1,
|
||||
ENCODER_2 = 2,
|
||||
ENCODER_3 = 3,
|
||||
ENCODER_4 = 4,
|
||||
ENCODER_5 = 5
|
||||
} encoder_idx_t;
|
||||
|
||||
err_code_t encoder_init(void);
|
||||
int16_t encoder_get_delta(encoder_idx_t idx);
|
||||
void encoder_clear_delta(encoder_idx_t idx);
|
||||
|
||||
#endif
|
||||
|
||||
269
src/drivers/uart.c
普通文件
269
src/drivers/uart.c
普通文件
@ -0,0 +1,269 @@
|
||||
|
||||
#include "uart.h"
|
||||
|
||||
static volatile uint8_t _rx_data = 0;
|
||||
static volatile uint8_t _rx_flag = 0;
|
||||
|
||||
static void _uart_gpio_init(void);
|
||||
static void _uart_periph_init(void);
|
||||
static void _uart_nvic_init(void);
|
||||
|
||||
err_code_t uart_init(void)
|
||||
{
|
||||
_uart_gpio_init();
|
||||
_uart_periph_init();
|
||||
_uart_nvic_init();
|
||||
|
||||
USART_Cmd(UART_INSTANCE, ENABLE);
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
static void _uart_gpio_init(void)
|
||||
{
|
||||
GPIO_InitTypeDef gpio_init_struct;
|
||||
|
||||
RCC_APB2PeriphClockCmd(UART_GPIO_CLK, ENABLE);
|
||||
|
||||
gpio_init_struct.GPIO_Mode = GPIO_Mode_AF_PP;
|
||||
gpio_init_struct.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
gpio_init_struct.GPIO_Pin = UART_TX_PIN;
|
||||
GPIO_Init(UART_GPIO_PORT, &gpio_init_struct);
|
||||
|
||||
gpio_init_struct.GPIO_Mode = GPIO_Mode_IPU;
|
||||
gpio_init_struct.GPIO_Pin = UART_RX_PIN;
|
||||
GPIO_Init(UART_GPIO_PORT, &gpio_init_struct);
|
||||
}
|
||||
|
||||
static void _uart_periph_init(void)
|
||||
{
|
||||
USART_InitTypeDef usart_init_struct;
|
||||
|
||||
RCC_APB1PeriphClockCmd(UART_CLK, ENABLE);
|
||||
|
||||
usart_init_struct.USART_BaudRate = UART_BAUDRATE;
|
||||
usart_init_struct.USART_WordLength = UART_WORD_LENGTH;
|
||||
usart_init_struct.USART_StopBits = UART_STOP_BITS;
|
||||
usart_init_struct.USART_Parity = UART_PARITY;
|
||||
usart_init_struct.USART_Mode = UART_MODE;
|
||||
usart_init_struct.USART_HardwareFlowControl = UART_HW_FLOW_CTRL;
|
||||
|
||||
USART_Init(UART_INSTANCE, &usart_init_struct);
|
||||
|
||||
USART_ITConfig(UART_INSTANCE, USART_IT_RXNE, ENABLE);
|
||||
}
|
||||
|
||||
static void _uart_nvic_init(void)
|
||||
{
|
||||
NVIC_InitTypeDef nvic_init_struct;
|
||||
|
||||
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
|
||||
|
||||
nvic_init_struct.NVIC_IRQChannel = USART3_IRQn;
|
||||
nvic_init_struct.NVIC_IRQChannelCmd = ENABLE;
|
||||
nvic_init_struct.NVIC_IRQChannelPreemptionPriority = 2;
|
||||
nvic_init_struct.NVIC_IRQChannelSubPriority = 1;
|
||||
NVIC_Init(&nvic_init_struct);
|
||||
}
|
||||
|
||||
err_code_t uart_send_byte(uint8_t byte)
|
||||
{
|
||||
USART_SendData(UART_INSTANCE, byte);
|
||||
while (USART_GetFlagStatus(UART_INSTANCE, USART_FLAG_TXE) == RESET);
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
err_code_t uart_send_string(const char* str)
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
if (str == NULL)
|
||||
{
|
||||
return ERR_NULL_PTR;
|
||||
}
|
||||
|
||||
for (i = 0; str[i] != '\0'; i++)
|
||||
{
|
||||
uart_send_byte((uint8_t)str[i]);
|
||||
}
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
err_code_t uart_int_to_str(int32_t num, char* buffer, uint8_t buffer_size)
|
||||
{
|
||||
char temp[12];
|
||||
uint8_t i = 0, j = 0;
|
||||
uint8_t is_negative = 0;
|
||||
|
||||
if (buffer == NULL)
|
||||
{
|
||||
return ERR_NULL_PTR;
|
||||
}
|
||||
|
||||
if (buffer_size < 2)
|
||||
{
|
||||
return ERR_PARAM_INVALID;
|
||||
}
|
||||
|
||||
if (num < 0)
|
||||
{
|
||||
is_negative = 1;
|
||||
num = -num;
|
||||
}
|
||||
|
||||
if (num == 0)
|
||||
{
|
||||
temp[i++] = '0';
|
||||
}
|
||||
else
|
||||
{
|
||||
while (num > 0 && i < 11)
|
||||
{
|
||||
temp[i++] = '0' + (num % 10);
|
||||
num = num / 10;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_negative && i < 11)
|
||||
{
|
||||
temp[i++] = '-';
|
||||
}
|
||||
|
||||
if (i >= buffer_size)
|
||||
{
|
||||
i = buffer_size - 1;
|
||||
}
|
||||
|
||||
for (j = 0; j < i; j++)
|
||||
{
|
||||
buffer[j] = temp[i - j - 1];
|
||||
}
|
||||
buffer[j] = '\0';
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
err_code_t uart_float_to_str(float num, char* buffer, uint8_t buffer_size, uint8_t decimal_places)
|
||||
{
|
||||
char temp[30];
|
||||
int32_t int_part;
|
||||
int32_t dec_part;
|
||||
uint8_t i = 0, j = 0;
|
||||
uint8_t is_negative = 0;
|
||||
int32_t multiplier = 1;
|
||||
uint8_t k;
|
||||
int32_t temp_int;
|
||||
|
||||
if (buffer == NULL)
|
||||
{
|
||||
return ERR_NULL_PTR;
|
||||
}
|
||||
|
||||
if (buffer_size < 8)
|
||||
{
|
||||
return ERR_PARAM_INVALID;
|
||||
}
|
||||
|
||||
if (decimal_places > 6)
|
||||
{
|
||||
decimal_places = 6;
|
||||
}
|
||||
|
||||
for (k = 0; k < decimal_places; k++)
|
||||
{
|
||||
multiplier *= 10;
|
||||
}
|
||||
|
||||
if (num < -180.0f)
|
||||
{
|
||||
num = -180.0f;
|
||||
}
|
||||
if (num > 180.0f)
|
||||
{
|
||||
num = 180.0f;
|
||||
}
|
||||
|
||||
if (num < 0.0f)
|
||||
{
|
||||
is_negative = 1;
|
||||
num = -num;
|
||||
}
|
||||
|
||||
int_part = (int32_t)num;
|
||||
dec_part = (int32_t)((num - int_part) * multiplier + 0.5f);
|
||||
|
||||
if (dec_part >= multiplier)
|
||||
{
|
||||
dec_part -= multiplier;
|
||||
int_part++;
|
||||
}
|
||||
|
||||
temp_int = dec_part;
|
||||
for (k = 0; k < decimal_places; k++)
|
||||
{
|
||||
temp[i++] = '0' + (temp_int % 10);
|
||||
temp_int = temp_int / 10;
|
||||
}
|
||||
|
||||
temp[i++] = '.';
|
||||
|
||||
temp_int = int_part;
|
||||
if (temp_int == 0)
|
||||
{
|
||||
temp[i++] = '0';
|
||||
}
|
||||
else
|
||||
{
|
||||
while (temp_int > 0)
|
||||
{
|
||||
temp[i++] = '0' + (temp_int % 10);
|
||||
temp_int = temp_int / 10;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_negative)
|
||||
{
|
||||
temp[i++] = '-';
|
||||
}
|
||||
|
||||
if (i >= buffer_size)
|
||||
{
|
||||
i = buffer_size - 1;
|
||||
}
|
||||
|
||||
for (j = 0; j < i; j++)
|
||||
{
|
||||
buffer[j] = temp[i - j - 1];
|
||||
}
|
||||
buffer[j] = '\0';
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
uint8_t uart_get_received_flag(void)
|
||||
{
|
||||
return _rx_flag;
|
||||
}
|
||||
|
||||
uint8_t uart_get_received_data(void)
|
||||
{
|
||||
return _rx_data;
|
||||
}
|
||||
|
||||
void uart_clear_received_flag(void)
|
||||
{
|
||||
_rx_flag = 0;
|
||||
}
|
||||
|
||||
void USART3_IRQHandler(void)
|
||||
{
|
||||
if (USART_GetITStatus(UART_INSTANCE, USART_IT_RXNE) == SET)
|
||||
{
|
||||
_rx_data = USART_ReceiveData(UART_INSTANCE);
|
||||
_rx_flag = 1;
|
||||
USART_ClearITPendingBit(UART_INSTANCE, USART_IT_RXNE);
|
||||
}
|
||||
}
|
||||
|
||||
35
src/drivers/uart.h
普通文件
35
src/drivers/uart.h
普通文件
@ -0,0 +1,35 @@
|
||||
|
||||
#ifndef __UART_H
|
||||
#define __UART_H
|
||||
|
||||
#include "stm32f10x.h"
|
||||
#include "../../common.h"
|
||||
|
||||
#define UART_INSTANCE USART3
|
||||
#define UART_CLK RCC_APB1Periph_USART3
|
||||
#define UART_GPIO_CLK RCC_APB2Periph_GPIOB
|
||||
#define UART_GPIO_PORT GPIOB
|
||||
|
||||
#define UART_TX_PIN GPIO_Pin_10
|
||||
#define UART_RX_PIN GPIO_Pin_11
|
||||
|
||||
#define UART_BAUDRATE 9600
|
||||
#define UART_WORD_LENGTH USART_WordLength_8b
|
||||
#define UART_STOP_BITS USART_StopBits_1
|
||||
#define UART_PARITY USART_Parity_No
|
||||
#define UART_MODE USART_Mode_Rx | USART_Mode_Tx
|
||||
#define UART_HW_FLOW_CTRL USART_HardwareFlowControl_None
|
||||
|
||||
#define UART_INT_BUFF_SIZE 16
|
||||
|
||||
err_code_t uart_init(void);
|
||||
err_code_t uart_send_byte(uint8_t byte);
|
||||
err_code_t uart_send_string(const char* str);
|
||||
err_code_t uart_int_to_str(int32_t num, char* buffer, uint8_t buffer_size);
|
||||
err_code_t uart_float_to_str(float num, char* buffer, uint8_t buffer_size, uint8_t decimal_places);
|
||||
uint8_t uart_get_received_flag(void);
|
||||
uint8_t uart_get_received_data(void);
|
||||
void uart_clear_received_flag(void);
|
||||
|
||||
#endif
|
||||
|
||||
28
src/peripherals/delay.c
普通文件
28
src/peripherals/delay.c
普通文件
@ -0,0 +1,28 @@
|
||||
|
||||
#include "delay.h"
|
||||
|
||||
void delay_us(uint32_t us)
|
||||
{
|
||||
SysTick->LOAD = 72 * us;
|
||||
SysTick->VAL = 0x00;
|
||||
SysTick->CTRL = 0x00000005;
|
||||
while (!(SysTick->CTRL & 0x00010000));
|
||||
SysTick->CTRL = 0x00000004;
|
||||
}
|
||||
|
||||
void delay_ms(uint32_t ms)
|
||||
{
|
||||
while (ms--)
|
||||
{
|
||||
delay_us(1000);
|
||||
}
|
||||
}
|
||||
|
||||
void delay_s(uint32_t s)
|
||||
{
|
||||
while (s--)
|
||||
{
|
||||
delay_ms(1000);
|
||||
}
|
||||
}
|
||||
|
||||
15
src/peripherals/delay.h
普通文件
15
src/peripherals/delay.h
普通文件
@ -0,0 +1,15 @@
|
||||
|
||||
#ifndef __DELAY_H
|
||||
#define __DELAY_H
|
||||
|
||||
#include "stm32f10x.h"
|
||||
#include "../../common.h"
|
||||
|
||||
#define DELAY_SYSCLK_FREQ 72000000
|
||||
|
||||
void delay_us(uint32_t us);
|
||||
void delay_ms(uint32_t ms);
|
||||
void delay_s(uint32_t s);
|
||||
|
||||
#endif
|
||||
|
||||
291
src/peripherals/oled.c
普通文件
291
src/peripherals/oled.c
普通文件
@ -0,0 +1,291 @@
|
||||
|
||||
#include "oled.h"
|
||||
#include "delay.h"
|
||||
|
||||
static void _oled_i2c_init(void);
|
||||
static void _oled_i2c_start(void);
|
||||
static void _oled_i2c_stop(void);
|
||||
static void _oled_i2c_send_byte(uint8_t byte);
|
||||
static void _oled_write_cmd(uint8_t cmd);
|
||||
static void _oled_write_data(uint8_t data);
|
||||
static uint32_t _oled_pow(uint32_t x, uint32_t y);
|
||||
|
||||
err_code_t oled_init(void)
|
||||
{
|
||||
uint32_t i, j;
|
||||
|
||||
for (i = 0; i < 1000; i++)
|
||||
{
|
||||
for (j = 0; j < 1000; j++);
|
||||
}
|
||||
|
||||
_oled_i2c_init();
|
||||
|
||||
_oled_write_cmd(0xAE);
|
||||
_oled_write_cmd(0xD5);
|
||||
_oled_write_cmd(0x80);
|
||||
_oled_write_cmd(0xA8);
|
||||
_oled_write_cmd(0x3F);
|
||||
_oled_write_cmd(0xD3);
|
||||
_oled_write_cmd(0x00);
|
||||
_oled_write_cmd(0x40);
|
||||
_oled_write_cmd(0xA1);
|
||||
_oled_write_cmd(0xC8);
|
||||
_oled_write_cmd(0xDA);
|
||||
_oled_write_cmd(0x12);
|
||||
_oled_write_cmd(0x81);
|
||||
_oled_write_cmd(0xCF);
|
||||
_oled_write_cmd(0xD9);
|
||||
_oled_write_cmd(0xF1);
|
||||
_oled_write_cmd(0xDB);
|
||||
_oled_write_cmd(0x30);
|
||||
_oled_write_cmd(0xA4);
|
||||
_oled_write_cmd(0xA6);
|
||||
_oled_write_cmd(0x8D);
|
||||
_oled_write_cmd(0x14);
|
||||
_oled_write_cmd(0xAF);
|
||||
|
||||
oled_clear();
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
static void _oled_i2c_init(void)
|
||||
{
|
||||
GPIO_InitTypeDef gpio_init_struct;
|
||||
|
||||
RCC_APB2PeriphClockCmd(OLED_GPIO_CLK, ENABLE);
|
||||
|
||||
gpio_init_struct.GPIO_Mode = GPIO_Mode_Out_OD;
|
||||
gpio_init_struct.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
gpio_init_struct.GPIO_Pin = OLED_SCL_PIN;
|
||||
GPIO_Init(OLED_GPIO_PORT, &gpio_init_struct);
|
||||
|
||||
gpio_init_struct.GPIO_Pin = OLED_SDA_PIN;
|
||||
GPIO_Init(OLED_GPIO_PORT, &gpio_init_struct);
|
||||
|
||||
GPIO_WriteBit(OLED_GPIO_PORT, OLED_SCL_PIN, SET);
|
||||
GPIO_WriteBit(OLED_GPIO_PORT, OLED_SDA_PIN, SET);
|
||||
}
|
||||
|
||||
static void _oled_i2c_start(void)
|
||||
{
|
||||
GPIO_WriteBit(OLED_GPIO_PORT, OLED_SDA_PIN, SET);
|
||||
GPIO_WriteBit(OLED_GPIO_PORT, OLED_SCL_PIN, SET);
|
||||
GPIO_WriteBit(OLED_GPIO_PORT, OLED_SDA_PIN, RESET);
|
||||
GPIO_WriteBit(OLED_GPIO_PORT, OLED_SCL_PIN, RESET);
|
||||
}
|
||||
|
||||
static void _oled_i2c_stop(void)
|
||||
{
|
||||
GPIO_WriteBit(OLED_GPIO_PORT, OLED_SDA_PIN, RESET);
|
||||
GPIO_WriteBit(OLED_GPIO_PORT, OLED_SCL_PIN, SET);
|
||||
GPIO_WriteBit(OLED_GPIO_PORT, OLED_SDA_PIN, SET);
|
||||
}
|
||||
|
||||
static void _oled_i2c_send_byte(uint8_t byte)
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
GPIO_WriteBit(OLED_GPIO_PORT, OLED_SDA_PIN, (BitAction)!!(byte & (0x80 >> i)));
|
||||
GPIO_WriteBit(OLED_GPIO_PORT, OLED_SCL_PIN, SET);
|
||||
GPIO_WriteBit(OLED_GPIO_PORT, OLED_SCL_PIN, RESET);
|
||||
}
|
||||
|
||||
GPIO_WriteBit(OLED_GPIO_PORT, OLED_SCL_PIN, SET);
|
||||
GPIO_WriteBit(OLED_GPIO_PORT, OLED_SCL_PIN, RESET);
|
||||
}
|
||||
|
||||
static void _oled_write_cmd(uint8_t cmd)
|
||||
{
|
||||
_oled_i2c_start();
|
||||
_oled_i2c_send_byte(OLED_I2C_ADDR);
|
||||
_oled_i2c_send_byte(OLED_CMD);
|
||||
_oled_i2c_send_byte(cmd);
|
||||
_oled_i2c_stop();
|
||||
}
|
||||
|
||||
static void _oled_write_data(uint8_t data)
|
||||
{
|
||||
_oled_i2c_start();
|
||||
_oled_i2c_send_byte(OLED_I2C_ADDR);
|
||||
_oled_i2c_send_byte(OLED_DATA);
|
||||
_oled_i2c_send_byte(data);
|
||||
_oled_i2c_stop();
|
||||
}
|
||||
|
||||
void oled_set_cursor(uint8_t page, uint8_t column)
|
||||
{
|
||||
_oled_write_cmd(0xB0 | page);
|
||||
_oled_write_cmd(0x10 | ((column & 0xF0) >> 4));
|
||||
_oled_write_cmd(0x00 | (column & 0x0F));
|
||||
}
|
||||
|
||||
void oled_clear(void)
|
||||
{
|
||||
uint8_t i, j;
|
||||
|
||||
for (j = 0; j < OLED_PAGE_COUNT; j++)
|
||||
{
|
||||
oled_set_cursor(j, 0);
|
||||
for (i = 0; i < OLED_COLUMN_COUNT; i++)
|
||||
{
|
||||
_oled_write_data(0x00);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
err_code_t oled_show_char(uint8_t line, uint8_t column, char ch)
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
if (line < OLED_LINE_MIN || line > OLED_LINE_MAX ||
|
||||
column < OLED_COLUMN_MIN || column > OLED_COLUMN_MAX)
|
||||
{
|
||||
return ERR_PARAM_INVALID;
|
||||
}
|
||||
|
||||
if (ch < ' ' || ch > 0x7E)
|
||||
{
|
||||
return ERR_PARAM_INVALID;
|
||||
}
|
||||
|
||||
oled_set_cursor((line - 1) * 2, (column - 1) * 8);
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
_oled_write_data(OLED_F8x16[ch - ' '][i]);
|
||||
}
|
||||
|
||||
oled_set_cursor((line - 1) * 2 + 1, (column - 1) * 8);
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
_oled_write_data(OLED_F8x16[ch - ' '][i + 8]);
|
||||
}
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
err_code_t oled_show_string(uint8_t line, uint8_t column, const char* str)
|
||||
{
|
||||
uint8_t i;
|
||||
err_code_t err;
|
||||
|
||||
if (str == NULL)
|
||||
{
|
||||
return ERR_NULL_PTR;
|
||||
}
|
||||
|
||||
for (i = 0; str[i] != '\0'; i++)
|
||||
{
|
||||
err = oled_show_char(line, column + i, str[i]);
|
||||
if (err != ERR_OK)
|
||||
{
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
static uint32_t _oled_pow(uint32_t x, uint32_t y)
|
||||
{
|
||||
uint32_t result = 1;
|
||||
|
||||
while (y--)
|
||||
{
|
||||
result *= x;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
err_code_t oled_show_num(uint8_t line, uint8_t column, uint32_t num, uint8_t len)
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
if (len == 0 || len > 10)
|
||||
{
|
||||
return ERR_PARAM_INVALID;
|
||||
}
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
oled_show_char(line, column + i, num / _oled_pow(10, len - i - 1) % 10 + '0');
|
||||
}
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
err_code_t oled_show_signed_num(uint8_t line, uint8_t column, int32_t num, uint8_t len)
|
||||
{
|
||||
uint8_t i;
|
||||
uint32_t num1;
|
||||
|
||||
if (len == 0 || len > 10)
|
||||
{
|
||||
return ERR_PARAM_INVALID;
|
||||
}
|
||||
|
||||
if (num >= 0)
|
||||
{
|
||||
oled_show_char(line, column, '+');
|
||||
num1 = num;
|
||||
}
|
||||
else
|
||||
{
|
||||
oled_show_char(line, column, '-');
|
||||
num1 = -num;
|
||||
}
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
oled_show_char(line, column + i + 1, num1 / _oled_pow(10, len - i - 1) % 10 + '0');
|
||||
}
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
err_code_t oled_show_hex_num(uint8_t line, uint8_t column, uint32_t num, uint8_t len)
|
||||
{
|
||||
uint8_t i, single_num;
|
||||
|
||||
if (len == 0 || len > 8)
|
||||
{
|
||||
return ERR_PARAM_INVALID;
|
||||
}
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
single_num = num / _oled_pow(16, len - i - 1) % 16;
|
||||
if (single_num < 10)
|
||||
{
|
||||
oled_show_char(line, column + i, single_num + '0');
|
||||
}
|
||||
else
|
||||
{
|
||||
oled_show_char(line, column + i, single_num - 10 + 'A');
|
||||
}
|
||||
}
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
err_code_t oled_show_bin_num(uint8_t line, uint8_t column, uint32_t num, uint8_t len)
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
if (len == 0 || len > 16)
|
||||
{
|
||||
return ERR_PARAM_INVALID;
|
||||
}
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
oled_show_char(line, column + i, num / _oled_pow(2, len - i - 1) % 2 + '0');
|
||||
}
|
||||
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
39
src/peripherals/oled.h
普通文件
39
src/peripherals/oled.h
普通文件
@ -0,0 +1,39 @@
|
||||
|
||||
#ifndef __OLED_H
|
||||
#define __OLED_H
|
||||
|
||||
#include "stm32f10x.h"
|
||||
#include "../../common.h"
|
||||
#include "oled_font.h"
|
||||
|
||||
#define OLED_GPIO_CLK RCC_APB2Periph_GPIOB
|
||||
#define OLED_GPIO_PORT GPIOB
|
||||
#define OLED_SCL_PIN GPIO_Pin_8
|
||||
#define OLED_SDA_PIN GPIO_Pin_9
|
||||
|
||||
#define OLED_I2C_ADDR 0x78
|
||||
#define OLED_CMD 0x00
|
||||
#define OLED_DATA 0x40
|
||||
|
||||
#define OLED_WIDTH 128
|
||||
#define OLED_HEIGHT 64
|
||||
#define OLED_PAGE_COUNT 8
|
||||
#define OLED_COLUMN_COUNT 128
|
||||
|
||||
#define OLED_LINE_MIN 1
|
||||
#define OLED_LINE_MAX 4
|
||||
#define OLED_COLUMN_MIN 1
|
||||
#define OLED_COLUMN_MAX 16
|
||||
|
||||
err_code_t oled_init(void);
|
||||
void oled_clear(void);
|
||||
void oled_set_cursor(uint8_t page, uint8_t column);
|
||||
err_code_t oled_show_char(uint8_t line, uint8_t column, char ch);
|
||||
err_code_t oled_show_string(uint8_t line, uint8_t column, const char* str);
|
||||
err_code_t oled_show_num(uint8_t line, uint8_t column, uint32_t num, uint8_t len);
|
||||
err_code_t oled_show_signed_num(uint8_t line, uint8_t column, int32_t num, uint8_t len);
|
||||
err_code_t oled_show_hex_num(uint8_t line, uint8_t column, uint32_t num, uint8_t len);
|
||||
err_code_t oled_show_bin_num(uint8_t line, uint8_t column, uint32_t num, uint8_t len);
|
||||
|
||||
#endif
|
||||
|
||||
293
src/peripherals/oled_font.h
普通文件
293
src/peripherals/oled_font.h
普通文件
@ -0,0 +1,293 @@
|
||||
#ifndef __OLED_FONT_H
|
||||
#define __OLED_FONT_H
|
||||
|
||||
/*OLED字模库,宽8像素,高16像素*/
|
||||
const uint8_t OLED_F8x16[][16]=
|
||||
{
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// 0
|
||||
|
||||
0x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x33,0x30,0x00,0x00,0x00,//! 1
|
||||
|
||||
0x00,0x10,0x0C,0x06,0x10,0x0C,0x06,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//" 2
|
||||
|
||||
0x40,0xC0,0x78,0x40,0xC0,0x78,0x40,0x00,
|
||||
0x04,0x3F,0x04,0x04,0x3F,0x04,0x04,0x00,//# 3
|
||||
|
||||
0x00,0x70,0x88,0xFC,0x08,0x30,0x00,0x00,
|
||||
0x00,0x18,0x20,0xFF,0x21,0x1E,0x00,0x00,//$ 4
|
||||
|
||||
0xF0,0x08,0xF0,0x00,0xE0,0x18,0x00,0x00,
|
||||
0x00,0x21,0x1C,0x03,0x1E,0x21,0x1E,0x00,//% 5
|
||||
|
||||
0x00,0xF0,0x08,0x88,0x70,0x00,0x00,0x00,
|
||||
0x1E,0x21,0x23,0x24,0x19,0x27,0x21,0x10,//& 6
|
||||
|
||||
0x10,0x16,0x0E,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//' 7
|
||||
|
||||
0x00,0x00,0x00,0xE0,0x18,0x04,0x02,0x00,
|
||||
0x00,0x00,0x00,0x07,0x18,0x20,0x40,0x00,//( 8
|
||||
|
||||
0x00,0x02,0x04,0x18,0xE0,0x00,0x00,0x00,
|
||||
0x00,0x40,0x20,0x18,0x07,0x00,0x00,0x00,//) 9
|
||||
|
||||
0x40,0x40,0x80,0xF0,0x80,0x40,0x40,0x00,
|
||||
0x02,0x02,0x01,0x0F,0x01,0x02,0x02,0x00,//* 10
|
||||
|
||||
0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,
|
||||
0x01,0x01,0x01,0x1F,0x01,0x01,0x01,0x00,//+ 11
|
||||
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x80,0xB0,0x70,0x00,0x00,0x00,0x00,0x00,//, 12
|
||||
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,//- 13
|
||||
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,//. 14
|
||||
|
||||
0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x04,
|
||||
0x00,0x60,0x18,0x06,0x01,0x00,0x00,0x00,/// 15
|
||||
|
||||
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,
|
||||
0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,//0 16
|
||||
|
||||
0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,
|
||||
0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//1 17
|
||||
|
||||
0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,
|
||||
0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,//2 18
|
||||
|
||||
0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,
|
||||
0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00,//3 19
|
||||
|
||||
0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,
|
||||
0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00,//4 20
|
||||
|
||||
0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,
|
||||
0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00,//5 21
|
||||
|
||||
0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,
|
||||
0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00,//6 22
|
||||
|
||||
0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,
|
||||
0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,//7 23
|
||||
|
||||
0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,
|
||||
0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00,//8 24
|
||||
|
||||
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,
|
||||
0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00,//9 25
|
||||
|
||||
0x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,//: 26
|
||||
|
||||
0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x80,0x60,0x00,0x00,0x00,0x00,//; 27
|
||||
|
||||
0x00,0x00,0x80,0x40,0x20,0x10,0x08,0x00,
|
||||
0x00,0x01,0x02,0x04,0x08,0x10,0x20,0x00,//< 28
|
||||
|
||||
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,
|
||||
0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x00,//= 29
|
||||
|
||||
0x00,0x08,0x10,0x20,0x40,0x80,0x00,0x00,
|
||||
0x00,0x20,0x10,0x08,0x04,0x02,0x01,0x00,//> 30
|
||||
|
||||
0x00,0x70,0x48,0x08,0x08,0x08,0xF0,0x00,
|
||||
0x00,0x00,0x00,0x30,0x36,0x01,0x00,0x00,//? 31
|
||||
|
||||
0xC0,0x30,0xC8,0x28,0xE8,0x10,0xE0,0x00,
|
||||
0x07,0x18,0x27,0x24,0x23,0x14,0x0B,0x00,//@ 32
|
||||
|
||||
0x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,
|
||||
0x20,0x3C,0x23,0x02,0x02,0x27,0x38,0x20,//A 33
|
||||
|
||||
0x08,0xF8,0x88,0x88,0x88,0x70,0x00,0x00,
|
||||
0x20,0x3F,0x20,0x20,0x20,0x11,0x0E,0x00,//B 34
|
||||
|
||||
0xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,
|
||||
0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00,//C 35
|
||||
|
||||
0x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,
|
||||
0x20,0x3F,0x20,0x20,0x20,0x10,0x0F,0x00,//D 36
|
||||
|
||||
0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,
|
||||
0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00,//E 37
|
||||
|
||||
0x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,
|
||||
0x20,0x3F,0x20,0x00,0x03,0x00,0x00,0x00,//F 38
|
||||
|
||||
0xC0,0x30,0x08,0x08,0x08,0x38,0x00,0x00,
|
||||
0x07,0x18,0x20,0x20,0x22,0x1E,0x02,0x00,//G 39
|
||||
|
||||
0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,
|
||||
0x20,0x3F,0x21,0x01,0x01,0x21,0x3F,0x20,//H 40
|
||||
|
||||
0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0x00,
|
||||
0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//I 41
|
||||
|
||||
0x00,0x00,0x08,0x08,0xF8,0x08,0x08,0x00,
|
||||
0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,0x00,//J 42
|
||||
|
||||
0x08,0xF8,0x88,0xC0,0x28,0x18,0x08,0x00,
|
||||
0x20,0x3F,0x20,0x01,0x26,0x38,0x20,0x00,//K 43
|
||||
|
||||
0x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,
|
||||
0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00,//L 44
|
||||
|
||||
0x08,0xF8,0xF8,0x00,0xF8,0xF8,0x08,0x00,
|
||||
0x20,0x3F,0x00,0x3F,0x00,0x3F,0x20,0x00,//M 45
|
||||
|
||||
0x08,0xF8,0x30,0xC0,0x00,0x08,0xF8,0x08,
|
||||
0x20,0x3F,0x20,0x00,0x07,0x18,0x3F,0x00,//N 46
|
||||
|
||||
0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,
|
||||
0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00,//O 47
|
||||
|
||||
0x08,0xF8,0x08,0x08,0x08,0x08,0xF0,0x00,
|
||||
0x20,0x3F,0x21,0x01,0x01,0x01,0x00,0x00,//P 48
|
||||
|
||||
0xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,
|
||||
0x0F,0x18,0x24,0x24,0x38,0x50,0x4F,0x00,//Q 49
|
||||
|
||||
0x08,0xF8,0x88,0x88,0x88,0x88,0x70,0x00,
|
||||
0x20,0x3F,0x20,0x00,0x03,0x0C,0x30,0x20,//R 50
|
||||
|
||||
0x00,0x70,0x88,0x08,0x08,0x08,0x38,0x00,
|
||||
0x00,0x38,0x20,0x21,0x21,0x22,0x1C,0x00,//S 51
|
||||
|
||||
0x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,
|
||||
0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//T 52
|
||||
|
||||
0x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,
|
||||
0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//U 53
|
||||
|
||||
0x08,0x78,0x88,0x00,0x00,0xC8,0x38,0x08,
|
||||
0x00,0x00,0x07,0x38,0x0E,0x01,0x00,0x00,//V 54
|
||||
|
||||
0xF8,0x08,0x00,0xF8,0x00,0x08,0xF8,0x00,
|
||||
0x03,0x3C,0x07,0x00,0x07,0x3C,0x03,0x00,//W 55
|
||||
|
||||
0x08,0x18,0x68,0x80,0x80,0x68,0x18,0x08,
|
||||
0x20,0x30,0x2C,0x03,0x03,0x2C,0x30,0x20,//X 56
|
||||
|
||||
0x08,0x38,0xC8,0x00,0xC8,0x38,0x08,0x00,
|
||||
0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//Y 57
|
||||
|
||||
0x10,0x08,0x08,0x08,0xC8,0x38,0x08,0x00,
|
||||
0x20,0x38,0x26,0x21,0x20,0x20,0x18,0x00,//Z 58
|
||||
|
||||
0x00,0x00,0x00,0xFE,0x02,0x02,0x02,0x00,
|
||||
0x00,0x00,0x00,0x7F,0x40,0x40,0x40,0x00,//[ 59
|
||||
|
||||
0x00,0x0C,0x30,0xC0,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x01,0x06,0x38,0xC0,0x00,//\ 60
|
||||
|
||||
0x00,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,
|
||||
0x00,0x40,0x40,0x40,0x7F,0x00,0x00,0x00,//] 61
|
||||
|
||||
0x00,0x00,0x04,0x02,0x02,0x02,0x04,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//^ 62
|
||||
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,//_ 63
|
||||
|
||||
0x00,0x02,0x02,0x04,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//` 64
|
||||
|
||||
0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,
|
||||
0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20,//a 65
|
||||
|
||||
0x08,0xF8,0x00,0x80,0x80,0x00,0x00,0x00,
|
||||
0x00,0x3F,0x11,0x20,0x20,0x11,0x0E,0x00,//b 66
|
||||
|
||||
0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,
|
||||
0x00,0x0E,0x11,0x20,0x20,0x20,0x11,0x00,//c 67
|
||||
|
||||
0x00,0x00,0x00,0x80,0x80,0x88,0xF8,0x00,
|
||||
0x00,0x0E,0x11,0x20,0x20,0x10,0x3F,0x20,//d 68
|
||||
|
||||
0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,
|
||||
0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00,//e 69
|
||||
|
||||
0x00,0x80,0x80,0xF0,0x88,0x88,0x88,0x18,
|
||||
0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//f 70
|
||||
|
||||
0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,
|
||||
0x00,0x6B,0x94,0x94,0x94,0x93,0x60,0x00,//g 71
|
||||
|
||||
0x08,0xF8,0x00,0x80,0x80,0x80,0x00,0x00,
|
||||
0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//h 72
|
||||
|
||||
0x00,0x80,0x98,0x98,0x00,0x00,0x00,0x00,
|
||||
0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//i 73
|
||||
|
||||
0x00,0x00,0x00,0x80,0x98,0x98,0x00,0x00,
|
||||
0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,//j 74
|
||||
|
||||
0x08,0xF8,0x00,0x00,0x80,0x80,0x80,0x00,
|
||||
0x20,0x3F,0x24,0x02,0x2D,0x30,0x20,0x00,//k 75
|
||||
|
||||
0x00,0x08,0x08,0xF8,0x00,0x00,0x00,0x00,
|
||||
0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//l 76
|
||||
|
||||
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,
|
||||
0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F,//m 77
|
||||
|
||||
0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,
|
||||
0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//n 78
|
||||
|
||||
0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,
|
||||
0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//o 79
|
||||
|
||||
0x80,0x80,0x00,0x80,0x80,0x00,0x00,0x00,
|
||||
0x80,0xFF,0xA1,0x20,0x20,0x11,0x0E,0x00,//p 80
|
||||
|
||||
0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00,
|
||||
0x00,0x0E,0x11,0x20,0x20,0xA0,0xFF,0x80,//q 81
|
||||
|
||||
0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x00,
|
||||
0x20,0x20,0x3F,0x21,0x20,0x00,0x01,0x00,//r 82
|
||||
|
||||
0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,
|
||||
0x00,0x33,0x24,0x24,0x24,0x24,0x19,0x00,//s 83
|
||||
|
||||
0x00,0x80,0x80,0xE0,0x80,0x80,0x00,0x00,
|
||||
0x00,0x00,0x00,0x1F,0x20,0x20,0x00,0x00,//t 84
|
||||
|
||||
0x80,0x80,0x00,0x00,0x00,0x80,0x80,0x00,
|
||||
0x00,0x1F,0x20,0x20,0x20,0x10,0x3F,0x20,//u 85
|
||||
|
||||
0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,
|
||||
0x00,0x01,0x0E,0x30,0x08,0x06,0x01,0x00,//v 86
|
||||
|
||||
0x80,0x80,0x00,0x80,0x00,0x80,0x80,0x80,
|
||||
0x0F,0x30,0x0C,0x03,0x0C,0x30,0x0F,0x00,//w 87
|
||||
|
||||
0x00,0x80,0x80,0x00,0x80,0x80,0x80,0x00,
|
||||
0x00,0x20,0x31,0x2E,0x0E,0x31,0x20,0x00,//x 88
|
||||
|
||||
0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,
|
||||
0x80,0x81,0x8E,0x70,0x18,0x06,0x01,0x00,//y 89
|
||||
|
||||
0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,
|
||||
0x00,0x21,0x30,0x2C,0x22,0x21,0x30,0x00,//z 90
|
||||
|
||||
0x00,0x00,0x00,0x00,0x80,0x7C,0x02,0x02,
|
||||
0x00,0x00,0x00,0x00,0x00,0x3F,0x40,0x40,//{ 91
|
||||
|
||||
0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,//| 92
|
||||
|
||||
0x00,0x02,0x02,0x7C,0x80,0x00,0x00,0x00,
|
||||
0x00,0x40,0x40,0x3F,0x00,0x00,0x00,0x00,//} 93
|
||||
|
||||
0x00,0x06,0x01,0x01,0x02,0x02,0x04,0x04,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//~ 94
|
||||
};
|
||||
|
||||
#endif
|
||||
在新工单中引用
屏蔽一个用户