styling: remove trailing whitespace from all modules

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll 2014-06-02 11:49:57 +01:00
parent 83c29cc330
commit fdcd36e1ae
8 changed files with 56 additions and 56 deletions

View File

@ -94,12 +94,12 @@ TM1637::~TM1637() {
} }
} }
maa_result_t maa_result_t
TM1637::setBrightness (uint8_t level) { TM1637::setBrightness (uint8_t level) {
m_brightness = level; m_brightness = level;
} }
maa_result_t maa_result_t
TM1637::setSegments (const uint8_t segments[], uint8_t length, uint8_t pos) { TM1637::setSegments (const uint8_t segments[], uint8_t length, uint8_t pos) {
start(); start();
writeByte(TM1637_I2C_COMM1); writeByte(TM1637_I2C_COMM1);
@ -117,7 +117,7 @@ TM1637::setSegments (const uint8_t segments[], uint8_t length, uint8_t pos) {
stop(); stop();
} }
maa_result_t maa_result_t
TM1637::write (std::string msg) { TM1637::write (std::string msg) {
char leter = '\0'; char leter = '\0';
uint8_t data[] = { 0x0, 0x0, 0x0, 0x0 }; uint8_t data[] = { 0x0, 0x0, 0x0, 0x0 };
@ -131,7 +131,7 @@ TM1637::write (std::string msg) {
setSegments(data); setSegments(data);
} }
maa_result_t maa_result_t
TM1637::pinMode (maa_gpio_context ctx, gpio_dir_t mode) { TM1637::pinMode (maa_gpio_context ctx, gpio_dir_t mode) {
maa_result_t error = MAA_SUCCESS; maa_result_t error = MAA_SUCCESS;
error = maa_gpio_dir(ctx, mode); error = maa_gpio_dir(ctx, mode);
@ -140,13 +140,13 @@ TM1637::pinMode (maa_gpio_context ctx, gpio_dir_t mode) {
} }
} }
maa_result_t maa_result_t
TM1637::start() { TM1637::start() {
pinMode (m_dataPinCtx, MAA_GPIO_OUT); pinMode (m_dataPinCtx, MAA_GPIO_OUT);
usleep(PULSE_LENGTH); usleep(PULSE_LENGTH);
} }
maa_result_t maa_result_t
TM1637::stop() { TM1637::stop() {
pinMode (m_dataPinCtx, MAA_GPIO_OUT); pinMode (m_dataPinCtx, MAA_GPIO_OUT);
usleep(PULSE_LENGTH); usleep(PULSE_LENGTH);
@ -156,7 +156,7 @@ TM1637::stop() {
usleep(PULSE_LENGTH); usleep(PULSE_LENGTH);
} }
maa_result_t maa_result_t
TM1637::writeByte(uint8_t value) { TM1637::writeByte(uint8_t value) {
for (uint8_t idx = 0; idx < 8; idx++) { for (uint8_t idx = 0; idx < 8; idx++) {
pinMode(m_clkPinCtx, MAA_GPIO_OUT); pinMode(m_clkPinCtx, MAA_GPIO_OUT);

View File

@ -48,7 +48,7 @@ public:
/** /**
* Updates the values by reading from i2c * Updates the values by reading from i2c
* *
* @return 0 for success * @return 0 for success
*/ */
int update(); int update();

View File

@ -41,7 +41,7 @@ IICLcd::IICLcd (int bus, int lcdAddress) {
} }
} }
maa_result_t maa_result_t
IICLcd::write (int row, int column, std::string msg) { IICLcd::write (int row, int column, std::string msg) {
setCursor (row, column); setCursor (row, column);
write (msg); write (msg);

View File

@ -53,8 +53,8 @@ Jhd1313m1::Jhd1313m1 (int bus, int lcdAddress, int rgbAddress) : IICLcd(bus, lcd
clear (); clear ();
usleep(4500); usleep(4500);
cmd (m_i2c_lcd_control, LCD_ENTRYMODESET | cmd (m_i2c_lcd_control, LCD_ENTRYMODESET |
LCD_ENTRYLEFT | LCD_ENTRYLEFT |
LCD_ENTRYSHIFTDECREMENT); LCD_ENTRYSHIFTDECREMENT);
setReg (m_i2c_lcd_rgb, m_rgb_address, 0, 0); setReg (m_i2c_lcd_rgb, m_rgb_address, 0, 0);
@ -88,26 +88,26 @@ Jhd1313m1::write (std::string msg) {
return error; return error;
} }
maa_result_t maa_result_t
Jhd1313m1::setCursor (int row, int column) { Jhd1313m1::setCursor (int row, int column) {
maa_result_t error = MAA_SUCCESS; maa_result_t error = MAA_SUCCESS;
int row_addr[] = { 0x80, 0xc0, 0x14, 0x54}; int row_addr[] = { 0x80, 0xc0, 0x14, 0x54};
uint8_t offset = ((column % 16) + row_addr[row]); uint8_t offset = ((column % 16) + row_addr[row]);
uint8_t data[2] = { 0x80, offset }; uint8_t data[2] = { 0x80, offset };
error = maa_i2c_address (m_i2c_lcd_control, m_lcd_control_address); error = maa_i2c_address (m_i2c_lcd_control, m_lcd_control_address);
error = maa_i2c_write (m_i2c_lcd_control, data, 2); error = maa_i2c_write (m_i2c_lcd_control, data, 2);
return error; return error;
} }
maa_result_t maa_result_t
Jhd1313m1::clear () { Jhd1313m1::clear () {
return cmd (m_i2c_lcd_control, LCD_CLEARDISPLAY); return cmd (m_i2c_lcd_control, LCD_CLEARDISPLAY);
} }
maa_result_t maa_result_t
Jhd1313m1::home () { Jhd1313m1::home () {
return cmd (m_i2c_lcd_control, LCD_RETURNHOME); return cmd (m_i2c_lcd_control, LCD_RETURNHOME);
} }
@ -117,7 +117,7 @@ Jhd1313m1::home () {
* private area * private area
* ************** * **************
*/ */
maa_result_t maa_result_t
Jhd1313m1::setReg (maa_i2c_context ctx, int deviceAdress, int addr, uint8_t value) { Jhd1313m1::setReg (maa_i2c_context ctx, int deviceAdress, int addr, uint8_t value) {
maa_result_t error = MAA_SUCCESS; maa_result_t error = MAA_SUCCESS;
@ -128,7 +128,7 @@ Jhd1313m1::setReg (maa_i2c_context ctx, int deviceAdress, int addr, uint8_t valu
return error; return error;
} }
maa_result_t maa_result_t
Jhd1313m1::cmd (maa_i2c_context ctx, uint8_t value) { Jhd1313m1::cmd (maa_i2c_context ctx, uint8_t value) {
maa_result_t error = MAA_SUCCESS; maa_result_t error = MAA_SUCCESS;

View File

@ -78,7 +78,7 @@ Lcm1602::write (std::string msg) {
return error; return error;
} }
maa_result_t maa_result_t
Lcm1602::setCursor (int row, int column) { Lcm1602::setCursor (int row, int column) {
maa_result_t error = MAA_SUCCESS; maa_result_t error = MAA_SUCCESS;
@ -88,12 +88,12 @@ Lcm1602::setCursor (int row, int column) {
return send (LCD_SETDDRAMADDR | offset, 0); return send (LCD_SETDDRAMADDR | offset, 0);
} }
maa_result_t maa_result_t
Lcm1602::clear () { Lcm1602::clear () {
return send(LCD_CLEARDISPLAY, 0); return send(LCD_CLEARDISPLAY, 0);
} }
maa_result_t maa_result_t
Lcm1602::home () { Lcm1602::home () {
return send(LCD_RETURNHOME, 0); return send(LCD_RETURNHOME, 0);
} }
@ -103,7 +103,7 @@ Lcm1602::home () {
* private area * private area
* ************** * **************
*/ */
maa_result_t maa_result_t
Lcm1602::send (uint8_t value, int mode) { Lcm1602::send (uint8_t value, int mode) {
maa_result_t ret = MAA_SUCCESS; maa_result_t ret = MAA_SUCCESS;
uint8_t h = value & 0xf0; uint8_t h = value & 0xf0;

View File

@ -71,7 +71,7 @@ MY9221::~MY9221() {
} }
} }
maa_result_t maa_result_t
MY9221::setBarLevel (uint8_t level) { MY9221::setBarLevel (uint8_t level) {
if (level > 10) { if (level > 10) {
return MAA_ERROR_INVALID_PARAMETER; return MAA_ERROR_INVALID_PARAMETER;
@ -85,7 +85,7 @@ MY9221::setBarLevel (uint8_t level) {
lockData (); lockData ();
} }
maa_result_t maa_result_t
MY9221::lockData () { MY9221::lockData () {
maa_result_t error = MAA_SUCCESS; maa_result_t error = MAA_SUCCESS;
error = maa_gpio_write (m_dataPinCtx, LOW); error = maa_gpio_write (m_dataPinCtx, LOW);
@ -97,7 +97,7 @@ MY9221::lockData () {
} }
} }
maa_result_t maa_result_t
MY9221::send16bitBlock (short data) { MY9221::send16bitBlock (short data) {
maa_result_t error = MAA_SUCCESS; maa_result_t error = MAA_SUCCESS;
for (uint8_t bit_idx = 0; bit_idx < MAX_BIT_PER_BLOCK; bit_idx++) { for (uint8_t bit_idx = 0; bit_idx < MAX_BIT_PER_BLOCK; bit_idx++) {

View File

@ -50,7 +50,7 @@ NRF24l01::~NRF24l01 () {
} }
} }
void void
NRF24l01::nrfInitModule (uint8_t chip_select, uint8_t chip_enable) { NRF24l01::nrfInitModule (uint8_t chip_select, uint8_t chip_enable) {
maa_result_t error = MAA_SUCCESS; maa_result_t error = MAA_SUCCESS;
@ -84,7 +84,7 @@ NRF24l01::nrfInitModule (uint8_t chip_select, uint8_t chip_enable) {
m_spi = maa_spi_init (0); m_spi = maa_spi_init (0);
} }
void void
NRF24l01::nrfConfigModule() { NRF24l01::nrfConfigModule() {
/* Set RF channel */ /* Set RF channel */
nrfConfigRegister (RF_CH, m_channel); nrfConfigRegister (RF_CH, m_channel);
@ -101,7 +101,7 @@ NRF24l01::nrfConfigModule() {
} }
/* Clocks only one byte into the given MiRF register */ /* Clocks only one byte into the given MiRF register */
void void
NRF24l01::nrfConfigRegister(uint8_t reg, uint8_t value) { NRF24l01::nrfConfigRegister(uint8_t reg, uint8_t value) {
nrfCSOn (); nrfCSOn ();
maa_spi_write (m_spi, W_REGISTER | (REGISTER_MASK & reg)); maa_spi_write (m_spi, W_REGISTER | (REGISTER_MASK & reg));
@ -109,16 +109,16 @@ NRF24l01::nrfConfigRegister(uint8_t reg, uint8_t value) {
nrfCSOff (); nrfCSOff ();
} }
void void
NRF24l01::nrfPowerUpRX() { NRF24l01::nrfPowerUpRX() {
m_ptx = 0; m_ptx = 0;
nrfCELow(); nrfCELow();
nrfConfigRegister(CONFIG, mirf_CONFIG | ( (1<<PWR_UP) | (1<<PRIM_RX) ) ); nrfConfigRegister(CONFIG, mirf_CONFIG | ( (1<<PWR_UP) | (1<<PRIM_RX) ) );
nrfCEHigh(); nrfCEHigh();
nrfConfigRegister(STATUS,(1 << TX_DS) | (1 << MAX_RT)); nrfConfigRegister(STATUS,(1 << TX_DS) | (1 << MAX_RT));
} }
void void
NRF24l01::nrfFlushRX() { NRF24l01::nrfFlushRX() {
nrfCSOn (); nrfCSOn ();
maa_spi_write (m_spi, FLUSH_RX); maa_spi_write (m_spi, FLUSH_RX);
@ -126,7 +126,7 @@ NRF24l01::nrfFlushRX() {
} }
/* Sets the receiving address */ /* Sets the receiving address */
void void
NRF24l01::nrfSetRXaddr(uint8_t * addr) { NRF24l01::nrfSetRXaddr(uint8_t * addr) {
nrfCELow(); nrfCELow();
nrfWriteRegister(RX_ADDR_P1, addr, mirf_ADDR_LEN); nrfWriteRegister(RX_ADDR_P1, addr, mirf_ADDR_LEN);
@ -134,7 +134,7 @@ NRF24l01::nrfSetRXaddr(uint8_t * addr) {
} }
/* Sets the transmitting address */ /* Sets the transmitting address */
void void
NRF24l01::nrfSetTXaddr(uint8_t * addr) NRF24l01::nrfSetTXaddr(uint8_t * addr)
{ {
/* RX_ADDR_P0 must be set to the sending addr for auto ack to work. */ /* RX_ADDR_P0 must be set to the sending addr for auto ack to work. */
@ -143,20 +143,20 @@ NRF24l01::nrfSetTXaddr(uint8_t * addr)
} }
/* The broadcast address should be 0xFFFFF */ /* The broadcast address should be 0xFFFFF */
void void
NRF24l01::nrfSetBroadcastAddr (uint8_t * addr) { NRF24l01::nrfSetBroadcastAddr (uint8_t * addr) {
nrfCELow (); nrfCELow ();
nrfWriteRegister (RX_ADDR_P2, addr, mirf_ADDR_LEN); nrfWriteRegister (RX_ADDR_P2, addr, mirf_ADDR_LEN);
nrfCEHigh (); nrfCEHigh ();
} }
void void
NRF24l01::nrfSetPayload (uint8_t load) { NRF24l01::nrfSetPayload (uint8_t load) {
m_payload = load; m_payload = load;
} }
void void
NRF24l01::nrfWriteRegister(uint8_t reg, uint8_t * value, uint8_t len) NRF24l01::nrfWriteRegister(uint8_t reg, uint8_t * value, uint8_t len)
{ {
nrfCSOn (); nrfCSOn ();
maa_spi_write (m_spi, W_REGISTER | (REGISTER_MASK & reg)); maa_spi_write (m_spi, W_REGISTER | (REGISTER_MASK & reg));
@ -164,7 +164,7 @@ NRF24l01::nrfWriteRegister(uint8_t reg, uint8_t * value, uint8_t len)
nrfCSOff (); nrfCSOff ();
} }
void void
NRF24l01::nrfTransmitSync(uint8_t *dataout, uint8_t len){ NRF24l01::nrfTransmitSync(uint8_t *dataout, uint8_t len){
uint8_t i; uint8_t i;
for(i = 0; i < len; i++) { for(i = 0; i < len; i++) {
@ -173,7 +173,7 @@ NRF24l01::nrfTransmitSync(uint8_t *dataout, uint8_t len){
} }
/* Checks if data is available for reading */ /* Checks if data is available for reading */
bool bool
NRF24l01::nrfDataReady() { NRF24l01::nrfDataReady() {
uint8_t status = nrfGetStatus(); uint8_t status = nrfGetStatus();
if ( status & (1 << RX_DR) ) { if ( status & (1 << RX_DR) ) {
@ -183,7 +183,7 @@ NRF24l01::nrfDataReady() {
return !nrfRXFifoEmpty(); return !nrfRXFifoEmpty();
} }
uint8_t uint8_t
NRF24l01::nrfGetStatus () { NRF24l01::nrfGetStatus () {
uint8_t rv; uint8_t rv;
nrfReadRegister (STATUS, &rv, 1); nrfReadRegister (STATUS, &rv, 1);
@ -191,7 +191,7 @@ NRF24l01::nrfGetStatus () {
} }
/* Reads an array of bytes from the given start position in the MiRF registers. */ /* Reads an array of bytes from the given start position in the MiRF registers. */
void void
NRF24l01::nrfReadRegister (uint8_t reg, uint8_t * value, uint8_t len) NRF24l01::nrfReadRegister (uint8_t reg, uint8_t * value, uint8_t len)
{ {
nrfCSOn (); nrfCSOn ();
@ -200,7 +200,7 @@ NRF24l01::nrfReadRegister (uint8_t reg, uint8_t * value, uint8_t len)
nrfCSOff (); nrfCSOff ();
} }
void void
NRF24l01::nrfTransferSync (uint8_t *dataout,uint8_t *datain,uint8_t len) { NRF24l01::nrfTransferSync (uint8_t *dataout,uint8_t *datain,uint8_t len) {
uint8_t i; uint8_t i;
for(i = 0;i < len;i++) { for(i = 0;i < len;i++) {
@ -208,7 +208,7 @@ NRF24l01::nrfTransferSync (uint8_t *dataout,uint8_t *datain,uint8_t len) {
} }
} }
bool bool
NRF24l01::nrfRXFifoEmpty () { NRF24l01::nrfRXFifoEmpty () {
uint8_t fifo_status; uint8_t fifo_status;
nrfReadRegister (FIFO_STATUS, &fifo_status, sizeof(fifo_status)); nrfReadRegister (FIFO_STATUS, &fifo_status, sizeof(fifo_status));
@ -216,8 +216,8 @@ NRF24l01::nrfRXFifoEmpty () {
} }
/* Reads payload bytes into data array */ /* Reads payload bytes into data array */
void void
NRF24l01::nrfGetData (uint8_t * data) NRF24l01::nrfGetData (uint8_t * data)
{ {
nrfCSOn (); nrfCSOn ();
/* Send cmd to read rx payload */ /* Send cmd to read rx payload */
@ -230,7 +230,7 @@ NRF24l01::nrfGetData (uint8_t * data)
/* Sends a data package to the default address. Be sure to send the correct /* Sends a data package to the default address. Be sure to send the correct
* amount of bytes as configured as payload on the receiver. */ * amount of bytes as configured as payload on the receiver. */
void void
NRF24l01::nrfSend(uint8_t * value) { NRF24l01::nrfSend(uint8_t * value) {
uint8_t status; uint8_t status;
status = nrfGetStatus(); status = nrfGetStatus();
@ -257,12 +257,12 @@ NRF24l01::nrfSend(uint8_t * value) {
nrfCEHigh(); // Start transmission nrfCEHigh(); // Start transmission
} }
void void
NRF24l01::nrfSend () { NRF24l01::nrfSend () {
nrfSend (m_txBuffer); nrfSend (m_txBuffer);
} }
bool bool
NRF24l01::nrfIsSending () { NRF24l01::nrfIsSending () {
uint8_t status; uint8_t status;
if (m_ptx) { // Sending mode. if (m_ptx) { // Sending mode.
@ -270,46 +270,46 @@ NRF24l01::nrfIsSending () {
/* if sending successful (TX_DS) or max retries exceded (MAX_RT). */ /* if sending successful (TX_DS) or max retries exceded (MAX_RT). */
if((status & ((1 << TX_DS) | (1 << MAX_RT)))){ if((status & ((1 << TX_DS) | (1 << MAX_RT)))){
nrfPowerUpRX(); nrfPowerUpRX();
return false; return false;
} }
return true; return true;
} }
return false; return false;
} }
void void
NRF24l01::nrfPowerUpTX () { NRF24l01::nrfPowerUpTX () {
m_ptx = 1; m_ptx = 1;
nrfConfigRegister (CONFIG, mirf_CONFIG | ( (1<<PWR_UP) | (0<<PRIM_RX) ) ); nrfConfigRegister (CONFIG, mirf_CONFIG | ( (1<<PWR_UP) | (0<<PRIM_RX) ) );
} }
void void
NRF24l01::nrfPowerDown () { NRF24l01::nrfPowerDown () {
nrfCELow (); nrfCELow ();
nrfConfigRegister (CONFIG, mirf_CONFIG); nrfConfigRegister (CONFIG, mirf_CONFIG);
} }
maa_result_t maa_result_t
NRF24l01::nrfCEHigh () { NRF24l01::nrfCEHigh () {
return maa_gpio_write (m_cePinCtx, HIGH); return maa_gpio_write (m_cePinCtx, HIGH);
} }
maa_result_t maa_result_t
NRF24l01::nrfCELow () { NRF24l01::nrfCELow () {
return maa_gpio_write (m_cePinCtx, LOW); return maa_gpio_write (m_cePinCtx, LOW);
} }
maa_result_t maa_result_t
NRF24l01::nrfCSOn () { NRF24l01::nrfCSOn () {
return maa_gpio_write (m_csnPinCtx, LOW); return maa_gpio_write (m_csnPinCtx, LOW);
} }
maa_result_t maa_result_t
NRF24l01::nrfCSOff () { NRF24l01::nrfCSOff () {
return maa_gpio_write (m_csnPinCtx, HIGH); return maa_gpio_write (m_csnPinCtx, HIGH);
} }
void void
NRF24l01::nrfListenForChannel() { NRF24l01::nrfListenForChannel() {
if(!nrfIsSending() && nrfDataReady()) { if(!nrfIsSending() && nrfDataReady()) {
nrfGetData(m_rxBuffer); nrfGetData(m_rxBuffer);

View File

@ -80,7 +80,7 @@
#define PLL_LOCK 4 #define PLL_LOCK 4
#define RF_DR 3 #define RF_DR 3
#define RF_PWR 1 #define RF_PWR 1
#define LNA_HCURR 0 #define LNA_HCURR 0
#define RX_DR 6 #define RX_DR 6
#define TX_DS 5 #define TX_DS 5
#define MAX_RT 4 #define MAX_RT 4