23 #define ISF_LOCK_DEFAULT (0)
47 MUTEX_ATTR_STRUCT mutexattr;
63 if (MQX_OK == _mutatr_init(&mutexattr)) {
64 _mutatr_set_sched_protocol(&mutexattr, MUTEX_PRIO_INHERIT);
70 if(MQX_OK != _mutex_init(apBusHandle->
pLock, &mutexattr)){
75 if(MQX_OK != _mutex_init(apBusHandle->
pRdLock, &mutexattr)){
81 pBusHandle->
busConfig = gSys_UartBusConfig[aBusId];
85 apBusHandle->
pHandle = pBusHandle;
98 if((apBusHandle == NULL) || (apBusConfig == NULL)){
129 if(apBusHandle == NULL){
144 if((apBusHandle == NULL) || (apBusConfig == NULL)){
161 if(apBusHandle == NULL){
178 if(apBusHandle == NULL){
194 if(apBusHandle == NULL){
217 if(apBusHandle == NULL){
243 if((apBusHandle == NULL) || (apEndpointHandle == NULL)){
256 *apEndpointHandle = pEndpoint;
270 if(apEndpoint == NULL){
273 _lwmem_free(apEndpoint);
285 if((NULL == apEndpointHandle) || (NULL == pWriteBuffer)){
288 if(buffsize < nByteWrite){
325 if((NULL == apEndpointHandle) || (NULL == pReadBuffer)){
328 if(buffsize < nByteRead){
370 pnLock = &apBusHandle->
nRdLock;
372 pLock = apBusHandle->
pLock;
373 pnLock = &apBusHandle->
nLock;
382 if(MQX_OK != _mutex_lock ((MUTEX_STRUCT*)pLock)){
389 if (NULL == apBusHandle->
pLock){
395 if(MQX_OK != _mutex_lock ((MUTEX_STRUCT*)apBusHandle->
pLock)){
399 apBusHandle->
nLock++;
419 pnLock = &apBusHandle->
nRdLock;
421 pLock = apBusHandle->
pLock;
422 pnLock = &apBusHandle->
nLock;
433 _mutex_unlock((MUTEX_STRUCT*)pLock);
437 if(NULL == apBusHandle->
pLock){
441 if(0 == apBusHandle->
nLock){
445 _mutex_unlock((MUTEX_STRUCT*)apBusHandle->
pLock);
User configuration structure for UART driver.
ISF board support header files.
uart_status_t uart_receive_data_async(uart_state_t *uartState, uint8_t *rxBuffer, uint32_t requestedByteCount)
This function gets (receives) data from the UART module using a non-blocking method.
unsigned char uint8
This defines uint8 as unsigned char.
void uart_hal_disable_transmitter(uint32 uartInstance)
Disable the UART transmitter.
uart_parity_mode_t parityMode
uint32 comm_Id_t
This type is for a numeric channel identifier- index into an array of channels in the system...
void uart_hal_disable_receiver(uint32 uartInstance)
Disable the UART receiver.
isf_status_t uart_adapter_release_lock(busHandle_t *apBusHandle)
This function releases exclusive bus access.
This structure defines the data bus handle.
uart_BusConfig_t busConfig
UART configuration structure.
uart_stop_bit_count_t stopBitCount
unsigned long uint32
This defines uint32 as unsigned long.
isf_status_t uart_adapter_get_endpoint(busHandle_t *apBusHandle, void *apDevice, void **apEndpointHandle)
This function creates a endpoint at a already initialized bus.
isf_status_t uart_adapter_acquire_lock(busHandle_t *apBusHandle, isf_duration_t aTimeout)
This function locks the bus for exclusive access.
fsl_uart_driver.h defines structures and types for the i2c master driver.
uart_user_config_t config
isf_status_t uart_adapter_read(void *apEndpointHandle, int32 offset, void *pReadBuffer, uint32 buffsize, uint32 nByteRead, uart_readFlags_t aFlags)
This function reads from a uart device.
isf_status_t uart_adapter_write(void *apEndpointHandle, int32 offset, void *pWriteBuffer, uint32 buffsize, uint32 nByteWrite, uart_writeFlags_t aFlags)
This function writes to a uart device.
isf_protocol_adapter.h defines the general interface definition for the protocol adapter.
uart_parity_mode_t parityMode
isf_status_t uart_adapter_stop(busHandle_t *apBusHandle)
This function stops the given uart bus.
isf_status_t uart_adapter_release_endpoint(uart_Endpoint_t *apEndpoint)
This function closes a particular endpoint.
isf_status_t uart_adapter_init(comm_Id_t aBusId, busHandle_t *apBusHandle)
This function initializes a uart bus.
uart_status_t uart_send_data_async(uart_state_t *uartState, const uint8_t *sendBuffer, uint32_t txByteCount)
This function sends (transmits) data through the UART module using a non-blocking method...
The isf_util.h file contains the utility method declarations and macros.
uart_status_t uart_init(uint32_t uartInstance, uart_state_t *uartState, const uart_user_config_t *uartUserConfig)
This function initializes a UART instance for operation.
This structure is a declaration of a BusHandle type.
uart_bit_count_per_char_t bitCountPerChar
isf_status_t uart_adapter_configure(busHandle_t *apBusHandle, uart_config_t *apBusConfig)
This function reconfigures an already initialized bus.
uart_bit_count_per_char_t bitCountPerChar
comm_Flags_t uart_readFlags_t
comm_Flags_t uart_writeFlags_t
void uart_hal_enable_transmitter(uint32 uartInstance)
Enable the UART transmitter.
uart_status_t uart_receive_data(uart_state_t *uartState, uint8_t *rxBuffer, uint32_t requestedByteCount, uint32_t timeout)
This function gets (receives) data from the UART module using a blocking method.
uart_BusConfig_t gSys_UartBusConfig[]
isf_status_t uart_adapter_get_config(busHandle_t *apBusHandle, void *apBusConfig)
This function returns the current bus configuration.
uart_status_t uart_send_data(uart_state_t *uartState, const uint8_t *sendBuffer, uint32_t txByteCount, uint32_t timeout)
This function sends (transmits) data out through the UART module using a blocking method...
uint32 isf_duration_t
ISF time duration in microseconds.
long int32
This defines int32 as long.
uart_stop_bit_count_t stopBitCount
Main ISF header file. Contains code common to all ISF components.
uart_busHandle_t uart_busHandle[]
comm_State_t uart_adapter_get_state(busHandle_t *apBusHandle)
This function returns the current bus state.
This structure defines a device endpoint encapsulation for uart handler.
MUTEX_STRUCT uart_rdlock[]
uart_status_t uart_hal_init(uint32 uartInstance, const uart_config_t *config)
Initialize the UART controller.
int32 isf_status_t
ISF return status type.
isf_uart_adapter.h defines the API definitions and types for the uart protocol adapter.
enum comm_State_vals comm_State_t
This enum holds an enumerated value describing the state of a channel.
isf_status_t uart_adapter_start(busHandle_t *apBusHandle)
This function starts a bus.
isf_devmsg.h defines the API definitions and types for the Intelligent Sensing (ISF) Device Messaging...
void uart_hal_enable_receiver(uint32 uartInstance)
Enable the UART receiver.