45 #include <px4_platform_common/px4_config.h> 46 #include <px4_platform_common/getopt.h> 47 #include <px4_platform_common/module.h> 48 #include <px4_platform_common/module_params.h> 49 #include <px4_platform_common/px4_work_queue/ScheduledWorkItem.hpp> 56 #ifdef PX4_SPI_BUS_OSD 57 #define OSD_BUS PX4_SPI_BUS_OSD 59 #error "add the required spi bus from board_config.h here" 63 #define OSD_SPIDEV PX4_SPIDEV_OSD 65 #error "add the required spi device from board_config.h here" 68 #define OSD_SPI_BUS_SPEED (2000000L) 70 #define DIR_READ(a) ((a) | (1 << 7)) 71 #define DIR_WRITE(a) ((a) & 0x7f) 73 #define OSD_CHARS_PER_ROW 30 74 #define OSD_NUM_ROWS_PAL 16 75 #define OSD_NUM_ROWS_NTSC 13 76 #define OSD_ZERO_BYTE 0x00 77 #define OSD_PAL_TX_MODE 0x40 81 class OSDatxxxx :
public device::SPI,
public ModuleBase<OSDatxxxx>,
public ModuleParams,
public px4::ScheduledWorkItem
98 static int print_usage(
const char *reason =
nullptr);
103 static int task_spawn(
int argc,
char *argv[]);
122 void clear_line(uint8_t pos_x, uint8_t pos_y,
int length);
126 int add_flighttime(
float flight_time, uint8_t pos_x, uint8_t pos_y);
157 (ParamInt<px4::params::OSD_ATXXXX_CFG>) _param_osd_atxxxx_cfg
int add_flighttime(float flight_time, uint8_t pos_x, uint8_t pos_y)
float _battery_voltage_filtered_v
uORB::Subscription _local_position_sub
bool _local_position_valid
__EXPORT int atxxxx_main(int argc, char *argv[])
static int print_usage(const char *reason=nullptr)
int readRegister(unsigned reg, uint8_t *data, unsigned count)
static int custom_command(int argc, char *argv[])
High-resolution timer with callouts and timekeeping.
void add_string_to_screen_centered(const char *str, uint8_t pos_y, int max_length)
Global flash based parameter store.
int add_altitude(uint8_t pos_x, uint8_t pos_y)
#define ORB_ID(_name)
Generates a pointer to the uORB metadata structure for a given topic.
float _battery_discharge_mah
void clear_line(uint8_t pos_x, uint8_t pos_y, int length)
int writeRegister(unsigned reg, uint8_t data)
static int task_spawn(int argc, char *argv[])
int add_battery_info(uint8_t pos_x, uint8_t pos_y)
static const char * get_flight_mode(uint8_t nav_state)
uint64_t _arming_timestamp
uORB::Subscription _vehicle_status_sub
int add_character_to_screen(char c, uint8_t pos_x, uint8_t pos_y)
OSDatxxxx(int bus=OSD_BUS)
uORB::Subscription _battery_sub