SmartBar
Loading...
Searching...
No Matches
main.c File Reference

: Main program body More...

#include "main.h"
#include "cmsis_os.h"
#include "cli.h"

Functions

void SystemClock_Config (void)
 System Clock Configuration.
 
void StartExecuteCommand (void *argument)
 Function implementing the ExecuteCommand thread.
 
int main (void)
 The application entry point.
 
void HAL_UART_RxCpltCallback (UART_HandleTypeDef *huart)
 Callback function for the UART reception.
 
void HAL_GPIO_EXTI_Callback (uint16_t GPIO_Pin)
 
void SelectInputChannel (uint8_t channel)
 Selects the input channel of the Mux.
 
void SelectOutputChannel (uint8_t channel)
 Selects the output channel of the DMux.
 
void HAL_TIM_PeriodElapsedCallback (TIM_HandleTypeDef *htim)
 Period elapsed callback in non blocking mode.
 
void Error_Handler (void)
 This function is executed in case of error occurrence.
 

Variables

TIM_HandleTypeDef htim3
 
TIM_HandleTypeDef htim15
 
TIM_HandleTypeDef htim16
 
TIM_HandleTypeDef htim17
 
UART_HandleTypeDef huart2
 
UART_HandleTypeDef huart3
 
osThreadId_t ExecuteCommandHandle
 
const osThreadAttr_t ExecuteCommand_attributes
 
volatile uint8_t enterPressed = 0
 
uint8_t textChar [2]
 
uint8_t rxIdx
 

Detailed Description

: Main program body

Attention

Copyright (c) 2024 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Function Documentation

◆ Error_Handler()

void Error_Handler ( void )

This function is executed in case of error occurrence.

Return values
None

◆ HAL_TIM_PeriodElapsedCallback()

void HAL_TIM_PeriodElapsedCallback ( TIM_HandleTypeDef * htim)

Period elapsed callback in non blocking mode.

Note
This function is called when TIM6 interrupt took place, inside HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment a global variable "uwTick" used as application time base.
Parameters
htim: TIM handle
Return values
None

◆ HAL_UART_RxCpltCallback()

void HAL_UART_RxCpltCallback ( UART_HandleTypeDef * huart)

Callback function for the UART reception.

This function is called when a character is received from the UART3 peripheral. The received character is stored in the rxBuffer and echoed back to the terminal console connected to the UART2 peripheral. Supports backspace and Enter characters.

Parameters
huart
Return values
None
Note
The expected UART instance to receive data is USART3, which is connected to the HC-05 Bluetooth module. The UART2 instance is used to echo the received characters back to the terminal console, which corresponds to the USB virtual COM port from the Nucleo board.

◆ main()

int main ( void )

The application entry point.

Return values
int

MOVER AQUƍ

◆ SelectInputChannel()

void SelectInputChannel ( uint8_t channel)

Selects the input channel of the Mux.

Sets the appropriate pin values to let a signal come from the desired channel, which can be 1 out 8 input channels

Parameters
channelChannel to be selected
Return values
None

◆ SelectOutputChannel()

void SelectOutputChannel ( uint8_t channel)

Selects the output channel of the DMux.

Sets the appropriate pin values to pass a signal through the desired channel, which can be 1 out 8 output channels

Parameters
channelChannel to be selected
Return values
None

◆ StartExecuteCommand()

void StartExecuteCommand ( void * argument)

Function implementing the ExecuteCommand thread.

Parameters
argument

◆ SystemClock_Config()

void SystemClock_Config ( void )

System Clock Configuration.

Return values
None

Initializes the RCC Oscillators according to the specified parameters in the RCC_OscInitTypeDef structure.

Initializes the CPU, AHB and APB buses clocks

Variable Documentation

◆ ExecuteCommand_attributes

const osThreadAttr_t ExecuteCommand_attributes
Initial value:
= {
.name = "ExecuteCommand",
.stack_size = 128 * 4,
.priority = (osPriority_t) osPriorityNormal,
}