MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_hw_timer_register

Function rt_hw_timer_register

bsp/efm32/drv_timer.c:167–188  ·  view source on GitHub ↗

/ * @brief * Register Timer device * * @details * * @note * * @param[in] device * Pointer to device descriptor * * @param[in] name * Device name * * @param[in] flag * Configuration flags * * @param[in] timer * Pointer to Timer device descriptor * * @return * Error code ******************************************************************************/

Source from the content-addressed store, hash-verified

165 * Error code
166 ******************************************************************************/
167rt_err_t rt_hw_timer_register(
168 rt_device_t device,
169 const char *name,
170 rt_uint32_t flag,
171 struct efm32_timer_device_t *timer)
172{
173 RT_ASSERT(device != RT_NULL);
174
175 device->type = RT_Device_Class_Char; /* fixme: should be timer type*/
176 device->rx_indicate = RT_NULL;
177 device->tx_complete = RT_NULL;
178 device->init = rt_hs_timer_init;
179 device->open = RT_NULL;
180 device->close = RT_NULL;
181 device->read = RT_NULL;
182 device->write = RT_NULL;
183 device->control = rt_hs_timer_control;
184 device->user_data = timer;
185
186 /* register a character device */
187 return rt_device_register(device, name, flag);
188}
189
190/***************************************************************************//**
191 * @brief

Callers 1

rt_hw_timer_initFunction · 0.85

Calls 1

rt_device_registerFunction · 0.85

Tested by

no test coverage detected