Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
cs_Serial.h File Reference
#include <protocol/cs_SerialTypes.h>
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for cs_Serial.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void serial_config (uint8_t pinRx, uint8_t pinTx)
 Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: 10 Oct., 2014 License: LGPLv3+, Apache License 2.0, and/or MIT (triple-licensed) More...
 
void serial_init (serial_enable_t enabled)
 Init the UART. More...
 
void serial_enable (serial_enable_t enabled)
 Change what is enabled. More...
 
void serial_set_read_callback (serial_read_callback callback)
 Set the callback. More...
 
serial_enable_t serial_get_state ()
 Get the state of the serial. More...
 
bool serial_tx_ready ()
 Returns whether serial is ready for TX, and has it enabled. More...
 
void serial_write (uint8_t val)
 Write a single byte. More...
 

Function Documentation

◆ serial_config()

void serial_config ( uint8_t  pinRx,
uint8_t  pinTx 
)

Author: Crownstone Team Copyright: Crownstone (https://crownstone.rocks) Date: 10 Oct., 2014 License: LGPLv3+, Apache License 2.0, and/or MIT (triple-licensed)

Driver class for serial / UART.

Note: this class is also used by C code. General configuration of the serial connection. This sets the pin to be used for UART, the baudrate, the parity bits, etc. Should only be called once.

◆ serial_enable()

void serial_enable ( serial_enable_t  enabled)

Change what is enabled.

◆ serial_get_state()

serial_enable_t serial_get_state ( )

Get the state of the serial.

◆ serial_init()

void serial_init ( serial_enable_t  enabled)

Init the UART.

Make sure it has been configured first.

◆ serial_set_read_callback()

void serial_set_read_callback ( serial_read_callback  callback)

Set the callback.

◆ serial_tx_ready()

bool serial_tx_ready ( )

Returns whether serial is ready for TX, and has it enabled.

◆ serial_write()

void serial_write ( uint8_t  val)

Write a single byte.