PX4 Firmware
PX4 Autopilot Software http://px4.io
|
Public Member Functions | |
PWMIN () | |
virtual | ~PWMIN () |
virtual int | init () |
virtual int | open (struct file *filp) |
virtual ssize_t | read (struct file *filp, char *buffer, size_t buflen) |
virtual int | ioctl (struct file *filp, int cmd, unsigned long arg) |
void | publish (uint16_t status, uint32_t period, uint32_t pulse_width) |
void | print_info (void) |
void | hard_reset () |
Private Member Functions | |
void | _timer_init (void) |
void | _turn_on () |
void | _turn_off () |
void | _freeze_test () |
Private Member Functions inherited from cdev::CDev | |
CDev (const char *devname) | |
Constructor. More... | |
CDev (const CDev &)=delete | |
CDev & | operator= (const CDev &)=delete |
CDev (CDev &&)=delete | |
CDev & | operator= (CDev &&)=delete |
virtual | ~CDev () |
virtual int | open (file_t *filep) |
Handle an open of the device. More... | |
virtual int | close (file_t *filep) |
Handle a close of the device. More... | |
virtual ssize_t | read (file_t *filep, char *buffer, size_t buflen) |
Perform a read from the device. More... | |
virtual ssize_t | write (file_t *filep, const char *buffer, size_t buflen) |
Perform a write to the device. More... | |
virtual off_t | seek (file_t *filep, off_t offset, int whence) |
Perform a logical seek operation on the device. More... | |
virtual int | ioctl (file_t *filep, int cmd, unsigned long arg) |
Perform an ioctl operation on the device. More... | |
virtual int | poll (file_t *filep, px4_pollfd_struct_t *fds, bool setup) |
Perform a poll setup/teardown operation. More... | |
const char * | get_devname () const |
Get the device name. More... | |
virtual pollevent_t | poll_state (file_t *filep) |
Check the current state of the device for poll events from the perspective of the file. More... | |
virtual void | poll_notify (pollevent_t events) |
Report new poll events. More... | |
virtual void | poll_notify_one (px4_pollfd_struct_t *fds, pollevent_t events) |
Internal implementation of poll_notify. More... | |
virtual int | open_first (file_t *filep) |
Notification of the first open. More... | |
virtual int | close_last (file_t *filep) |
Notification of the last close. More... | |
virtual int | register_class_devname (const char *class_devname) |
Register a class device name, automatically adding device class instance suffix if need be. More... | |
virtual int | unregister_class_devname (const char *class_devname, unsigned class_instance) |
Register a class device name, automatically adding device class instance suffix if need be. More... | |
void | lock () |
Take the driver lock. More... | |
void | unlock () |
Release the driver lock. More... | |
int | unregister_driver_and_memory () |
First, unregisters the driver. More... | |
Private Attributes | |
uint32_t | _error_count |
uint32_t | _pulses_captured |
uint32_t | _last_period |
uint32_t | _last_width |
hrt_abstime | _last_poll_time |
hrt_abstime | _last_read_time |
ringbuffer::RingBuffer * | _reports |
bool | _timer_started |
hrt_call | _hard_reset_call |
hrt_call | _freeze_test_call |
Private Attributes inherited from cdev::CDev | |
px4_sem_t | _lock |
lock to protect access to all class members (also for derived classes) More... | |
Additional Inherited Members | |
Static Private Attributes inherited from cdev::CDev | |
static const px4_file_operations_t | fops = {} |
Pointer to the default cdev file operations table; useful for registering clone devices etc. More... | |
Definition at line 173 of file pwm_input.cpp.
PWMIN::PWMIN | ( | ) |
Definition at line 218 of file pwm_input.cpp.
Referenced by pwmin_start().
|
virtual |
Definition at line 229 of file pwm_input.cpp.
References _reports.
|
private |
Definition at line 327 of file pwm_input.cpp.
References _last_poll_time, _last_read_time, hard_reset(), hrt_elapsed_time(), TIMEOUT_POLL, and TIMEOUT_READ.
Referenced by init().
|
private |
Definition at line 264 of file pwm_input.cpp.
References _timer_started, GPIO_VDD_RANGEFINDER_EN, pwmin_tim_isr(), PWMIN_TIMER_CLOCK, PWMIN_TIMER_POWER_BIT, PWMIN_TIMER_POWER_REG, PWMIN_TIMER_VECTOR, rARR, rCCER, rCCMR1, rCCMR2, rCR1, rCR2, rDCR, rDIER, rEGR, rPSC, and rSMCR.
Referenced by ioctl(), and open().
|
private |
Definition at line 344 of file pwm_input.cpp.
References GPIO_VDD_RANGEFINDER_EN.
Referenced by hard_reset().
|
private |
Definition at line 337 of file pwm_input.cpp.
References GPIO_VDD_RANGEFINDER_EN.
Referenced by hard_reset().
void PWMIN::hard_reset | ( | ) |
Definition at line 351 of file pwm_input.cpp.
References _hard_reset_call, _turn_off(), _turn_on(), and hrt_call_after().
Referenced by _freeze_test(), ioctl(), and pwmin_reset().
|
virtual |
Reimplemented from cdev::CDev.
Definition at line 243 of file pwm_input.cpp.
References _freeze_test(), _freeze_test_call, _reports, hrt_call_every(), ToneAlarmInterface::init(), OK, and TIMEOUT_POLL.
Referenced by pwmin_start().
|
virtual |
Definition at line 382 of file pwm_input.cpp.
References _timer_init(), hard_reset(), OK, and SENSORIOCRESET.
Referenced by pwmin_reset().
|
virtual |
Definition at line 362 of file pwm_input.cpp.
References _timer_init(), _timer_started, and OK.
Referenced by pwmin_reset(), and pwmin_test().
void PWMIN::print_info | ( | void | ) |
Definition at line 454 of file pwm_input.cpp.
References _last_period, _last_width, _pulses_captured, and _timer_started.
Referenced by pwmin_info().
void PWMIN::publish | ( | uint16_t | status, |
uint32_t | period, | ||
uint32_t | pulse_width | ||
) |
Definition at line 432 of file pwm_input.cpp.
References _error_count, _last_poll_time, _reports, pwm_input_s::error_count, hrt_absolute_time(), pwm_input_s::period, pwm_input_s::pulse_width, and pwm_input_s::timestamp.
Referenced by pwmin_tim_isr().
|
virtual |
Definition at line 405 of file pwm_input.cpp.
References _last_read_time, _reports, and hrt_absolute_time().
Referenced by pwmin_test().
|
private |
Definition at line 189 of file pwm_input.cpp.
Referenced by publish().
|
private |
Definition at line 199 of file pwm_input.cpp.
Referenced by init().
|
private |
Definition at line 198 of file pwm_input.cpp.
Referenced by hard_reset().
|
private |
Definition at line 191 of file pwm_input.cpp.
Referenced by print_info().
|
private |
Definition at line 193 of file pwm_input.cpp.
Referenced by _freeze_test(), and publish().
|
private |
Definition at line 194 of file pwm_input.cpp.
Referenced by _freeze_test(), and read().
|
private |
Definition at line 192 of file pwm_input.cpp.
Referenced by print_info().
|
private |
Definition at line 190 of file pwm_input.cpp.
Referenced by print_info().
|
private |
|
private |
Definition at line 196 of file pwm_input.cpp.
Referenced by _timer_init(), open(), and print_info().