Updated SIO template.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15734 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
eedc93bc01
commit
69e0b44070
|
@ -88,6 +88,7 @@ msg_t sio_lld_start(SIODriver *siop) {
|
|||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Configures the peripheral.*/
|
||||
|
||||
return HAL_RET_SUCCESS;
|
||||
|
@ -115,43 +116,45 @@ void sio_lld_stop(SIODriver *siop) {
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Starts a SIO operation.
|
||||
* @brief Enable flags change notification.
|
||||
*
|
||||
* @param[in] siop pointer to an @p SIODriver structure
|
||||
*
|
||||
* @api
|
||||
* @param[in] siop pointer to the @p SIODriver object
|
||||
*/
|
||||
void sio_lld_start_operation(SIODriver *siop) {
|
||||
void sio_lld_update_enable_flags(SIODriver *siop) {
|
||||
|
||||
(void)siop;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Stops an ongoing SIO operation, if any.
|
||||
*
|
||||
* @param[in] siop pointer to an @p SIODriver structure
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
void sio_lld_stop_operation(SIODriver *siop) {
|
||||
|
||||
(void)siop;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the pending SIO events flags.
|
||||
* @brief Get and clears SIO error event flags.
|
||||
*
|
||||
* @param[in] siop pointer to the @p SIODriver object
|
||||
* @return The pending event flags.
|
||||
*
|
||||
* @notapi
|
||||
*/
|
||||
sio_events_mask_t sio_lld_get_and_clear_events(SIODriver *siop) {
|
||||
sio_events_mask_t evtmask = 0U;
|
||||
sioevents_t sio_lld_get_and_clear_errors(SIODriver *siop) {
|
||||
sioevents_t errors = 0U;
|
||||
|
||||
(void)siop;
|
||||
|
||||
return evtmask;
|
||||
return errors;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get and clears SIO event flags.
|
||||
*
|
||||
* @param[in] siop pointer to the @p SIODriver object
|
||||
* @return The pending event flags.
|
||||
*
|
||||
* @notapi
|
||||
*/
|
||||
sioevents_t sio_lld_get_and_clear_events(SIODriver *siop) {
|
||||
sioevents_t events = 0U;
|
||||
|
||||
(void)siop;
|
||||
|
||||
return events;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -247,6 +250,18 @@ msg_t sio_lld_control(SIODriver *siop, unsigned int operation, void *arg) {
|
|||
return MSG_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Serves an UART interrupt.
|
||||
*
|
||||
* @param[in] siop pointer to the @p SIODriver object
|
||||
*
|
||||
* @notapi
|
||||
*/
|
||||
void sio_lld_serve_interrupt(SIODriver *siop) {
|
||||
|
||||
(void)siop;
|
||||
}
|
||||
|
||||
#endif /* HAL_USE_SIO == TRUE */
|
||||
|
||||
/** @} */
|
||||
|
|
|
@ -57,11 +57,6 @@
|
|||
/* Driver data structures and types. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Type of a SIO events mask.
|
||||
*/
|
||||
typedef uint32_t sio_events_mask_t;
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Driver macros. */
|
||||
/*===========================================================================*/
|
||||
|
@ -90,6 +85,32 @@ typedef uint32_t sio_events_mask_t;
|
|||
*/
|
||||
#define sio_lld_is_rx_empty(siop) false
|
||||
|
||||
/**
|
||||
* @brief Determines the activity state of the receiver.
|
||||
*
|
||||
* @param[in] siop pointer to the @p SIODriver object
|
||||
* @return The RX activity state.
|
||||
* @retval false if RX is in active state.
|
||||
* @retval true if RX is in idle state.
|
||||
*
|
||||
* @notapi
|
||||
*/
|
||||
#define sio_lld_is_rx_idle(siop) false
|
||||
|
||||
/**
|
||||
* @brief Determines if RX has pending error events to be read and cleared.
|
||||
* @note Only error and protocol errors are handled, data events are not
|
||||
* considered.
|
||||
*
|
||||
* @param[in] siop pointer to the @p SIODriver object
|
||||
* @return The RX error events.
|
||||
* @retval false if RX has no pending events
|
||||
* @retval true if RX has pending events
|
||||
*
|
||||
* @notapi
|
||||
*/
|
||||
#define sio_lld_has_rx_errors(siop) false
|
||||
|
||||
/**
|
||||
* @brief Determines the state of the TX FIFO.
|
||||
*
|
||||
|
@ -128,14 +149,15 @@ extern "C" {
|
|||
void sio_lld_init(void);
|
||||
msg_t sio_lld_start(SIODriver *siop);
|
||||
void sio_lld_stop(SIODriver *siop);
|
||||
void sio_lld_start_operation(SIODriver *siop);
|
||||
void sio_lld_stop_operation(SIODriver *siop);
|
||||
sio_events_mask_t sio_lld_get_and_clear_events(SIODriver *siop);
|
||||
void sio_lld_update_enable_flags(SIODriver *siop);
|
||||
sioevents_t sio_lld_get_and_clear_errors(SIODriver *siop);
|
||||
sioevents_t sio_lld_get_and_clear_events(SIODriver *siop);
|
||||
size_t sio_lld_read(SIODriver *siop, uint8_t *buffer, size_t n);
|
||||
size_t sio_lld_write(SIODriver *siop, const uint8_t *buffer, size_t n);
|
||||
msg_t sio_lld_get(SIODriver *siop);
|
||||
void sio_lld_put(SIODriver *siop, uint_fast16_t data);
|
||||
msg_t sio_lld_control(SIODriver *siop, unsigned int operation, void *arg);
|
||||
void sio_lld_serve_interrupt(SIODriver *siop);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue