Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
MCU Peripherals
+ Collaboration diagram for MCU Peripherals:

Modules

 I2C Interface
 
 SPI Interface
 

Enumerations

enum  reboot_state_t { MCU_REBOOT_NORMAL , MCU_REBOOT_POWEROFF , MCU_REBOOT_FAST , MCU_REBOOT_BOOTLOADER }
 The requested reboot states. More...
 

Functions

void mcu_init (void)
 Microcontroller peripherals initialization. More...
 
void mcu_event (void)
 MCU event functions. More...
 
void mcu_reboot (enum reboot_state_t reboot_state)
 Reboot the MCU Should not be called during flight or ciritcal operations. More...
 
void mcu_energy_save (void)
 Puts the MCU in energy save mode This disables features of the MCU to save energy. More...
 
void board_init (void)
 Optional board init function called at the start of mcu_init(). More...
 
void board_init2 (void)
 Optional board init function called at the end of mcu_init(). More...
 

Detailed Description

Enumeration Type Documentation

◆ reboot_state_t

The requested reboot states.

Enumerator
MCU_REBOOT_NORMAL 

Normal reboot.

MCU_REBOOT_POWEROFF 

Poweroff the device.

MCU_REBOOT_FAST 

Fast reboot (skip bootloader)

MCU_REBOOT_BOOTLOADER 

Go to bootloader.

Definition at line 42 of file mcu.h.

Function Documentation

◆ board_init()

void board_init ( void  )

Optional board init function called at the start of mcu_init().

Definition at line 130 of file board.c.

References kill_gracefull(), and KillGracefully().

Referenced by mcu_init().

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

◆ board_init2()

void board_init2 ( void  )

Optional board init function called at the end of mcu_init().

Definition at line 92 of file board.c.

Referenced by mcu_init().

+ Here is the caller graph for this function:

◆ mcu_energy_save()

void mcu_energy_save ( void  )

Puts the MCU in energy save mode This disables features of the MCU to save energy.

This is used for example to quickly write to the SD card while powering off.

Puts the MCU in energy save mode This disables features of the MCU to save energy.

Definition at line 230 of file mcu_arch.c.

References BOARD_GROUP_DECLFOREACH, ENERGY_SAVE_INPUTS, and ENERGY_SAVE_LOWS.

◆ mcu_event()

void mcu_event ( void  )

MCU event functions.

Calls the event functions of used peripherals like i2c, uart, etc.

Definition at line 270 of file mcu.c.

References i2c_event(), softi2c_event(), and VCOM_event().

Referenced by main_event(), and main_event_task().

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

◆ mcu_init()

void mcu_init ( void  )

Microcontroller peripherals initialization.

This function is responisble for setting up the microcontroller after Reset.

Definition at line 98 of file mcu.c.

References adc_init(), board_init(), board_init2(), BTN_ON, BTN_ON_PIN, dac_init(), gpio_get(), gpio_setup_input(), gpio_setup_output(), led_init(), mcu_arch_init(), MCU_PWR, MCU_PWR_OFF, MCU_PWR_ON, MCU_PWR_PIN, PERIPHERAL3V3_ENABLE_ON, PERIPHERAL3V3_ENABLE_PIN, PERIPHERAL3V3_ENABLE_PORT, RADIO_CONTROL_POWER_ON, RADIO_CONTROL_POWER_PIN, RADIO_CONTROL_POWER_PORT, rng_init(), spi0_init(), spi1_init(), spi2_init(), spi_init_slaves(), sys_time_init(), uart_arch_init(), udp_arch_init(), and VCOM_init().

Referenced by main(), and main_init().

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

◆ mcu_reboot()

void mcu_reboot ( enum reboot_state_t  reboot_state)

Reboot the MCU Should not be called during flight or ciritcal operations.

Parameters
stateThe state to reboot towards

Reboot the MCU Should not be called during flight or ciritcal operations.

  • POWEROFF will go the deep sleep
  • NORMAL will do a normal reboot (also to bootloader)
  • FAST will try to skip the bootloader
  • BOOTLOADER will try to keep the MCU in bootloader
    Parameters
    reboot_stateThe sate to reboot to

Definition at line 206 of file mcu_arch.c.

References mcu_deep_sleep(), MCU_REBOOT_BOOTLOADER, MCU_REBOOT_FAST, MCU_REBOOT_POWEROFF, RTC_BOOT_FAST, and RTC_BOOT_HOLD.

Referenced by px4flash_event(), and thdUsbStorage().

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