Sonochan II 0.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Enumerations | Functions
HW_bridge_uniprot.h File Reference

Virtual bridge, that connect HW library and universal protocol library. More...

`#include "HW.h"`
`#include "uniprot.h"`
`#include "FreeRTOS.h"`
`#include "task.h"`

Go to the source code of this file.

## Macros
#define | HW_BRIDGE_UNIPROT_USED_PIPE 0
| Define witch pipe bridge will use. More...
#define | HW_BRIDGE_UNIPROT_SUPPORT_RTOS 1
| Allow enable or disable FreeRTOS support. More...
#define | HW_BRIDGE_UNIPROT_DEBUG 1
| Debug version - 1 (debug enabled) or 0 (debug disabled) More...
#define | HW_BRIDGE_UNIPROT_RX_BUFFER_SIZE 8
| Size of RX buffer. More...
#define | HW_BRIDGE_UNIPROT_TX_BUFFER_SIZE (26+2*GD_MAX_STRING_SIZE)
| Size of TX buffer. More...

## Enumerations
enum | BRIDGE_STATE { HW_BRIDGE_UNIPROT_STATE_WAITING_FOR_REQUEST = 0, HW_BRIDGE_UNIPROT_STATE_REQUEST_GET_SETTING = 1, HW_BRIDGE_UNIPROT_STATE_REQUEST_SET_SETTINGS = 2, HW_BRIDGE_UNIPROT_STATE_REQUEST_GET_METADATA = 3, HW_BRIDGE_UNIPROT_STATE_REQUEST_GET_NUM_OF_DEV = 4, HW_BRIDGE_UNIPROT_STATE_SEND_ONLY_RETURN_CODE, HW_BRIDGE_UNIPROT_STATE_SEND_RETURN_CODE_AND_METADATA, HW_BRIDGE_UNIPROT_STATE_SEND_RETURN_CODE_AND_SETTING, HW_BRIDGE_UNIPROT_STATE_FAILED_TO_READ_METADATA }
| Possible states of bridge. More...

## Functions
void | bridge_init (void)
void | bridge_task_FreeRTOS (void *pvParameters)
| FreeRTOS task. More...
void | bridge_task (void)

## Detailed Description

Virtual bridge, that connect HW library and universal protocol library.

Created 24.09.2013
Modified 28.04.2014

Version
  0.4.1

Author
  Martin Stejskal

## Macro Definition Documentation

#define HW_BRIDGE_UNIPROT_DEBUG 1

Debug version - 1 (debug enabled) or 0 (debug disabled)

When software is in develop stage there can be a lot unexpected behavior.
So in debug mode is there more checking, witch in fully working code have
no meaning. Anyway sometimes this redundant checking is good when debugging.

#define HW_BRIDGE_UNIPROT_RX_BUFFER_SIZE 8

Size of RX buffer.

max - 1B Device ID, 1B Request ID, 2B for CMD ID and 4B for data value

#define HW_BRIDGE_UNIPROT_SUPPORT_RTOS 1

Allow enable or disable FreeRTOS support.

Options: 0 (FreeRTOS disabled) or 1 (FreeRTOS enabled)

#define HW_BRIDGE_UNIPROT_TX_BUFFER_SIZE (26+2*GD_MAX_STRING_SIZE)

Size of TX buffer.

1B Device ID, 1B Return code, 2B CMD ID, 1B IN TYPE, 4B IN MIN, 4B IN MAX,
1B OUT TYPE, 4B OUT MIN, 4B OUT MAX, 4B OUT VALUE + 2*MAX STRING SIZE

#define HW_BRIDGE_UNIPROT_USED_PIPE 0

Define witch pipe bridge will use.

## Enumeration Type Documentation

enum BRIDGE_STATE

Possible states of bridge.

Also number of some states represent their "Command number". Especially:
HW_BRIDGE_UNIPROT_STATE_REQUEST_GET_SETTINGS,
HW_BRIDGE_UNIPROT_STATE_REQUEST_SET_SETTINGS,
HW_BRIDGE_UNIPROT_STATE_REQUEST_GET_METADATA,
HW_BRIDGE_UNIPROT_STATE_REQUEST_GET_NUM_OF_DEV

Enumerator
HW_BRIDGE_UNIPROT_STATE_WAITING_FOR_REQUEST | HW_BRIDGE_UNIPROT_STATE_WAITING_FOR_REQUEST.
HW_BRIDGE_UNIPROT_STATE_REQUEST_GET_SETTING | HW_BRIDGE_UNIPROT_STATE_REQUEST_GET_SETTINGS.
HW_BRIDGE_UNIPROT_STATE_REQUEST_SET_SETTINGS | HW_BRIDGE_UNIPROT_STATE_REQUEST_SET_SETTINGS.
HW_BRIDGE_UNIPROT_STATE_REQUEST_GET_METADATA | HW_BRIDGE_UNIPROT_STATE_REQUEST_GET_METADATA.
HW_BRIDGE_UNIPROT_STATE_REQUEST_GET_NUM_OF_DEV | HW_BRIDGE_UNIPROT_STATE_REQUEST_GET_NUM_OF_DEV.
HW_BRIDGE_UNIPROT_STATE_SEND_ONLY_RETURN_CODE | HW_BRIDGE_UNIPROT_STATE_SEND_ONLY_RETURN_CODE.
HW_BRIDGE_UNIPROT_STATE_SEND_RETURN_CODE_AND_METADATA | HW_BRIDGE_UNIPROT_STATE_SEND_RETURN_CODE_AND_METADATA.
HW_BRIDGE_UNIPROT_STATE_SEND_RETURN_CODE_AND_SETTING | HW_BRIDGE_UNIPROT_STATE_SEND_RETURN_CODE_AND_SETTING.
HW_BRIDGE_UNIPROT_STATE_FAILED_TO_READ_METADATA | HW_BRIDGE_UNIPROT_STATE_FAILED_TO_READ_METADATA.

## Function Documentation

void bridge_init | ( | void | ) |  |

void bridge_task | ( | void | ) |  |

void bridge_task_FreeRTOS | ( | void * | pvParameters) |  |

FreeRTOS task.

Instead of complicating bridge_task() we just make function, that is ready
for FreeRTOS stuff, so code will be still easy to use.