mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
1wire: Move onewire_valid_rom to 1wire_crc.h
To let developers use all procedures implemented in the corresponding .c file when 1wire_crc.h is included. Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
This commit is contained in:
parent
2ea2655bc6
commit
9a4114a9d3
3 changed files with 17 additions and 4 deletions
|
|
@ -35,6 +35,7 @@
|
|||
#include <nuttx/kmalloc.h>
|
||||
#include <nuttx/1wire/1wire_master.h>
|
||||
#include <nuttx/1wire/1wire.h>
|
||||
#include <nuttx/1wire/1wire_crc.h>
|
||||
|
||||
#include "1wire_internal.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -66,10 +66,6 @@ struct onewire_slave_s
|
|||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/* Additional CRC helpers from 1wire_crc.c */
|
||||
|
||||
bool onewire_valid_rom(uint64_t rom);
|
||||
|
||||
/* Rest are from 1wire.c */
|
||||
|
||||
int onewire_addslave(FAR struct onewire_master_s *master,
|
||||
|
|
|
|||
|
|
@ -82,6 +82,22 @@ uint8_t onewire_crc8(FAR const uint8_t *input, uint8_t len);
|
|||
uint16_t onewire_crc16(FAR const uint8_t *input, uint16_t len,
|
||||
uint16_t initial_crc);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: onewire_valid_rom
|
||||
*
|
||||
* Description:
|
||||
* Check CRC-8 of received input
|
||||
*
|
||||
* Input Parameters:
|
||||
* rom - 64-bit rom code
|
||||
*
|
||||
* Returned Value:
|
||||
* true if CRC-8 of rom matches
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
bool onewire_valid_rom(uint64_t rom);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: onewire_check_crc16
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue