Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
mcu_arch.c File Reference

linux arch dependant microcontroller initialisation functions. More...

#include "mcu_arch.h"
#include "mcu.h"
#include <stdio.h>
#include <string.h>
#include <dirent.h>
Include dependency graph for mcu_arch.c:

Go to the source code of this file.

Macros

#define LINUX_UID_FILE   ""
 Optional file with a unique board serial number (read as text).

Functions

static uint8_t uid_from_file (const char *path, uint8_t *uid, uint8_t max_len)
 Read the first line of a text file as unique ID.
static uint8_t uid_from_mac (uint8_t *uid, uint8_t max_len)
 Get the MAC address of the first network interface (by name), skipping loopback.
uint8_t mcu_get_uid (uint8_t *uid, uint8_t max_len)
 Get a unique hardware ID of the board.
void mcu_arch_init (void)
 Initialize the specific archittecture functions.

Detailed Description

linux arch dependant microcontroller initialisation functions.

Because Linux runs on omap, we don't have to initialize the MCU ourselves.

Definition in file mcu_arch.c.

Macro Definition Documentation

◆ LINUX_UID_FILE

#define LINUX_UID_FILE   ""

Optional file with a unique board serial number (read as text).

Definition at line 39 of file mcu_arch.c.

Referenced by mcu_get_uid().

Function Documentation

◆ mcu_arch_init()

void mcu_arch_init ( void )

Initialize the specific archittecture functions.

Definition at line 168 of file mcu_arch.c.

◆ uid_from_file()

uint8_t uid_from_file ( const char * path,
uint8_t * uid,
uint8_t max_len )
static

Read the first line of a text file as unique ID.

Definition at line 45 of file mcu_arch.c.

References f, and Min.

Referenced by mcu_get_uid().

Here is the caller graph for this function:

◆ uid_from_mac()

uint8_t uid_from_mac ( uint8_t * uid,
uint8_t max_len )
static

Get the MAC address of the first network interface (by name), skipping loopback.

Definition at line 68 of file mcu_arch.c.

References dir, f, and Min.

Referenced by mcu_get_uid().

Here is the caller graph for this function: