NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
system_calls.h File Reference
#include <stdint.h>
#include <stddef.h>
Include dependency graph for system_calls.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  system_calls_pwm
 pwm related system calls More...
 
struct  system_calls_imu
 
struct  system_calls_leds
 
struct  system_calls_beeper
 
struct  system_calls_time
 
struct  system_eeprom_info
 
struct  system_calls_eeprom
 
struct  system_calls_range
 
struct  system_calls
 

Macros

#define SYSTEM_GYRO_RANGE   2000
 
#define SYSTEM_ACC_1G   1000
 
#define SYSTEM_GYRO_SCALE   ((float)SYSTEM_GYRO_RANGE / (int16_t)0x7fff)
 
#define sys_led_on(sys, id)   sys->leds.on(&(sys)->leds, id, true)
 
#define sys_led_off(sys, id)   sys->leds.on(&(sys)->leds, id, false)
 
#define sys_led_toggle(sys, id)   sys->leds.toggle(&(sys)->leds, id)
 
#define sys_beeper_on(sys)   sys->beeper.on(&(sys)->beeper, true)
 
#define sys_beeper_off(sys)   sys->beeper.on(&(sys)->beeper, false)
 
#define sys_millis(sys)   (sys->time.micros(&(sys)->time) / 1000)
 
#define sys_micros(sys)   (sys->time.micros(&(sys)->time))
 
#define sys_gyro_read(sys, data)   (sys->imu.read_gyro(&(sys)->imu, data))
 
#define sys_acc_read(sys, data)   (sys->imu.read_acc(&(sys)->imu, data))
 
#define sys_get_pressure(sys, data)   (sys->imu.read_pressure(&(sys)->imu, data))
 
#define sys_get_temperature(sys, data)   (sys->imu.read_temperature(&(sys)->imu, data))
 
#define sys_motor_write(sys, id, val)   (sys->pwm.write_motor(&(sys)->pwm, id, val))
 
#define sys_servo_write(sys, id, val)   (sys->pwm.write_servo(&(sys)->pwm, id, val))
 
#define sys_eeprom_write(sys, addr, src, size)   (sys->eeprom.write(&(sys)->eeprom, addr, src, size))
 
#define sys_eeprom_read(sys, dst, addr, size)   (sys->eeprom.read(&(sys)->eeprom, dst, addr, size))
 
#define sys_eeprom_get_info(sys, info)   (sys->eeprom.get_info(&(sys)->eeprom, info))
 
#define sys_eeprom_erase_page(sys, addr)   (sys->eeprom.erase_page(&(sys)->eeprom, addr))
 
#define sys_range_read(sys, deg, dst)   (sys->range.read_range(&(sys)->range, deg, dst))
 

Typedefs

typedef int32_t sys_millis_t
 
typedef int32_t sys_micros_t
 

Detailed Description

Sysytem calls interface

Author
Martin Schröder mksch.nosp@m.rede.nosp@m.r.uk@.nosp@m.gmai.nosp@m.l.com

Main interface between the flight controller and the system. Keep it to a minimum.

Typedef Documentation

typedef int32_t sys_micros_t
typedef int32_t sys_millis_t