Paparazzi UAS  v6.2_unstable
Paparazzi is a free software Unmanned Aircraft System.
mcu_arch.c File Reference
#include "ch.h"
#include "hal.h"
#include "mcu.h"
+ Include dependency graph for mcu_arch.c:

Go to the source code of this file.

Enumerations

enum  rtc_boot_magic {
  RTC_BOOT_OFF = 0, RTC_BOOT_HOLD = 0xb0070001, RTC_BOOT_FAST = 0xb0070002, RTC_BOOT_CANBL = 0xb0080000,
  RTC_BOOT_FWOK = 0xb0093a26
}
 RTC backup register values. More...
 

Functions

static void mcu_deep_sleep (void)
 Put MCU into deep sleep mode. More...
 
void mcu_arch_init (void)
 Initialize the specific archittecture functions. More...
 
void mcu_reboot (enum reboot_state_t reboot_state)
 Reboot the MCU. More...
 
void mcu_energy_save (void)
 Save energy for performing operations on shutdown Used for example to shutdown SD-card logging. More...
 

Detailed Description

Microcontroller initialization function for ChibiOS

ChibiOS initialized peripherals by itself, only interrupt vector has to be relocated for Luftboot

Definition in file mcu_arch.c.

Enumeration Type Documentation

◆ rtc_boot_magic

RTC backup register values.

Enumerator
RTC_BOOT_OFF 

Normal boot.

RTC_BOOT_HOLD 

Hold in bootloader, do not boot application.

RTC_BOOT_FAST 

No timeout in bootloader.

RTC_BOOT_CANBL 

CAN bootloader, ORd with 8 bit local node ID.

RTC_BOOT_FWOK 

indicates FW ran for 30s

Definition at line 107 of file mcu_arch.c.

Function Documentation

◆ mcu_arch_init()

void mcu_arch_init ( void  )

Initialize the specific archittecture functions.

Definition at line 124 of file mcu_arch.c.

Referenced by mcu_init().

+ Here is the caller graph for this function:

◆ mcu_deep_sleep()

static void mcu_deep_sleep ( void  )
static

Put MCU into deep sleep mode.

This can be used when closing the SD log files right after a power down to save the remaining energy for the SD card internal MCU

Never call this during flight!

Definition at line 217 of file mcu_arch.c.

References __disable_irq(), and __enable_irq().

Referenced by mcu_reboot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: