Programmable Clock with RTOS 0.0.1
Implementaiton of a programmable clock using RTOS with STM32GO microcontroller.
Loading...
Searching...
No Matches
bsp.h
Go to the documentation of this file.
1
6
7#ifndef BSP_H_
8#define BSP_H_
9
10#include "FreeRTOS.h"
11#include "SEGGER_RTT.h"
12#include "stm32g0xx.h"
13#include "task.h"
14#include "queue.h"
15#include "timers.h"
16#include <stdint.h>
17
21typedef struct
22{
23 uint8_t Data[ 8 ];
25
26
30typedef struct _APP_TmTypeDef
31{
32 uint32_t tm_sec;
33 uint32_t tm_min;
34 uint32_t tm_hour;
35 uint32_t tm_mday;
36 uint32_t tm_mon;
37 uint32_t tm_year;
38 uint32_t tm_wday;
39 uint32_t tm_yday;
40 uint32_t tm_isdst;
41 uint32_t tm_min_alarm;
42 uint32_t tm_hour_alarm;
44
53
57extern FDCAN_HandleTypeDef CANHandler;
58
73
85
97
98/*Queue identifier to use*/
99extern QueueHandle_t serialQueue; /* Serial Queue identifier to use in the serial machine. */
100extern QueueHandle_t clockQueue; /* Serial Queue identifier to use in the clock machine */
101extern QueueHandle_t displayQueue; /* Serial Queue identifier to use in the display machine. */
102
103extern TimerHandle_t xTimerDisplay; /* Struct for handling Display Software timer */
104
105extern RTC_HandleTypeDef RtcHandler; /* Struct for handling RTC peripheral Declared in bsp */
106
107#endif
RTC_HandleTypeDef RtcHandler
Struct for handling RTC peripheral Declared in bsp.
Definition app_clock.c:32
TimerHandle_t xTimerDisplay
Struct for handling Software timer.
Definition app_clock.c:44
FDCAN_HandleTypeDef CANHandler
Structure type variable for CAN handler.
Definition app_serial.c:29
QueueHandle_t serialQueue
Serial Queue identifier to use in the serial machine.
Definition main.c:44
QueueHandle_t clockQueue
Serial Queue identifier to use in the clock machine.
Definition main.c:48
APP_Messages
Enum with message types used as events.
Definition bsp.h:63
@ SERIAL_MSG_DATE
Definition bsp.h:65
@ DISPLAY_ALARM
Definition bsp.h:71
@ SERIAL_MSG_ALARM
Definition bsp.h:64
@ ERROR_STATE
Definition bsp.h:69
@ OK_STATE
Definition bsp.h:68
@ CLOCK_MSG_PRINT
Definition bsp.h:67
@ SERIAL_MSG_TIME
Definition bsp.h:66
@ DISPLAY_MSG_ALARM_A
Definition bsp.h:70
Display_M
Enum with message types used as events for unit testing.
Definition bsp.h:78
@ DISPLAY_3
Definition bsp.h:83
@ DISPLAY_2
Definition bsp.h:82
@ DISPLAY_MSG_TIME
Definition bsp.h:79
@ DISPLAY_1
Definition bsp.h:81
@ DISPLAY_IDLE_STATE
Definition bsp.h:80
MACHINE_State
Enum with states for state machines.
Definition bsp.h:90
@ CLOCK_STATE_PRINT
Definition bsp.h:94
@ CLOCK_STATE_DATE
Definition bsp.h:92
@ CLOCK_STATE_IDLE
Definition bsp.h:95
@ CLOCK_STATE_TIME
Definition bsp.h:93
@ CLOCK_STATE_ALARM
Definition bsp.h:91
QueueHandle_t displayQueue
Serial Queue identifier to use in the display machine.
Definition main.c:52
struct _APP_MsgTypeDef APP_MsgTypeDef
Struct with the msg element.
struct _APP_TmTypeDef APP_TmTypeDef
Struct with the date, time and alarm elements.
Struct with array to queue.
Definition bsp.h:22
uint8_t Data[8]
Definition bsp.h:23
Struct with the msg element.
Definition bsp.h:49
APP_TmTypeDef tm
Definition bsp.h:51
uint8_t msg
Definition bsp.h:50
Struct with the date, time and alarm elements.
Definition bsp.h:31
uint32_t tm_min
Definition bsp.h:33
uint32_t tm_hour
Definition bsp.h:34
uint32_t tm_year
Definition bsp.h:37
uint32_t tm_mday
Definition bsp.h:35
uint32_t tm_min_alarm
Definition bsp.h:41
uint32_t tm_sec
Definition bsp.h:32
uint32_t tm_mon
Definition bsp.h:36
uint32_t tm_hour_alarm
Definition bsp.h:42
uint32_t tm_yday
Definition bsp.h:39
uint32_t tm_isdst
Definition bsp.h:40
uint32_t tm_wday
Definition bsp.h:38