busvoodoo_onewire.c File Reference

BusVoodoo 1-wire mode (code) More...

Go to the source code of this file.

## Enumerations

enum | busvoodoo_onewire_setting_t { BUSVOODOO_ONEWIRE_SETTING_NONE, BUSVOODOO_ONEWIRE_SETTING_PULLUP, BUSVOODOO_ONEWIRE_SETTING_POWER, BUSVOODOO_ONEWIRE_SETTING_DONE }
| mode setup stage

## Functions

static bool | busvoodoo_onewire_setup (char **prefix, const char *line)
| setup 1-wire mode More...
static void | busvoodoo_onewire_write (uint8_t value)
| write to 1-wire More...
static void | busvoodoo_onewire_read (void)
| read from 1-wire
static void | busvoodoo_onewire_exit (void)
| exit 1-wire mode
static bool | busvoodoo_onewire_action (const char *action, uint32_t repetition, bool perform)
| perform 1-wire action More...
static void | busvoodoo_onewire_command_actions (void *argument)
| command to perform actions More...
static void | busvoodoo_onewire_rom_search (void *argument)
| command to perform ROM search More...

## Variables

static enum busvoodoo_onewire_setting_t | busvoodoo_onewire_setting = BUSVOODOO_ONEWIRE_SETTING_NONE
| current mode setup stage
static bool | busvoodoo_onewire_embedded_pullup = true
| if embedded pull-up resistors are used
static bool | busvoodoo_onewire_power = false
| time (in ms) between slot to provide power
static const struct menu_command_t | busvoodoo_onewire_commands []
| 1-wire menu commands More...
const struct busvoodoo_mode_t | busvoodoo_onewire_mode
| 1-wire mode interface definition More...

## Detailed Description

BusVoodoo 1-wire mode (code)

Author
  King Kévin kingk.nosp@m.evin.nosp@m.@cuvo.nosp@m.odoo.nosp@m..info

Date
  2018

Note
  peripherals used: timer timer used to measure 1-wire signal timing

Definition in file busvoodoo_onewire.c.

## Function Documentation

## busvoodoo_onewire_action()

static bool busvoodoo_onewire_action | ( | const char * | action,
|  | uint32_t | repetition,
|  | bool | perform
| ) |  |

static

perform 1-wire action

Parameters

  [in] | action | action to perform
  [in] | repetition | how many times to perform the action
  [in] | perform | the action (true) or just check it (false)

Returns
  true if the action has been performed, false if it is malformed

Definition at line 172 of file busvoodoo_onewire.c.

## busvoodoo_onewire_command_actions()

static void busvoodoo_onewire_command_actions | ( | void * | argument | ) |

static

command to perform actions

Parameters

  [in] | argument | actions to perform

Definition at line 294 of file busvoodoo_onewire.c.

## busvoodoo_onewire_rom_search()

static void busvoodoo_onewire_rom_search | ( | void * | argument | ) |

static

command to perform ROM search

Parameters

  [in] | argument | if only ROMs with alarms should be searched

Definition at line 327 of file busvoodoo_onewire.c.

## busvoodoo_onewire_setup()

static bool busvoodoo_onewire_setup | ( | char ** | prefix,
|  | const char * | line
| ) |  |

static

setup 1-wire mode

Parameters

  [out] | prefix | terminal prompt prefix
  [in] | line | terminal prompt line to configure mode

Returns
  if setup is complete

Definition at line 57 of file busvoodoo_onewire.c.

## busvoodoo_onewire_write()

static void busvoodoo_onewire_write | ( | uint8_t | value | ) |

static

write to 1-wire

Parameters

  [in] | value | value to write

Definition at line 138 of file busvoodoo_onewire.c.

## Variable Documentation

## busvoodoo_onewire_commands

const struct menu_command_t busvoodoo_onewire_commands[]

static

Initial value:
= {
{
.shortcut = 'a',
.name = "action",
.command_description = "perform protocol actions",
.argument = MENU_ARGUMENT_STRING,
.argument_description = "[actions]",
.command_handler = &busvoodoo_onewire_command_actions,
},
{
.shortcut = 's',
.name = "search",
.command_description = "perform ROM search",
.argument = MENU_ARGUMENT_STRING,
.argument_description = "[alarm]",
.command_handler = &busvoodoo_onewire_rom_search,
},
}
busvoodoo_onewire_rom_search
static void busvoodoo_onewire_rom_search(void *argument)
command to perform ROM search
Definition: busvoodoo_onewire.c:327
busvoodoo_onewire_command_actions
static void busvoodoo_onewire_command_actions(void *argument)
command to perform actions
Definition: busvoodoo_onewire.c:294

1-wire menu commands

Definition at line 379 of file busvoodoo_onewire.c.

## busvoodoo_onewire_mode

const struct busvoodoo_mode_t busvoodoo_onewire_mode

Initial value:
= {
.name = "1-wire",
.description = "1-Wire",
.full_only = false,
.setup = &busvoodoo_onewire_setup,
.commands = busvoodoo_onewire_commands,
.commands_nb = LENGTH(busvoodoo_onewire_commands),
.exit = &busvoodoo_onewire_exit,
}
busvoodoo_onewire_exit
static void busvoodoo_onewire_exit(void)
exit 1-wire mode
Definition: busvoodoo_onewire.c:160
LENGTH
#define LENGTH(x)
get the length of an array
Definition: global.h:26
busvoodoo_onewire_setup
static bool busvoodoo_onewire_setup(char **prefix, const char *line)
setup 1-wire mode
Definition: busvoodoo_onewire.c:57
busvoodoo_onewire_commands
static const struct menu_command_t busvoodoo_onewire_commands[]
1-wire menu commands
Definition: busvoodoo_onewire.c:379

1-wire mode interface definition

Definition at line 398 of file busvoodoo_onewire.c.