Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
MCU Peripherals
Collaboration diagram for MCU Peripherals:

Topics

 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.
void mcu_event (void)
 MCU event functions.
void mcu_reboot (enum reboot_state_t reboot_state)
 Reboot the MCU Should not be called during flight or ciritcal operations.
void mcu_energy_save (void)
 Puts the MCU in energy save mode This disables features of the MCU to save energy.
uint8_t mcu_get_uid (uint8_t *uid, uint8_t max_len)
 Get the unique hardware ID of the MCU.
void board_init (void)
 Optional board init function called at the start of mcu_init().
void board_init2 (void)
 Optional board init function called at the end of mcu_init().

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 43 of file mcu.h.

Function Documentation

◆ board_init()

void board_init ( void )
extern

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

Definition at line 72 of file board.c.

References kill_gracefull().

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 )
extern

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 )
extern

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 232 of file mcu_arch.c.

References BOARD_GROUP_DECLFOREACH, ENERGY_SAVE_INPUTS, and ENERGY_SAVE_LOWS.

◆ mcu_event()

void mcu_event ( void )
extern

MCU event functions.

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

Definition at line 275 of file mcu.c.

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

Here is the call graph for this function:

◆ mcu_get_uid()

uint8_t mcu_get_uid ( uint8_t * uid,
uint8_t max_len )
extern

Get the unique hardware ID of the MCU.

Parameters
uidBuffer to write the ID to
max_lenSize of the buffer
Returns
Number of bytes written, 0 if not available

Get the unique hardware ID of the MCU.

Parameters
uidBuffer to write the ID to
max_lenSize of the buffer
Returns
Number of bytes written, 0 if not available

Get the unique hardware ID of the MCU.

Uses the serial number from LINUX_UID_FILE if set and readable, otherwise the MAC address of the first network interface.

Get the unique hardware ID of the MCU.

on macOS)

Definition at line 252 of file mcu_arch.c.

References b, f, LINUX_UID_FILE, Min, p, uid_from_file(), and uid_from_mac().

Referenced by mavlink_send_autopilot_version(), and send_autopilot_version().

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

◆ mcu_init()

void mcu_init ( void )
extern

Microcontroller peripherals initialization.

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

Definition at line 104 of file mcu.c.

References adc_init(), board_init(), board_init2(), can_init(), gpio_get(), gpio_setup_input(), gpio_setup_output(), led_init(), mcu_arch_init(), 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_init(), main_init(), main_init(), main_init(), 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)
extern

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 208 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: