mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
STM32: Add a experimental oneshot, lower-half driver for STM32
This commit is contained in:
@@ -131,23 +131,27 @@
|
||||
* arg - The opaque argument provided when the interrupt was registered
|
||||
*/
|
||||
|
||||
typedef void (*oneshot_callback_t)(FAR struct oneshot_dev_s *lower,
|
||||
void *arg);
|
||||
struct oneshot_lowerhalf_s;
|
||||
typedef void (*oneshot_callback_t)(FAR struct oneshot_lowerhalf_s *lower,
|
||||
FAR void *arg);
|
||||
|
||||
/* The one short operations supported by the lower half driver */
|
||||
|
||||
struct timespec;
|
||||
struct oneshot_operations_s
|
||||
{
|
||||
CODE int (*max_delay)(FAR struct oneshot_s *lower, uint64_t *usec);
|
||||
CODE int (*start)(FAR struct oneshot_dev_s *lower,
|
||||
CODE int (*max_delay)(FAR struct oneshot_lowerhalf_s *lower,
|
||||
FAR uint64_t *usec);
|
||||
CODE int (*start)(FAR struct oneshot_lowerhalf_s *lower,
|
||||
oneshot_callback_t callback, FAR void *arg,
|
||||
FAR const struct timespec *ts);
|
||||
CODE int (*cancel)(struct oneshot_dev_s *lower, FAR struct timespec *ts);
|
||||
CODE int (*cancel)(struct oneshot_lowerhalf_s *lower,
|
||||
FAR struct timespec *ts);
|
||||
};
|
||||
|
||||
/* This structure describes the state of the oneshot timer driver */
|
||||
/* This structure describes the state of the oneshot timer lower-half driver */
|
||||
|
||||
struct oneshot_dev_s
|
||||
struct oneshot_lowerhalf_s
|
||||
{
|
||||
/* This is the part of the lower half driver that is visible to the upper-
|
||||
* half client of the driver.
|
||||
@@ -194,7 +198,8 @@ extern "C"
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct oneshot_dev_s *oneshot_initialize(int chan, uint16_t resolution);
|
||||
FAR struct oneshot_lowerhalf_s *oneshot_initialize(int chan,
|
||||
uint16_t resolution);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user