Commit 14473f8b authored by Oliver Horst's avatar Oliver Horst
Browse files

Merge branch 'split/freertos-plus-hal' into split/freertos-plus-src

parents fe851c98 879a9347
Pipeline #19565 failed with stages
in 3 minutes and 52 seconds
#ifndef FREERTOS_HAL_CPU_H
#define FREERTOS_HAL_CPU_H
#ifndef INC_FREERTOS_H
#error "include FreeRTOS.h must appear in source files before include cpu.h"
#endif
/**
* Returns the id of the core on which the program is executed
* retrieving it from the hardware.
*
* @return cpu_id of the core running the program
*/
UBaseType_t uxHalGetCpuId();
#endif /* FREERTOS_HAL_CPU_H */
// SPDX-License-Identifier: MIT
#ifndef FREERTOS_HAL_DRIVERS_CAN_H_
#define FREERTOS_HAL_DRIVERS_CAN_H_
/******************************************************************************/
/*** Includes ***/
/******************************************************************************/
#include "freertos/FreeRTOS.h"
#include "freertos/hal/io.h"
#include <stdint.h>
/******************************************************************************/
/*** Defines ***/
/******************************************************************************/
/******************************************************************************/
/*** Type definitions ***/
/******************************************************************************/
/**
* \struct xme_hal_can_message_t
* \brief Describes one message received or to be transmitted via CAN.
*/
typedef struct
{
uint32_t msgID; ///< Identifier of message. Might be 11 or 29 bit.
uint8_t msgLen; ///< Number of valid bytes in payload.
uint8_t data[8]; ///< Payload.
} hal_can_message_t;
typedef void * hal_can_handle_t;
/******************************************************************************/
/*** Prototypes ***/
/******************************************************************************/
BaseType_t hal_can_init(hal_io_handle_t deviceId, uint32_t bitrate);
BaseType_t hal_can_release(hal_io_handle_t deviceId);
BaseType_t hal_can_open(hal_io_handle_t deviceId, hal_can_handle_t * canHandlePtr );
BaseType_t hal_can_close( hal_can_handle_t * canHandlePtr );
BaseType_t hal_can_write(hal_can_handle_t canHandle, hal_can_message_t message);
BaseType_t hal_can_read(hal_can_handle_t canHandle, hal_can_message_t *message);
#endif /* FREERTOS_HAL_DRIVERS_CAN_H_ */
// SPDX-License-Identifier: MIT
#ifndef FREERTOS_HAL_DRIVERS_UART_H_
#define FREERTOS_HAL_DRIVERS_UART_H_
#include "freertos/FreeRTOS.h"
#include "freertos/hal/io.h"
#include <stdint.h>
/*!
* @brief This method will call the hal_uart_init_channel method for all
* enabled UART devices. It is called during system boot-up.
*/
void hal_uart_setup(void);
/*!
* @brief Initializes a given UART channel to use the given baudrate
*
* @param channel The base address of the UART controller to use.
* @param baudrate The baudrate to be used for transmission on the UART
* device that shall be initialized
* @return Returns 0 in case of a failure and 1 in case of success.
*/
int hal_uart_init_channel(hal_io_handle_t handle, uint32_t baudrate);
/*!
* @brief Receive a character on the UART port (non-blocking)
*
* @param channel The base address of the UART controller to use.
* @param ch Pointer to the byte where to store the read data.
* @return 0 in case of success and -1 otherwise.
*/
int hal_uart_getchar(hal_io_handle_t handle, uint8_t *ch);
int hal_uart_getchar_timeout(hal_io_handle_t handle, uint8_t *ch, TickType_t timeout);
/*!
* @brief Output a character to UART port (blocks until character is flushed)
*
* @param channel The base address of the UART controller to use.
* @param ch Byte that shall be written.
* @return 0 in case of success and -1 otherwise.
*/
int hal_uart_putchar(hal_io_handle_t handle, uint8_t ch);
#endif /* FREERTOS_HAL_DRIVERS_UART_H_ */
// SPDX-License-Identifier: MIT
#ifndef FREERTOS_HAL_IO_H_
#define FREERTOS_HAL_IO_H_
#include <stdint.h>
typedef uint32_t hal_io_handle_t;
int hal_io_lookup( const char* name, hal_io_handle_t* handle );
int hal_io_release( const hal_io_handle_t handle );
#endif /* FREERTOS_HAL_IO_H_ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment